brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: dd status=progress shows a disk copy, and of= decides what you destroy

Disk
~/tips/tip-disk-dd-status-progress-of-danger

sudo dd if=debian.iso of=/dev/sdX bs=4M status=progress conv=fsync

Copies an image to a disk with live progress, and the target device decides what gets overwritten.

dd writes straight to the device you name, with no question asked. A wrong letter in of= overwrites the wrong disk.

lsblk -o NAME,SIZE,MODEL,MOUNTPOINT
sudo dd if=debian.iso of=/dev/sdX bs=4M status=progress conv=fsync

Check the target with lsblk first and replace sdX only after the size and model match. status=progress prints the speed and the bytes copied, and conv=fsync flushes the data before dd exits, so it is safe to unplug the stick afterwards. The data is gone for good once it has been written, so read the line twice before pressing Enter.

Further reading: dd manual page

More Disk tips sudo e2freefrag /dev/sdb1 sudo smartctl -a --json /dev/sda | jq '.smart_status.passed' lsscsi -s udisksctl power-off -b /dev/sdX du -sh — .[!.]* * 2>/dev/null | sort -h All Disk tips (44) All topics

Link