Corrupted NTFS needs reformat - how to preserve windows installation

M

Martin T.

Hi all,

SHORT:
------
How do I preserve a Windows XP sp2 installation (registry, drivers,
installed programs) when I want to reformat my C: drive, without using a
disk cloning tool??

LONG:
My C: NTFS partition went bad when a power outage occurred during
shutdown. Now, when XP tries to boot I get a UNMOUNTABLE_BOOT_VOLUME
blue screen.
Booting to the recovery console and running chkdsk /P will result in
chkdsk telling me that there are unrecoverable errors on C: (In fact,
the recovery console won't even dir the contents of the C: drive.
So far so bad.
When I access the NTFS volume (read only) from my Linux boot option, I
can see that basically all data on there is intact and accessible (read
only). (Checked with a few images and zip files -- assuming that most
other stuff would also be correct.)

Now, as I see this, since CHKDSK refuses to repair the volume I will
have to reformat (I can get all data I need off it.)

What would also be great be when I'd be able to preserve my Windows
Install.

I can't use a Clone Program since these will copy at the partition level
and so I guess will just replicate the broken NFTS structure. (-> ??)

Is there a way to preserve my old registry etc. ??


thanks!
-Martin-
 
J

Juan Perez

Hi Martin:

I can you take a look to C:\WINDOWS\repair you will find a copy of the
reguistry. Check the dates of the files for security, software, system and
SAM. They are copies of your registry. If you copy and restore them later in
a new windows xp instalation, you will have the computer registry at that
date.

Take a look:

How to recover from a corrupted registry that prevents Windows XP from
starting
http://support.microsoft.com/kb/307545/en-us
 
J

John John

Did you try running the fixboot command from the Recovery Console?

Can you mount the disk to another Windows XP installation and when you
do can you see and access all the files on the corrupt disk? If no to
the above do you have an NTFS or FAT32 driver for your Linux installation?

If you can answer yes to one of the above what you can do is get another
hard disk, mount it to an XP box or use the XP cd to partition and
format it and mark the primary partition active (prepare it for XP) then
mount it and the broken disk to your other operating system. You can
then use Xcopy, XXcopy or (something similar if you are doing this with
Linux) and then using the appropriate switches copy the files and folder
structure from the broken disk to the new disk. Once done you may need
to run the fixboot command on the new disk for it to boot. No guarantee
but worth a try.

John
 
M

Martin T.

John said:
Did you try running the fixboot command from the Recovery Console?

Can you mount the disk to another Windows XP installation and when you
do can you see and access all the files on the corrupt disk? If no to
the above do you have an NTFS or FAT32 driver for your Linux installation?

If you can answer yes to one of the above what you can do is get another
hard disk, mount it to an XP box or use the XP cd to partition and
format it and mark the primary partition active (prepare it for XP) then
mount it and the broken disk to your other operating system. You can
then use Xcopy, XXcopy or (something similar if you are doing this with
Linux) and then using the appropriate switches copy the files and folder
structure from the broken disk to the new disk. Once done you may need
to run the fixboot command on the new disk for it to boot. No guarantee
but worth a try.

John

Hello.

I can access the broken partition from Linux alright.

I have not tried fixboot yet, ...
Will fixboot mess up the Grub Linux boot loader (I think that resides in
the MBR, so I'd figure not) ??

Your description sounds good:
So I would:
1.) Do a recursive copy backup of NTFS-C: to my external Harddisk
2.) Reformat NTFS-C: so that it gets a clean filesystem
3.) Do a recursive copy back from my external drive to NTFS-C:
4.) Run the recovery console and do a 'fixboot'

Is this OK?

It's just one more copy, but I do not have another disk so that will
have to do.


Thanks!
-Martin-
 
J

John John

Martin said:
Hi all,

SHORT:
------
How do I preserve a Windows XP sp2 installation (registry, drivers,
installed programs) when I want to reformat my C: drive, without
using a disk cloning tool??

LONG:
My C: NTFS partition went bad when a power outage occurred during
shutdown. Now, when XP tries to boot I get a UNMOUNTABLE_BOOT_VOLUME
blue screen.
Booting to the recovery console and running chkdsk /P will result in
chkdsk telling me that there are unrecoverable errors on C: (In fact,
the recovery console won't even dir the contents of the C: drive.
So far so bad.
When I access the NTFS volume (read only) from my Linux boot option,
I can see that basically all data on there is intact and accessible
(read only). (Checked with a few images and zip files -- assuming
that most other stuff would also be correct.)

Now, as I see this, since CHKDSK refuses to repair the volume I will
have to reformat (I can get all data I need off it.)

What would also be great be when I'd be able to preserve my Windows
Install.

I can't use a Clone Program since these will copy at the partition
level and so I guess will just replicate the broken NFTS structure.
(-> ??)

Is there a way to preserve my old registry etc. ??


thanks!

John John wrote:

Did you try running the fixboot command from the Recovery Console?

Can you mount the disk to another Windows XP installation and when you
do can you see and access all the files on the corrupt disk? If no to
the above do you have an NTFS or FAT32 driver for your Linux
installation?

If you can answer yes to one of the above what you can do is get
another hard disk, mount it to an XP box or use the XP cd to partition
and format it and mark the primary partition active (prepare it for
XP) then mount it and the broken disk to your other operating system.
You can then use Xcopy, XXcopy or (something similar if you are doing
this with Linux) and then using the appropriate switches copy the
files and folder structure from the broken disk to the new disk. Once
done you may need to run the fixboot command on the new disk for it to
boot. No guarantee but worth a try.

John

Martin T. wrote:

Hello.

I can access the broken partition from Linux alright.

I have not tried fixboot yet, ...
Will fixboot mess up the Grub Linux boot loader (I think that resides in
the MBR, so I'd figure not) ??

Your description sounds good:
So I would:
1.) Do a recursive copy backup of NTFS-C: to my external Harddisk
2.) Reformat NTFS-C: so that it gets a clean filesystem
3.) Do a recursive copy back from my external drive to NTFS-C:
4.) Run the recovery console and do a 'fixboot'

Is this OK?

It's just one more copy, but I do not have another disk so that will
have to do.


Thanks!

To dislodge the GRUB loader you would use the fixmbr command, if fixboot
damages GRUB then you will have to repair it, shouldn't be too big a
problem to fix if the disk is otherwise sound, search the net and you
will quickly find how to do that. I don't know how your disks are
arranged and where GRUB is being started, that is for you to determine.

As for the trying to salvage the Windows installation that is how I
would try if nothing else works, which seems to be where you're at now.
Strange that Linux can read the files on the disk but that Windows
cannot see them or even chkdsk the drive, go figure! But it seems that
I have read posts with similar happenings before.

I want to *emphasize* that there is no guarantee that this will work!
There is no saying what kind of corruption the disk is having and if all
the files are recoverable, maybe there are certain areas or sectors of
the disk where system files reside that are corrupt beyond repair or
recovery. After you do this copy over job you may still need to to a
repair install. Before you try to copy files back to the disk it would
be a good idea to run a disk diagnostic utility from the hard drive
manufacturer to make sure that the disk is sound.

Also, I don't have extensive experience with Linux and I am not sure
that you will be able to copy files to an NTFS disk without the Paragon
driver or without another similar driver. If you cannot copy to NTFS
you may be able to copy to FAT32 and convert the file system after the
mess is fixed, if it is fixable to start with!

Good luck,

John
 
M

Martin T.

John said:
To dislodge the GRUB loader you would use the fixmbr command, if fixboot
damages GRUB then you will have to repair it, shouldn't be too big a
problem to fix if the disk is otherwise sound, search the net and you
will quickly find how to do that. I don't know how your disks are
arranged and where GRUB is being started, that is for you to determine.

As for the trying to salvage the Windows installation that is how I
would try if nothing else works, which seems to be where you're at now.
Strange that Linux can read the files on the disk but that Windows
cannot see them or even chkdsk the drive, go figure! But it seems that
I have read posts with similar happenings before.

I want to *emphasize* that there is no guarantee that this will work!
There is no saying what kind of corruption the disk is having and if all
the files are recoverable, maybe there are certain areas or sectors of
the disk where system files reside that are corrupt beyond repair or
recovery. After you do this copy over job you may still need to to a
repair install. Before you try to copy files back to the disk it would
be a good idea to run a disk diagnostic utility from the hard drive
manufacturer to make sure that the disk is sound.

Also, I don't have extensive experience with Linux and I am not sure
that you will be able to copy files to an NTFS disk without the Paragon
driver or without another similar driver. If you cannot copy to NTFS
you may be able to copy to FAT32 and convert the file system after the
mess is fixed, if it is fixable to start with!

Good luck,

John

Thanks! You've been very helpful.

I'm aware that the data on the C: windows partition might be partially
unaccessible, and I'll maybe end up doing a reinstall anyway.
Grub shouldn't be too much of a problem I guess.

FYI: I use the ntfs-3g driver under linux for write access. It will have
to be seen if I succeed in copying really everything on the C: drive.

Thanks again!
-Martin-
 
J

John John

Martin said:
Thanks! You've been very helpful.

I'm aware that the data on the C: windows partition might be partially
unaccessible, and I'll maybe end up doing a reinstall anyway.
Grub shouldn't be too much of a problem I guess.

FYI: I use the ntfs-3g driver under linux for write access. It will have
to be seen if I succeed in copying really everything on the C: drive.

Thanks again!

You're welcome. Keep us posted, it would be interesting and informative
to see how well (or not) things turn out. As for copying the files back
and forth to NTFS there is also the matter of NTFS permissions which may
or may not be affected, once again it depends on the level of corruption
on the disk and the file system of the intermediate location to where
you copy the files to. An In-Place upgrade (repair install) should
reapply the default NTFS permissions, or they can be reapplied using
Secedit and the proper security.inf file. Nothing to worry about for
the time being but something that you might need to do... depending on
how things turn out.

John
 
M

Martin T.

You're welcome. Keep us posted, it would be interesting and informative
to see how well (or not) things turn out. As for copying the files back
and forth to NTFS there is also the matter of NTFS permissions which may
or may not be affected, once again it depends on the level of corruption
on the disk and the file system of the intermediate location to where
you copy the files to. An In-Place upgrade (repair install) should
reapply the default NTFS permissions, or they can be reapplied using
Secedit and the proper security.inf file. Nothing to worry about for
the time being but something that you might need to do... depending on
how things turn out.

John


Weeeeell.
I really messed up. Since I haven't got my external drive around atm I
thought I'd give it a try and run run fixboot anyway to se what it
does.
And what it bloody did was corrupt (or delete or whatever) the
PARTITION TABLE of my harddisk.
When I ran "fixboot C:" it put out some messages and then appeared to
change the drive type of the partition to FAT (!). Although this drive
has never seen a fat part.
Before running fixboot I had a disk with 100GB of accessible data and
a running linux partition on. (there were 3 part. on disk, C: NTFS, D:
NTFS and one ext3 linux partition)
NOW, there's nothing. *cry*
When I boot from my PartitinMagic floppy I get a big fat yellow blob
for my harddisk saying "partition table corrupted".

When I boot from my linux CD and run fdisk, I get: Device contains
neither a valid DOS partition table, nor SUN, SGI or OSF disklabel ...

So kids, don't be as silly as me and try this at home with a complete
physical backup of all data.

Well ... maybe I can get my data back somehow ... should still be on
there, shouldnt it ... Bah!

I'll keep you posted, this promises to get really thrilling.

cheers,
Martin
 
J

John John

Martin said:
Weeeeell.
I really messed up. Since I haven't got my external drive around atm I
thought I'd give it a try and run run fixboot anyway to se what it
does.
And what it bloody did was corrupt (or delete or whatever) the
PARTITION TABLE of my harddisk.
When I ran "fixboot C:" it put out some messages and then appeared to
change the drive type of the partition to FAT (!). Although this drive
has never seen a fat part.
Before running fixboot I had a disk with 100GB of accessible data and
a running linux partition on. (there were 3 part. on disk, C: NTFS, D:
NTFS and one ext3 linux partition)
NOW, there's nothing. *cry*
When I boot from my PartitinMagic floppy I get a big fat yellow blob
for my harddisk saying "partition table corrupted".

When I boot from my linux CD and run fdisk, I get: Device contains
neither a valid DOS partition table, nor SUN, SGI or OSF disklabel ...

So kids, don't be as silly as me and try this at home with a complete
physical backup of all data.

Well ... maybe I can get my data back somehow ... should still be on
there, shouldnt it ... Bah!

I'll keep you posted, this promises to get really thrilling.

Oh my, I thought you were doing this from two separate and different
hard disks! Definitely not something to do to try to recover data from
a corrupt partition from another operating system on the same disk, or
without backing up data that is stored on other partitions on the same
disk! If the utilities that you used to prepare the disk cannot recover
the partition table, or unless you had backed up the MBR, you may have
to try recovery software.

John
 
M

Martin T.

Oh my, I thought you were doing this from two separate and different
hard disks! Definitely not something to do to try to recover data from
a corrupt partition from another operating system on the same disk, or
without backing up data that is stored on other partitions on the same
disk! If the utilities that you used to prepare the disk cannot recover
the partition table, or unless you had backed up the MBR, you may have
to try recovery software.

John





Weeeeell.
I really messed up. Since I haven't got my external drive around atm I
thought I'd give it a try and run run fixboot anyway to se what it
does.
And what it bloody did was corrupt (or delete or whatever) the
PARTITION TABLE of my harddisk.
When I ran "fixboot C:" it put out some messages and then appeared to
change the drive type of the partition to FAT (!). Although this drive
has never seen a fat part.
Before running fixboot I had a disk with 100GB of accessible data and
a running linux partition on. (there were 3 part. on disk, C: NTFS, D:
NTFS and one ext3 linux partition)
NOW, there's nothing. *cry*
When I boot from my PartitinMagic floppy I get a big fat yellow blob
for my harddisk saying "partition table corrupted".

When I boot from my linux CD and run fdisk, I get: Device contains
neither a valid DOS partition table, nor SUN, SGI or OSF disklabel ...

So kids, don't be as silly as me and try this at home with a complete
physical backup of all data.

Well ... maybe I can get my data back somehow ... should still be on
there, shouldnt it ... Bah!

I'll keep you posted, this promises to get really thrilling.

cheers,
Martin

(How I hate google groups, lets see how many times this post ends up.)

OK. Next update:
Found this utility TestDisk (http://www.cgsecurity.org/)
It's freeware and so I managed to copy it onto a boot floppy and try
my best. After manually telling it to use 255 cylinders instead of 240
(it actually told me to try so) it found all partitions and fixed up
the part.table.
After A Reboot the MBR was still messed up so I booted back into
TestDisk and let it write the MBR anew. Now I get to boot from the
primary partition once more. (Not that windows starts, but well.)
All that remains now is to get grub back on to see if Linux also
starts.

Phew. Seems I was half lucky. (Though I'd say I've not halfway
deserved it trying these stunts w/o backup.)

cheers,
Martin
 
M

Martin T.

(...)
All that remains now is to get grub back on to see if Linux also
starts.
Phew. Seems I was half lucky. (Though I'd say I've not halfway
deserved it trying these stunts w/o backup.)

Okies - got grub to reinstall and now everything is back to before I
ran fixboot. Fixboot indeed!!

I will post again as soon as I get another harddrive to do proper
backup and reinstall/repair windows.

.... Now that was an interesting evening ... ::)

cheers,
Martin
 
J

John John

Martin said:
Okies - got grub to reinstall and now everything is back to before I
ran fixboot. Fixboot indeed!!

I will post again as soon as I get another harddrive to do proper
backup and reinstall/repair windows.

... Now that was an interesting evening ... ::)

You are quite adept and resourceful! It is quite remarkable that you
managed to recover the MBR and the whole disk so quickly and
(apparently) fairly easily with the Test Disk utility, I have never used
that utility but I have now added it to my list of disk recovery
utilities! Do keep us posted on your progress and efforts, it is very
interesting and informative to have knowledgeable folks tell us how they
manged to fix tough problems like the one you are having.

John
 
B

Bruce Chambers

Martin said:
Hi all,

SHORT:

Besides performing a full system backup, you can't.
LONG:
My C: NTFS partition went bad when a power outage occurred during
shutdown. Now, when XP tries to boot I get a UNMOUNTABLE_BOOT_VOLUME
blue screen.
Booting to the recovery console and running chkdsk /P will result in
chkdsk telling me that there are unrecoverable errors on C: (In fact,
the recovery console won't even dir the contents of the C: drive.
So far so bad.
When I access the NTFS volume (read only) from my Linux boot option, I
can see that basically all data on there is intact and accessible (read
only). (Checked with a few images and zip files -- assuming that most
other stuff would also be correct.)

Now, as I see this, since CHKDSK refuses to repair the volume I will
have to reformat (I can get all data I need off it.)


From your description, formatting won't help. You need to replace the
hard drive.




--

Bruce Chambers

Help us help you:



They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety. -Benjamin Franklin

Many people would rather die than think; in fact, most do. -Bertrand Russell
 
M

Martin T.

Bruce said:
Besides performing a full system backup, you can't.

Grml. I feared that. I'll still try though.
From your description, formatting won't help. You need to replace
the hard drive.

I do not think it has anything to do with the physical drive.
Power outage during shutdown -> NTFS bust.
This has nothing to do with hardware. (imho)
(All data on the drive is accessible, it's just the NTFS-filesystem on
the first part. that is unrepairable.)

cheers,
Martin
 
M

Martin T.

You are quite adept and resourceful! It is quite remarkable that you
managed to recover the MBR and the whole disk so quickly and
(apparently) fairly easily with the Test Disk utility, I have never used
that utility but I have now added it to my list of disk recovery
utilities! Do keep us posted on your progress and efforts, it is very
interesting and informative to have knowledgeable folks tell us how they
manged to fix tough problems like the one you are having.

John

So ... let's just wrap this up (halfway at least.)

I have now just installed Windows XP from scratch on a new disk, and
will reinstall everything.
I was easily able to selectively save all important data (Like
Documents and settings, My Files, some program settings) from my old
NTFS-C: but a recursive copy failed, because the Linux NTFS driver
(the read-only standard one) would crash when encountering some
corrupted NTFS entries - so I never could copy the whole disk.

What was VERY bothersome was the reinstallation of Windows XP, because
I only have a sp1a installer CD and that one did not correctly
recognize the new 160GB harddisk I used for installing.
I ended up unplugging the old one to make sure windows would not mess
further with it and managed to install on the new disk, although
windows did NOT recognize the correct disk capacity.
(This last paragraph's work took me hours all in all, because I double
checked things as far as possible.)

After having installed WinXPsp1a on the new disk, I re-plugged the old
one to install sp2 from it, but oh-my windows did not correctly
recognize it. (it displayed it as 130GB empty when in fact if was
200GB wioth lots of data and partitins on it)

On my system, with the clean windows XP (sp1a) setup WinXP refused to
recognize more than 130GB of the harddisks and so it was impossible to
properly setup my system.
I ended up copying the sp2 install file I had on the old NTFS
partition to the new 130 GB windows installation and running it from
there. After sp2 was installed, windows then correctly recognized the
harddisks and I am now able to set the rest up.

So ...
* If something get's messed up and you do not have a backup yet, make
one (using linux or whatever). DONT use any M$/Windows tools before
this, because they WILL corrupt things further and don't ask you
beforehand.
* I was unable to find out how/if it would be possible to get windows
to boot from a filesystem level copy.
* INSTALL sp2. If you do not have a sp2 installer CD, make this THE
FIRST thing you do, especially on newer hardware.
* The Recovery console is one crappy tool. It didn't help in any way.
* When you mess with MBR/boot sector/... use two different tools to
double check. (I used the said Testdisk free utility and my boot-disks
of Partition Magic 7)
* Don't trust Windows. :)

I must say this whole affair was a real eye-opener as to how deficient
the Windows XP system level tools and system-startup-procedure really
are and how non-interoperable M$ really makes their products.

I do not blame M$ for the few data I lost, that is entirely my fault.
I blame them for a crappy bootup procedure and for not being able to
access a NTFS partition even though I can access it with open-source
drivers.

Now if it weren't for the games I want to play I woul probably just
have throw that whole XP crap out of the window and settled with
Ubuntu only. Bah!

I hope this thread may be of use to some people.
best regards, until the next M$ suffering,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top