4.6 KiB
User:
I created LXC backups in proxmox and now want to copy them from the server to my laptop. How can I do this?
Ellama:
Congratulations on creating LXC backups in Proxmox! To copy the backups from your server to your laptop, you have a few options:
Method 1: Using SCP (Secure Copy)
- Install an SSH client on your laptop: You'll need an SSH client like OpenSSH (comes
pre-installed on Linux and macOS) or PuTTY (for Windows).
- Identify the backup files: In Proxmox, go to the backups tab and identify the LXC backups you
created. Note the file paths and names.
- Open a terminal/command prompt on your laptop: Navigate to the directory where you want to save
the backups.
- Use SCP to copy the backups: Run the following command, replacing
<username>with your SSH
username, <server_ip> with your Proxmox server's IP address, and <backup_file> with the path and
name of the backup file:
scp <username>@<server_ip>:/<path_to_backup_file> <local_save_directory>
Example:
scp root@192.168.1.100:/var/lib/vz/lxc/backup/ CTX101_20230205_1200.tar.gz ~/Backups
- Enter your SSH password: You'll be prompted to enter your SSH password.
Method 2: Using RSYNC
- Install RSYNC on your laptop: You'll need to install RSYNC on your laptop.
- Identify the backup files: In Proxmox, go to the backups tab and identify the LXC backups you
created. Note the file paths and names.
- Open a terminal/command prompt on your laptop: Navigate to the directory where you want to save
the backups.
- Use RSYNC to copy the backups: Run the following command, replacing
<username>with your SSH
username, <server_ip> with your Proxmox server's IP address, and <backup_file> with the path and
name of the backup file:
rsync -avz <username>@<server_ip>:/<path_to_backup_file> <local_save_directory>
Example:
rsync -avz root@192.168.1.100:/var/lib/vz/lxc/backup/CTX101_20230205_1200.tar.gz ~/Backups
- Enter your SSH password: You'll be prompted to enter your SSH password.
Method 3: Using a GUI SFTP client (e.g., FileZilla)
- Install a GUI SFTP client: You can use FileZilla (free) or another GUI SFTP client.
- Configure the SFTP client: Set up the client with your Proxmox server's IP address, username,
and password.
- Connect to the server: Establish a connection to your Proxmox server using the SFTP client.
- Navigate to the backup files: Find the LXC backups in the SFTP client's file explorer.
- Download the backup files: Select the backup files and download them to your laptop.
Please make sure to use the correct username, server IP, and file paths to avoid any issues during the transfer process.
User:
I know how to use ssh and rsync. How can I access the backups on lvm?
Ellama:
Since you're familiar with SSH and RSYNC, let's focus on accessing the backups stored on the LVM (Logical Volume Manager) in Proxmox.
Accessing LXC backups on LVM
By default, Proxmox stores LXC backups on a dedicated LVM volume, which is not directly accessible via SSH or RSYNC. To access the backups, you'll need to:
- Identify the LVM volume: In Proxmox, go to Datacenter > Storage and find the LVM volume
used for backups. Note the volume name, e.g., pve/lxc-backup.
- Activate the LVM volume: SSH into your Proxmox server and activate the LVM volume:
ssh <username>@<server_ip>
Once connected, run:
lvchange -ay pve/lxc-backup
Replace pve/lxc-backup with the actual volume name you identified earlier.
- Mount the LVM volume: Create a mount point and mount the LVM volume:
mkdir /mnt/lxc-backup
mount /dev/pve/lxc-backup /mnt/lxc-backup
Again, replace pve/lxc-backup with the actual volume name.
Now, you can access the backups
You can now access the LXC backups stored on the LVM volume. You can use RSYNC or SCP to copy the backups to your laptop.
Example using RSYNC:
rsync -avz /mnt/lxc-backup/CTX101_20230205_1200.tar.gz ~/Backups
Example using SCP:
scp /mnt/lxc-backup/CTX101_20230205_1200.tar.gz ~/Backups
Remember to replace CTX101_20230205_1200.tar.gz with the actual name of the backup file you want
to transfer.
Once you've transferred the backups, don't forget to unmount the LVM volume:
umount /mnt/lxc-backup
And deactivate the volume:
lvchange -an pve/lxc-backup
This ensures the LVM volume is not left in an active state.
Now you should be able to access and transfer your LXC backups stored on the LVM volume!