Multi-Booting Linux distros and Windows

Threepwood

Senior Member
Joined
Aug 27, 2007
Messages
806
Reaction score
0
What's a basic example of how you guys Multi-Boot?

I haven't yet got into Linux really, as I need Windows for games and need to sort out all my data before I go installing a new OS.

Awhile ago I tried Fedora Core 1, and have since installed Ubuntu and Windows on a test HD I had.

The way I did it was using XOSL as a boot manager, with XP on a primary partition and Linux distros on logical drives, with the respective Linux boot loader on the respective linux partition.

This way XOSL starts up on boot, and you select the OS you want to run, XOSL points to the OSs own boot loader and loads it up.

I just wandered if anyone has a "better" way, I couldn't get the grip of using GRUB to load XP, so I just did it like this as it seemed easier.
 
Last edited:
I put it on a different physical hard drive, and switch their boot order in the BIOS when I want to switch to the other OS.

A bit extreme maybe, but I don't trust bootloaders. Had one hose my Windows boot before.
 
IHow did the bootloader hose your Windows install? I’ve been multi-booting for a long time and even changing which distro sits on the MBR and never experienced any hassles.

Easiest way to multi-boot.

1. Install the Windows of your choice.
2. Install the Linux distros you want. Have them install grub to the partition the distro is installed on.
3. One of the distros you install must have its grub installed to the MBR. This should be the last one
4. You will then have to manually add entries in the grub of the distro in 3 to point to the partitions of the other distros and Windows. I’ll post a sample grub.
 
IHow did the bootloader hose your Windows install? I’ve been multi-booting for a long time and even changing which distro sits on the MBR and never experienced any hassles.

I think I tried to reinstall Windows without getting rid of Linux.

I reinstall Windows often, so I'd rather just let the OSes follow a policy of separate development...
 
IHow did the bootloader hose your Windows install? I’ve been multi-booting for a long time and even changing which distro sits on the MBR and never experienced any hassles.

Easiest way to multi-boot.

1. Install the Windows of your choice.
2. Install the Linux distros you want. Have them install grub to the partition the distro is installed on.
3. One of the distros you install must have its grub installed to the MBR. This should be the last one
4. You will then have to manually add entries in the grub of the distro in 3 to point to the partitions of the other distros and Windows. I’ll post a sample grub.

I agree... In my experience, Linux doesn't mind co-existing with Windows (it doesn't pwn the Windows boot sector), but Windows doesn't play nicely with Linux. So installing Linux after Windows seems to work fine for me (100% of the time).

And then even if you have to re-install Windows later, as long as you store your boot loader in the correct place, everything is usually safe. And if not, before you re-install, make a copy of your
Code:
/boot/grub/menu.lst
and use a Live CD to restore it once you've done your Windows install
 
Code:
title           Debian GNU/Linux, kernel 2.6.24.4-rt4 (single-user mode)
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.24.4-rt4 root=/dev/sdb2 ro vga=791 single
initrd          /boot/initrd.img-2.6.24.4-rt4

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title           Other operating systems:
root


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hdd8.
#title          Debian 32-bit
#root           (hd1,7)
#chainloader    +1


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hdd6.
title           Fedora 8
root            (hd1,5)
chainloader     +1


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hdd9.
title           Sidux
root            (hd1,8)
chainloader     +1

# 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
chainloader     +1

So for each distro you add, you need the following in /boot/grub/menu.lst

title <Name of Distro>
root hd(x,y)
chainloader +1

for the format of hd(x,y) x refers to the drive (I have found on my system their are ordered in the order I installed them in. The first drive is labelled 0. The y refers to the partition on drive x. Again here, the first patrition is labelled 0.

You'll notice that for the Winodws install, I have savedefault between root and chainloader.

To find out which drive has which number, see the file /boot/grub/device.map

Code:
(fd0)   /dev/fd0
(hd0)   /dev/sdb
(hd1)   /dev/sdc
(hd2)   /dev/sda
 
I have my swap file, ntfs partition, /root and /home on the same drive. Haven't had any issues... ever.
 
@milomak, thanks for posting that example up, I forgot to check in on this thread again.

I remember trying something like that from an internet tutorial ages ago with Fedora 1, and I screwed it up somehow. Couldn't boot.

What I'm interested to see there is "This entry automatically added by the Debian installer for a non-linux OS # on /dev/hda1"

Will the required lines automatically be added to the grub file when installing Ubuntu, if XP is already present on the machine? That will make it easier for me I'm sure.

Also how best would you back up your boot loader and recover from a bad boot loader? Don't worry to be to specific at this point.

I'm also wondering is it easier/harder/better/worse to use XPs boot loader to load up Ubuntu? Come to think of it, that may be how I screwed up my PC with Fedora...
 
What I'm interested to see there is "This entry automatically added by the Debian installer for a non-linux OS # on /dev/hda1"

Will the required lines automatically be added to the grub file when installing Ubuntu, if XP is already present on the machine? That will make it easier for me I'm sure.

Yes, if installing Grub with Ubuntu, whilst having an existing XP partition, it will add an entry for the XP OS.

Just one caveat: it is not recommendable to install GRUB on the XP partition, in my experience. I have had cases where I was not able to boot into Windows after removing the Linux partition and was too ignorant to fix the GRUB entry.

I prefer to install Linux entirely on its own drive, whilst disabling the XP drive. Once Linux + GRUB has been fully installed, set that disk as the boot disk and re-enable the Windows disk. Then add the entry in GRUB for XP.
 
I've never had a problem with grub on the MBR of the disk with XP. If you remove Linux all you have to do is to load a Recovery Console and run fixmbr.
 
I have 3 primary partitions, the 1st one is for Vista, 2nd is for linux swap and the 3rd is for Kubuntu. I first install Windows and then Kubuntu, Grub automatically detects Vista and adds the entry to its config file (which will obviously show on the boot menu). If I reinstall windows all I do is take a Live CD and run a command and Grub gets restored. I don't know if off the top of my head though.

The rest of my data gets stored on the extended partition.
 
Top
Sign up to the MyBroadband newsletter
X