hypeit
(Mateusz)
February 5, 2023, 7:33am
1
Hi,
I am trying to mount an lvm based volume:
mother@infra2:~$ lxc storage volume create local-lvm backups size=25GiB
Storage volume backups created
mother@infra2:~$ sudo lvdisplay | grep backups
LV Path /dev/storage2-vg/custom_default_backups
LV Name custom_default_backups
LV Path /dev/lxcstore-vg/custom_default_backups
LV Name custom_default_backups
mother@infra2:~$ sudo mount /dev/lxcstore-vg/custom_default_backups /backups
mount: /backups: special device /dev/lxcstore-vg/custom_default_backups does not exist.
SImilar command works on another lxd host where there is no clustering, what did I do wrong?
tomp
(Thomas Parrott)
February 5, 2023, 1:21pm
2
Please can you show “sudo lvs” output?
I suspect you need to activate the volume before it appears aa a device.
hypeit
(Mateusz)
February 8, 2023, 4:09pm
3
mother@infra2:~$ sudo -i
root@infra2:~# lxc storage volume create remote-lvm recovery size=50GiB
Storage volume recovery created
root@infra2:~# sudo lvs | grep recovery
custom_default_recovery storage2-vg Vwi---tz-k 50.00g lvm-pool
root@infra2:~# sudo lvs | grep recovery -A 20
custom_default_recovery storage2-vg Vwi---tz-k 50.00g lvm-pool
images_1c15b72dcd63d3a91b6a198a052de015e5d5ea09be7d17f237155904c4e7b8d0 storage2-vg Vwi---tz-k 10.00g lvm-pool
images_21e6855cea66108ce49354f7efa012c1d94c7ff11adc7c31cfd4f23bb367b51c storage2-vg Vwi---tz-k 10.00g lvm-pool
images_48fba1296bd536c098c69fbbc72ed7d27eb5d0f259b16d0f17f390e8beeda06d storage2-vg Vwi---tz-k 100.00m lvm-pool
images_48fba1296bd536c098c69fbbc72ed7d27eb5d0f259b16d0f17f390e8beeda06d.block storage2-vg Vwi---tz-k 10.00g lvm-pool
@tomp do you mean any particular command?
Ithink I should add the fact that I am running on a 3 member cluster, in the documentation I see
To add a custom storage volume on a cluster member, add the --target flag:
lxc storage volume create <pool_name> <volume_name> --target=<cluster_member> [configuration_options...]
62
root@infra2:~# lvdisplay /dev/storage2-vg/custom_default_recovery
--- Logical volume ---
LV Path /dev/storage2-vg/custom_default_recovery
LV Name custom_default_recovery
VG Name storage2-vg
LV UUID LscXd6-VI1N-1fIO-f9i7-Qg8s-Vi32-Ba8GIv
LV Write Access read/write
LV Creation host, time infra2, 2023-02-08 16:06:48 +0000
LV Pool name lvm-pool
LV Status NOT available
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
tomp
(Thomas Parrott)
February 9, 2023, 8:24am
4
So LXD only activates the logical volumes when it needs to mount the volume, this is so we don’t keep unnecessary devices active in the system.
You can manually activate using:
sudo lvchange --activate y --ignoreactivationskip /dev/storage2-vg/custom_default_recovery
And then when you’re done, after unmounting, do
sudo lvchange --activate n --ignoreactivationskip /dev/storage2-vg/custom_default_recovery
hypeit
(Mateusz)
February 12, 2023, 10:01pm
5
Seems I was missing --ignoreactivationskip, thank you very much
1 Like