When I run the chkdsk for my external M.2 drive (FAT32 formatted, 64 sectors per cluster, 512 bytes per sector, single FAT), I got an error indicating that the first allocation unit is not valid for the file LOG00.DAT.
The type of the file system is FAT32.
Volume APPLICATION created 7/16/2019 1:38 PM
Volume Serial Number is 1509-2430
Windows is verifying files and folders...
Windows found errors on the disk, but will not fix them
because disk checking was run without the /F (fix) parameter.
\USER\LOG\LOG00.DAT first allocation unit is not valid. The entry will be truncated.
File and folder verification is complete.
Convert lost chains to files (Y/N)? n
At this point, I don't want to fix the issue but I want to understand what caused this issue.
So I opened up the M.2 drive in HxD editor (a tool to display the drive content in terms of sectors).
I traverse to the root directory sector and find out the directory entry for LOG00.DAT.
4C 4F 47 30 30 20 20 20 44 41 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 74 17 A2 0C 00 00
From the above directory entry, - The last four bytes indicates the size of the file which is 0x00000CA2 (Little endian). - The first cluster number of the file is 0x00001774
When I look at the FAT entry for the cluster 0x00001774, i found the 32-bit value as 0x0FFFFFFF. This indicates that the one and only cluster for the file is 0x00001774. So the FAT looks good to me.
I looked at the cluster 0x00001774 in the data region and I was able to verify the all the bytes (Size: 0x00000CA2 bytes) present in this location are correct.
So when I manually trace the file, I found everything seems to be correct. But why I'm still getting the "First Allocation Unit is not Valid" error.
When I run the dosfsck command in FreeDOS, I'm getting the similiar error. Therefore, something is wrong either in the FAT or in the directory entry or in the data cluster region.
I'm sure that I missed something in my above analysis and need help to identify that.
Thanks, Anand
When I look at the FAT entry for the cluster 0x00001774, i found the 32-bit value as 0x0FFFFFFF. I was wrong. The FAT entry reads 0. That's the reason I was getting first allocation unit is not valid error because the first cluster for that file in the FAT is marked as not used.
User contributions licensed under CC BY-SA 3.0