this post was submitted on 12 Dec 2024
529 points (98.9% liked)

linuxmemes

21865 readers
1194 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack users for any reason. This includes using blanket terms, like "every user of thing".
  • Don't get baited into back-and-forth insults. We are not animals.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
  • These rules are somewhat loosened when the subject is a public figure. Still, do not attack their person or incite harrassment.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn. Even if you watch it on a Linux machine.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, <loves/tolerates/hates> systemd, and wants to interject for a moment. You can stop now.
  •  

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't remove France.

    founded 2 years ago
    MODERATORS
     
    top 50 comments
    sorted by: hot top controversial new old
    [–] waigl 80 points 1 month ago (4 children)

    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.

    [–] [email protected] 19 points 1 month ago (1 children)

    Yeah lsblk, lsscsi, fdsik -l , go have a coffee, come back later and hit enter on dd

    [–] Cenzorrll 7 points 1 month ago (1 children)

    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.

    [–] [email protected] 11 points 1 month ago

    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

    [–] grue 5 points 1 month ago

    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.

    [–] [email protected] 2 points 1 month ago (3 children)

    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.

    [–] [email protected] 3 points 1 month ago (1 children)

    does that mean that you dont use hard drives at all? how many storage have you got?

    [–] [email protected] 4 points 1 month ago* (last edited 1 month ago) (10 children)

    I have a nas with 32TB. My main pc has 2TB and my laptop 512GB. I expected to need to upgrade especially the laptop at some point, but haven't gotten anywhere near using up that local storage without even trying.
    I don't have anything huge I couldn't put on the nas.

    At this point I could easily go 4TB on the laptop and 8TB the desktop if I needed to.
    Spinning rust is comparable in speed to networking anyway, so as long as noone invents a 20TB 2.5'' hdd that fits my laptop for otg storage, there would be no reason something would benefit from an hdd in my systems over in my nas.

    Edit:
    Anything affordable in ssd storage has similar prices in M.2-nvme and 2.5''-sata format. So unless you have old hardware, I see the remaining use for sata as hdd-only.

    load more comments (10 replies)
    load more comments (2 replies)
    [–] [email protected] 57 points 1 month ago (2 children)

    Always lsblk before dd. The order of /sdX might change from boot to boot. Only /nvme doesn't change.

    [–] extremeboredom 6 points 1 month ago (1 children)
    [–] [email protected] 17 points 1 month ago (1 children)

    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.

    load more comments (1 replies)
    load more comments (1 replies)
    [–] BeatTakeshi 54 points 1 month ago

    I am become dd, the destroyer of disks

    [–] [email protected] 51 points 1 month ago

    "/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... "

    [–] debil 48 points 1 month ago (2 children)

    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.

    [–] [email protected] 23 points 1 month ago (2 children)

    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.

    [–] [email protected] 8 points 1 month ago

    I could swear the argument order to "ln" swaps every now and then!

    [–] debil 5 points 1 month ago (3 children)

    Unless you forget what if and of mean. With cp it's simply "cp what where". Never had problems remembering that.

    [–] [email protected] 14 points 1 month ago (1 children)

    is it really hard to remember infile and outfile?

    [–] debil 5 points 1 month ago

    No, but you're just typing if and of, not infile and outfile, and the letters are right next to each other on a qwerty kbd. One can haphazardly misuse a lot of commands, it's just that some commands may lead to nastier outcomes than others.

    load more comments (2 replies)
    load more comments (1 replies)
    [–] [email protected] 42 points 1 month ago (2 children)

    --status=progress. So happy when they added this.

    [–] [email protected] 6 points 1 month ago

    If only I could remember to set status=progress...

    I always end up using killall -USR1 from another terminal

    load more comments (1 replies)
    [–] [email protected] 27 points 1 month ago* (last edited 1 month ago) (5 children)

    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.

    load more comments (5 replies)
    [–] [email protected] 24 points 1 month ago (3 children)

    i always just

    cat /dev/??? > /dev/null
    

    to make sure the usb blinks

    [–] rtxn 19 points 1 month ago (1 children)
    [–] InnerScientist 10 points 1 month ago

    More like *screams into the void*

    [–] [email protected] 6 points 1 month ago (1 children)

    Me laughing with /dev/nvme0n1p1

    load more comments (1 replies)
    [–] [email protected] 4 points 1 month ago

    That's a good way of doing it

    [–] [email protected] 22 points 1 month ago (2 children)

    You all still have a LED inside USB flashdrive?

    [–] [email protected] 12 points 1 month ago (7 children)

    Yep! I just installed Void about ten minutes ago off a 2GB stick from the mid-2000s. Somehow, those little sticks just keep going!

    [–] [email protected] 6 points 1 month ago

    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 😳😳

    load more comments (6 replies)
    [–] [email protected] 8 points 1 month ago

    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.

    [–] Voyajer 16 points 1 month ago* (last edited 1 month ago)

    Remember kids, always lsblk before you dd

    [–] [email protected] 13 points 1 month ago

    heh i do it hardcore, my USB has no light ;)

    [–] hakunawazo 7 points 1 month ago (1 children)
    [–] [email protected] 4 points 1 month ago

    don't cross the streams

    [–] heisenbug4242 6 points 1 month ago

    /dev/disk/by-id/xxx works for me. Never made a mistake.

    [–] [email protected] 5 points 1 month ago

    Sounds like someone's not up to date with their backups.

    [–] [email protected] 5 points 1 month ago (2 children)

    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🤷

    load more comments (2 replies)
    [–] [email protected] 5 points 1 month ago* (last edited 1 month ago) (1 children)

    ls /dev > /tmp/before

    ls /dev > /tmp/after

    diff /tmp/before /tmp/after

    <sweating>
    [–] [email protected] 3 points 1 month ago (1 children)

    You could just open gnome disks

    [–] [email protected] 11 points 1 month ago

    ok grandma, go back to facebook /s

    [–] MITM0 4 points 1 month ago* (last edited 1 month ago)

    We seriously need a series of DD-Command 4 Dummies guides Also you guys have USB drives with lights ????

    load more comments
    view more: next ›