You are not logged in.

#1 2013-04-03 15:31:16

Chris Dennis
Member
Registered: 2012-01-20
Posts: 10

[SOLVED] Grub2 and LVM -- "Couldn't find physical volume `pv1'"

Hello Folks

I'm trying to upgrade from grub-legacy to grub2, following the instructions at https://wiki.archlinux.org/index.php/GRUB2

I've installed grub-bios, and run this without problem:

# modprobe dm-mod
# grub-install --recheck /dev/sda

But this command

# grub-mkconfig -o /boot/grub/grub.cfg

gives this:

Generating grub.cfg ...
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv1'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv1'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv1'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv1'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv1'. Some modules may be missing from core image..
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv1'. Some modules may be missing from core image..
done

So now I'm reluctant to try to reboot the system because it seems likely to be broken.  Should I ignore the warnings, or fix something?

I'm using LVM2 as you can see.  /boot is on a separate non-LVM partition (/dev/sdc1).  root is on LVM.  This is all on a recently-updated 64-bit Arch installation using systemd.

Here's a load of information -- I hope it's relevant.

# fdisk -lu
Disk /dev/sdb: 250.1 GB, 250059350016 bytes, 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xea22bb30

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63   488392064   244196001   83  Linux

Disk /dev/sda: 250.0 GB, 250000000000 bytes, 488281250 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000080

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048   488281249   244139601   8e  Linux LVM

Disk /dev/sdc: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *          63      481949      240943+  83  Linux
/dev/sdc2          481950    12482504     6000277+  82  Linux swap / Solaris
/dev/sdc3        12482505   976773167   482145331+  8e  Linux LVM

Disk /dev/mapper/vg1-root: 64.4 GB, 64424509440 bytes, 125829120 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/vg1-home: 583.0 GB, 583008256000 bytes, 1138688000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sdc3
  VG Name               vg1
  PV Size               459.81 GiB / not usable 1.05 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              117711
  Free PE               0
  Allocated PE          117711
  PV UUID               zaLJiO-1LCH-TGi6-hwBr-OyNs-Sjlm-HggrMo
   
  --- Physical volume ---
  PV Name               /dev/sda1
  VG Name               vg1
  PV Size               232.83 GiB / not usable 1.58 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              59604
  Free PE               22955
  Allocated PE          36649
  PV UUID               P05c2d-1d2i-bf0M-u6BX-EEq0-fvZW-VkTLhY
# lvdisplay
  --- Logical volume ---
  LV Path                /dev/vg1/root
  LV Name                root
  VG Name                vg1
  LV UUID                Z68H3p-VvbC-ZNau-7Ds7-GptS-Hpl0-VZNjo4
  LV Write Access        read/write
  LV Creation host, time , 
  LV Status              available
  # open                 1
  LV Size                60.00 GiB
  Current LE             15360
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:0
   
  --- Logical volume ---
  LV Path                /dev/vg1/home
  LV Name                home
  VG Name                vg1
  LV UUID                uUfmS9-C4CK-Vw3V-cmwD-hEC1-VcwD-90yAyO
  LV Write Access        read/write
  LV Creation host, time , 
  LV Status              available
  # open                 1
  LV Size                542.97 GiB
  Current LE             139000
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:1

Last edited by Chris Dennis (2013-04-03 19:04:58)

Offline

#2 2013-04-03 15:48:11

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Grub2 and LVM -- "Couldn't find physical volume `pv1'"

It appears as though your /boot is not actually on the LVM, is this correct?  Because the only reason you would need grub2's LVM2 compatibility is if your kernel/initrd is stored within the LVM itself.  If it is apart from the rest, stored in a regular /boot partition, this is not necessary.


[side-note] Honestly, if grub-legacy was working for you, I would stick with that.  I don't see any real reason to switch to grub2, as I really don't think that the bootloader holds and security risk or anything.  Grub2 tries to automate everything, including the creation of your grub.cfg.  This makes it not so entirely obvious to debug like grub-legacy was.

Either that, or use syslinux, as it really reminds me of the grub-legacy.  It is nice, and simple and does what it needs to do without any crazy BS for you to contend with. [/side-note]

Offline

#3 2013-04-03 16:07:43

Chris Dennis
Member
Registered: 2012-01-20
Posts: 10

Re: [SOLVED] Grub2 and LVM -- "Couldn't find physical volume `pv1'"

Thanks for your reply, WonderWoofy.

WonderWoofy wrote:

It appears as though your /boot is not actually on the LVM, is this correct?  Because the only reason you would need grub2's LVM2 compatibility is if your kernel/initrd is stored within the LVM itself.  If it is apart from the rest, stored in a regular /boot partition, this is not necessary.

Correct, /boot is not on an LVM volume.  I didn't tell grub that it was -- I just ran the grub-mkconfig command. 

Is there something different that I need to do to tell grub that /boot is on /dev/sdc1 ?

WonderWoofy wrote:

[side-note] Honestly, if grub-legacy was working for you, I would stick with that.  I don't see any real reason to switch to grub2, as I really don't think that the bootloader holds and security risk or anything.  Grub2 tries to automate everything, including the creation of your grub.cfg.  This makes it not so entirely obvious to debug like grub-legacy was.

Either that, or use syslinux, as it really reminds me of the grub-legacy.  It is nice, and simple and does what it needs to do without any crazy BS for you to contend with. [/side-note]

I'll consider those ideas.  I just assumed that support for grub-legacy would go away at some stage.

cheers

Chris

Offline

#4 2013-04-03 19:04:06

Chris Dennis
Member
Registered: 2012-01-20
Posts: 10

Re: [SOLVED] Grub2 and LVM -- "Couldn't find physical volume `pv1'"

Oh well, I took a punt on the word 'Warning' in the message, and rebooted anyway.

It worked!

An error message flashed up that I couldn't read, but it's all up and running again now.

If I find out anything more specific about those messages, I'll post it here.

Offline

#5 2013-06-18 00:33:29

re_nelson
Member
Registered: 2013-06-18
Posts: 3

Re: [SOLVED] Grub2 and LVM -- "Couldn't find physical volume `pv1'"

Chris Dennis wrote:

Oh well, I took a punt on the word 'Warning' in the message, and rebooted anyway.

It worked!

I've just completed a series of experiments involving LVM and GRUB2. The short story is that such warnings are innocuous and arise from extending a volume group.

Now in some detail, here's what happens (all of which was performed in VirtualBox with the current Arch rolling release just to make it easy to add and remove disk devices):

    a). pvcreate /dev/sde1 /dev/sdf1

        * Use partitions of type 8e, spanning the whole drive, for BOTH devices comprising the physical
          volume to prove that partitioning is irrelevant to the matter.

    b). vgcreate vg_x /dev/sde1

        * Start with just one device in the volume group.

    c). lvcreate --extents 100%VG --name boot vg_x

    d). mkfs.ext4 /dev/vg_x/boot && mount /dev/vg_x/boot /mnt/other

    e). grub2-install --boot-directory=/mnt/other /dev/sde
        Installation finished. No error reported.

All is well...but now let's extend the vg_x volume group with the pre-allocated device, /dev/sdf1:

    f). vgextend vg_x /dev/sdf1

    g). grub2-install --boot-directory=/mnt/other /dev/sde
        /usr/sbin/grub2-probe: warning: Couldn't find physical volume `pv1'. Some modules may be missing from core
        /usr/sbin/grub2-probe: warning: Couldn't find physical volume `pv1'. Some modules may be missing from core
        Installation finished. No error reported.

...and boom goes the dynamite. As Chris Dennis stated, GRUB2 installs fine and the system is bootable in spite of the warning. The grub-2.00 source where the warning arises is in ./grub-core/disk/diskfilter.c and has this comment:

      /* TRANSLATORS: This message kicks in during the detection of
         which modules needs to be included in core image. This happens
         in the case of degraded RAID and means that autodetection may
         fail to include some of modules. It's an installation time
         message, not runtime message.  */

I haven't tried to hack the GRUB code but, based upon my experimentation and the ease of replicating the problem, my guess is that somehow a volume group that extended in manner shown above is mishandled by GRUB. It's arguably a bug, IMHO, since a volume group, even when extended, is still a valid entity.

Offline

#6 2013-06-18 11:36:27

Chris Dennis
Member
Registered: 2012-01-20
Posts: 10

Re: [SOLVED] Grub2 and LVM -- "Couldn't find physical volume `pv1'"

Thank you re_nelson for researching this issue (which persists on my system, but doesn't seem to cause a problem).

I have indeed extended and otherwise adjusted LVM volumes in the past, so that's consistent with what you found.

Offline

#7 2013-06-18 18:12:21

re_nelson
Member
Registered: 2013-06-18
Posts: 3

Re: [SOLVED] Grub2 and LVM -- "Couldn't find physical volume `pv1'"

Chris Dennis wrote:

I have indeed extended and otherwise adjusted LVM volumes in the past, so that's consistent with what you found.

And I thank you for this followup about GRUB's behavior when an LVM volume is extended. My concern when I posted my procedure was that I had encountered a one-off scenario unique to my situation. For what it's worth, I checked out the latest development GRUB from bzr, with file timestamps as recent as 16 JUN 2013 and the problem persists with that warning.

Since it is so readily reproduced and you've been able to confirm my findings, I'll contact the GRUB developer(s) and report the recipe that yields the error.

Again, your reply is greatly appreciated.

Offline

Board footer

Powered by FluxBB