When the rescue environment, you can make an offline backup of the entire boot disk, or of some of the partitions on it. This backup file can then be used to restore a partition whose boot disk has become corrupted to the point where it will not boot and is too badly corrupted to repair by manipulation of the file systems from the rescue environment. The backup and restore process takes advantage of the fact that the rescue environment is not stored on the partition boot disk, but instead runs in RAM and thus does not depend on any files on the boot disk.
The following tools are available in the <path> of the rescue environment:
dd – Sector level backup or restore
fsarchiver – File system level backup or restore
tar – File level backup or restore
cpio – File level backup or restore
zip – pkzip compressor
gzip – gzip compressor (typically the fastest)
pigz – Multithreaded gzip compressor
bzip2 – bzip2 compressor
xz – xz compressor (typically the smallest file size)
pixz – Multithreaded xz compressor (similar to xz -T0)
If you prefer a tool that not present, install the tool of your choice.
Example
A simple example for making a full backup of the boot disk:
Boot the partition into the Linux rescue environment and access the partition boot disk.
For more information, see Starting a Linux Partition Image in Rescue Mode and Accessing the Linux Partition Boot Disk in the Rescue Environment.
Configure the rescue environment for accessing the network to read or write files.
For more information, see Configuring the Network Adapter in the Rescue Environment.
Mount the remote directory to which you want to write the backup file. For example, to mount a Windows share named BackupShare located at 192.59.240.12, use the following command:
mount //192.59.240.12/BackupShare /mnt –o user=foo,domain=bar
Or to mount an exported NFS directory named BackupExport located at 192.59.240.18, use the following command:
mount.nfs 192.59.240.18:/BackupExport /mnt
Write the contents of the boot disk to the remote directory:
dd if=/dev/sda | xz –czT 0 > /mnt/backup-1.xz