Move LVM disk from VM to container

johen

Member
Mar 27, 2022
17
1
8
HI all,

I tried to reassign the LVM disk from a VM to a container but fail - during startup it complains about wrong fs.
Code:
lxc-start 109 20220918083546.325 DEBUG    conf - ../src/lxc/conf.c:run_buffer:310 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 109 lxc pre-start produced output: mount: /var/lib/lxc/.pve-staged-mounts/mp0: wrong fs type, bad option, bad superblock on /dev/mapper/pve0--hdd2T-vm--109--disk--0, missing codepage or helper program, or other error.

When I run
Code:
lsblk -o NAME,FSTYPE
I notified that all LVM disk for VMs don't show any FSTYPE but I struggle to understand this.. why is there a difference?
Any additional step required to make the container being able to use this LVM disk ?

Reference (vm to vm), which I followed: https://pve.proxmox.com/wiki/Moving_disk_image_from_one_KVM_machine_to_another

thanks
Jochen
 
Last edited:
Ok I think I found the missing puzzle
the vm disks have a GPT where container disk are directly the partition

fdisk -l

Code:
Disk /dev/pve0-hdd2T/vm-110-disk-0: 1.82 TiB, 2000401989632 bytes, 3907035136 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disklabel type: gpt
Disk identifier: 3F89406B-00B9-4FBF-B544-E7F4502D906A

Device                          Start        End    Sectors  Size Type
/dev/pve0-hdd2T/vm-110-disk-0p1  2048 3907029134 3907027087  1.8T Linux filesystem

to mount a partition inside a vm disk
kpartx -av dev
can be used