2

I'm trying to make LVM VDO work on my Debian 11.3 (test VM installed from scratch). I've shared my installation procedure here if someone wants to reproduce the problem. Now I'm stuck with a "basic" problem which is : the logical volume is inactive at startup. After VDO is compiled and installed, I run the following script:

# Create zeroed VDO volume and format to ext4
DESTINATION_LVM_VG="/dev/Pepper-Potts-vg"
VDOLV_NAME="ZEROED-VDOLV-1"
VDOLV_PATH="$DESTINATION_LVM_VG/$VDOLV_NAME"

lvcreate -y --vdopool "ZEROED-VDOPOOL-1" --name $VDOLV_NAME --activate y --compression n --deduplication n --size 12G --virtualsize 24G --config "allocation/vdo_slab_size_mb=8192" $DESTINATION_LVM_VG && \
mkfs.ext4 -E nodiscard $VDOLV_PATH

# Reconfigure /etc/fstab to mount zeroed VDO partition to /mnt/ZEROED-VDOLV-1
MOUNT_POINT="/mnt/$VDOLV_NAME"
mkdir $MOUNT_POINT
DM_VDOLV_PATH=($(lvs --noheadings --options "lv_dm_path" $VDOLV_PATH))
# We use "@" because $DIRECTORY_TO_MOVE contains "/"
echo "$DM_VDOLV_PATH    $MOUNT_POINT    ext4    defaults,x-systemd.device-timeout=0,x-systemd.requires=vdo.service  0   0" >> /etc/fstab
mount -a

and it works well but rebooting the VM fails because /dev/mapper/Pepper-Potts-vg-ZEROED--VDOPOOL--1 ($DM_VDOLV_PATH) no longer exists (I've checked). So I investigated with lvscan and found out that the logical volume doesn't exist in /dev/mapper/ because it is inactive. Doing vgchange -ay solves the boot problem but at next reboot it is stuck again.

I tried the same script with a "classic"/non-VDO logical volume and I don't have the problem as the logical volume stay active.

Edit 1: lvs output is as follow:

LV               VG              Attr       LSize   Pool             Origin Data%  Meta%  Move Log Cpy%Sync Convert
ZEROED-VDOLV-1   Pepper-Potts-vg vwi-XXv-X-  24,00g ZEROED-VDOPOOL-1
ZEROED-VDOPOOL-1 Pepper-Potts-vg dwi-XX--X-  12,00g
home             Pepper-Potts-vg -wi-ao----  <9,08g
root             Pepper-Potts-vg -wi-ao----  <3,18g
swap_1           Pepper-Potts-vg -wi-ao---- 976,00m
tmp              Pepper-Potts-vg -wi-ao---- 316,00m
var              Pepper-Potts-vg -wi-ao----   1,37g

Edit 2: I ran systemctl status /dev/mapper/Pepper--Potts--vg-ZEROED--VDO and it gave me the following :

● dev-mapper-Pepper\x2d\x2dPotts\x2d\x2dvg\x2dZEROED\x2d\x2dVDO.device - /dev/mapper/Pepper--Potts--vg-ZEROED--VDO
     Loaded: loaded
     Active: inactive (dead)

While other LVs are loaded and active (plugged) :

● dev-mapper-Pepper\x2d\x2dPotts\x2d\x2dvg\x2dhome.device - /dev/mapper/Pepper--Potts--vg-home
   Follow: unit currently follows state of sys-devices-virtual-block-dm\x2d4.device
     Loaded: loaded
     Active: active (plugged) since Sat 2022-05-14 19:00:24 CEST; 5min ago
     Device: /sys/devices/virtual/block/dm-4

Any idea ? Maybe I should create a virtual device as the other default logical volume has ?

Edit 3: No, virtual device (/dev/dm-X) is created by LVM when doing lvcreate

Suggestions :

  • Does Debian has any logical volume list to activate at boot ? As it is/was the case for CentOS and RHEL ?
  • Would it be this old Debian bug ??
tigerblue77
  • 31
  • 1
  • 3
  • Show the `lvs` output (which will include, among other potentially relevant bits, the *activation skip* flag). – anx May 14 '22 at 16:34
  • @anx Thanks for your answer, I've edited the post with the `lvs` command output – tigerblue77 May 14 '22 at 16:38
  • Man page says `X` means unknown. There should be vdo-specifics tools to inquire directly, and errors logged via kernel (dmesg) and/or journal if those fail, too. Note that you can pass device paths directly to systemd, so try `systemctl status /dev/whatever` – anx May 14 '22 at 16:59
  • @anx I didn't have the idea to check about these attributes, thanks. The only up-to-date documentation that I found is : https://man7.org/linux/man-pages/man7/lvmvdo.7.html I didn't find any information about mount problem on Red Hat, probably because they don't use LVM. I ran your command and edited my original post – tigerblue77 May 14 '22 at 17:35

1 Answers1

1

Solved here.

  1. My /etc/fstab line was directly taken from Red Hat documentation but couldn't work as vdo.service no longer exist ; VDO module is now integrated with LVM. So now I run:
echo "$DM_VDOLV_PATH    $MOUNT_POINT    ext4    defaults,x-systemd.device-timeout=0 0   0" >> /etc/fstab
  1. I find out that lvm2-activation-generator is not a package to install using apt install ... but is packaged with apt and can be used by adding event_activation = 0 configuration line in LVM configuration file (/etc/lvm/lvm.conf). This configuration file is loaded during the initialisation phase of LVM (source). Once "enabled", this generator generates systemd mount units for each /etc/fstab entry (in /run/systemd/generator/ directory) and the system starts correctly.
tigerblue77
  • 31
  • 1
  • 3