Master Linux Backups with dd: 6 Practical Examples
Learn how to protect critical data on Linux by using the powerful dd command, with six detailed examples covering full-disk cloning, image creation, partition backup, floppy and CD ISO imaging, and essential options like conv=noerror and bs for reliable, low-level backups.
Example 1: Backup an entire disk
Use dd to copy the whole source disk (/dev/sda) to another disk (/dev/sdb). The basic command is: # dd if=/dev/sda of=/dev/sdb Adding conv=noerror lets the copy continue despite read errors, and sync pads each block to keep data aligned.
# dd if=/dev/sda of=/dev/sdb conv=noerror,syncExample 2: Create a disk image
Generate an image file of a disk and store it on another storage device. This method is fast and easy to restore later.
# dd if=/dev/sda of=sdadisk.imgExample 3: Restore a disk image
Write a previously created image file back to a disk, effectively restoring its contents.
# dd if=sdadisk.img of=/dev/sdbExample 4: Create a floppy image
Back up a floppy disk by creating an image file. Specify the floppy device as the input and the desired image filename as the output.
# dd if=/dev/sda1 of=~/partition1.imgExample 5: Backup a partition
Copy a specific partition to an image file, which can later be used for restoration or cloning.
# dd if=/dev/sda1 of=~/partition1.imgExample 6: Create a CD ISO image
Use dd to create an ISO file from a CD-ROM. The block size is set to 2048 bytes, which matches the standard CD sector size. # dd if=/dev/cdrom of=tgsservice.iso bs=2048 Before creating the ISO, ensure the CD is unmounted to avoid unnecessary access.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
