What is the best way to copy the proxmox pve/root partition somewhere else ?

shodan

Active Member
Sep 1, 2022
342
79
48
I need to copy my proxmox root, file by file, not as a block device.

I found these commands
Code:
  1) cp -a --sparse=always --one-file-system
  2) tar via intermediate archive
  3) tar via pipe
  4) rsync -aHAXxS --numeric-ids --info=progress2

Are all of these going to give the same results ?
Is there a better method then these ?
thanks !
 
I need to copy my proxmox root, file by file, not as a block device.

I found these commands
Code:
  1) cp -a --sparse=always --one-file-system
  2) tar via intermediate archive
  3) tar via pipe
  4) rsync -aHAXxS --numeric-ids --info=progress2

Are all of these going to give the same results ?
Is there a better method then these ?
thanks !
Those will mostly give the same results. Which one is best would be down to what you know how to do, and details about how you are doing it. In most cases I would use some variant of the rsync command. The ability to resume from being interrupted, is really nice. Also rsync can handle source and destination in the same machine, or destination is remote over the network really well with only small changes to the command.

Aside from rsync, the switches you give tar will decide if it handles sparse files similar to your cp command, and if it stays within one filesystem. If rsync isn't an option, cp is easier for when both disks are mounted locally, and tar piped over the network to remote tar when they aren't. And if the destination is a tape drive, tar is probably only one that will work.