1

Topic: XP boot lost after partition resize

Hi!
although I don't get the error message about partition size and media, as a matter of facts XP does not boot anymore after I resized/created partition on my HD (originally only 2 partitions, a big one for XP and a sort-of-hidden one for system recovery by HP)

I've seen in previous posts with similar problems, that you need the following info:
fdisk -l -u

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    83377349    41688643+   7  HPFS/NTFS
/dev/sda2       463222784   488390655    12583936    7  HPFS/NTFS
/dev/sda3        83377350   206258534    61440592+   7  HPFS/NTFS
/dev/sda4       206258535   463218209   128479837+   7  HPFS/NTFS

Partition table entries are not in disk order

and

parted /dev/sda unit s print

Disk /dev/sda: 488397167s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start       End         Size        Type     File system  Flags
1      63s         83377349s   83377287s   primary  ntfs         boot
3      83377350s   206258534s  122881185s  primary  ntfs             
4      206258535s  463218209s  256959675s  primary  ntfs             
2      463222784s  488390655s  25167872s   primary  ntfs             

as well as the two files (.mdr and pbr) generated by the dd commands. They're in a zip file (along with the info from fdisk and parted, as above) here:

http://rapidshare.com/files/337235424/arrturi.zip.html

I'm sorry I cannot say which version of Gparted has been used, because it was in a pendrive live Slax release that a friend of mine handed me yesterday. If you really need this info, I can tell you tomorrow.

Thanks a lot
Arturo

2

Re: XP boot lost after partition resize

Update:
I've just tried to follow the tutorial in this forum:
http://gparted-forum.surf4.info/viewtopic.php?id=13937
the size in the original pbr was only slightly different from that reported by parted (83377272; 83377286 respectively). I've edited and replaced the pbr as suggested. The only difference when rebooting is the characters displayed on the screen when the boot from HDD fails (previously two short lines with ASCII weird characters like, a musical note, a smiley a greek alpha; now just and only "E2").
Thanks!

3

Re: XP boot lost after partition resize

Were you able to solve the problem using the proposed tutorial, or do you still have the same problem?

4

Re: XP boot lost after partition resize

Sorry I was not clear in my second post.
I'm still experiencing the problem. system does not boot.
I was describing the "funny" behavior when it gets stuck.
In the meantime, I've also tried to boot by a XP installation CD, in order to use the recovery option. It loads all the drivers and stuff, but then crashes into a very "annoying" blue screen, with some error messages that I'm not able to report now (the workstation is in my office)
Thanks for the support

5

Re: XP boot lost after partition resize

The partition size and NTFS volume size appear fine:
83,377,287 sectors in length for the partition (sda1) from the MBR file
82,377,272 sectors in length for the NTFS volume from the PBR file.

However, it does appear that the number of "Hidden Sectors" in the NTFS PBR was not updated correctly.  The PBR has a value of 2048, which does not match the partition start sector of 63.


Out of curiosity, which version of GParted Live and/or Live CD did you use?


The change I have made to the file is from a value of 2048 for "Hidden Sectors":
00000010   00 00 00 00  00 F8 00 00  3F 00 FF 00  00 08 00 00
To a new value of 63 sectors:
00000010   00 00 00 00  00 F8 00 00  3F 00 FF 00  3F 00 00 00

To apply this change:

1) Download the new NTFS PBR: sda1-arrturi_new.pbr

2) Load the new NTFS PBR on your hard disk.
NOTE:  Be extra careful when entering the commands.  Data loss could result otherwise.

dd if=sda1-arrturi_new.pbr of=/dev/sda bs=512 count=1 seek=63

3) Reboot the computer

4) Check that the file system is recognized in GParted

5) If all seems fine then I would advise booting into Windows and running "chkdsk /f /r" multiple times, until there are no more faults.

6 (edited by arrturi 2010-01-19 13:48:07)

Re: XP boot lost after partition resize

Many thanks, Gedakc!
System's back to (WixXP)life, and ready to welcome a linux-based OS on one of the partitions. (next challenge: dual boot!)
At first boot, disk check was automatically run and errors were found and fixed. I've run it 2 more times and no faults were reported.
All partitions are correctly managed.
I've used GParted version 0.4.8.
These days, in order to fix the boot problem, I've been using a Linux Rescue live CD, with Gparted 0.3.4 on it. This version has been detecting all the partitions without errors, but I did not try to use it to resize them. Perhaps, this could have overridden the faulty partition table?
Now, let me comment the tutorial I've followed yesterday, as compared to what you did to fix my problem (which seems to be a more subtle issue, indeed).
The tutorial says:
Make a parted /dev/sda unit s print,
Write down the number of the size column, minus 1
....
...
and replace the 3rd column with you inverted Hexadecimal value magic number!

You say:
The partition size and NTFS volume size appear fine:
83,377,287 sectors in length for the partition (sda1) from the MBR file
82,377,272 sectors in length for the NTFS volume from the PBR file.

So that I should not have tried to replace this value in the PBR.
It's true that in most of the posted problems the size recorded in the PBR file was largely different from the real size, but (maybe this is a trivial question) how can one understand if a 15 sectors difference is OK?
Thanks a lot, once again!

Arturo

7

Re: XP boot lost after partition resize

arrturi wrote:

It's true that in most of the posted problems the size recorded in the PBR file was largely different from the real size, but (maybe this is a trivial question) how can one understand if a 15 sectors difference is OK?

To be a valid partition and file system, the file system size must fit within the partition.  If the file system size is much smaller than the partition, then this is still valid.  A smaller file system simply means that there is some unused space within the partition.

With NTFS file systems, the file system must be at least one sector smaller than the partition.  This is because NTFS stores a backup sector after the file system.  For NTFS the backup sector is not considered part of the file system.

8

Re: XP boot lost after partition resize

Super clear!
I admit I did not even notice that the system size was smaller than the partition.....
Thanks a lot!

9

Re: XP boot lost after partition resize

If this problem is now solved, you can edit your initial post to prefix the title with "SOLVED".  Doing so can help other users that are searching for answers to questions in this forum.  smile