Restore individual disk from PBS

kurdam

Member
Sep 29, 2020
44
1
13
33
Hi,
I'm creating this topic because we have a bit of a problem.
We have a big machine that we use as a NAS (FreeNAS) that has 11G on the first drive and 700G on the second drive.
Lately we have experienced a lot of problems with that machine (freezes after backups followed by a reset that more often that not bricks the machine completely forcing us to restore the entire machine (which can take up to 8 hours))
What i would like is to be able to restore just the first disk, that contains the OS to save 7h45 on my restore.

i tried to look a bit into that and all i could find is this topic : https://forum.proxmox.com/threads/restore-single-virtual-disk-from-pbs.95868/
and this documentation : https://pbs.proxmox.com/docs/backup-client.html#restoring-data:~:text=text > qrkey.txt-,Restoring Data,-¶

I tried to follow a bit but i can't manage to do it.

Is there a way to explain to me how to form the proxmox-backup-client restore command ? and maybe plan to add it in the gui when you restore a machine with a selection (full restore/single disk)?

Thank you in advance.
Thomas
 

Attachments

  • Capture2.PNG
    Capture2.PNG
    11.5 KB · Views: 6
the man page of the client could be helpful here: `man proxmox-backup-client`

basically you have to give the snapshot, archive and target, e.g.

Code:
proxmox-backup-client restore vm/100/2022-01-01T00:00:00Z drive-scsi0.img.fidx /path/to/target/drive.img

(you also have to give the correct user/password/repository of course, see https://pbs.proxmox.com/docs/backup-client.html for more info)
 
So the command would look like this ? : proxmox-backup-client restore vm/1015/2022-01-01T00:00:00Z drive-scsi0.img.fidx /dev/EQ3-LVM-VG/drive-scsi0.img

From what i can see, when i go in the LVM in question i don't see all my disks and all of them don't have the same attributes i don't know why.

LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
EQ3-LVM-TP EQ3-LVM-VG twi-aot--- 1.06t 0.00 10.42
vm-100-disk-0 EQ3-LVM-VG -wi-ao---- 10.00g
vm-1003-disk-0 EQ3-LVM-VG -wi------- 20.00g
vm-101-disk-0 EQ3-LVM-VG -wi-a----- 10.00g
vm-1014-disk-0 EQ3-LVM-VG -wi------- 56.00g
vm-1015-disk-0 EQ3-LVM-VG -wi------- 50.00g
vm-1015-disk-1 EQ3-LVM-VG -wi------- 75.00g
vm-1018-disk-0 EQ3-LVM-VG -wi------- 55.00g
vm-105-disk-0 EQ3-LVM-VG -wi-ao---- 10.00g
vm-108-disk-0 EQ3-LVM-VG -wi-ao---- 10.00g
vm-2000-disk-0 EQ3-LVM-VG -wi------- 75.00g
vm-2001-disk-0 EQ3-LVM-VG -wi------- 10.00g
vm-2002-disk-0 EQ3-LVM-VG -wi------- 20.00g
vm-2004-disk-0 EQ3-LVM-VG -wi------- 50.00g
vm-2005-disk-0 EQ3-LVM-VG -wi------- 10.00g
vm-500-disk-0 EQ3-LVM-VG -wi------- 60.00g
vm-501-disk-0 EQ3-LVM-VG -wi------- 40.00g
vm-502-disk-0 EQ3-LVM-VG -wi------- 30.00g
vm-503-disk-0 EQ3-LVM-VG -wi------- 10.00g
vm-506-disk-0 EQ3-LVM-VG -wi------- 20.00g
vm-508-disk-0 EQ3-LVM-VG -wi------- 30.00g
vm-511-disk-0 EQ3-LVM-VG -wi------- 30.00g
vm-513-disk-0 EQ3-LVM-VG -wi------- 10.00g
vm-515-disk-0 EQ3-LVM-VG -wi-ao---- 32.00g
vm-518-disk-0 EQ3-LVM-VG -wi------- 75.00g
vm-519-disk-0 EQ3-LVM-VG -wi------- 75.00g
vm-520-disk-0 EQ3-LVM-VG -wi------- 500.00g
vm-521-disk-0 EQ3-LVM-VG -wi------- 75.00g
vm-522-disk-0 EQ3-LVM-VG -wi------- 200.00g
vm-523-disk-0 EQ3-LVM-VG -wi------- 75.00g
vm-525-disk-0 EQ3-LVM-VG -wi------- 75.00g
vm-528-disk-0 EQ3-LVM-VG -wi------- 75.00g
vm-529-disk-0 EQ3-LVM-VG -wi-ao---- 75.00g
vm-533-disk-0 EQ3-LVM-VG -wi-ao---- 10.00g
vm-534-disk-0 EQ3-LVM-VG -wi-ao---- 10.00g
vm-537-disk-0 EQ3-LVM-VG -wi-ao---- 10.00g
vm-538-disk-0 EQ3-LVM-VG -wi------- 10.00g
vm-541-disk-0 EQ3-LVM-VG -wi------- 200.00g
vm-545-disk-0 EQ3-LVM-VG -wi-a----- 60.00g
vm-546-disk-0 EQ3-LVM-VG -wi------- 60.00g
vm-547-disk-0 EQ3-LVM-VG -wi------- 60.00g

/dev/EQ3-LVM-VG# ls -la
total 0
drwxr-xr-x 2 root root 240 Sep 13 00:06 .
drwxr-xr-x 24 root root 5680 Sep 13 00:06 ..
lrwxrwxrwx 1 root root 7 Sep 12 23:04 vm-100-disk-0 -> ../dm-6
lrwxrwxrwx 1 root root 8 Sep 12 23:04 vm-101-disk-0 -> ../dm-45
lrwxrwxrwx 1 root root 7 Sep 13 00:06 vm-105-disk-0 -> ../dm-1
lrwxrwxrwx 1 root root 7 Sep 13 00:07 vm-108-disk-0 -> ../dm-0
lrwxrwxrwx 1 root root 7 Sep 12 13:52 vm-515-disk-0 -> ../dm-7
lrwxrwxrwx 1 root root 8 Sep 12 18:01 vm-529-disk-0 -> ../dm-10

I think the documentation is a bit light. It needs a proper example of a single disk restore.
Is it possible to ask that this functionality to be added in the roadmap ?
It would change a lot of things for us to be able to do a single disk restore via the GUI, and i think i'm not the only one.
It's bothersome to have to restore all the machine each time. We work a lot with a system drive and a data drive on our VM.


Thanks again for your help
Regards,

Thomas
 
So the command would look like this ? : proxmox-backup-client restore vm/1015/2022-01-01T00:00:00Z drive-scsi0.img.fidx /dev/EQ3-LVM-VG/drive-scsi0.img
no since the lvm(thin) ist not a file but a volume that you would have to create first

in that case it would probably be easier to restore to a (temporary) file and use 'qm importdisk' to bring it to the storage you want

I think the documentation is a bit light. It needs a proper example of a single disk restore.
Is it possible to ask that this functionality to be added in the roadmap ?
It would change a lot of things for us to be able to do a single disk restore via the GUI, and i think i'm not the only one.
It's bothersome to have to restore all the machine each time. We work a lot with a system drive and a data drive on our VM.
sure, the best way is to open a feature/enhancement request on https://bugzilla.proxmox.com
 
CLI pbs-restore works too , here example from PVE with PBS alongside VE, replace 127.0.0.1 by PBS ip.
restored directly on an empty LVMthin volume created in PVE after original disk detached ...
Code:
export PBS_PASSWORD=xxx
export PBS_FINGERPRINT=paste_from_your_PBS
pbs-restore --repository root@pam@127.0.0.1:pbs-datastore vm/XXX/2023-09-11T17:30:04Z drive-scsi0.img.fidx /dev/pve/vm-XXX-disk-0 --verbose --format raw --skip-zero
 
  • Like
Reactions: tuxick and DC-CA1
CLI pbs-restore works too , here example from PVE with PBS alongside VE, replace 127.0.0.1 by PBS ip.
restored directly on an empty LVMthin volume created in PVE after original disk detached ...
Code:
export PBS_PASSWORD=xxx
export PBS_FINGERPRINT=paste_from_your_PBS
pbs-restore --repository root@pam@127.0.0.1:pbs-datastore vm/XXX/2023-09-11T17:30:04Z drive-scsi0.img.fidx /dev/pve/vm-XXX-disk-0 --verbose --format raw --skip-zero

do you want me to do those 2 commands in CLI from PBS ? or from PVE ?

i dont understand why they are in 3 differents commands line
 
do you want me to do those 2 commands in CLI from PBS ? or from PVE ?

i dont understand why they are in 3 differents commands line
This would be a script that you run *in the running VM*. You can probably specify what's in the export commands in the final command.

If the VM is not bootable, then you have to boot from a live linux installer, or something else that gives you a linux terminal.
Install proxmox-backup-client in the VM.
Then run the script in the VM.

I don't know what "pbs-restore" is. Never ran across it. My script runs "proxmox-backup-client restore" etc.
For details, read the PBS documentation if you haven't already done so.
 
do you want me to do those 2 commands in CLI from PBS ? or from PVE ?

i dont understand why they are in 3 differents commands line
as written, from PVE, from a PVE shell, command after command, the first are just to set variable for pbs-restore cli.
but be careful, detach current vDisk if you want to keep as rollback, or it will be overwrited.
Restore can be only done over existant vDisk, so need to create a fresh new one if you detach existing disk.
(sorry for my wording...)
 
Last edited:
  • Like
Reactions: EllyMae
CLI pbs-restore works too , here example from PVE with PBS alongside VE, replace 127.0.0.1 by PBS ip.
restored directly on an empty LVMthin volume created in PVE after original disk detached ...
Code:
export PBS_PASSWORD=xxx
export PBS_FINGERPRINT=paste_from_your_PBS
pbs-restore --repository root@pam@127.0.0.1:pbs-datastore vm/XXX/2023-09-11T17:30:04Z drive-scsi0.img.fidx /dev/pve/vm-XXX-disk-0 --verbose --format raw --skip-zero
I noticed
Code:
proxmox-backup-client snapshot  list
shows image names without the .fidx bit, so i needed to add 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!