[SOLVED] get .raw from local-lvm

maurolucc

Member
Dec 1, 2017
30
0
6
32
Hello everyone,

can someone tell me how can I get the .raw of an image that is in a local-lvm?

I would like to get it to send it through scp to another pc as a backup. I'd prefer doing it in this way to have the image and not a snapshot.

Thanks
 
Hi,

First some hints:
* You always need to shutdown the VM / CT if you backup with this method, else you will get inconsistent data.
* maybe take look at rsync, if not already, could make this faster.

One method which would allow to make backups through PVE to the other machine as it is an shared storage would be sshfs, it's a user space file system over ssh (duh), not the fastest but for backups it could be enough, specially if your other host is in the LAN.

To get back to your original question: you could use the `dd` unix tool for this.

First get the path of your desired disk, this can be done also with pvesm:
Code:
# pvesm path STORAGE:DISK
e.g.:
# pvesm path local-lvm:vm-101-disk-1
/dev/pve/vm-101-disk-1

Then just point the input file (if) option of dd to the path you got from above, pipe the output over SSH to another dd command with the respective output option, e.g.:

Code:
dd if=/dev/pve/vm-101-disk-1 | ssh user@otherhost -- dd of=image.raw

You could throw in compression if you like, see: https://unix.stackexchange.com/a/132800
 
U save my day t.lamprecht. thanks a lot to share.
I use this code to get a raw to share stogare in Proxmox
dd if=/dev/pve/vm-ID-disk-1 | dd of=/mnt/pve/{name of share stogare}/images/vm-ID-disk-1.raw
 
Hi,

First some hints:
* You always need to shutdown the VM / CT if you backup with this method, else you will get inconsistent data.
* maybe take look at rsync, if not already, could make this faster.

One method which would allow to make backups through PVE to the other machine as it is an shared storage would be sshfs, it's a user space file system over ssh (duh), not the fastest but for backups it could be enough, specially if your other host is in the LAN.

To get back to your original question: you could use the `dd` unix tool for this.

First get the path of your desired disk, this can be done also with pvesm:
Code:
# pvesm path STORAGE:DISK
e.g.:
# pvesm path local-lvm:vm-101-disk-1
/dev/pve/vm-101-disk-1

Then just point the input file (if) option of dd to the path you got from above, pipe the output over SSH to another dd command with the respective output option, e.g.:

Code:
dd if=/dev/pve/vm-101-disk-1 | ssh user@otherhost -- dd of=image.raw

You could throw in compression if you like, see: https://unix.stackexchange.com/a/132800
please need your help for recovery my VM with movies, i change the name of the node and cant find the vm
 
please need your help for recovery my VM with movies, i change the name of the node and cant find the vm
Please open a new thread. It might be enough to move some files from old node directory in /etc/pve/nodes to the new one (take care to not overwrite anything).