F
Franc Zabkar
I recently had to repair file system corruption for two XP users, one
with a FAT32 partition, the other with NTFS. Unfortunately I have
little experience with XP so I struggled quite a bit. Anyway I
discovered that Microsoft's disc repair tools were flawed in several
ways.
Case #1
-------
The PC with the NTFS partition had an inaccessible registry file,
c:\windows\system32\config\system. It couldn't be deleted, copied, or
renamed, so the procedure in this MSKB article could not be applied:
How to recover from a corrupted registry that prevents Windows XP from
starting:
http://support.microsoft.com/kb/307545
I attempted to run CHKDSK from the repair console of a bootable XP CD,
but the file system was deemed to have unrecoverable errors. I then
installed the drive into an external USB enclosure, attached it to a
working XP system, and ran CHKDSK from within a CMD window. CHKDSK
found many problems, including an MFT issue, all of which were fixed.
Prior to running CHKDSK, I tried to repair the drive from within the
GUI via Tools > Properties, but this also produced an "unrecoverable"
message.
Case #2
-------
The PC with the FAT32 partition could not boot. It produced a "missing
NTLDR" error. This suggested that the MBR and boot sector were
probably OK, and that the error was somewhere in the FATs or directory
structure. I booted into the repair console of an XP CD and tried a
DIR command. This produced a "could not be enumerated" error. DISKPART
was able to see the full partition (38GB), so the partition table and
MBR were apparently OK. CHKDSK deemed that the drive was
"unrecoverable". In desperation I tried the FIXBOOT command and that's
when things became extremely bizarre. A DIR command was now able to
see the C: drive, but there were no files! The partition size was
reported as 10MB (or was it 10GB?). I reconfirmed with DISKPART that
the partition table was still intact, but in desperation I now tried
FIXMBR. This command warned me that the MBR contained unknown or
damaged code, so I went ahead and allowed it to refresh the code. It
reported success but when I ran FIXMBR a second time, it still
complained of unknown or damaged code.
Now I'd had enough, so I installed the drive into an external USB
enclosure and attached it to a working XP system. I used DEBUG from
with a CMD window to view the drive's boot sector and was horrified to
see a FAT12 signature. For some inexplicable reason, FIXBOOT had
replaced a FAT32 HD boot sector with a FAT12 floppy boot sector!
CHKDSK was unable to repair this problem, and My Computer showed the
drive as having a capacity of 10MB (or 10GB?). I then used DEBUG to
zero the contents of the boot sector, thinking that now CHKDSK would
have a better chance to repair it, but CHKDSK now complained that it
would not operate on a RAW volume. Attempting to repair the drive from
within the GUI using Tools > Options produced no response.
Now I was getting desperate. I took the USB drive to my Windows 98SE
box and to my surprise Explorer was able to see the entire drive with
all the original files apparently still intact! SCANDISK determined
that the first copy of the FAT was corrupt, but it didn't tell me that
the boot sector was missing. It just used the backup copy of the boot
sector (logical sector 6) and behaved as if all was well. With some
trepidation I allowed Scandisk to repair the FAT, and to fix the
misreported file sizes for SYSTEM.LOG and SOFTWARE.LOG. However,
Scandisk did not replace the damaged boot sector. I had to do this
manually via DEBUG in a DOS box, by copying the contents of sector 6
to sector 0. After doing this, I was able to see the all the files in
a working XP system (in the USB enclosure), and CHKDSK reported that
all was fine. However, I was still unable to boot from the drive when
I reinstalled it in the original XP box.
So what was wrong? I looked closely at the boot sector again and found
that it was a Win9x boot sector, ie there were references to IO.SYS,
MSDOS.SYS and WINBOOT.SYS, but no reference to NTLDR. WTF! I decided
to load XP onto a spare HD that had been FDISKed and FORMATted by
Windows 98SE and sure enough XP replaced the boot sector with its own
FAT32 code, but it did not touch the backup boot sector. So XP had
created a file system that had an XP boot sector and a Win9X backup.
So what to do now? I decided to make a hybrid boot sector by using the
tail end of an XP FAT32 boot sector for the code, and the beginning of
the Win9X boot sector for the data. After restoring this patched boot
sector to sector 0, the drive booted in the original machine and all
was well. BTW, boot sector templates can also be extracted from
AUTOCHK.EXE.
As a final check, I used MBRtool to make a copy of the MBR code. I
then compared this with an MBR template that I found inside
DISKPART.EXE. There was no difference. So why did FIXMBR complain
about unknown or damaged code?
- Franc Zabkar
--
Please remove one 'i' from my address when replying by email.
with a FAT32 partition, the other with NTFS. Unfortunately I have
little experience with XP so I struggled quite a bit. Anyway I
discovered that Microsoft's disc repair tools were flawed in several
ways.
Case #1
-------
The PC with the NTFS partition had an inaccessible registry file,
c:\windows\system32\config\system. It couldn't be deleted, copied, or
renamed, so the procedure in this MSKB article could not be applied:
How to recover from a corrupted registry that prevents Windows XP from
starting:
http://support.microsoft.com/kb/307545
I attempted to run CHKDSK from the repair console of a bootable XP CD,
but the file system was deemed to have unrecoverable errors. I then
installed the drive into an external USB enclosure, attached it to a
working XP system, and ran CHKDSK from within a CMD window. CHKDSK
found many problems, including an MFT issue, all of which were fixed.
Prior to running CHKDSK, I tried to repair the drive from within the
GUI via Tools > Properties, but this also produced an "unrecoverable"
message.
Case #2
-------
The PC with the FAT32 partition could not boot. It produced a "missing
NTLDR" error. This suggested that the MBR and boot sector were
probably OK, and that the error was somewhere in the FATs or directory
structure. I booted into the repair console of an XP CD and tried a
DIR command. This produced a "could not be enumerated" error. DISKPART
was able to see the full partition (38GB), so the partition table and
MBR were apparently OK. CHKDSK deemed that the drive was
"unrecoverable". In desperation I tried the FIXBOOT command and that's
when things became extremely bizarre. A DIR command was now able to
see the C: drive, but there were no files! The partition size was
reported as 10MB (or was it 10GB?). I reconfirmed with DISKPART that
the partition table was still intact, but in desperation I now tried
FIXMBR. This command warned me that the MBR contained unknown or
damaged code, so I went ahead and allowed it to refresh the code. It
reported success but when I ran FIXMBR a second time, it still
complained of unknown or damaged code.
Now I'd had enough, so I installed the drive into an external USB
enclosure and attached it to a working XP system. I used DEBUG from
with a CMD window to view the drive's boot sector and was horrified to
see a FAT12 signature. For some inexplicable reason, FIXBOOT had
replaced a FAT32 HD boot sector with a FAT12 floppy boot sector!
CHKDSK was unable to repair this problem, and My Computer showed the
drive as having a capacity of 10MB (or 10GB?). I then used DEBUG to
zero the contents of the boot sector, thinking that now CHKDSK would
have a better chance to repair it, but CHKDSK now complained that it
would not operate on a RAW volume. Attempting to repair the drive from
within the GUI using Tools > Options produced no response.
Now I was getting desperate. I took the USB drive to my Windows 98SE
box and to my surprise Explorer was able to see the entire drive with
all the original files apparently still intact! SCANDISK determined
that the first copy of the FAT was corrupt, but it didn't tell me that
the boot sector was missing. It just used the backup copy of the boot
sector (logical sector 6) and behaved as if all was well. With some
trepidation I allowed Scandisk to repair the FAT, and to fix the
misreported file sizes for SYSTEM.LOG and SOFTWARE.LOG. However,
Scandisk did not replace the damaged boot sector. I had to do this
manually via DEBUG in a DOS box, by copying the contents of sector 6
to sector 0. After doing this, I was able to see the all the files in
a working XP system (in the USB enclosure), and CHKDSK reported that
all was fine. However, I was still unable to boot from the drive when
I reinstalled it in the original XP box.
So what was wrong? I looked closely at the boot sector again and found
that it was a Win9x boot sector, ie there were references to IO.SYS,
MSDOS.SYS and WINBOOT.SYS, but no reference to NTLDR. WTF! I decided
to load XP onto a spare HD that had been FDISKed and FORMATted by
Windows 98SE and sure enough XP replaced the boot sector with its own
FAT32 code, but it did not touch the backup boot sector. So XP had
created a file system that had an XP boot sector and a Win9X backup.
So what to do now? I decided to make a hybrid boot sector by using the
tail end of an XP FAT32 boot sector for the code, and the beginning of
the Win9X boot sector for the data. After restoring this patched boot
sector to sector 0, the drive booted in the original machine and all
was well. BTW, boot sector templates can also be extracted from
AUTOCHK.EXE.
As a final check, I used MBRtool to make a copy of the MBR code. I
then compared this with an MBR template that I found inside
DISKPART.EXE. There was no difference. So why did FIXMBR complain
about unknown or damaged code?
- Franc Zabkar
--
Please remove one 'i' from my address when replying by email.