Booting Windows and Linux distros separately; from master & slave drives
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
Booting Windows and Linux distros separately; from master & slave drives
My Motherboard Intel D865GBF supports 2 PATA IDE. In my case, it is 250 GB Seagate(master) & 40 GB(slave.) Using BIOS settings; I can select the drive to boot.
Presently, Windows XP has been installed on the master drive. RHEL5 & Ubuntu has been installed on the slave drives. GRUB containing entries for RHEL5, Ubuntu & Windows has been installed on the MBR Of the master drive.
My AIM is to: boot Windows & LInux distros independent of each other.
A thought came in my mind. If I select the master drive as 1st boot device, then I should be able to see only the bootloader of the Windows; & NO GRUB. consequently, no Linux distros
If I select the slave drive as 1st boot device, then I should be able to see the GRUB only with Linux distros as its entries. With No windows option available.
Sure it is possible. Why you would want to do it, since it requires you to go into bios and change the boot drive to switch OS is a mystery to me, but yes you can do it.
Just install grub on the slave drive, and reinstall the windows boot loader on the master drive.
Both operating systems will see the other drive, but Windows will ignore it because it isn't a Windows filesystem and Linux won't mount it unless you tell it to.
When you install GRUB on the second drive, make sure you specify that GRUB's stage one also goes on the second drive.
Some (I expect most) Linux installers "help" you with installing GRUB and when you install Linux on the second drive, they will default to installing most of GRUB on the second drive but stage 1 of GRUB on the first drive.
If you're installing GRUB without such help, it will be clear that you need to select places for both.
Quote:
Originally Posted by jiml8
Just install grub on the slave drive, and reinstall the windows boot loader on the master drive.
Edit: When I first wrote this post, I missed the detail in the first post of this thread that stage one of GRUB is already installed in the MBR of the master drive. So jiml8 is correct. You do need to reinstall the windows boot loader. I believe that is done with the fixmbr command. In this unusual case that windows is bootable despite needing its mbr fixed, you might be able to do that from within windows. Normally that must be done from the recovery media.
Hi
can you give a link or something that shows how to do these things?
for example: how to specify that GRUB's stage one also goes on the second drive?!!
sorry, i'm a complete newbie!
thanks!
Hi
can you give a link or something that shows how to do these things?
for example: how to specify that GRUB's stage one also goes on the second drive?!!
I'm not 100% sure. The fact that grub is already installed may make it easier or harder.
Is your linux partition sdb1? Or what?
Assuming you are booted already in linux in the partition containing most of the previous grub, I think it is as simple as
Code:
grub-install sdb
If that slave drive isn't sdb on your system, substitute the correct name.
If you are booted in Linux in a liveCD or a different partition, I think the command is
Code:
grub-install --root-directory=sdb1 sdb
Substituting the correct partition name (where most of grub is installed) in place of sdb1 and the drive name containing it in place of sdb.
thank you for answering me
ok here is what i'm going to do:
i have a SATA hard drive & a normal Hard drive (i dont know what this is called) and i'm going to install a windows on sata and a linux on the other one. i first install windows then linux. as articles say when i reboot the computer grub should load and show the both OSs, but it shows only the linux. in this situation the only way to swith between linux and windows is to change the first boot device from bios menu. i tried installing GAG boot manager (or boot loader, i dont know). it could load windows, but for linux, it says: boot sector not found, while i can boot linux by changing bios!
how can i choose "where to install grub" when i'm installing linux?
this the whole story!
by the way, i've got troubles using mouse in linux, help me here.
thank you
Why you would want to do it, since it requires you to go into bios and change the boot drive to switch OS is a mystery to me, but yes you can do it.
The drives are PATA drives. I like to play around with the GRUB & partitions The Windows OS is shared by others. Any incomplete work done in GRUB; also makes Windows unbootable. Hence, I want to make the booting process of the Windows & Linux distros s.e.p.a.r.a.t.e
As, I have noted previously; I have 2 linux distros on slave PATA drive.
viz. RHEL5 & Ubuntu 7.04
Note:All the commands have been given through the RHEL5 distro.
This is the configuration of the partitions on my system, presently.
In the above output; the hda is the master PATA drive(Seagate).
hdb is the slave PATA drive(Samsung). Windows System Root(C:\)is installed on the hda1 partition.
Regarding RHEL5; /boot is on the hdb1 & / is on the hdb2.
Regarding Ubuntu 7.04; / is on the hdb6.
The swap space has been created on the hdb7.
cat /boot/grub/grub.conf
# 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 (hd1,0)
# kernel /vmlinuz-version ro root=/dev/hdb2
# initrd /initrd-version.img
#boot=/dev/hda
default=1
timeout=30
splashimage=(hd1,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-8.el5)
root (hd1,0)
kernel /vmlinuz-2.6.18-8.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-8.el5.img
title Windows XP
rootnoverify (hd0,0)
chainloader +1
These command give information bout Ubuntu distro. Due to my fiddling around the GRUB & partitions; I had to grub-install through RHEL5 distribution to make, atleast RHEL5 & Windows accessible & hence, bootable.
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu
# Pretty colours
#color cyan/blue white/blue
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret
#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#
#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below
## DO NOT UNCOMMENT THEM, Just edit them to your needs
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=c7c8fdd7-6bfa-4e8b-b2a6-3c2c9b81af5e ro
## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,6)
## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true
## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false
## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash
## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false
## Xen hypervisor options to use with the default Xen boot option
# xenhopt=
## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all
## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true
## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false
## ## End Default Options ##
title Ubuntu, kernel 2.6.20-15-generic
root (hd1,6)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=c7c8fdd7-6bfa-4e8b-b2a6-3c2c9b81af5e ro quiet splash
initrd /boot/initrd.img-2.6.20-15-generic
quiet
savedefault
title Ubuntu, kernel 2.6.20-15-generic (recovery mode)
root (hd1,6)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=c7c8fdd7-6bfa-4e8b-b2a6-3c2c9b81af5e ro single
initrd /boot/initrd.img-2.6.20-15-generic
title Ubuntu, memtest86+
root (hd1,6)
kernel /boot/memtest86+.bin
quiet
### 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 a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1
# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sdb2.
title Red Hat Enterprise Linux Server (2.6.18-8.el5) (on /dev/sdb2)
root (hd1,0)
kernel /vmlinuz-2.6.18-8.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-8.el5.img
savedefault
boot
Please suggest me the steps to
1. Make changes in the fstab files in each distro; to reflect the status of the drives.
2. Make changes in the grub.conf & menu.lst, to reflect the the changed order of the boot status.
3. Make changes in the grub configuration files of both the distros; such that both know; tht other exists
4. Install GRUB on the slave drive.
1. RHEL 5 doesn't identify the installation of Ubuntu 8.04.
2. Manual addition has to be made in the grub.conf of RHEL5 .
These are the contents of the file.
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 (hd1,2)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=30
splashimage=(hd0,2)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-8.el5)
root (hd0,2)
kernel /vmlinuz-2.6.18-8.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-8.el5.img
title Ubuntu 8.04, kernel 2.6.24-19-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=942080e2-43b7-47b6-a6f1-f31d708bbb7e ro quiet splash
initrd /boot/initrd.img-2.6.24-19-generic
quiet
title Ubuntu 8.04, kernel 2.6.24-19-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=942080e2-43b7-47b6-a6f1-f31d708bbb7e ro single
initrd /boot/initrd.img-2.6.24-19-generic
title WindowsXP Professional
root (hd1,0)
map (hd1) (hd0)
map (hd0) (hd1)
chainloader +1
Hence; I can now boot even Windows XP from the slave drive.
My Motherboard Intel D865GBF supports 2 PATA IDE. In my case, it is 250 GB Seagate(master) & 40 GB(slave.) Using BIOS settings; I can select the drive to boot.
Presently, Windows XP has been installed on the master drive. RHEL5 & Ubuntu has been installed on the slave drives. GRUB containing entries for RHEL5, Ubuntu & Windows has been installed on the MBR Of the master drive.
My AIM is to: boot Windows & LInux distros independent of each other.
A thought came in my mind. If I select the master drive as 1st boot device, then I should be able to see only the bootloader of the Windows; & NO GRUB. consequently, no Linux distros
If I select the slave drive as 1st boot device, then I should be able to see the GRUB only with Linux distros as its entries. With No windows option available.
Is it possible? & How to proceed with it?
Load first Windows XP & free some space for linux at the time installation of linux creating partion select free space for linux or othe r disk for installtion & create partion as per reqr. after complete the installtion at time of booting it will show two options one for windows (it may show other) & linux.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.