Installed GRUB on 3rd hard drive, how do I boot 1st drive?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
Installed GRUB on 3rd hard drive, how do I boot 1st drive?
Hi,
I have 3 hard drives with several different partitions.
I have 2 copies of Windows XP Pro, Ubuntu linux, and Fedora Core 2 linux all installed on the first physical hard drive (different partitions obviously)
I have been using Grub to boot between them all but yesterday Windows got messed up and required me to reinstall. After that I was unable to boot Linux so I installed another version of Fedora Core 2 onto my third physical drive.
Now the new install of Fedora (on the third drive) boots but not any of the other versions.
I tried configuring grub.conf to boot the others but I am assuming that it is failing because of grub being installed on my third drive (hdd) but the other OSs are all installed on hda.
I do not have a GRUB boot partition on hda because I was not aware of how much trouble it would save me in the long run.
Here is my grub.conf as well as my hard drive information:
grub.conf
Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd2,0)
# kernel /boot/vmlinuz-version ro root=/dev/hdd1
# initrd /boot/initrd-version.img
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd2,0)/boot/grub/splash.xpm.gz
title Fedora Core 2 (2.6.5-1.358)
root (hd2,0)
kernel /boot/vmlinuz-2.6.5-1.358 ro root=LABEL=/1 rhgb quiet
initrd /boot/initrd-2.6.5-1.358.img
title Fedora Core 2 (.771)(hda7)
root (hd0,7)
kernel /boot/vmlinuz-2.6.10-1.771_FC2 ro root=/dev/hda7
initrd /boot/initrd-2.6.10-1.771_FC2.img
title Windows XP a
rootnoverify (hd0,0)
chainloader +1
title Fedora Core 2b
rootnoverify (hd0,6)
chainloader +1
title Windows XP b
rootnoverify (hd0,4)
chainloader +1
title Ubuntu
rootnoverify (hd0,8)
chainloader +1
The first boot option, "Fedora Core 2 (2.6.5-1.358)" is the only one bootable. It was automatically set when Fedora installed it. All the other entries were desperate attempts, by myself, at getting the other OSs to boot.
Here is my drive information:
Code:
[root@localhost root]# /sbin/fdisk -l
Disk /dev/hda: 40.0 GB, 40027029504 bytes
16 heads, 63 sectors/track, 77557 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 20321 10241406 c W95 FAT32 (LBA)
/dev/hda2 20321 77552 28844676+ f W95 Ext'd (LBA)
/dev/hda5 20321 36577 8193118+ b W95 FAT32
/dev/hda6 36577 38665 1052226 82 Linux swap
/dev/hda7 38665 57009 9245376 83 Linux
/dev/hda8 57009 59097 1052226 82 Linux swap
/dev/hda9 59097 77552 9301603+ 83 Linux
Disk /dev/hdc: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 * 1 19457 156288321 c W95 FAT32 (LBA)
Disk /dev/hdd: 33.8 GB, 33820284928 bytes
16 heads, 63 sectors/track, 65530 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Device Boot Start End Blocks Id System
/dev/hdd1 * 1 30883 15565000+ 83 Linux
/dev/hdd2 30884 32508 819000 82 Linux swap
/dev/hdd3 32509 34133 819000 82 Linux swap
I'm sure this is something really easy to fix or at least an easy answer of the best way to start over.
Thanks for any help,
Stephen
Wow, quick reply.
I have worked on this for so long and retyped the entries so many times and Windows never worked but I guess I did something right at one point and never checked again as I pull all my focus on getting Fedora to boot. Windows does boot.
After editing grub.conf with the alterations you suggested it works like a charm. Thanks!
I'm just trying to understand this now... Why would Windows boot but not Linux (well, didn't) when they are both on the same drive? I read the:
Quote:
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd2,0)
# kernel /boot/vmlinuz-version ro root=/dev/hdd1
# initrd /boot/initrd-version.img
but couldn't make sense of where to put "(hd2,0".
Also, Now that I have it all running again, what should I do to be prepared for next time I can't boot (either after reinstalling windows, reinstalling linux, or just boot failure.)? Since I have access to everything right now I would like to be prepared next time. Just the info that I've learned so far will help out allot, but is there a way to make a backup or something?
Thanks again for the quick response! You have no idea how long I tried doing this on my own!
-Stephen
Originally posted by jesusphreak
I'm just trying to understand this now... Why would Windows boot but not Linux (well, didn't) when they are both on the same drive?
Nothing to do with the physical drive - more the partition. Once loaded, ntldr has all the info it needs in the XP partition. Grub simply needs to know where it is, and transfer control to it. After all, ntldr *is* a boot-loader, and handles it all itself.
For Linux, you need a boot-loader - all the smarts are in the directory you installed grub to.
Hence the need for the root(hd2,0) directive - this is for grub.
Normally you would have your kernel images in here too, but as you see, you can address it absolutely in need.
Quote:
Also, Now that I have it all running again, what should I do to be prepared for next time I can't boot (either after reinstalling windows, reinstalling linux, or just boot failure.)? Since I have access to everything right now I would like to be prepared next time. Just the info that I've learned so far will help out allot, but is there a way to make a backup or something?
All you need is grub.conf. Create a copy on disk, put another on floppy, whatever.
Trying to backup the MBR is a mugs game. Seriously not worth trying.
Better option is to re-install if it gets over-written/corrupted.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.