LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Gparted - power failure - lost XP? (https://www.linuxquestions.org/questions/linux-newbie-8/gparted-power-failure-lost-xp-582959/)

3lowdown 10-11-2007 10:37 AM

May have stumbled onto something here. I booted with Gparted, and finally noticed the flags column. I set the restore partition's flag to Boot (it did say ?lva). Saved, rebooted and now the HP PC Recovery is underway. Wish I'd have noticed that flag a month ago!

saikee 10-11-2007 11:12 AM

The advise below is based on the partition layout as indicated in Post #3. Making sda1 bootable instead of sda2 bootable will nullifies the advice.

The problem does not appear to be fully reported and the OP does not seem to be fully conversant with the partition table structure (from C is blank and D still have files).

The OP even attempted to alter the hard disk geometry to 240 heads without a valid reason and against the print out stated in Post #3 that the hard disk has 255 head and 63 sectors.

If Gparted was not resizing sda2 then there could be no damage to it when the power to the PC was interrupted.

I would change the number of heads back to 255 myself because the LBA mode assumes all hard disks to have 255 heads and 63 sectors and only the number of cylinders varies.

There is only one partition sda2 which is in ntfs format and so that will have all the Windows files. The OP did mention he/she can read the files and so that partition is healthy, appear to be mountable and so all data inside can be salvaged.

The current problem appears to be the Windows isn't bootable.

Before advice can be given we need to know if the sda1 was original bootable or not. The Post #3 indicated that sda1 is not bootable (possibly a utility partition set up by HP and substantially empty) because sda2 has a "*" meaning it has the booting flag switched on, otherwise the boot loader for Windows may have been deposited in sda1. Windows boots only an active partition which must have its booting flay switched to the "on" position.

If sda2 is indeed a bootable partition then it will have all the booting files inside, like NTLDR and boot.ini (hidden). A view from PCLinuxOS can reveal all this.

Assuming sda2 is healthy then these commands in a Grub prompt should fire it up
Code:

root (hd0,1)
chainloader +1
boot

A Grub prompt can only be obtained before a Linux is booted so this may be hard for the OP to generate himself/herself unless he/she has a floppy drive and follow the Chapter 3.1 of the Grub Manual to dd the stage1 and stage2 files from the Live CD of PCLinuxOS to a floppy.

The other method to make sda2 bootable is to run Windows installation CD, choose repair and drop into recovery console and issue command
Code:

fixmbr
This should make Windows bootable again unless Windows washes its hand on a dodgy hard disk with partition boundary errors.

The above is based on sda2 is in a healthy state. Only the OP can tell by mounting this partition in PCLinuxOS (if it isn't already mounted). If the partition is of value I strongly recommend to get a external USB hard disk to clone the disk over as a backup.

fynstee 10-28-2007 04:40 AM

Sometimes the simple stuff is right..
 
Quote:

Originally Posted by 3lowdown (Post 2887759)
Ok, tried gparted testdisk, said heads were 255 and should probably be 240, so I changed them to 240, re-ran analyze, and it didn't flag them as bad, but still can't boot windows. Windows XP Boot disk says:

Windows could not start because the following file is missing or corrupt:
<Windows root>\system32\hal.dll.
Please re-install a copy of the above file.


what next?
Thanks

What was wrong with windows (I assume it's fixed by now) is exactly what it says in the error message. Windows thinks that file is missing or corrupt, usually because the registry itself is corrupted.

If pressing F8 and using the 'Last known good configuration' doesn't work you can replace the windows registry hives with earlier versions using a linux live CD like Wolvix (wolvix reads/writes to ntfs).

It's a bit like the old scanreg /restore from Win98, a sort of limited system restore concerning just the reg files.

Your current registry files can be found here:-

C:\WINDOWS\System32\config\

Your XP's system restore stores old copies in the C:\System Volume Information folder. Can't remember the names used for the folders in ther, but it's a big mishmash of letters. Look for these files in a relatively recent folder:-

_REGISTRY_MACHINE_SAM
_REGISTRY_MACHINE_SECURITY
_REGISTRY_MACHINE_SOFTWARE
_REGISTRY_MACHINE_SYSTEM
_REGISTRY_MACHINE_DEFAULT

Then rename them as show below:-

Rename '_REGISTRY_MACHINE_SAM' to SAM
Rename '_REGISTRY_MACHINE_SECURITY' to SECURITY
Rename '_REGISTRY_MACHINE_SOFTWARE' to SOFTWARE
Rename '_REGISTRY_MACHINE_SYSTEM' to SYSTEM
Rename '_REGISTRY_MACHINE_DEFAULT' to DEFAULT

Then copy the renamed files to C:\WINDOWS\System32\config\

This replaces the old corrupted registry hives with ones from an earlier point. WinXP should now boot

moljac024 10-28-2007 06:19 AM

All the time you spent waiting or trying to fix windows could have been spent re-installing it and all of your apps about 30 times ! :D


All times are GMT -5. The time now is 10:42 AM.