Skip to the content ForoHackers
Log inJoin

I dd'd the wrong disk. It was my own. Nothing was lost. This time.

Backups and recoverySystem administration
#1127 · anonymous · · Report

be me, 4 a.m., migrating a disk image on my homelab dd if=backup.img of=/dev/sdb bs=4M "sdb is the new disk, I plugged it in a minute ago" it is not kernel reorders device names after reboot sdb is the data disk realise after 12 seconds Ctrl+C first 400 MB of the partition table and file system are gone testdisk and a lot of praying recovered everything, except my sense of calm

What I do now, written on a sticky note on the monitor:

  • Never trust /dev/sdX names. Use lsblk -o NAME,SIZE,MODEL,SERIAL and /dev/disk/by-id/ paths, which include the serial number.
  • Read the command out loud before pressing Enter.
  • Unplug the disks you are not touching, if you can.
  • And, as everyone says: have a backup you have actually restored.
#1840 · anonymous · · Report

reads command out loud

Underrated. Also dd status=progress so you see immediately that it is writing way more than expected, and conv=fsync at the end. The sticky note is the best hardware you own.

#1841 · anonymous · · Report

A friend renamed his own disk by wiping the label. We call it "optimising for the next admin".

#1842 · anonymous · · Report

dd is nicknamed "disk destroyer" for a reason. Consider pv or ddrescue when you can. Both show you the progress and the destination before you commit.

Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply