How to copy a virtual disk from a thin pool?

nta

Active Member
Jan 21, 2017
13
0
41
64
I am trying to copy the virtual disk that was created by PVE floor a VM. I'm bored off a Ubuntu live cd, and I would like to copy the disk image to an external drive. I can see the volumes, but I'd like to copy the image as a single file. How can I do that?
I'm used to the image on the old versions, but I'm completely new to thin pools. Can I still move the contents as one file as before?
Is it possible to mount the thin pve data lv?
 
I'm not sure if by old images you mean a qcow2 file or regular LVM so first: for most purposes you can consider the thin volumes as being regular LVM logical volumes. This means you'll find them as block devices in /dev/pve/ or /dev/mapper/ just as you would find other LVs once they're activated.
For your purposes these can be treated as .raw files, meaning you can copy them directly, but note that with most copying tools they won't be "thin" anymore. (So eg. with dd you'll probably want to use conv=sparse to save some space).

Alternatively you can use the PVE GUI or CLI to convert the disk to a .qcow2 file first via the Move Disk command.

But since you're mentioning an ubuntu live CD - in case you're recovering data from a PVE installation which doesn't exist anymore, you can convert them with the `qemu-img` tool like this:
$ qemu-img convert -f raw -O qcow2 /dev/pve/$VOLNAME /desired/destination.qcow2
 
you'll find them as block devices in /dev/pve/ or /dev/mapper/
To make sure I'm not misunderstanding, I should find the volumes as files under /dev/pve/?

live CD - in case you're recovering data from a PVE installation which doesn't exist anymore, you can convert them with the `qemu-img` tool
Would qemu-img be on the cd, if not, how would I get it?

Țhank you for your comprehensive answer.
 
To make sure I'm not misunderstanding, I should find the volumes as files under /dev/pve/?
Yes, if they were indeed thin-volumes you should see them there after activating the pve volume group.
Would qemu-img be on the cd, if not, how would I get it?
I think it's usually in the qemu-utils package, so you'd have to install that.
 

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!