Why is Windows saying Drive is Not Formatted

I am a computer science Masters student trying to finish up my Thesis and I am almost there but have hit a problem I am not sure how to solve. I have wrote a storport miniport driver to mount a Windows Software raid even when the disk is write blocked but Windows is telling me I need to format the disk before I can use it. When I open up the partition in a hex editor (WinHex Specialist Licence v 15.8 SR02) it tells me, “The volume does not contain a recognized file system. Please make sure that all required file system drivers are loaded and that the volume is not corrupted.”

The problem is that neither Windows nor WinHex will tell me why it is wrong, only that there is something wrong. I have copied the bootstrap code from my Sony 8GB Flash drive and appended the following partition table starting at 0x1BE:

80 01 01 00 07 1F D0 FF 20 00 00 00 F8 CF FF 00

$Boot is found at Sector 32 and is as follows:

00 02 08 00 00 00 00 00 00 00 F8 00 00 3F 00 FF 00 20 00 00 00 00 00 00 00 80 00 80 00 FF CF FF 00 00 00 00 00 00 00 0C 00 00 00 00 00 FF FC 0F 00 00 00 00 00 F6 00 00 00 01 00 00 00 53 52 56 44 55 52 49 31 00 00 00 00

The only difference that $Boot has from the original raid is changing the hidden sectors from 3F to 20 since there are 32 sectors instead of 1024 preceding the partition and the disk signature has been changed.

Now all of that looks right to me as it is an 8GB drive so I believe that all of that was done correctly. Other then the changes I mentioned above there is no difference on my mounted disk and the original disk so I don’t know if there is some obscure SRB that I am not handling that Windows requires to mount the disk. If you need any more information please let me know as I have no idea where to go from here and this is all my thesis and graduation are waiting on and I can’t find a problem.

What will happen during mount processing is each registered file system
will be called and asked if it recognizes the volume. Each file system
will in turn perform some validation of content, FAT, NTFS, UDFS, etc.
all know their own layout and read information from the start of the
volume to determine if it is formatted for them.

So a few things, first be sure the partition entry in the MBR is
correct, that it points off to the start of the volume, etc. At the
start of the volume will be the information about the file system
itself, there are tons of links out there. Here is one for NTFS

http://bootmaster.filerecovery.biz/appnote3.html

So either the information in the partition entry is not correct or the
information at the start of the volume is not correct for the below
problems to be hit. It’s trivial to check both …

Pete

On 4/19/2011 1:28 PM, dducharme@my.uri.edu wrote:

I am a computer science Masters student trying to finish up my Thesis and I am almost there but have hit a problem I am not sure how to solve. I have wrote a storport miniport driver to mount a Windows Software raid even when the disk is write blocked but Windows is telling me I need to format the disk before I can use it. When I open up the partition in a hex editor (WinHex Specialist Licence v 15.8 SR02) it tells me, “The volume does not contain a recognized file system. Please make sure that all required file system drivers are loaded and that the volume is not corrupted.”

The problem is that neither Windows nor WinHex will tell me why it is wrong, only that there is something wrong. I have copied the bootstrap code from my Sony 8GB Flash drive and appended the following partition table starting at 0x1BE:

80 01 01 00 07 1F D0 FF 20 00 00 00 F8 CF FF 00

$Boot is found at Sector 32 and is as follows:

00 02 08 00 00 00 00 00 00 00 F8 00 00 3F 00 FF 00 20 00 00 00 00 00 00 00 80 00 80 00 FF CF FF 00 00 00 00 00 00 00 0C 00 00 00 00 00 FF FC 0F 00 00 00 00 00 F6 00 00 00 01 00 00 00 53 52 56 44 55 52 49 31 00 00 00 00

The only difference that $Boot has from the original raid is changing the hidden sectors from 3F to 20 since there are 32 sectors instead of 1024 preceding the partition and the disk signature has been changed.

Now all of that looks right to me as it is an 8GB drive so I believe that all of that was done correctly. Other then the changes I mentioned above there is no difference on my mounted disk and the original disk so I don’t know if there is some obscure SRB that I am not handling that Windows requires to mount the disk. If you need any more information please let me know as I have no idea where to go from here and this is all my thesis and graduation are waiting on and I can’t find a problem.


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295

Thanks for the fast reply. I thought that might be the problem as well which is why I included the NTFS boot sector code above. However, I cannot find a problem with it and when I compare it to file system information it appears right. Furthermore when I compare it to the original volume the only 2 differences are the hidden sectors and the volume serial number. I have been staring at this problem for 2 weeks now and although I created the partition table by hand I have compared it to the numerous websites and and books I have and it again appears right. So while it may seem trivial to check both of those they are both seemingly correct although I could be missing something. Also note that the above $Boot code is only the BIOS Parameter Block and not the complete $Boot.

On 4/19/2011 3:24 PM, dducharme@my.uri.edu wrote:

Thanks for the fast reply. I thought that might be the problem as well which is why I included the NTFS boot sector code above. However, I cannot find a problem with it and when I compare it to file system information it appears right. Furthermore when I compare it to the original volume the only 2 differences are the hidden sectors and the volume serial number. I have been staring at this problem for 2 weeks now and although I created the partition table by hand I have compared it to the numerous websites and and books I have and it again appears right. So while it may seem trivial to check both of those they are both seemingly correct although I could be missing something. Also note that the above $Boot code is only the BIOS Parameter Block and not the complete $Boot.

Are you handling all relevant IOCtls coming into your driver?

Having done similar implementations in the past, there are a limited
number of things which can be wrong at this level.

Pete


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295

I have no idea whether this is your issue, but this *looks* like an
off-by-one error, as you have a power-of-2 in your decimal values for the
number of sectors preceding the partition, and you have a ((power-of-2)-1)
hex value in the working case, but a power-of-2 hex value in your
non-working case.

Phil

Philip D. Barila??? (303) 776-1264