I’m testing restoring rsync backup from TrueNAS Scale. But one obstacle is that TrueNAS scale doesn’t install LVM2 tool. I can’t mount lvs/vgs in the target restore drive. I can’t do apt-get.
How to hack it?
The AI RAG from TrueNAS Documentation Hub suggests me to do it from a VM and passthrough my USB hard drive hooking to the NAS. But this sounds silly.
The ChatGPT suggest me to do it inside a ubuntu container:
# Run Ubuntu container with LVM access
docker run -it --privileged \
-v /dev:/dev \
-v /mnt:/host-mnt \
ubuntu:22.04 bash
# Inside container:
apt update && apt install lvm2
I entered into the ubuntu container. But it immediately got bitten by the fact TrueNAS kernel doesn’t have device-mapper driver. I bet this won’t fly in VM case, either.
root@0fcc857f2579:/host-mnt/tank/linux-backup/t30# lvs
/dev/mapper/control: open failed: No such device
Failure to communicate with kernel device-mapper driver.
Check that device-mapper is available in the kernel.
Incompatible libdevmapper 1.02.175 (2021-01-08) and kernel driver (unknown version).
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lv_home vg_2tb_hd -wi-XX---- <215.03g
lv_root vg_2tb_hd -wi-XX---- 200.00g
lv_swap vg_2tb_hd -wi-XX---- 64.00g
lv_var vg_2tb_hd -wi-XX---- 400.00g
Why TrueNAS Scale doesn’t support LVM and device/mapper in the kernel OTB? Not everyone can afford 10GB Ethernet setup. When I do restore, I prefer to hook up a USB3 hard drive. It is faster than 1GB Ethernet or 2.5GB Ethernet.