Practical Usage Examples
1. Disk Backup and Cloning
Full Disk Backup
dd if=/dev/sda of=/backup/full_disk.img bs=4M status=progress
Partition-specific Backup
dd if=/dev/sda1 of=/backup/root_partition.img bs=1M status=progress
2. Creating Bootable USB Drives
ISO to USB Conversion
dd if=ubuntu-22.04.iso of=/dev/sdx bs=4M status=progress oflag=sync
3. Secure Data Wiping
Zero-fill Entire Disk
dd if=/dev/zero of=/dev/sda bs=1M status=progress
Random Data Overwrite
dd if=/dev/urandom of=/dev/sda bs=1M status=progress
4. File Conversion and Manipulation
dd if=input.bin of=output.bin conv=swab bs=1M
Split Large Files
dd if=largefile.bin of=chunk bs=1M count=100
Usage Scenarios Comparison
Scenario |
Command Example |
Primary Purpose |
Disk Backup |
dd if=/dev/sda of=backup.img |
Full system backup |
Bootable Media |
dd if=ubuntu.iso of=/dev/usb |
Create bootable USB |
Data Wiping |
dd if=/dev/zero of=/dev/sda |
Secure disk erasure |
Workflow Visualization
graph TD
A[Data Operation] --> B{Backup}
A --> C{Bootable Media}
A --> D{Data Wiping}
B --> E[Disk/Partition Image]
C --> F[Bootable USB/CD]
D --> G[Secure Erasure]
Best Practices
- Always double-check source and destination
- Use
status=progress
for large operations
- Verify copied data integrity
- Have backup before critical operations
LabEx recommends practicing these techniques in controlled environments to gain proficiency with the dd
command.