lvm2 thin volume snapshot

Posted on

Is it not possible to mount thin snapshot logical volumes with the following configuration:

RHEL 9 Vmware workstation vm

One virtual disk nvme0n1
GPT with 3 partitions:

nvme0n1p1 partition 1 = /boot/efi
nvme0n1p2 partition 2 = /boot
nvme0n1p3 = physical volume in volume group vg00

vg00 is encrypted luks2

vg00 is setup for thin provisioning with thin pool pool00

~~~~~~~

fdisk -l

Disk /dev/nvme0n1: 100 GiB, 107374182400 bytes, 209715200 sectors
Disk model: VMware Virtual NVMe Disk
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 300C3B35-2F6B-4E4C-AC5D-6E92071DAEF2

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 514047 512000 250M EFI System
/dev/nvme0n1p2 514048 4700159 4186112 2G Linux filesystem
/dev/nvme0n1p3 4700160 199218750 194518591 92.8G Linux filesystem

Disk /dev/mapper/luks-f1ab7b57-c37f-41a0-9a1f-bbbb34c6ca1f: 92.74 GiB, 99576741376 bytes, 194485823 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/vg00-root: 4 GiB, 4290772992 bytes, 8380416 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes

Disk /dev/mapper/vg00-swap: 2 GiB, 2151677952 bytes, 4202496 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes

Disk /dev/mapper/vg00-usr: 15 GiB, 16106127360 bytes, 31457280 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes

Disk /dev/mapper/vg00-usr_local: 6 GiB, 6442450944 bytes, 12582912 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes

Disk /dev/mapper/vg00-var_log_audit: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes

Disk /dev/mapper/vg00-var_log: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes

Disk /dev/mapper/vg00-tmp: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes

Disk /dev/mapper/vg00-home: 500 MiB, 524288000 bytes, 1024000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes

Disk /dev/mapper/vg00-var: 4 GiB, 4294967296 bytes, 8388608 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes

Disk /dev/mapper/vg00-var_tmp: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes

Disk /dev/mapper/vg00-opt: 6 GiB, 6442450944 bytes, 12582912 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes

Disk /dev/mapper/vg00-testvol: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes

Disk /dev/mapper/vg00-root_snapshot: 4 GiB, 4290772992 bytes, 8380416 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes

Disk /dev/mapper/vg00-var_snapshot: 4 GiB, 4294967296 bytes, 8388608 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes

~~~~~~~~

~~~~~~~~~~

vgdisplay -v vg00

--- Volume group ---
VG Name vg00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 41
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 15
Open LV 11
Max PV 0
Cur PV 1
Act PV 1
VG Size 92.73 GiB
PE Size 4.00 MiB
Total PE 23740
Alloc PE / Size 23740 / 92.73 GiB
Free PE / Size 0 / 0
VG UUID QLnC4i-yDt3-ew1i-N7JL-3aXy-rHyY-Xtlkff

--- Logical volume ---
LV Name pool00
VG Name vg00
LV UUID uejmXT-sm4Z-eeQv-dxGF-gQPJ-olrS-9MiW0d
LV Write Access read/write (activated read only)
LV Creation host, time , 2024-01-29 22:58:20 -0500
LV Pool metadata pool00_tmeta
LV Pool data pool00_tdata
LV Status available
# open 0
LV Size <92.55 GiB
Allocated pool data 6.11%
Allocated metadata 12.70%
Current LE 23692
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:7

--- Logical volume ---
LV Path /dev/vg00/usr_local
LV Name usr_local
VG Name vg00
LV UUID UrjivX-jdi8-sGRE-k0MZ-tpmS-JInE-GmnKcw
LV Write Access read/write
LV Creation host, time , 2024-01-29 22:58:21 -0500
LV Pool name pool00
LV Status available
# open 1
LV Size 6.00 GiB
Mapped size 1.06%
Current LE 1536
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:8

--- Logical volume ---
LV Path /dev/vg00/var_log_audit
LV Name var_log_audit
VG Name vg00
LV UUID HjGKI6-Gyiw-bH1Q-HeVB-ylfs-UUpR-x8fcLq
LV Write Access read/write
LV Creation host, time , 2024-01-29 22:58:22 -0500
LV Pool name pool00
LV Status available
# open 1
LV Size 2.00 GiB
Mapped size 4.90%
Current LE 512
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:9

--- Logical volume ---
LV Path /dev/vg00/var_log
LV Name var_log
VG Name vg00
LV UUID N2lHV1-DJ2Z-LcW5-pkQb-g9aW-bWB7-xVynYe
LV Write Access read/write
LV Creation host, time , 2024-01-29 22:58:22 -0500
LV Pool name pool00
LV Status available
# open 1
LV Size 2.00 GiB
Mapped size 9.96%
Current LE 512
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:10

--- Logical volume ---
LV Path /dev/vg00/tmp
LV Name tmp
VG Name vg00
LV UUID xpo1Bv-eNwy-nB8u-nafK-2c3P-rkCG-lgnKvv
LV Write Access read/write
LV Creation host, time , 2024-01-29 22:58:22 -0500
LV Pool name pool00
LV Status available
# open 1
LV Size 1.00 GiB
Mapped size 6.35%
Current LE 256
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:11

--- Logical volume ---
LV Path /dev/vg00/swap
LV Name swap
VG Name vg00
LV UUID bDGc6l-OAsJ-CLK7-Fa8F-8PX2-6PBz-PdyCaS
LV Write Access read/write
LV Creation host, time , 2024-01-29 22:58:23 -0500
LV Pool name pool00
LV Status available
# open 2
LV Size 2.00 GiB
Mapped size 5.61%
Current LE 513
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:5

--- Logical volume ---
LV Path /dev/vg00/home
LV Name home
VG Name vg00
LV UUID LgxItj-NqAG-60OX-bxTe-LCL7-c6aL-Wqh1Xn
LV Write Access read/write
LV Creation host, time , 2024-01-29 22:58:23 -0500
LV Pool name pool00
LV Status available
# open 1
LV Size 500.00 MiB
Mapped size 12.90%
Current LE 125
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:12

--- Logical volume ---
LV Path /dev/vg00/root
LV Name root
VG Name vg00
LV UUID HCydVn-86ct-Yvmf-UqtH-2jLU-jC2R-c9yJe0
LV Write Access read/write
LV Creation host, time , 2024-01-29 22:58:23 -0500
LV Pool name pool00
LV Status available
# open 1
LV Size <4.00 GiB
Mapped size 2.90%
Current LE 1023
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:4

--- Logical volume ---
LV Path /dev/vg00/usr
LV Name usr
VG Name vg00
LV UUID HKzFXQ-mE0l-aE4q-LWjF-DD3u-dRSy-uGHwFk
LV Write Access read/write
LV Creation host, time , 2024-01-29 22:58:24 -0500
LV Pool name pool00
LV Status available
# open 1
LV Size 15.00 GiB
Mapped size 25.96%
Current LE 3840
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:6

--- Logical volume ---
LV Path /dev/vg00/var
LV Name var
VG Name vg00
LV UUID HxGH01-xkrC-8CQd-TefM-8pcW-1cid-nDoeHt
LV Write Access read/write
LV Creation host, time , 2024-01-29 22:58:24 -0500
LV Pool name pool00
LV Status available
# open 1
LV Size 4.00 GiB
Mapped size 16.14%
Current LE 1024
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:13

--- Logical volume ---
LV Path /dev/vg00/var_tmp
LV Name var_tmp
VG Name vg00
LV UUID W6IsaF-MElZ-nuuc-GAXe-Vucg-PDex-Wcai3Q
LV Write Access read/write
LV Creation host, time , 2024-01-29 22:58:26 -0500
LV Pool name pool00
LV Status available
# open 1
LV Size 2.00 GiB
Mapped size 3.19%
Current LE 512
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:14

--- Logical volume ---
LV Path /dev/vg00/opt
LV Name opt
VG Name vg00
LV UUID pVC5SR-OyiC-7b1h-BYP9-v3eA-qP9q-zcYvW2
LV Write Access read/write
LV Creation host, time , 2024-01-29 22:58:27 -0500
LV Pool name pool00
LV Status available
# open 1
LV Size 6.00 GiB
Mapped size 4.23%
Current LE 1536
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:15

--- Logical volume ---
LV Path /dev/vg00/testvol
LV Name testvol
VG Name vg00
LV UUID hKNuOH-Iiyg-kTms-7Md0-6tUJ-s62Y-BdTGtL
LV Write Access read/write
LV Creation host, time , 2024-01-30 14:08:17 -0500
LV Pool name pool00
LV Status available
# open 0
LV Size 2.00 GiB
Mapped size 3.16%
Current LE 512
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:16

--- Logical volume ---
LV Path /dev/vg00/root_snapshot
LV Name root_snapshot
VG Name vg00
LV UUID 5L4nUs-Ysb1-jqe6-7v4m-Yeir-FrE6-i6o3zJ
LV Write Access read/write
LV Creation host, time , 2024-01-30 14:34:55 -0500
LV Pool name pool00
LV Thin origin name root
LV Status available
# open 0
LV Size <4.00 GiB
Mapped size 2.90%
Current LE 1023
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:17

--- Logical volume ---
LV Path /dev/vg00/var_snapshot
LV Name var_snapshot
VG Name vg00
LV UUID JPNRB9-gOws-T6CQ-YnqR-EwzF-eOBa-ykccjN
LV Write Access read/write
LV Creation host, time , 2024-01-30 15:09:57 -0500
LV Pool name pool00
LV Thin origin name var
LV Status available
# open 0
LV Size 4.00 GiB
Mapped size 16.14%
Current LE 1024
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:18

--- Physical volumes ---
PV Name /dev/mapper/luks-f1ab7b57-c37f-41a0-9a1f-bbbb34c6ca1f
PV UUID eLiBk8-a4SV-JS9c-KFsf-eYip-CQUC-iivzNR
PV Status allocatable
Total PE / Free PE 23740 / 0

~~~~~~~~~~~~~~~~

lvcreate -s --name var_snapshot vg00/var

Logical volume "var_snapshot" created.

lvchange -ay -Ky /dev/vg00/var_snapshot

lvdisplay vg00/var_snapshot

--- Logical volume ---
LV Path /dev/vg00/var_snapshot
LV Name var_snapshot
VG Name vg00
LV UUID JPNRB9-gOws-T6CQ-YnqR-EwzF-eOBa-ykccjN
LV Write Access read/write
LV Creation host, time , 2024-01-30 15:09:57 -0500
LV Pool name pool00
LV Thin origin name var
LV Status available
# open 0
LV Size 4.00 GiB
Mapped size 16.14%
Current LE 1024
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:18

mkdir /mnt/var_snapshot

mount /dev/vg00/var_snapshot /mnt/var_snapshot

mount: /mnt/var_snapshot: wrong fs type, bad option, bad superblock on /dev/mapper/vg00-var_snapshot, missing codepage or helper program, or other error.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Responses