Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-19-2010, 12:44 PM   #1
LQ Newbie
Registered: Jan 2008
Posts: 6

Rep: Reputation: 0
Question 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?
Old 10-19-2010, 12:50 PM   #2
Senior Member
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,665

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
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.
Old 10-19-2010, 01:15 PM   #3
LQ Newbie
Registered: Jan 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Actually I am using grub, grub2 is not installed.

The menu file:
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)
    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:

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.
Old 10-19-2010, 01:20 PM   #4
Registered: Aug 2009
Location: USA
Posts: 141

Rep: Reputation: 26
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

Last edited by btncix; 10-19-2010 at 01:23 PM.
Old 10-19-2010, 01:40 PM   #5
LQ Newbie
Registered: Jan 2008
Posts: 6

Original Poster
Rep: Reputation: 0
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. =)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatted my linux drive in a dual boot setup, now the GRUB loader hangs the system.. Dr_Horse Linux - General 4 12-04-2008 04:50 PM
How to change from grub boot loader to lilo boot loader linuxjamil Linux - Software 1 05-27-2008 02:47 PM
grub boot loader with external SATA hard drive james2b Linux - Newbie 1 03-24-2008 06:27 AM
Linux won't boot in removable drive tray. But has no poblem in Internal bay. Mike Hotel Linux - Laptop and Netbook 0 06-16-2004 06:28 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:28 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration