Dual Boot w/Debian

I have an interesting scenario,

I have 2 SATA hard drives:

One - Hard disk with Opensuse 11 insalled. This is all setup and running on my PC.

Second - Hard disk with Debian (64 Studio) installed, however it is from another machine. I want to install it in my current machine (currently running OPENSUSE 11).

How do I edit the grub menu to see this drive as an option to run Debian (64 Studio)?

Any Help would be greatly appreciated. Thank you!

If it was from another machine, it’s probably installed as if on the primary drive of the computer. If that’s the case you’d need to use tha “map” function to boot it. I suggest a three step process:

  1. Back up the existing grub config file (menu.lst) with this command in a console:
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.bak
  1. Reinitialise the Suse Grub installation in a fashion trhat will make it include the Debian partition:

Go to Yast → System → Boot Loader. The Grub configuration screen comes up with the Tab “Section Management” activated. In the lower right is a drop-down selector labelled “Other”. Select from “Other” the option “Propose New Configuration” and then wait for Grub to analyse your partitions and display a new configuration. This may take a while. Important: When that finishes, activate the tab labelled “Boot Loader Installation” and select to “Boot from the Master Boot Record”. [Yast will often default to booting from the root or boot partition rather than from the MBR but that’s for experts only – always choose the MBR.] Then click Finish to save the changes and install the reconfigured Grub into the hard drive’s MBR. If you get a message that "The bootloader boot sector will be written to a floppy disk … don’t bother with the floppy – just click OK to proceed and install to the MBR. Reboot and you should see a Debian entry along with the Suse entries on the Grub boot menu.

  1. That will allow booting back to Suse and hopefully into Debian BUT if I was right about the “map” function you will have to tweak that entry by adding these lines into the subsection for Debial in Suse’s new menu.lst, just under the title line:
map (hd0) (hd1)
map (hd1) (hd0)

Luck

Thank you very much for this information! I will definitely try this out tomorrow after work.

Alternatively you could copy the stanza used by the 64 Studio’s menu.lst into the current menu.lst and change all the hd0 to hd1 in that stanza.

That’s not all you need to do though. If you get 64 Studio’s kernel loaded then it will use the /etc/fstab from the 64 Studio root partition. So you have to change the hda there to hdb, or sda to sdb, depending. This also needs to be done if you choose to go Swerdna’s way because the swapping of disk with map only works on GRUB. Once the kernel is up, the disk will be at a different device name.

You can do this change by mounting the disk on SUSE and then doing the edit with a text editor.

There is another manner i use without messing with Grub config files. First make sure that Suse’s Grub is installed in the root/boot partition then use a boot manager like gag. So you can google it and download. It is a small iso. Just burn it and reboot with this cd. You will be prompted by a small setup procedure where you will choose your keyboard and language. Then configure it pressing c and add all the operating systems you want. Save the configuration pressing h then return to the main menu pressing r and boot the system you decide.

I’m running into one issue. After installing the Debian hard drive into my PC, and booting the PC, it shows only the grub menu for Debian, nothing pertaining to OPENSUSE 11. In order to get into OPENSUSE to make those changes stated above, I have to disconnect the hard drive with Debian Installed.

Is this how it’s supposed to be? Please advise, thank you! :slight_smile:

Ok, Ignore the last post, I’m able to get into Opensuse 11.0 now (after running the Boot loader again).

I get the option for Debian (64 Studio), but it still won’t boot up. I made the changes in the menu.lst in OpenSuse, but still won’t let me in. Any advice would be greatly appreciated.

Check what ken_yap said. Also how far does the boot get in Debian, if at all? Any messages on screen?

I’m not entirely sure what he means by “stanza” (I’m pretty new to editing grub menus and such).

This is the error I get:

Error 17: Cannot mount selected Partition

Thank you!

Error 17 happens if you point the bootloader at the wrong partition. Please enter the following two commands in a console and post the results back here:

sudo /sbin/fdisk -l

and

sudo cat /boot/grub/menu.lst

The first command shows what partitions are on the two drives. The second shows eher you’re pointing Grub and also the minor details that might trick it up.

You don’t need to use the map command. In the SuSE menu.lst file you can point directly to the Debian /boot directory, or, if you installed grub earlier with Debian into its boot sector, you can chainload to the grub installed there. The usual method is the former. Take a look at the SuSE boot stanza in menu.lst. The Debian stanza will be similar, with the root statement pointing to the disk/partition Debian’s /boot directory is on (in grub numbering), the kernel statement points to the Debian kernel filename plus the root filesystem partition (root=/dev/sdxx), and the initrd statement points to the Debian /boot/initrd filename. If you’re uncertain, post back your fdisk -l of each disk, and the contents of device.map and menu.lst.

the 500GB is the OpenSuse 11 OS

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0007fe93

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         262     2104483+  82  Linux swap / Solaris
/dev/sda2   *         263        2873    20972857+  83  Linux
/dev/sda3            2874       60801   465306660   83  Linux

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x79447944

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        2432    19535008+  83  Linux
/dev/sdb2            2433        2699     2144677+  82  Linux swap / Solaris
/dev/sdb3            2700       30401   222516315   83  Linux

Second Command:

# Modified by YaST2. Last modification on Mon Jul  7 22:08:29 EDT 2008

map (hd0) (hd1)
map (hd1) (hd0)

default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,1)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.0
    root (hd0,1)
    kernel /boot/vmlinuz-2.6.25.5-1.1-pae root=/dev/disk/by-id/scsi-SATA_Maxtor_7H500F0_H817GENH-part2    resume=/dev/sda1 splash=silent showopts
    initrd /boot/initrd-2.6.25.5-1.1-pae

###Don't change this comment - YaST2 identifier: Original name:  64studio, kernel 2.6.21-1-multimedia-amd64 (/dev/sdb1)###
title  64studio, kernel 2.6.21-1-multimedia-amd64 (/dev/sdb1)
    root (hd1,0)
    configfile /boot/grub/menu.lst

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.0
    root (hd0,1)
    kernel /boot/vmlinuz-2.6.25.5-1.1-pae root=/dev/disk/by-id/scsi-SATA_Maxtor_7H500F0_H817GENH-part2 showopts ide=nodma apm=off acpi=off noresume nosmp noapic maxcpus=0 edd=off  x11failsafe
    initrd /boot/initrd-2.6.25.5-1.1-pae

###Don't change this comment - YaST2 identifier: Original name: Kernel-2.6.25.5-1.1-pae###
title Kernel-2.6.25.5-1.1-pae
    root (hd0,1)
    kernel /boot/vmlinuz-2.6.25.5-1.1-pae root=/dev/disk/by-id/scsi-SATA_Maxtor_7H500F0_H817GENH-part2    resume=/dev/sda1 splash=silent showopts
    initrd /boot/initrd-2.6.25.5-1.1-pae

Thank you!

Hi I think you misunderstood where to put the map functions. I now suggest two things to try.

First try it mingus’s way by editing menu.lst to remove these two lines:
make this:

Modified by YaST2. Last modification on Mon Jul 7 22:08:29 EDT 2008

map (hd0) (hd1)
map (hd1) (hd0)

default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,1)/boot/message
##YaST - activate

Like this

Modified by YaST2. Last modification on Mon Jul 7 22:08:29 EDT 2008

default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,1)/boot/message
##YaST - activate

Se if that works to test mingus’s thoughts.

Then if that doesn’t work, leave the beginning like the above with no map stuff in it and make this:

###Don’t change this comment - YaST2 identifier: Original name: 64studio, kernel 2.6.21-1-multimedia-amd64 (/dev/sdb1)###
title 64studio, kernel 2.6.21-1-multimedia-amd64 (/dev/sdb1)
root (hd1,0)
configfile /boot/grub/menu.lst

into this:

###Don’t change this comment - YaST2 identifier: Original name: 64studio, kernel 2.6.21-1-multimedia-amd64 (/dev/sdb1)###
title 64studio, kernel 2.6.21-1-multimedia-amd64 (/dev/sdb1)
map (hd0) (hd1)
map (hd1) (hd0)
root (hd1,0)
configfile /boot/grub/menu.lst

That will test my thoughts.

Maybe one of us will be right, maybe not.

Grub allows you to construct the stanza in different ways to obtain the same result. More than one method will work, as long as set up correctly; it’s a matter of personal preference. I haven’t used the “configfile” you currently have, so I can’t comment on that.

What I was suggesting is to use the standard Debian multi-boot method. In that method one Linux instance is the master and all other instances are booted directly from menu.lst just like the master instance, as opposed to chaining to another instance. Again, this is just one approach. What this does require is that, should you for example change the Debian kernel, you would need to change the Debian stanza in the openSUSE menu.lst (as you do when the SuSE kernel changes), because the Debian menu.lst is not being used. So using this method, the Debian stanza would be thus:

root (hd1,0) ## assuming the Debian /boot in on the first partition of the second drive

kernel /boot/<kernel filename> ## you supply the exact filename of the Debian kernel, like is done in the SuSE stanza above, followed by root=/dev/sdb1

initrd /boot/<initrd filename> ## using the Debian initrd filename. Note: I don’t remember if Debian uses an initrd or not; it if does, this line is required; if it does not, you must not use this line

That’s all that is required for this particular method.

Ok, I tried this, but still got the same result. Thank you again!

Any other suggestion?

Well now we’re really in the dark looking for a light. I have real concerns as expressed by ken_yap about the fstab and other matchings to the new computer. But that’s later. Mingus’s way for editing a new bootloader into menu.lst seems to be good. Dual Boot w/Debian - Page 2 - openSUSE Forums
The proposition is to edit an appropriate entry into menu.lst. Can you extract and post here the menu.lst in Debian?

Menu list from Debian (64 Studio)

# 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 	5

# 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=/dev/sda1 ro vga=791 splash=silent

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## 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=

## 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=(single-user) single
# altoptions=(single-user 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		64studio, kernel 2.6.21-1-multimedia-amd64
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.21-1-multimedia-amd64 root=/dev/sda1 ro vga=791 splash=silent 
initrd		/boot/initrd.img-2.6.21-1-multimedia-amd64
savedefault

title		64studio, kernel 2.6.21-1-multimedia-amd64 (single-user mode)
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.21-1-multimedia-amd64 root=/dev/sda1 ro vga=791 splash=silent single
initrd		/boot/initrd.img-2.6.21-1-multimedia-amd64
savedefault

title		64studio, kernel memtest86
root		(hd0,0)
kernel		/boot/memtest86.bin

title		64studio, kernel memtest86+
root		(hd0,0)
kernel		/boot/memtest86+.bin

### END DEBIAN AUTOMAGIC KERNELS LIST

Should I change all the hd0’s to hd1’s?

OK, here’s what needs to be added to your openSUSE menu.lst:


###Don't change this comment - YaST2 identifier: Original name: debian64studio###
title		64studio, kernel 2.6.21-1-multimedia-amd64
root		(hd1,0)
kernel		/boot/vmlinuz-2.6.21-1-multimedia-amd64 root=/dev/sdb1 ro vga=791 splash=silent 
initrd		/boot/initrd.img-2.6.21-1-multimedia-amd64

###Don't change this comment - YaST2 identifier: Original name: debian64studio-single###
title		64studio, kernel 2.6.21-1-multimedia-amd64 (single-user mode)
root		(hd1,0)
kernel		/boot/vmlinuz-2.6.21-1-multimedia-amd64 root=/dev/sdb1 ro vga=791 splash=silent single
initrd		/boot/initrd.img-2.6.21-1-multimedia-amd64

(hd0,1) is changed to (hd1,0) which points grub at the first partition on the second drive. The “root” phrase in the kernel command line needs to change to /dev/sdb1. The savedefault line needs to be removed.

You can of course if you wish change the title line to however you want it displayed on your boot menu. And you decide whether you want both Debian stanzas; the second boots in single-mode.

You should also edit the Debian menu.lst. The section “Automatic Kernels List” supplies variables to Debian’s update-grub script, which is called with every kernel update. You need to change the kopt line to (hd1,0) and the groot line to /dev/sdb1; then after a kernel update you can just copy/paste to your SuSE menu.lst.

I think you’re set.

You’re certainly right, I’m all set! Thank you so much, this has worked perfectly. I appreciate your patience and persistence in helping me. Kudos mate :slight_smile: