[SOLVED] Restore .img from PBS to a /dev/sda

Jul 20, 2022
133
8
18
I have a PBS backup like this:
Screenshot from 2023-06-04 01-47-07.png
It was created thusly:
export PBS_PASSWORD=<password> export PBS_REPOSITORY=dan1@pbs@192.168.1.50:PBS proxmox-backup-client backup \ system.img:/dev/disk/by-id/ata-1TB_SATA_SSD_AF20011703077 \ --keyfile=/etc/priv/PBS.enc \ --ns=rocky

And, I have a VM on the same Proxmox host that has a blank disk /dev/sda. This VM is booted from a USB drive that has proxmox-backup-client installed.

I'm trying to figure out the command that will restore the image backup to /dev/sda.

Here's what I have so far:
sudo proxmox-backup-client restore \ host/PBSclient/2023-05-26T04:10:02Z \ system.img \ /dev/sda \ --repository dan1@pbs@192.168.1.50:PBS \ --keyfile=/etc/priv/PBS.enc \ --ns rocky

Here's what happens:
Password for "dan1@pbs": *********** storing login ticket failed: $XDG_RUNTIME_DIR must be set Using encryption key from '/etc/priv/PBS.enc'.. Fingerprint: 1e:f6:69:0e:05:61:5c:bb Error: unable to create target file "/dev/sda" - File exists (os error 17)

How do I specify the target?

Thanks. :)
 
Last edited:
Ok. This is what I ended up with. I guess the backup command accepts a block device as input, but the restore command does NOT accept a block device as output. So, I piped it to dd.
export PBS_PASSWORD=<password> export PBS_REPOSITORY=dan1@pbs@192.168.1.50:PBS # restore proxmox backup image: sudo -E proxmox-backup-client restore \ host/PBSclient/2023-05-26T04:10:02Z \ system.img \ - \ --keyfile=/etc/priv/PBS.enc \ --ns rocky \ | sudo dd of=/dev/sda bs=256M status=progress

I did not need to boot this image, so that part was not tested.
 
  • Like
Reactions: fabian

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!