LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-19-2009, 01:37 AM   #1
firewiz87
Member
 
Registered: Jan 2006
Distribution: OpenSUSE 11.2, OpenSUSE 11.3,Arch
Posts: 240

Rep: Reputation: 37
Configuration problem of grub2 installed in Ext.HDD!!


I have managed to successfully install GRUB 2 on an external hard drive, which is meant to load linux that is installed within the external hard disk. The problem i face is that the device mapping of grub2 (hd0 etc)changes from system to system (obviously).

It is interesting to note that sometimes the external HDD gets a mapping hd0 even though the system has a native HDD installed.... i thought the mappings would be sequential as native HDD gets lower numbers compared to ext.HDDs... can anybody tell me why this happens??

Can i in someway, address the partitions in the Ext.HDD without using the GRUB mappings (hd0 etc) since the grub is also loaded from the ext.HDD??

I am also facing probles with the "root=" option of the linux kernel. What exactly does this option denote?? What would be its value in case od a Live CD boot???

Thanx in advance for your help....
 
Old 08-19-2009, 06:57 PM   #2
aus9
LQ Addict
 
Registered: Oct 2003
Location: Australia
Distribution: MX 18/ TC64
Posts: 5,301

Rep: Reputation: Disabled
hi

imo your bios must be set to usb hd first....so usb grub2 drive should always be hd0. And must be detected as the first bootable device otherwise your grub2 will not load but the internal devices.

Does that explain it?

2) root= means you are referring to the kernel line that says root=.....it wants to know what partition / is on. In the kernel line it is not interested in where /boot is but /.....altho it may be the same partition.

3) I have not reviewed bootable grub2 isos as I have moved on but you may like to examine how to make them in my signature
 
Old 08-19-2009, 10:38 PM   #3
firewiz87
Member
 
Registered: Jan 2006
Distribution: OpenSUSE 11.2, OpenSUSE 11.3,Arch
Posts: 240

Original Poster
Rep: Reputation: 37
Thanx for your quick response

Quote:
Originally Posted by aus9 View Post
imo your bios must be set to usb hd first....so usb grub2 drive should always be hd0. And must be detected as the first bootable device otherwise your grub2 will not load but the internal devices.
I forgot abt the hard disk order in BIOS.... maybe that explains it.... i ll check...

Quote:
Originally Posted by aus9 View Post
hi
2) root= means you are referring to the kernel line that says root=.....it wants to know what partition / is on. In the kernel line it is not interested in where /boot is but /.....altho it may be the same partition.
so i could just give the path to my ext.HDD?? Since i am trying to boot linux ISO using a loop device in grub.... what would be the "root=" value??
 
Old 08-23-2009, 07:27 PM   #4
aus9
LQ Addict
 
Registered: Oct 2003
Location: Australia
Distribution: MX 18/ TC64
Posts: 5,301

Rep: Reputation: Disabled
Warning I could be completely wrong as I can not test my thinking

if you have an usb hd...lucky you...you first must configure the bios to boot usb devices before (normal) hard drive devices.


assuming you are on grub legacy you edit your USB /boot/grub/device.map...I have only one internal so mine is
Code:
cat /boot/grub/device.map 
(hd0) /dev/sda

what I think you need to remember...from above....that you need to really boot into the usb drive by making it hd0....and maybe you can then edit the internal drive if you also want the internal drive to be able to boot it.

lets say that again.

bios boot order usb then internal hd
grub on usb drive mbr detected...jumps to usb /boot/grub...and kernel etc and you boot usb

bios boot order usb hd
grub on usb mbr and you have editted its grub menu (assuming legacy) so internal is in there

so its likely, on the usb files.... you would add an entry for the internal such as (hd1) /dev/sdb


now as we boot usb first...the menu entries on usb are hd0 not hd1

3
now lets look at your internal

its device.map now changes as grub sees it as second device.....but I am not sure you have tried to edit its file?

assuming you have a live cd....no harm we can fix my errors...if any

so change to this

(hd0) /dev/sda
(hd1) /dev/sdb

then copy all of your menu entries but in the second group change them to hd1

the re-run update-grub to see what happens.

so lets try and explain it?

------------------------
You are more likely to have no usb drive versus always usb drive detected...so bios boot order with usb to hd...will jump to first detected drive and with no usb...that is hd....and your hd device.map says its sda and hd0.....so your original grub entries work "as is"

More importantly you can force this situation by remembering to unplug the usb drive before kernel grub/mbr stage to force bios onto hd.

But if you leave your usb installed....grub detected will be usb...and then its usb menu is what is loading and so the usb can stil chainload to hd with an entry like this

title mbr of hd
root (hd1)
chainloader =1

finally you lucky dude...you have 2 mbr s and 2 grubs so there is nothing stopping from chainloading to either

good luck

Last edited by aus9; 08-23-2009 at 07:30 PM.
 
Old 08-24-2009, 03:59 AM   #5
firewiz87
Member
 
Registered: Jan 2006
Distribution: OpenSUSE 11.2, OpenSUSE 11.3,Arch
Posts: 240

Original Poster
Rep: Reputation: 37
Once say a linux distro boots from the Ext.HDD and starts the installation(say), we no longer need to address the internal drives in terms of grub right....so thank god i dont need to boot the Int.HDD from the external HDD. Or it would ve caused a lot of other complications, bcoz i am using grub2 in Ext.HDD and legacy in Int.HDD

The main reason i installed grub2 was bcoz of its loopback command which could load an ISO file as a loop back device. However this does not work very well with DVD images (always gives me magic number errors), which i intended to use.... So i might as well switch to legacy....
 
Old 08-24-2009, 09:37 AM   #6
aus9
LQ Addict
 
Registered: Oct 2003
Location: Australia
Distribution: MX 18/ TC64
Posts: 5,301

Rep: Reputation: Disabled
yeah sorry missed your subject title

usb grub.cfg for chainloader could be

menuentry "internal" {
set root=(hd1)
chainloader +1
}

where we assume bios is hd0 for usb so hd1 is internal...change it, if not pls
 
  


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
Transfer time has slowed down to ext HDD with dd tschima Linux - Hardware 6 03-27-2008 01:27 AM
ext. usb HDD mounts read only for non root accounts logname Linux - Hardware 14 02-27-2006 04:17 PM
Safely removing ext hdd nanoprobe Linux - Hardware 1 07-24-2005 07:34 PM
ext hdd mounting read/write issue Jestrik Linux - Hardware 1 06-12-2004 08:46 AM
Toshiba boot problems - USB ext HDD - new install wtriver Linux - Newbie 5 11-02-2003 04:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:30 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