LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Configuration problem of grub2 installed in Ext.HDD!! (https://www.linuxquestions.org/questions/linux-software-2/configuration-problem-of-grub2-installed-in-ext-hdd-748620/)

firewiz87 08-19-2009 01:37 AM

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....

aus9 08-19-2009 06:57 PM

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

firewiz87 08-19-2009 10:38 PM

Thanx for your quick response

Quote:

Originally Posted by aus9 (Post 3650187)
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 (Post 3650187)
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??

aus9 08-23-2009 07:27 PM

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

firewiz87 08-24-2009 03:59 AM

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.... :(

aus9 08-24-2009 09:37 AM

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


All times are GMT -5. The time now is 12:20 PM.