LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-19-2010, 11:44 AM   #1
mitchpotter
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, 11:50 AM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,665

Rep: Reputation: 485Reputation: 485Reputation: 485Reputation: 485Reputation: 485
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, 12:15 PM   #3
mitchpotter
LQ Newbie
 
Registered: Jan 2008
Posts: 6

Original Poster
Rep: Reputation: 0
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.
 
Old 10-19-2010, 12:20 PM   #4
btncix
Member
 
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 12:23 PM.
 
Old 10-19-2010, 12:40 PM   #5
mitchpotter
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. =)
 
  


Reply


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 03:50 PM
How to change from grub boot loader to lilo boot loader linuxjamil Linux - Software 1 05-27-2008 01:47 PM
grub boot loader with external SATA hard drive james2b Linux - Newbie 1 03-24-2008 05: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 05:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:13 PM.

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