How to backup entire disk using dd on Linux

How to backup entire disk using dd on Linux

Welcome to BestBackup.Site. The dd command is a powerful and popular utility among Linux users. With this tool we can clone and backup our disk to another disk or to a disk image. dd stands for “data duplicator” which is used for copying and converting data.

Here are some usage examples of dd

  • Backup and restore entire disk
  • Backup MBR (Master Boot Record)
  • Create Linux Live USB from ISO image

Because dd is so powerful, we need to be careful when using it. If you use it wrong way, you may lose your data in your disks.

How to backup entire disk using dd command

dd is available for Linux only. So I assume you are on a Linux when using dd command. I use Debian 9 on this tutorial.

dd syntax

dd if=<source file name> of=<target file name> [Options]

Example 1 (Clone disk):

dd if=/dev/sda of=/dev/sdb

The above command will clone disk 1 (/dev/sda) to disk 2 (/dev/sdb). This is great if you want to clone your existing OS to multiple disks. In case you need to build many computers with the same OS and application installed. The command above can be executed on the fly, when the system is running.

Example 2 (Backup to disk image):

dd if=/dev/sda of=/mnt/sda.img

The command above will backup the entire disk of /dev/sda into an image called sda.img inside /mnt directory.

With a high precautions, we can have a free and powerful backup tool with dd. In case of operating system won’t boot, the backup will do it’s job.

No Responses

Write a response

This site uses Akismet to reduce spam. Learn how your comment data is processed.