PDA

View Full Version : [ubuntu] 10.04/GRUB2 Update made HD "Win-proof" (XP doesn't boot, Rec/Inst CD doesn't work)



MurphysServant
May 4th, 2010, 09:33 AM
Hi there!

I am a happy user of Linux since quite a while, and have ended up with Ubuntu as the distro of choice. I think this is the best thing since the invention of coffeine - thanks for the great work!

Due to work-related reasons (it's a company laptop for one), I am forced to also have Windows on the hard disk as well, but I had managed to have Linux and Windows co-existing peacefully (on a Dell Vostro 1710 AMD 64bit) for quite a while now - yipieh, there it was, World Peace on a smaller scale!

Well - "was" - 3 days ago I pressed that "Upgrade to Ubuntu 10.04 LTS" button. There were warnings - I admit (and you may blame me) - to not finalize the change to GRUB2 until verified that all OSs on the HD work and to verify no OS is in sleep state, but I guess I have become too "jaunty" after months of smooth sailing with Ubuntu. Well, I like GRUB2 and I have a very nice Boot Splash Screen now - however Windows XP doesn't boot anymore. Since Friday I have been trying to find a solution also via googling, to no avail, so I try via my first forum question ever.

Whatever linux-based means I use (e.g. 30_os_prober identifies WinXP on /sda2 an auto-puts it in the boot menu), it shows no problems (and the data of the Windows disk is still there), however the laptop simply stands with a black screen / blinking cursor after leaving the Boot Menu. It looks like the handover from boot menu to WinXP doesn't work. I tried several tools on e.g. the "Ultimate Boot CD", but to no avail (maybe I made things worse in the process). The interesting thing is that also the XP Recovery and Installation Disk doesn't work anymore, it says it can't see any hard disk?!?

sda1: Dell Utility
sda2: Win XP
sda3: Extd. Part.
sda5: DATA NTFS
sda6: Ubuntu
...

For info, I put the outputs of "sudo fdisk -l /dev/sda" and "sudo bash boot_info_script055.sh" underneath. From running the boot_info_script055.sh, I got that there is "Grub 2 is installed in the boot sector of sda2" - that shouldn't be, or? Is that the root cause? If yes: how do I fix it?? I tried with features in UBCD, but I din't get anywhere...

Any help is GREATLY appreciated!! Thanks in advance....


fdisk -l /dev/sda

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x98deb064

Device Boot Start End Blocks Id System
/dev/sda1 * 1 15 120456 6 FAT16
/dev/sda2 16 7769 62284005 7 HPFS/NTFS
/dev/sda3 7770 29764 176674837+ f W95 Ext'd (LBA)
/dev/sda4 29765 30401 5116702+ 7 HPFS/NTFS
/dev/sda5 7770 25992 146376216 7 HPFS/NTFS
/dev/sda6 25993 28943 23703876 83 Linux
/dev/sda7 28944 29564 4988151 83 Linux
/dev/sda8 29565 29586 176683+ 82 Linux swap / Solaris
/dev/sda9 29587 29764 1429753+ 82 Linux swap / Solaris




sudo bash boot_info_script055.sh

Boot Info Script 0.55 dated February 15th, 2010

============================= Boot Info Summary: ==============================

=> Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
partition #6 for /boot/grub.

sda1: __________________________________________________ _______________________

File system: vfat
Boot sector type: Dell Utility: Fat16
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /COMMAND.COM

sda2: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Grub 2
Boot sector info: Grub 2 is installed in the boot sector of sda2 and
looks at sector 421836599 of the same hard drive for
core.img, but core.img can not be found at this
location. No errors found in the Boot Parameter Block.
Operating System: Windows XP
Boot files/dirs: /boot.ini /ntldr /NTDETECT.COM

sda3: __________________________________________________ _______________________

File system: Extended Partition
Boot sector type: -
Boot sector info:

sda5: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Grub 2
Boot sector info: Grub 2 is installed in the boot sector of sda5 and
looks at sector 422551615 of the same hard drive for
core.img, but core.img can not be found at this
location. According to the info in the boot sector,
sda5 starts at sector 63.
Operating System:
Boot files/dirs:

sda6: __________________________________________________ _______________________

File system: ext3
Boot sector type: Grub 2
Boot sector info: Grub 2 is installed in the boot sector of sda6 and
looks at sector 421928783 of the same hard drive for
core.img, but core.img can not be found at this
location.
Operating System: Ubuntu 10.04 LTS
Boot files/dirs: /boot/grub/menu.lst /boot/grub/grub.cfg /etc/fstab
/boot/grub/core.img

sda7: __________________________________________________ _______________________

File system: reiserfs
Boot sector type: -
Boot sector info:
Operating System: Debian GNU/Linux squeeze/sid
Boot files/dirs:

sda8: __________________________________________________ _______________________

File system: swap
Boot sector type: -
Boot sector info:

sda9: __________________________________________________ _______________________

File system: swap
Boot sector type: -
Boot sector info:

sda4: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs:

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start End Size Id System

/dev/sda1 * 63 240,974 240,912 6 FAT16
/dev/sda2 240,975 124,808,984 124,568,010 7 HPFS/NTFS
/dev/sda3 124,808,985 478,158,659 353,349,675 f W95 Ext d (LBA)
/dev/sda5 124,809,048 417,561,479 292,752,432 7 HPFS/NTFS
/dev/sda6 417,561,543 464,969,294 47,407,752 83 Linux
/dev/sda7 464,969,358 474,945,659 9,976,302 83 Linux
/dev/sda8 474,945,723 475,299,089 353,367 82 Linux swap / Solaris
/dev/sda9 475,299,153 478,158,659 2,859,507 82 Linux swap / Solaris
/dev/sda4 478,158,660 488,392,064 10,233,405 7 HPFS/NTFS


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/sda1 07D9-0218 vfat DellUtility
/dev/sda2 9E02E8C802E8A68D ntfs OS
/dev/sda3: PTTYPE="dos"
/dev/sda4 708B600C5142ABD5 ntfs
/dev/sda5 153421CA55730A01 ntfs
/dev/sda6 a74438b5-197d-42bc-abf7-bfd841fd32a6 ext3 Ubuntu
/dev/sda7 09dcdfd8-3f9f-4fd4-8248-bad203439056 reiserfs
/dev/sda8 swap
/dev/sda9 swap
/dev/sda: PTTYPE="dos"

============================ "mount | grep ^/dev output: ===========================

Device Mount_Point Type Options

/dev/sda6 / ext3 (rw,relatime,errors=remount-ro)
/dev/sda5 /media/disk fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)


================================ sda2/boot.ini: ================================

[boot loader]
timeout=3
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOW S
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect

bcbc
May 4th, 2010, 09:54 AM
Yes, grub2 should not be installed in /dev/sda2. See here (http://sourceforge.net/apps/mediawiki/bootinfoscript/index.php?title=Boot_Problems:Boot_Sector) for meierfra's fix.

The boot flag should probably also be on /dev/sda2 and not /dev/sda1.

MurphysServant
May 4th, 2010, 10:24 AM
Thanks for the fast reply!

I remember that menu entry, been there before.

I did the following:

- switched boot flag to sda2 in qparted
- run testdisk, verified flag is right
- navigated to that menu entry, pressed rebuild, response:
<<
TestDisk 6.11, Data Recovery Utility, April 2009
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sda - 250 GB / 232 GiB - CHS 30401 255 63
Partition Start End Size in sectors
2 * HPFS - NTFS 15 0 1 7768 254 63 124568010 [OS]

filesystem size 124568010
sectors_per_cluster 8
mft_lcn 786432
mftmirr_lcn 524289
clusters_per_mft_record -10
clusters_per_index_record 1
Extrapolated boot sector and current boot sector are identical.
>>
- afterwards: update-grub, reboot
- exactly same behaviour, same problem, no change
- ran "sudo bash boot_info_script055.sh" again, funny thing is the note on grub2 in sda2 is still there?!

MurphysServant
May 4th, 2010, 10:32 AM
Actually, the menu listings are slightly different then described in the sourceforge source. The last screen looks like this (it says "Rebuild BS", not "Backup BS" - or should I press "Repair MFT"?):

TestDisk 6.11, Data Recovery Utility, April 2009
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sda - 250 GB / 232 GiB - CHS 30401 255 63
Partition Start End Size in sectors
2 * HPFS - NTFS 15 0 1 7768 254 63 124568010 [OS]

Boot sector
Status: OK

Backup boot sector
Status: OK

Sectors are identical.

A valid NTFS Boot sector must be present in order to access
any data; even if the partition is not bootable.

[ Quit ] [ List ] [Rebuild BS] [Repair MFT] [ Dump ]

bcbc
May 4th, 2010, 10:43 AM
If the testdisk result doesn't look right, go with the windows repair option. I think there is a typo though - 'bootrect /fixboot' should be 'bootrec /fixboot'

Edit: forgot you have XP. So it's not bootrec but rather fixboot

Another edit: you mentioned running some attempted fixes. This may be why the backup bootsector is identical. Also, I think the incorrect bootflag might be the reason the XP repair CD didn't work. Hopefully it works now. Otherwise, I can't think of anything else to try.

MurphysServant
May 4th, 2010, 10:52 AM
...but 'bootrect /fixboot' applied to Vista - I would go with "fixboot" for XP, right...?

But since the WinXP CD doesn't see the hard disk at all (see first post), I would try via Ultimate Boot CD to get a 'fixboot' out to the WinXP partition.

bcbc
May 4th, 2010, 10:58 AM
...but 'bootrect /fixboot' applied to Vista - I would go with "fixboot" for XP, right...?

But since the WinXP CD doesn't see the hard disk at all (see first post), I would try via Ultimate Boot CD to get a 'fixboot' out to the WinXP partition.

Yes - I was too slow on my edits :)

Try the XP repair again now that the bootflag is correct. I don't know anything about the ultimate boot cd, but if that's your only option...

MurphysServant
May 4th, 2010, 01:29 PM
Well, this certainly isn't going well...

It looks like the MBR / Partition BS is in a state which is fine for linux, but unusable for anything DOS-based. I tried also with UBCD trying to realize a "Fixboot", but it doesn't work.

Currently I saving the Windows partition (which I can see perfectly well in Ubuntu) via LuckyBackup (since Acronis doesn't see anything)...

The question is how to proceed? Should I try to row back to old-Grub as in
https://help.ubuntu.com/community/Grub2#Uninstalling GRUB 2

However, I have the bad feeling that this won't fix the damage which seemingly was done to sda2, or?

Or install WinXP again on a different disk or partition and then use luckyBackup to dump the old sda2 content over it, hoping that it results in something that boots; that would be a pretty desperate attempt already.

Any other/better ideas?

bcbc
May 4th, 2010, 03:58 PM
I've seen this in other threads unfortunately. Attempts to fix the problem other than a fix to the bootsector or the testdisk method end up causing more harm.

Reinstalling different versions of grub or ubuntu won't do anything for you.

:(

kansasnoob
May 4th, 2010, 04:13 PM
OK, XP is on sda2 and Lucid is on sda6. So just as a matter of troubleshooting I'd try the following using an Ubuntu Live CD:


sudo apt-get install lilo


sudo lilo -M /dev/sda mbr

Then see if XP will boot. Regardless you won't now be able to boot Ubuntu so to give the mbr back to Ubuntu once again use the Live CD:


sudo mount /dev/sda6 /mnt && sudo mount --bind /dev /mnt/dev &&sudo mount --bind /proc /mnt/proc && sudo chroot /mnt


grub-install /dev/sda

Should that show any errors run:


grub-install --recheck /dev/sda


exit


sudo umount /mnt/dev && sudo umount /mnt/proc && sudo umount /mnt

Depending on whether XP boots with the "Lilo" mbr we'll plan from there.

mtdave
May 4th, 2010, 05:01 PM
I had the same problem and fixed it by reinstalling Grub2 to the /dev/sda. Then I ran sudo update-grub. Ubuntu then booted and XP was in the Grub menu but would not boot. I then took the Windows XP Home (mine is not Professional) CD and booted to that and went into recovery mode ("R"). I entered my Administrator password and it took me to the C:\Windows> prompt. I typed fixboot c: at the prompt and that was it. I rebooted and now I can boot to Ubuntu 10.04 and Windows XP Home without problem.

MurphysServant
May 4th, 2010, 05:19 PM
Thanks for the help!!

I pack my things now and go home where I will try the two suggestions. I'll keep you updated!!

MurphysServant
May 4th, 2010, 09:25 PM
:D

There is light at the end of the tunnel, and I am hopeful that it is NOT the freight train coming my way!

The core of the problem after updating to Lucid has been that no DOS/Win based means was able to do anything with the HD after switching to GRUB2.

Well - I just tried a newer XP installation disk, with not much difference in result: instead of saying that it cant see any hard disk after pressing 'r' for recovery console, it showed the various partitions - only to crash to blue screen immediately after choosing the one in question. Slight, but DECISIVE difference! I made some 5 GB unallocated space at the end of the HD using qparted, booted with that new disk again and tried - instead of recovery - installing XP a second time on the HD (on sda4). I figured if I can bring XP to leave its odor mark on the MBR/BS, I might have a chance.

Well - after reboot, it brings up a page were one can choose between:
- Win XP
- Win XP
- Recovery Console
... and guess what, one of the two "WinXP"s leads - without further ado - to the familiar XP on sda2.

Unorthodox and lengthy, but who cares if it works - after another reboot and using the Ubuntu 10.04 Installation CD I could verify that the increased dark&evil (XP-)side of the HD has not obliterated the Linux contents of it - all is still there, safe and sound. So all that is left to do now I guess is to archive sda2 as it is and to go via the Ubuntu CD & the 30_os-prober to bring Linux back into the game (/boot manager) - which should be much less of a problem than bringing back XP to life.

Thanks goes to Vancouver, Kansas, and ?? for your support - I owe you a beer each; I just have to figure out a way to upload it!
:P

bcbc
May 4th, 2010, 11:54 PM
Thanks goes to Vancouver, Kansas, and ?? for your support - I owe you a beer each; I just have to figure out a way to upload it!
:P

Good job! Why don't you just drink three beers - you probably need them after all that (I know I would).

ileader
May 5th, 2010, 06:45 PM
:D

Well - I just tried a newer XP installation disk, with not much difference in result: instead of saying that it cant see any hard disk after pressing 'r' for recovery console, it showed the various partitions - only to crash to blue screen immediately after choosing the one in question. Slight, but DECISIVE difference! I made some 5 GB unallocated space at the end of the HD using qparted, booted with that new disk again and tried - instead of recovery - installing XP a second time on the HD (on sda4). I figured if I can bring XP to leave its odor mark on the MBR/BS, I might have a chance.



I am getting a similar, but again slightly different problem (with the XP Enterprise Edition CD), after doing a clean XP install, followed by a clean install of 10.04 LTS.

When I select windows from the GRUB 2 menu, it Blue-screens almost immediately (just after the flag and the back-and-forth bar come up on the black screen); if I try to reinstall it says it can't detect any disk, and if I try to do anything after this, it blue-screens; and if I try to use the recovery console, whenever I run a command it says it can't detect the disk.

I've tried everything suggested in this thread and a few more besides.

I'm getting the following warning in testdisk:


Disk /dev/sda - 40 GB / 37 GiB - CHS 4864 255 63
Partition Start End Size in sectors
1 * HPFS - NTFS 0 1 1 2581 164 63 41474097

Boot sector
Warning: Incorrect number of heads/cylinder 240 (NTFS) != 255 (HD)
Status: OK

I'm wondering if this is in any way related - and in any way related to the 'Partition alignment changes may break some systems' note in the release notes (http://www.ubuntu.com/getubuntu/releasenotes/1004). The machine in question is a 2004 Thinkpad T41.

Any advice on how to troubleshoot / fix this would be very welcome.

Thanks, Ian.

MurphysServant
May 6th, 2010, 08:59 AM
Hi ileader,

this - to me - looks like a different story. An other-than-expected heads/cylinder count after install I guess consists a problem to pretty much any OS. But that's just my 2cents worth (me not being anywhere close to an expert).

Furcifer
May 6th, 2010, 09:53 AM
Similar issue on the first Lucid install - Got in a hurry, checked all the blocks, reboot and Vista 64 wouldn't boot. Fixed it with the TestDisk method (http://sourceforge.net/apps/mediawiki/bootinfoscript/index.php?title=Boot_Problems:Boot_Sector) mentioned in the earlier post.

NEW KERNEL update today, and I'm thinking, "HA! You won't get ME the same way twice!" So I unchecked all but /dev/sda and /dev/sdb where Ubuntu lives. Well, I was right - it didn't get me the same way... This time the windows partitions didn't show up at all!

sudo grub-install /dev/sda
sudo update-grub

Fixed!

I'm still not sure what that screwy grub configuration pop-up window should look like now, or what it's trying to get me to do?

/dev/sda
/dev/sda1 FAT32 Recovery
/dev/sda2 NTFS Vista64
/dev/sda3 Extended - container for logical partitions
/dev/sda5 NTFS D:\
/dev/sdb
/dev/sdb1 ext4 \
/dev/sdb2 swap
/dev/sdb3 extended - container for logical partitions
/dev/sdb5 ext4 Filesystem

Kevin.Dual@gmail.com
August 18th, 2010, 03:37 AM
I have Windows XP installed on a completely different hard drive. When I select Windows XP from the grub menu, it begins to boot windows (shows the windows logo), then blue screen of death almost immediately. Here's the interesting part... If I select the Windows drive as the first boot device in the BIOS, then it boots windows just fine without any problems at all. How can grub be causing the BSOD?