help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with device mapping


From: Jordan Uggla
Subject: Re: Problem with device mapping
Date: Fri, 15 Jun 2012 15:03:24 -0700

On Fri, Jun 15, 2012 at 4:58 AM, Kevin . <address@hidden> wrote:
> There seems to be an incoherence with the device mapping in my grub. I have
> two
> hard-drives, one is new and still completely empty (my sda in Linux), and
> the other
> is my old one (sdb). In '/boot/grub/device.map' file they are shown to be
> mapped
> as hd0 and hd1, respectively. So I should specify hd1 when I wanted to boot
> to my OS'es,
> however that doesnt work, I have to specify hd0 instead. In the grub command
> line
> I get something like this:
>
>    set root=(hd1,2)
>    linux /boot/vmlinuz...
>    error: partition doesn't exists
>

It's not grub which decides device enumeration, it's your BIOS. Since
your BIOS could decide to change enumeration (because you inserted or
removed a disk, because one disk started more quickly, or based on the
phase of the moon) it's best to search by UUID rather than using
static device names. For instance to set $root based on UUID you would
use a command like "search --set=root --fs-uuid UUID_HERE" instead of
"set root=(hd1,2)".

The device.map is not read at boot, and so can't effect enumeration at
boot in any way (and never has). In addition, the device.map is
obsolete at this point and in the next version of grub (2.00)
grub-mkdevicemap won't even exist. The only reason to have a
device.map at all at this point is to specify that something which
doesn't appear to be a disk at all when grub-install is run (like a
logical volume being used to store a disk image for a virtual machine)
will in fact look like a disk to grub at boot (because the virtual
machine software will make it appear so to the virtual machine).

-- 
Jordan Uggla (Jordan_U on irc.freenode.net)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]