Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   Problems probing a LVM device with GRUB2 (http://www.linux-archive.org/debian-user/427765-problems-probing-lvm-device-grub2.html)

Alberto Luaces 09-16-2010 10:02 AM

Problems probing a LVM device with GRUB2
 
Hello,

I'm trying to install GRUB2 to a disk that has an ext2/3 filesystem into
a LVM partition. I can even start the system from GRUB2 and a boot disk,
so it should work.

The problem is that `grub-install' displays `no such disk' errors. I
have tracked it down to `grub-probe':

$ ls /dev/mapper/
control lvm_volume-debian_root lvm_volume-swap

$ sudo grub-probe -d /dev/mapper/lvm_volume-debian_root
grub-probe: error: no such disk.

How can I make `grub-probe' to find the partition? I'm using Squeeze,
with latest GRUB2:

$ dpkg -l grub-pc
[...]
ii grub-pc 1.98+20100804-4

Thanks,

--
Alberto


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87zkvivwdc.fsf@eps142.cdf.udc.es">http://lists.debian.org/87zkvivwdc.fsf@eps142.cdf.udc.es

Tom H 09-16-2010 04:31 PM

Problems probing a LVM device with GRUB2
 
On Thu, Sep 16, 2010 at 6:02 AM, Alberto Luaces <aluaces@udc.es> wrote:
>
> I'm trying to install GRUB2 to a disk that has an ext2/3 filesystem into
> a LVM partition. I can even start the system from GRUB2 and a boot disk,
> so it should work.
>
> The problem is that `grub-install' displays `no such disk' errors. I
> have tracked it down to `grub-probe':
>
> $ ls /dev/mapper/
> control *lvm_volume-debian_root *lvm_volume-swap
>
> $ sudo grub-probe -d /dev/mapper/lvm_volume-debian_root
> grub-probe: error: no such disk.
>
> How can I make `grub-probe' to find the partition? I'm using Squeeze,
> with latest GRUB2:
>
> $ dpkg -l grub-pc
> [...]
> ii *grub-pc * * * * * * * * * * * * * * * * * * * *1.98+20100804-4

I have sid (with the same version of grub-pc) running with lvm.

Is "/dev/mapper/lvm_volume-debian_root" a symlink to "/dev/dm-X"?

What's the output of
cat /boot/grub/device.map
grub-probe --target=abstraction /
grub-probe --target=device /
grub-probe --target=drive /

What's the grub.cfg menuentry in the 10_linux section?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTi=5SkqBBQn-9sRBDSV3n0__sU74aeMwkL4nrFK1@mail.gmail.com">http://lists.debian.org/AANLkTi=5SkqBBQn-9sRBDSV3n0__sU74aeMwkL4nrFK1@mail.gmail.com

Alberto Luaces 09-17-2010 12:01 PM

Problems probing a LVM device with GRUB2
 
Hi Tom, thanks for the guidance, see below:

Tom H writes:

> On Thu, Sep 16, 2010 at 6:02 AM, Alberto Luaces wrote:
>>
>> I'm trying to install GRUB2 to a disk that has an ext2/3 filesystem into
>> a LVM partition. I can even start the system from GRUB2 and a boot disk,
>> so it should work.
>>
>> The problem is that `grub-install' displays `no such disk' errors. I
>> have tracked it down to `grub-probe':
>>
>> $ ls /dev/mapper/
>> control *lvm_volume-debian_root *lvm_volume-swap
>>
>> $ sudo grub-probe -d /dev/mapper/lvm_volume-debian_root
>> grub-probe: error: no such disk.
>>
>> How can I make `grub-probe' to find the partition? I'm using Squeeze,
>> with latest GRUB2:
>>
>> $ dpkg -l grub-pc
>> [...]
>> ii *grub-pc * * * * * * * * * * * * * * * * * * * *1.98+20100804-4
>
> I have sid (with the same version of grub-pc) running with lvm.
>
> Is "/dev/mapper/lvm_volume-debian_root" a symlink to "/dev/dm-X"?

Yes, /dev/dm-0

> What's the output of
> cat /boot/grub/device.map

$ cat /boot/grub/device.map
(fd0) /dev/fd0
(hd0) /dev/disk/by-id/ata-ST3320613AS_5SZ00HA9

> grub-probe --target=abstraction /

$ sudo grub-probe --target=abstraction /
grub-probe: error: no such disk.

> grub-probe --target=device /

$ sudo grub-probe --target=device /
/dev/mapper/lvm_volume-debian_root

> grub-probe --target=drive /

$ sudo grub-probe --target=drive /
(lvm_volume-debian_root)

Thanks to that pointers of yours, I realized that I should update my
device.map, adding a last line like this

(lvm_volume-debian_root) /dev/mapper/lvm_volume-debian_root

Now, I try to install grub again:

$ sudo grub-install --no-floppy --modules="ext2 lvm" /dev/sdb

The command finishes succesfully, but when I try to boot from my second
hard disk (sdb), I get an error that looks like:

error: no such device: ff5ef7a3-1d16-4a30-a3d5-1751c02c7630
Entering rescue mode

ff5ef7a3-1d16-4a30-a3d5-1751c02c7630 is the uuid of my /dev/dm-0. It
seems now that the image of my grub doesn't have lvm support, even I
activated it in the `grub-install' call.

Any clue about this? Relevant snippet of my grub.cfg, note that there is
no `insmod lvm' stanza!

insmod ext2
set root='(lvm_volume-debian_root)'
search --no-floppy --fs-uuid --set ff5ef7a3-1d16-4a30-a3d5-1751c02c7630

--
Alberto


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87sk18d1d2.fsf@eps142.cdf.udc.es">http://lists.debian.org/87sk18d1d2.fsf@eps142.cdf.udc.es

Tom H 09-28-2010 04:53 AM

Problems probing a LVM device with GRUB2
 
On Fri, Sep 17, 2010 at 8:01 AM, Alberto Luaces <aluaces@udc.es> wrote:
> Tom H writes:
>> On Thu, Sep 16, 2010 at 6:02 AM, Alberto Luaces wrote:


> Hi Tom, thanks for the guidance, see below:

You're welcome. I'm sorry about the delay in responding. I screwed up
and archived a few threads by mistake (not for the first time it
seems!), of which this one.


>>> I'm trying to install GRUB2 to a disk that has an ext2/3 filesystem into
>>> a LVM partition. I can even start the system from GRUB2 and a boot disk,
>>> so it should work.
>>>
>>> The problem is that `grub-install' displays `no such disk' errors. I
>>> have tracked it down to `grub-probe':
>>>
>>> $ ls /dev/mapper/
>>> control *lvm_volume-debian_root *lvm_volume-swap
>>>
>>> $ sudo grub-probe -d /dev/mapper/lvm_volume-debian_root
>>> grub-probe: error: no such disk.
>>>
>>> How can I make `grub-probe' to find the partition? I'm using Squeeze,
>>> with latest GRUB2:
>>>
>>> $ dpkg -l grub-pc
>>> [...]
>>> ii *grub-pc * * * * * * * * * * * * * * * * * * * *1.98+20100804-4
>>
>> I have sid (with the same version of grub-pc) running with lvm.


I am assuming that you have a setuo like mine, where "/boot" isn't a
separate partition and /dev/sdb (I have /dev/sda but that shouldn't be
an issue) is your disk with one partition on which "/" in an lv.


>> What's the output of
>> cat /boot/grub/device.map
>
> $ cat /boot/grub/device.map
> (fd0) * /dev/fd0
> (hd0) * /dev/disk/by-id/ata-ST3320613AS_5SZ00HA9

Same for me and it's correct (as long as it corresponds to the
"/dev/disk/by-id/" entry of /dev/sdb).


>> grub-probe --target=abstraction /
>
> $ sudo grub-probe --target=abstraction /
> grub-probe: error: no such disk.

"The" problem.
I get "lvm".


>> grub-probe --target=device /
>
> $ sudo grub-probe --target=device /
> /dev/mapper/lvm_volume-debian_root

Same for me.


>> grub-probe --target=drive /
>
> $ sudo grub-probe --target=drive /
> (lvm_volume-debian_root)

Same for me.


> Thanks to that pointers of yours, I realized that I should update my
> device.map, adding a last line like this
>
> (lvm_volume-debian_root) /dev/mapper/lvm_volume-debian_root
>
> Now, I try to install grub again:
>
> $ sudo grub-install --no-floppy --modules="ext2 lvm" /dev/sdb
>
> The command finishes succesfully, but when I try to boot from my second
> hard disk (sdb), I get an error that looks like:
>
> error: no such device: ff5ef7a3-1d16-4a30-a3d5-1751c02c7630
> Entering rescue mode
>
> ff5ef7a3-1d16-4a30-a3d5-1751c02c7630 is the uuid of my /dev/dm-0. It
> seems now that the image of my grub doesn't have lvm support, even I
> activated it in the `grub-install' call.
>
> Any clue about this? Relevant snippet of my grub.cfg, note that there is
> no `insmod lvm' stanza!
>
> insmod ext2
> set root='(lvm_volume-debian_root)'
> search --no-floppy --fs-uuid --set ff5ef7a3-1d16-4a30-a3d5-1751c02c7630

Since grub-probe isn't detecting your lvm setup, it's normal for
grub.cfg not to have "insmod lvm".

I don't think that adding that adding that line to
"/boot/grub/device.map" could be that useful and I'm not sure that
whether adding "--modules=..." is additive or not because you need a
few more modules to be able to boot. I've forgotten the command to
list the core.img modules but I'll try to find it and list the default
ones that you'd have to add to your command if it isn't additive.

What is and what's on sda?

More data requests...

What is the output of:

pvs
lvs
vgs
fdisk -l /dev/sdb
grub-probe --target=drive -d /dev/sdb
grub-probe --target=drive -d /dev/sdbX
grub-probe --target=drive -d /dev/dm-0
grub-probe --target=drive -d /dev/mapper/lvm_volume-debian_root
(the last one with your extra line and with it commented out)


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTimUFAGjq+zzOWo1E40_iZDLmjig_fkoCtpNovDD@mail .gmail.com">http://lists.debian.org/AANLkTimUFAGjq+zzOWo1E40_iZDLmjig_fkoCtpNovDD@mail .gmail.com

Alberto Luaces 09-30-2010 10:45 AM

Problems probing a LVM device with GRUB2
 
Hello Tom, thanks again for your assistance

Tom H writes:

> On Fri, Sep 17, 2010 at 8:01 AM, Alberto Luaces wrote:
>> Tom H writes:
>>> On Thu, Sep 16, 2010 at 6:02 AM, Alberto Luaces wrote:

[...]

> Since grub-probe isn't detecting your lvm setup, it's normal for
> grub.cfg not to have "insmod lvm".
>
> I don't think that adding that adding that line to
> "/boot/grub/device.map" could be that useful and I'm not sure that
> whether adding "--modules=..." is additive or not because you need a
> few more modules to be able to boot. I've forgotten the command to
> list the core.img modules but I'll try to find it and list the default
> ones that you'd have to add to your command if it isn't additive.
>

Certainly it could be useful to know the list of modules contained in a
specific core.img. Speaking of which, when I boot from /dev/sdb an get
the error about not findind a partition with the uuid, I can type
without any error

insmod lvm
insmod ext2

but then, if I type `ls', only the normal partitions are listed
(hd*,msdos*), and none of the LVM volumes. Here hd0 == sdb and hd1 ==
sda.

>
> What is and what's on sda?
>

Currently I have my system in /dev/sda. I am in the process of moving it
to a second hard drive, /dev/sdb. Using the GRUB on /dev/sda I can boot
into the LVM root partition and try to install GRUB on /dev/sdb, in
order to get rid of the /dev/sda disk eventually. After the copy process
of the ext partitions, I generated new UUIDs for the new ones in order
to avoid clashes.

>
> More data requests...
>
> What is the output of:
>
> pvs
> lvs
> vgs
> fdisk -l /dev/sdb
> grub-probe --target=drive -d /dev/sdb
> grub-probe --target=drive -d /dev/sdbX
> grub-probe --target=drive -d /dev/dm-0
> grub-probe --target=drive -d /dev/mapper/lvm_volume-debian_root
> (the last one with your extra line and with it commented out)
>

Ok, here it is. I collected that data from the system in the LVM,
booting manually from GRUB:

pvs
PV VG Fmt Attr PSize PFree
/dev/sdb2 lvm_volume lvm2 a- 77,19g 0

lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
debian_root lvm_volume -wi-ao 76,00g
swap lvm_volume -wi-a- 1,19g

vgs
VG #PV #LV #SN Attr VSize VFree
lvm_volume 1 2 0 wz--n- 77,19g 0

fdisk -l /dev/sdb
GNU Fdisk 1.2.4

[...]

Disk /dev/sdb: 250 GB, 250056737280 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 20325 163260531 7 HPFS/NTFS

/dev/sdb2 20325 30402 80943502 8e Linux LVM

grub-probe --target=drive -d /dev/sdb
(/dev/sdb)

grub-probe --target=drive -d /dev/sdb1
(/dev/sdb,msdos1)

grub-probe --target=drive -d /dev/sdb2
(/dev/sdb,msdos1)

grub-probe --target=drive -d /dev/dm-0
(lvm_volume-debian_root)

grub-probe --target=drive -d /dev/mapper/lvm_volume-debian_root
(lvm_volume-debian_root)

If I delete the line in device.map, the only output that change is:

grub-probe --target=drive -d /dev/dm-0
(/dev/dm-0)

Regards,

--
Alberto


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87eicbv7bh.fsf@eps142.cdf.udc.es">http://lists.debian.org/87eicbv7bh.fsf@eps142.cdf.udc.es


All times are GMT. The time now is 02:07 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.