LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Grub boot loader with removable drive tray (https://www.linuxquestions.org/questions/linux-newbie-8/grub-boot-loader-with-removable-drive-tray-839076/)

mitchpotter 10-19-2010 11:44 AM

Grub boot loader with removable drive tray
 
I have an internal disk with Linux installed and a removable drive bay for swapping out my windows disks. I'd like to get grub to map one option to the bay and be able to boot whatever disk is in there.

Right now it's mapped by id "/dev/disk/by-id/ata-ST3250310AS_6RY00KB61" but I noticed there is a by-path option. I am not sure how to use it and the documentation isn't very detailed so I could use some help. Is by-path a good way to do this or is there some other way to get this to work?

malekmustaq 10-19-2010 11:50 AM

mitchpotter, it appears you are using Grub2, isn't it?
Under Grub (legacy) you only need to map drives by way of editing a text file configuration. If you can install grub legacy. Until someone here familiar with grub2. Wish they are coming to help you. Goodluck.

mitchpotter 10-19-2010 12:15 PM

Actually I am using grub, grub2 is not installed.

The menu file:
Code:

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 Desktop -- openSUSE 11.3 - 2.6.34-12
    root (hd0,1)
    kernel /boot/vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-WDC_WD2500KS-00MJB0_WD-WCANKL225075-part2 resume=/dev/disk/by-id/ata-WDC_WD2500KS-00MJB0_WD-WCANKL225075-part1 splash=silent quiet showopts vga=0x345
    initrd /boot/initrd-2.6.34-12-desktop

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.3 - 2.6.34-12
    root (hd0,1)
    kernel /boot/vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-WDC_WD2500KS-00MJB0_WD-WCANKL225075-part2 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x345
    initrd /boot/initrd-2.6.34-12-desktop

###Don't change this comment - YaST2 identifier: Original name: windows###
title Windows
    map (hd1) (hd0)
    map (hd0) (hd1)
    rootnoverify (hd1,0)
    makeactive
    chainloader +1

Since this wasn't working I took a look at the boot loader gui (yast) to see if there were some easy way to fix it but it showed this under the Windows title:

Code:

/dev/disk/by-id/ata-ST3250310AS_6RY00KB61
I'm not sure which to trust, but since it won't boot without the disk with that id installed, I'd guess yast is correct.

btncix 10-19-2010 12:20 PM

It's probably not the best solution, but if you know that the swapped disks will always be the second, third, fourth, or whichever number hard drive for your system, you could look into chainloading onto that swapped disk.

For example - in grub.cfg
# boot up second hard drive - perhaps Windows XP
menuentry "boot up second hard drive, first partition" {
set root=(hd1,1)
chainloader +1
}
[note: I've read that you should not directly edit grub.cfg for grub2

Sorry I can't help you more, but I thought this info might get you started. Good luck.
one grub2 tutorial I found


Edit: Well, my post was late and probably not helpful to you

mitchpotter 10-19-2010 12:40 PM

Well apparently my post isn't helpful either because now it's working and I have no idea what I did to fix it. I just swapped the drives out again and it started working for two of them so far.

Yast now shows Windows as /dev/sdb1 so it must be changing that value based on the drive that's installed when Linux starts up. The drives are mounting correctly too, which is a relief.

The menu file didn't change so the mappings are correct. I guess I'll just chalk this up to "typical" Linux behavior.

Thanks for trying to help though. =)


All times are GMT -5. The time now is 01:26 AM.