Move LVM disk from VM to container

johen

Member
Mar 27, 2022
17
0
6
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
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!