Linux Troubleshooting

Backing and Restoring up Harddiscs

    1. Start a Shell as user root.

    2. Select your source device. Typically this is something like /dev/sda (labeled as SOURCE).

    3. Decide where you want to store your image (labeled as BACKUP_PATH). It must be different from your source device. In other words: if you make a backup from /dev/sda, your image file must not be stored under /dev/sda.

    4. Run the commands to create a compressed image file:

      1. dd if=/dev/SOURCE | gzip > /BACKUP_PATH/image.gz

    5. Restore the hard disk with the following commands:

      1. gzip -dc /BACKUP_PATH/image.gz | dd of=/dev/SOURCE

If you only need a partition to backup, replace the SOURCE placeholder with your respective partition. In this case, your image file can lie on the same hard disk, but on a different partition.