Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

View Poll Results: How useful is this thread?
very useful 2 100.00%
very useless 0 0%
neither/nor 0 0%
Voters: 2. You may not vote on this poll

 
Thread Tools Display Modes
Old July 6th, 2009   #1
loomsen
100% Pure Ubuntu
 
loomsen's Avatar
 
Join Date: Aug 2008
Location: germany
Beans: 857
HOWTO: Boot everything with grub

Hello.

I actually answered this to a question, but I think this will be useful for some more people as well.

This will show how to install additional distributions and boot them without changing your system (I won't explain partitioning, I'm sure you will be able to find some proper howto if you need it)

Here we go. If you plan to install another distribution besides your current, you may, and you should choose where to install the bootloader to in almost every distros installer.

Either don't install any bootloader at all and adjust your grub menu to boot the kernels, or install the distros native bootloader to the root partition rather than the MBR.

The MBR is the first sector of your harddrive, so it won't have a partition number.
Grub annotation:
(hd0)

which equals

/dev/sda

So, alter the location to install the bootloader to during installation to be

/dev/sda7
for instance if your suse root is on sda7.

NOTE: in grub annotation this would be
(hd0,6)

If you choose to go without any bootloader install, your grub menu should look like:
NOTE: kernel and initrd located in <partition>/boot/vmlinuz
Code:
title bluewhite64
root (hd0,7)  ## <-- setting the root partition
kernel /boot/vmlinuz root=LABEL=bw64 acpi_osi="Linux" vga=791 quiet
initrd /boot/initrd
If you choose to install to your root partition, your entry to your existing grub would be

Code:
title bluewhite64
rootnoverify (hd0,7)
chainloader +1
This will switch to the specified partition and launch the bootloader installed onto the partitions first sector.

For my USB to boot from my current grub I use:
NOTE: my USB stick holds the links to the kernel and the initrd in <stick>/ as opposed to bluewhite above where these are in /boot/
Code:
title debian USB
	root (hd1,0)
	kernel	(hd1,0)/vmlinuz ro root=LABEL=usb acpi_osi="Linux" vga=791 quiet
	initrd	(hd1,0)/initrd.img
which is a bootstrapped debian system I pulled in inside a chroot. So not even an installation is required...
Just need to make sure grub recognizes the stick as well, so
/boot/grub/device.map

has to include the proper information for grub. This is

Code:
(hd0)	/dev/sda
(hd1) /dev/sdb   ##<-- added this to boot from USB without choosing USB boot from my BIOS menu
Additional notes you might want to know as well:
The first specification of
root (hdX,Y)
changes to the drive containing your kernel (vmlinuz), checking it in ro, initializing your CPU, pci devices etc, then the second
root=LABEL or root=/dev/sdXY or root=UUID ## NOTE: use the LABEL option for ease of use, just add LABELs to all your partitions.
changes the root partition to <specified> and remounts your kernel rw and finally boots up your system using the order and modules specified inside the
initrd.img
it is pointed to.

This is my whole grub.conf, including all different options
Code:
# grub.conf generated by anaconda
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda7
#          initrd /initrd-version.img
############## test #############
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu
## My main OS
title Fedora (2.6.29.6)
	root (hd0,0)
	kernel /vmlinuz ro root=LABEL=fedora acpi_osi="Linux" vga=791 quiet
	initrd /initrd
title bluewhite64
	root (hd0,7)
	kernel /boot/vmlinuz root=LABEL=bw64 acpi_osi="Linux" vga=791 quiet
	initrd /boot/initrd
title sidux
	rootnoverify (hd0,8)
	chainloader +1
title debian USB
	root (hd1,0)
	kernel	(hd1,0)/vmlinuz ro root=LABEL=usb acpi_osi="Linux" vga=791 quiet
	initrd	(hd1,0)/initrd.img

Last edited by loomsen; August 2nd, 2009 at 08:15 AM..
loomsen is offline   Reply With Quote
Old July 7th, 2009   #2
jpeddicord
Super Ubuntu World
 
jpeddicord's Avatar
 
Join Date: Apr 2006
Location: Ohio, USA
Beans: 2,289
Ubuntu Development Release
Re: HOWTO: Boot everything with grub

The device names won't always be the same. /dev/sda on one system might by /dev/sdb on another. Anyway, approved, thank you for your tutorial contribution!
__________________
Previously known as jacobmp92
Site ║ ⬢ Launchpadµ Identi.caµ Twitter ║ ⬌ Mound Data Manager
jpeddicord is online now   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:41 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry