How to copy images of your server’s partitions to another server
Warning: Should you not have the expertise to perform these tasks please consult with your system administrator.
Copy images of your server’s partitions to another server with the Linux Rescue System using sshfs and part image:
- Install sshfs in the Linux Rescue System and load the fuse module to mount a foreign directory on a server using ssh.
root@jarvis ~ # apt-get update
root@jarvis ~ # apt-get install sshfs
root@jarvis ~ # modprobe fuse
- Mount an encrypted directory from the remote server.
root@jarvis ~ # sshfs email@example.com:/directory/on/remote/server/ /mnt
- Use partimage available within the Linux Rescue System to backup partitions:
root@jarvis ~ # partimage
- Choose the partition your wish to save/restore and insert the name of the image file and its path.
Alternatives to sshfs are NFS or SMB/CIFS mounts. Since neither of them are very common on the average Linux server and for the encryption that sshfs offers, sshfs is usually the best choice.
- Use dd to copy the entire hard drive instead of copying single partitions.
- dd copies on a per block basis. If it encounters an error, the program terminates (should this be the case, you can use dd_rescue).
- Take care to use the right device names for if= and of=, to avoid deleting all data accidently.
- dd copies empty parts of the hard drive (which may be unnecessary).