Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

There are lots of OSs and Linux dists to install on your netbook, and I want to make it as easy as possible to install, remove and switch between them.

Just installing a dist and then another one after it will replace the GRUB boot screen every time, and some dists might override previous GRUB menus entirely.

On a previous machine I created a GRUB partition which chain-loads GRUB for each dist, but now I can't remember how I did it.

The hard drive is currently empty, since I started playing around with repartitioning. What is the easiest way to install GRUB to a partition? Links are welcome, but please no generic "install GRUB" guides because the ones I've found haven't been relevant to my particular situation (empty hard drive, multi boot environment, no CD/floppy)..

share|improve this question
add comment

2 Answers

Just configure one grub install to find your various kernels.

Say you have three partitions. sda1 with windows int sda2 and sda3 with a linux distro each. Your grub config sould look like this:

title Windows
rootnoverify (hd0,0)
chainloader +1

title linux 1
root (hd0,1)
kernel /path/to/kernel1

title linux 2
root (hd0,2)
kernel /path/to/kernel2

This way you can load all OSes directly via one grub. Maybe you want to install grub into the partition boot record as well. Then you could chainload the linuxes also:

title Windows
rootnoverify (hd0,0)
chainloader +1

title linux 2
rootnoverify (hd0,2)
chainloader +1

title linux 1
root (hd0,1)
kernel /path/to/kernel1

The chainload option tells grub to load the first sector of the given partition where the next bootloader is located.

share|improve this answer
    
I want to accomplish the same soon, this is helpful, thanks! –  invert Feb 24 '11 at 14:27
add comment

In GRUB 2, you would use the command sudo grub-install {your boot partition, e.g. /dev/sdb2} which should autodetect which drives have a bootable OS on them and create the appropriate config files. In GRUB2, you shouldn't configure the grub.cfg file by yourself, rather let GRUB2 work itself using the commands grub-install and update-grub.
This should even work from a LiveCD. It'll autodetect the GRUB2 on the hardisk and change those files.

share|improve this answer
1  
This seems to be Ubuntu specific. Other distributions may not encourage autodetection. grub-mkconfig is another way to create a grub2 config. Included will be the kernels in /boot only. grub-install does no autodetection for itself, it just installs grub2 according to its config and does some sanity checks. –  matthias krull Aug 21 '10 at 9:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.