Hi,
I've tried to find some info about bare metal backup/recovery of proxmox installation (with ZFS). After searching and lot of trying I came up with some "walkthrough", although not a real bare metal. The scripts etc. are gathered from lot of places (also this forum) and updated for my needs. I've tested it (but not in depth) and would like to know opinions if I've got something wrong:
- Make the backup of the root with the given script (.txt files are only if something goes wrong when creating the rpool).
- Start proxmox liveCD, install as ZFS zraid0 (or other configuration). Reboot.
- Start proxmox liveCD debug, ctrl+D on first console. Then "Abort" on first screen.
- Reboot.
The root system should be in the state, when the snapshot has been produced.
Thank you
I've tried to find some info about bare metal backup/recovery of proxmox installation (with ZFS). After searching and lot of trying I came up with some "walkthrough", although not a real bare metal. The scripts etc. are gathered from lot of places (also this forum) and updated for my needs. I've tested it (but not in depth) and would like to know opinions if I've got something wrong:
- Make the backup of the root with the given script (.txt files are only if something goes wrong when creating the rpool).
Code:
# /bin/bash
BACKUP_LOC=/tmp/zfs_backup
mkdir $BACKUP_LOC
zpool get all rpool > $BACKUP_LOC/zpool.txt
zpool list > $BACKUP_LOC/zpool.list.txt
zfs list -r rpool > $BACKUP_LOC/zpool.list.rpool.txt
zfs snapshot -r rpool@rpool.snap
zfs destroy rpool/swap@rpool.snap
zfs send -Rv rpool@rpool.snap > $BACKUP_LOC/backup.zfs
for snap in `zfs list -H -t snapshot | grep "@rpool.snap" | cut -f 1`; do echo -n "Destroying $snap..."; zfs destroy $snap; echo " Done."; done
- Start proxmox liveCD, install as ZFS zraid0 (or other configuration). Reboot.
- Start proxmox liveCD debug, ctrl+D on first console. Then "Abort" on first screen.
Code:
$ zpool import -R /mnt rpool
$ zfs receive rpool < /path/to/zfs/rpool/full/snapshot
$ mount -t proc /proc /mnt/proc
$ mount --rbind /dev /mnt/dev
$ mount --rbind /sys /mnt/sys
$ chroot /mnt /bin/bash
(chroot)$ source /etc/profile
(chroot)$ grub-install /dev/your/main/disk
(chroot)$ update-grub2
(chroot)$ update-initramfs -u
- Reboot.
The root system should be in the state, when the snapshot has been produced.
Thank you