Hi all,
I need some information/help to solve a problem. I backup my VM daily
using rsync, and I have been meaning to test the restore process, but
life got in the way. Until this week.
Bottom line, restore appears to set all the files correctly, I re-setup
grub, but restored machine will not boot.
What I am doing. I use a keyfile to ssh into the VM as root, and run the
following to take the backup.
#!/bin/bash
rsync -aAXv \
--delete-during \
--exclude=/swapfile \
--exclude=/dev \
--exclude=/lost+found \
--exclude=/media \
--exclude=/mnt \
--exclude=/proc \
--exclude=/run \
--exclude=/tmp \
--exclude=/var/log \
--exclude=/home/*/.cache \
--exclude=/sys \
--exclude=/var/lib/lxcfs \
root@ianhobson.co.uk:/* /home/ian/BackupFiles/hobson42
For the restore, I manually:
1) Created a proxmox VM to restore to.
2) Install the same version of the O/S (Ubuntu 20.04.06) as the live VPS.
3) Set up passwordless access for root, from the backup machine into the
restore machine.
4) Run the following as root
rsync -aAXv \
--exclude=/home/ian/BackupFiles/hobson42/etc/hostname \
--exclude=/home/ian/BackupFiles/hobson42/etc/hosts \
--exclude=/home/ian/BackupFiles/hobson42/etc/netplan/* \
--exclude=/home/ian/BackupFiles/hobson42/boot/*
--exclude=/home/ian/BackupFiles/hobson42/boot/grub/*
/home/ian/BackupFiles/hobson42/* root@europa.hcs:/
The excludes are to stop the IP, and hostname being changed.
5) I then run the following as root on restored machine.
grub-mkconfig > /boot/grub/grub.cfg
6) Tried to log in. Saw all users (restore has gui)
but logging in produced a quick error popup, which was so
fast I could not read a word. Then got the usernames again.
7) SSHed in OK, and checked the files - they seem OK.
8) Reboot. This shows the grub menu, but when I select ubuntu
I get a black screen - and nothing further.
I have tried omitting the excludes of boot - same result.
Thoughts:
Restore is to VM under proxmox and not xen. Significant?
Do I need to edit something in /etc/grub.d?
Have I missed something blindingly obvious?
Ideas very welcome. A backup that I can't restore is about as useful as
a chocolate tea pot!
Regards
Ian
--
Ian Hobson
Tel (+66) 626 544 695