Operations 5 min read

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.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Master Linux Backups with dd: 6 Practical Examples

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,sync

Example 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.img

Example 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/sdb

Example 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.img

Example 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.img

Example 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.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

System Administrationdddisk cloning
Liangxu Linux
Written by

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.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.