Making a backup
Boot the system rescue cd ISO and follow the directions until you get to a shell.
Make a directory to mount a remote filesystem
mkdir /sshfs
mount a remote filesystem with sshfs
sshfs user@ip:/dir/to/mount /sshfs
Make the image and compress with gzip. If you are not using virtio-disk, replace vda with sda or hda
dd if=/dev/vda|gzip>/sshfs/hostname.img.gz
This will take a while depending on the size of your drive, how much data is stored and network speeds. After it finishes, unmount the ISO and reboot your VM.
Restoring a backup
To restore, boot the system rescue CD ISO and follow all the directions until you get a shell and remake a directory to mount the same remote filesystem
mkdir /sshfs
mount the remote filesystem with sshfs
sshfs user@ip:/dir/to/mount /sshfs
Now we restore the backup
gunzip -c /sshfs/hostname.img.gz|dd of=/dev/vda
After it finishes, unmount the ISO and reboot the VM.
本文作者: GavinDong
版权属于: GavinDong博客
文章链接: https://gavindong.com/1889.html
如果使用过程中遇到问题,可 **点击此处** 交流沟通。
版权所有,转载时必须以链接形式注明作者和原始出处及本声明。
评论列表(2条)
参考:http://pof.eslack.org/2010/12/23/best-solution-to-fully-backup-kvm-virtual-machines/
原文:https://www.realwebsolution.in/clients/knowledgebase.php?action=displayarticle&id=27