dd: disk destroyer
dd: disk destroyer
dd: disk destroyer
IMHO, it was a mistake to make USB block storage use the same line of names also used for local hard disks. Sure, the block device drivers for USB mass storage internally hook into the SCSI subsystem to provide block level access, and that's why the drives are called sd[something], but why should I as an end user have to care about that? A USB drive is very much not the same thing for me as a SCSI harddisk. A NVMe drive on the other hand, kinda sorta is, at least from a practical purpose point of view, yet NVMe drives get a completely different naming scheme.
That aside, suggest you use lsblk before dd.
Yeah lsblk, lsscsi, fdsik -l , go have a coffee, come back later and hit enter on dd
Yeah lsblk, lsscsi, fdsik -l , go have a coffee, come back later and hit enter on dd
Then realize you typed the command wrong and panic when you don't get an error.
I still made the mistake, when I sleep deprived switched if and of somehow
My then girlfriend wasn't exactly happy, that all here photos and music, which we just moved off old CDs, that couldn't be read correctly anymore, and I spent quite some time to finally move them
Obviously the old CDs and the backup image were thrown out/deleted just a few days earlier, because I proudly had saved the bulk of it - and being poor students having loads of storage for multiple backups wasn't in reach.
Backing them up again to fresh CDs was on the plan, but I quickly needed a live USB stick to restore my work laptop...
Since then I'm always anxious, when working with dd. Still years later I triple check and already think through my backup restoration plan
Which is a good thing in itself, but my heart rate spikes can't be healthy
While we're at it, can we also rename the hard drive block devices back to hd
instead of sd
again? SATA might use the SCSI subsystem, but SATA ain't SCSI.
At least sata is well on its way towards dying, so the problem will solve itself in some more years.
My machines all have nvme exclusively now, only some servers are left using sata. And I would say the type of user at risk of fucking up a dd command (which 95% of the time should be a cp command) doesn't deal with servers. Those are also not machines you plug thumb drives into commonly.
In 5-10 years we will think of sda as the usb drive, and it'll be a fun-fact that sda used to be the boot drive.
does that mean that you dont use hard drives at all? how many storage have you got?
S-ATA still is the only way to have more than two drives in the system.
Always lsblk
before dd
. The order of /sdX might change from boot to boot. Only /nvme doesn't change.
Why is this?
It's a design thing. BIOS can know NVMe disks' location because they're directly mounted to PCIe. SATA isn't like this. Similar logic with the RAM slots.
First thing I do after loading the liveusb is write the "mylsblk" which does the much more sane thing of:
bash
lsblk -o NAME,LABEL,PARTLABEL,UUID,SIZE,MOUNTPOINTS
I am become dd, the destroyer of disks
"/dev/sdb? It's sdb? With a B? Yep that's the flash drive. Just type it in... of=/dev/sd
what was the letter again? B? Alright, /dev/sdb
. Double check with lsblk
, yep that's the small disk. Are my backups working properly? Alright here goes nothing...
<enter>
"Commands like dd
are the best. Good ole greybeard-era spells with arcane syntax and the power to casually wipe out the whole universe (from their perspective ofc) if used haphazardly or not in respectful manner.
What do you mean? Explicitly having to set if=
and of=
is way harder to screw up than mixing up the order of arguments for e.g. cp
.
I could swear the argument order to "ln" swaps every now and then!
Unless you forget what if and of mean. With cp
it's simply "cp what where". Never had problems remembering that.
Computer equivalent of vacuum decay in our universe...
--status=progress. So happy when they added this.
If only I could remember to set status=progress
...
I always end up using killall -USR1
from another terminal
So I don't have to install ddrescue every time I clone a disk from a live USB anymore? Awesome
This is the only reason why I still use GUI for making Linux USBs. Can't trust my ADHD ass to write the correct drive name. Also, none of my USB drives have a light.
Popsicle is pretty nice, it doesn't let you choose the internal drives afaik.
Luckily, this problem will disappear soon as we're moving to systems with only nvme drives. Kinda hard to mistake /dev/nvmexny for /dev/sdx.
I'm a cheap ass who mostly gets old hardware, so it'll probably be a while before I get to see the benefits of that.
Are we though? My RPI uses a SD card and is labels it as sd
and the same is true for virtual machines.
i always just
undefined
cat /dev/??? > /dev/null
to make sure the usb blinks
More like screams into the void
Me laughing with /dev/nvme0n1p1
well i mean, the original meme was referring to a usb device with an led...
That's a good way of doing it
You all still have a LED inside USB flashdrive?
Yep! I just installed Void about ten minutes ago off a 2GB stick from the mid-2000s. Somehow, those little sticks just keep going!
Same! I have a 4gb white SanDisk stick, from like 12-14 years ago and is still working 💀💀 it even died on me once, and started working again after a few days 😳😳
Keep them around. I was playing with and testing some ~15 years old mobos for work, and they would not boot from any USB3.0 stick I tried. Same images on an 8GB USB2.0 stick booted with no problem.
Name and shame: Biostar motherboard
for an usb, it might work. For such an old hard drive, it won't. Linux will refuse to boot
I buy them specifically with LED. It s helpful for data transfer, but also helpful for doing a flash of new OS to old nas hardware... You have to hold reset button in on nas until you see it start to read USB (by LED) then you know you can release the reset button.
Remember kids, always lsblk before you dd
heh i do it hardcore, my USB has no light ;)
Don't confuse if and of!
don't cross the streams
/dev/disk/by-id/xxx works for me. Never made a mistake.
ls /dev > /tmp/before
<insert usb>
ls /dev > /tmp/after
<repeat two more times>
diff /tmp/before /tmp/after
undefined
<sweating>
You could just open gnome disks
ok grandma, go back to facebook /s
Sounds like someone's not up to date with their backups.
We seriously need a series of DD-Command 4 Dummies guides
<br>
Also you guys have USB drives with lights ????worst case for me would be ereasing my ventoy drive.
cause i for sure wont be partitioning any of my nvme drives. so the only mistake i can make is like type sda instead of sdb which would just be another usb drive🤷
I want a immutible Linux that restricts access to critical components. I wouldn't mind running my desktop in a container.
NixOS store (app folder) is read only. You literally can't mess with it. It doesn't really need a container, most things are locked down already. Of course you could mess up your home folder, but that's on you then
Doesn't dd pick sda by default?
No
Yeah once I forgot I had an external drive on one of the USB ports on my PC and created an Ubuntu drive with dd and just sent it do /dev/sdb ..lost all movies I had on it. After that I always check with df -h or fdisk -l
Reminds me of the DOS days of my youth.
fdisk does not stand for friendly disk.
Why doesnt everyone switch from Windows???
It's a joke. Nobody switching to Linux would organically encounter dd. There's like a million friendlier alternatives for everything it does.
(I swear to God if someone replies to me with 1 niche use case of dd that there's no alternative to, I'm gonna kick a dog into the sun)
I assume Steve was also making a joke. But who knows, in this topsy-turvy world?
What's the alternative? On Windows I use Rufus usually.
If you made it this far into linux, you already know why you had to switch