I have a freshly installed Ubuntu Server 20.04 on which I am attempting to create an LVM storage pool with a Logical Volume which I created on OS installation.
However I get the following error when attempting to create the storage pool:
$ lxc storage create test lvm source=/dev/ubuntu-vg/lxd-storage
Error: Failed to run: pvcreate /dev/ubuntu-vg/lxd-storage: Failed to clear hint file.
Device /dev/ubuntu-vg/lxd-storage excluded by a filter.
I have previously created the storage pool multiple times with the same steps and have not observed this error.
The /etc/lvm/lvm.conf file has all filters commented out by default.
Following are details regarding the Logical Volume:
$ sudo lvdisplay -v /dev/ubuntu-vg/lxd-storage
--- Logical volume ---
LV Path /dev/ubuntu-vg/lxd-storage
LV Name lxd-storage
VG Name ubuntu-vg
LV UUID SusZnB-2crM-IblT-6Ovc-KA9v-YeVL-LroQ1c
LV Write Access read/write
LV Creation host, time ubuntu-server, 2021-08-17 11:39:32 +0000
LV Status available
# open 0
LV Size 829.98 GiB
Current LE 212476
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
This seems like quite an unusual thing to attempt - if I’m reading this correctly you’re trying to create a LVM volume group (and physical volume) ontop of an existing logical volume.
Is there a reason you’re doing this, rather than just creating a volume group and then using that as the source name, e.g.
lxc storage create test lvm source=my-volumegroup-name
On Ubuntu installation I limited the boot partition LV’s size and used the rest of the disk space to create an unformatted LV /dev/ubuntu-vg/lxd-storage. I initially assumed that LXD would be able to use the unformatted LV to create the storage pool (which worked without errors before) but it seems to be giving me issues now.
Both my LVs are as follows:
$ sudo lvdisplay
--- Logical volume ---
LV Path /dev/ubuntu-vg/ubuntu-lv
LV Name ubuntu-lv
VG Name ubuntu-vg
LV UUID yIUUwI-P8jw-bVKo-4GLp-8ita-Of1G-cMavBF
LV Write Access read/write
LV Creation host, time ubuntu-server, 2021-08-17 11:39:26 +0000
LV Status available
# open 1
LV Size 100.00 GiB
Current LE 25600
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Path /dev/ubuntu-vg/lxd-storage
LV Name lxd-storage
VG Name ubuntu-vg
LV UUID SusZnB-2crM-IblT-6Ovc-KA9v-YeVL-LroQ1c
LV Write Access read/write
LV Creation host, time ubuntu-server, 2021-08-17 11:39:32 +0000
LV Status available
# open 0
LV Size 829.98 GiB
Current LE 212476
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
When we switched to Ubuntu Focal as the snap base the more recent LVM subsystem prevents nesting LVMs by default - as its not recommended by LVM upstream.