reddragdiva: (Default)
[personal profile] reddragdiva

(Warning: not only geeky, but geeky in a horribly Linux way. I'm extremely happy with Ubuntu as long as I can forget there's Linux at the bottom of it, and it just reminded me.)

I managed to cleverly trash GRUB by editing /boot/grub/menu.lst directly by hand to boot Windows 2000 from /dev/hda5. Bad move — on reboot, stage 2 came back with the infamous Error 17 (can't see a file system).

I went in with the Ubuntu Live CD and mounted /dev/hda1 to /mnt just fine — so the file system is there. Couldn't work out from the docs how to get it to rewrite the bootstrap so it would start up properly.

Eventually I thought, "OK, it should be possible to get it to boot into the Windows partition if I reinstall the NT boot." Put in the Windows 2000 CD, went to recovery console, did fixmbr, rebooted, it didn't work, did fixboot, rebooted, it didn't work. You will note that by this stage I was trying things more or less at random.

I could "fix" it easily enough by reinstalling from scratch (and this time getting the dual-boot right) — I'd only lose a day's effort — but I'd rather get myself out of this one if at all possible. What have I trashed, is it recoverable and how do I get back to a booting system? For bonus points: how do I get it to recognise the Windows 2000 partition as bootable? You will earn so many *pint*s for supplying the winning answer, or even approximations.

Update: Solved! The partition type was wrong. *pint* to [livejournal.com profile] dennyd.

(no subject)

Date: 2005-07-31 11:28 pm (UTC)
From: [identity profile] theemptied.livejournal.com
Hey,

grub does not need to be reinserted into the MBR every time your config for it changes(unlike lilo). My guess is you turned off initrd support. I am guessing hda1 is ext3? I don't know about Ubuntu but standard debian lkernels have ext3 as a module, which would necessitate initrd.

Try using apt to get a newer or older kernel, then compare the boot stanza it inserts tou the one for your regular linux kernel.

(no subject)

Date: 2005-07-31 11:49 pm (UTC)
From: [identity profile] zey.livejournal.com
I'd suggest going back to Lilo. Might not be as fancy but more people use it and the documentation's more extensive for resolving problems like that.

(no subject)

Date: 2005-08-01 12:04 am (UTC)
From: [identity profile] untermensch.livejournal.com
Agreed. All in all, I've had an easier time with LILO

(no subject)

Date: 2005-08-01 05:39 am (UTC)
pvaneynd: (Default)
From: [personal profile] pvaneynd
Well. I'm guessing you left out a step, because editing the menu.lst file until it breaks should get you into the grub command line interface. So I guess you did a grub-install?

Editing the menu.lst file does not require running any other command afterward.

I would just boot the live CD, mount the old filesystems as "/mnt" (don't forget your old /boot if you have it) and run "grub-install --recheck --root-directory=/mnt/boot /dev/hda". This should install a new MBR and point it to the stage1 and 2 on /mnt/boot/grub/.

To recreate the menu.lst file, boot into the system (either directly or using chroot) and run update-grub.

To boot my XP on /dev/hda1 I use:
# For booting Windows NT or Windows95
title Windows NT / Windows 95 boot menu
rootnoverify (hd0,0)
makeactive
chainloader  +1


The "makeactive" should make the XP mbr happy as it won't boot from a non-active partition.

(no subject)

Date: 2005-08-01 06:11 am (UTC)
From: [identity profile] steer.livejournal.com
I'm wondering if it's the /dev/hda1 and /dev/hda5 that is confusing it -- grub doesn't think like that because it comes in before the linux filesystems are mounted with /dev and everything

So this little lot boots from the first partition on the second harddrive

title Ubuntu, kernel 2.6.10-5-686
root (hd1,0)
kernel /boot/vmlinuz-2.6.10-5-686 root=/dev/hdc1 ro quiet splash
initrd /boot/initrd.img-2.6.10-5-686
savedefault
boot

And these lines boot W2K from the first partition in the first hard drive.

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title Windows NT/2000/XP
root (hd0,0)
savedefault
makeactive
chainloader +1

(no subject)

Date: 2005-08-01 09:19 am (UTC)
From: [identity profile] dennyd.livejournal.com
Once you'd returned the grub config files to normal, the command 'grub-install /dev/hda' should slap the grub MBR back over the top of whatever happened due to the Windows commands you tried.

As someone else has mentioned, grub doesn't speak /dev/hdXN - you'll be needing to RTFM to figure out the obscure hd(0,0) gibberish... I think it's something like /dev/hdb4 == hd(1,3) for instance, but the docs will tell you for sure.

(no subject)

Date: 2005-08-01 11:44 am (UTC)
From: [identity profile] hawkeviper.livejournal.com
yup, that's the one. <3 the inclusion of 0

(no subject)

Date: 2005-08-01 11:43 pm (UTC)
From: [identity profile] dennyd.livejournal.com
Hrm.

Does this help?
http://lists.linuxcoding.com/rhl/2005/msg07520.html

(no subject)

Date: 2005-08-01 11:58 pm (UTC)
From: [identity profile] dennyd.livejournal.com
More googling finds this:
I've installed Ubuntu on the desktop running rh9. I had a minor glitch with grub that refused to install. It turned out to be a wrong partition type set on an ext3 partition (had win95). Sadly grub would complain about:

The file /boot/grub/stage1 not read correctly

Which wasn't very clear that grub wasn't actually able to mount the partition holding stage1.

And this:
fixed it :) well... the problem was ... when i formatted my c: for installing xp... it somehow changed the linux partition number to hda6. so i had to edit the /boot/grub/menu.lst, /etc/fstab and fixed the partition number and then install grub to the bootloader using the commands in /etc/grub.conf.

Not sure if either is relevant to your woes... it seems grub throws this error under a helpful variety of circumstances.

(no subject)

Date: 2005-08-02 08:19 am (UTC)
From: [identity profile] dennyd.livejournal.com
Woohoo! Teh Win!! :)

PS: Amoeba? ?! indeed.