grub 0.97 on sda2 (NTFS) fails silently on "Loading stage2"
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
grub 0.97 on sda2 (NTFS) fails silently on "Loading stage2"
Well, the title pretty much sums it up. Expanding, I picked sda2 at the Kubuntu 9.04 installer to place GRUB because my Dell notebook uses a "special" MBR . The menu shows up, and selecting the Windows entry:
Code:
title Microsoft Windows XP Professional
rootnoverify (hd0,1)
savedefault
chainloader +1
makeactive
Grub0.97 is installed in the boot sector of sda2 and
looks at sector 23828642 of the same hard drive for
the stage2 file. A stage2 file is at this location on
/dev/sda. Stage2 looks on partition #6 for
/boot/grub/menu.lst.
I wasn't aware that there was a "special" MBR on Dells. I think it may be that the first partition, sda1, (the fat16 one) is a "special partition" (your diagnostic partition?). I could be wrong.
I think you could have installed Grub on your Ubuntu partition and made that one the active partition. So you would have had a Microsoft bootloader, loading Grub from sda6, which could then chainload to the Microsoft NTLOADER bootstrap on sda2.
But installing it to the MBR would have been better.
What you have now is the Microsoft MBR bootloader; passing control to the active partition, sda2, containing the Grub loader; which gives you your menu. When you select the Windows entry, Grub dutifully chainloads back to sda2, itself, and redisplays the menu. Your NTLOADER was there originally which would have booted Windows, but it was wiped out when you did the Grub install, so there is no way to get there anymore.
To recover, I think you first need to repair your Windows system. I don't know Vista, but XP has its "Recovery Console".
If you Google "windows mbr recovery", the first hit will bring you to "support.microsoft.com/kb/314058". You need to get into Recovery Console, and "Repair the file system boot sector or the master boot record (MBR)" (actually both). You'll need to do 'bootcfg' and 'fixmbr', I think. It's been a long time since I've done this.
Then you need to get into Ubuntu (I don't know how, I'm Fedora and Slackware) and then do a 'grub-install'. (Fedora has a rescue mode.) You can probably repost another question on this topic to the Ubuntu folks if you are not familiar with how to do this.
If you want, you can copy the original Microsoft MBR loader code with the dd command 'dd if=/dev/sda of=somename count=1 bs=446'.
In the event you want to restore it back to the beginning of the MBR you can 'dd if=somename of=/dev/sda count=1 bs=446'. (But that really shouldn't ever be necessary... )
Then just for grins if you're curious, you can look at the MBR (1st sector of the disk) with 'dd if=/dev/sda count=1 bs=512 | hexdump -C'.
There's 446 bytes of loader code (at offset 0), 64 bytes of partition table (at offset 1be), and signature '55aa' (at offset 1fe).
I picked sda2 at the Kubuntu 9.04 installer to place GRUB]
That was a (serious) mistake. You over-wrote the Vista boot sector record.
Plus a few more sectors as well - hence the non-bootable partition. As the script indicates, it's likely this (NTFS presumably) filesystem has been corrupted and can't even be mounted from bash.
You should have chosen sda6 for the grub install.
You may be able to recover this from the Vista CD/DVD -search the microsoft site for bootrec.exe and recovery.
You'll also need to install grub to sda6, and use something like EasyBCD to allow it to be selected from the Vista boot menu.
When you select the Windows entry, Grub dutifully chainloads back to sda2, itself, and redisplays the menu.
Yup, I figured it out late on the next day and felt a bit silly after confirming it ; perhaps the Kubuntu installer should advise on good/bad choices. I reinstalled grub to sda3 (my swap/pagefile partition), since I couldn't care less if it got corrupted.
And oh yes, I had backed up the MBR precisely with dd bs=1 count=446, but alas, I wasn't sure if the VBR backups I had were up to date.
Quote:
Originally Posted by syg00
As the script indicates, it's likely this (NTFS presumably) filesystem has been corrupted and can't even be mounted from bash.
Right too, so I figure the boot record contains more than just boot code and grub overwrote the BPB or whatever it's called in NTFS. I fixed it with the Recovery Console. Again, methinks the distro installer should warn about installing to any NTFS partition. I'm switching over to regular GNOME Ubuntu tomorrow and see if the installer does warn me.
A tip, to whom it may help: to write a new VBR (bootrecord) to an XP partition, use the Recovery Console from the CD, use "diskpart" to find out what letter it assigned provisionally to the partition, and then use "fixboot X:". To repair the MBR, in older versions of Windows it was FDISK /MBR, now it's "FIXMBR \Device\HardDiskX". There's a lot more at http://www.michaelstevenstech.com/r_c_cmds.htm, better explained than at MS's page.
Thanks a lot to both of you; I wasn't 100% sure about what I had done wrong.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.