• stoy@lemmy.zip
    link
    fedilink
    arrow-up
    6
    ·
    9 days ago

    I have used dd a few times without destroying my disk, here is my simple recommendation to stay safe:

    DON’T TYPE THE COMMAND DIRECTLY INTO THE TERMINAL!

    What I mean is that you should open a text editor, type the dd command you want to run in the editor, let it sit for 5 min, go back to the text editor, find the OF path, doublecheck and verify that it is safe.

    Correct misstakes, wait another 5 min and do the check again.

    Once you are confident that the command is accurate, copy paste it into a terminal and run it.

    • seaQueue@lemmy.world
      link
      fedilink
      arrow-up
      11
      ·
      9 days ago

      I use dd regularly to back up and restore disk images. It’s not particularly hard to use but like sudo rm -rf it absolutely will eat whatever you point it at so you need to understand what the command does and pay attention.

    • vrighter@discuss.tchncs.de
      cake
      link
      fedilink
      arrow-up
      3
      ·
      8 days ago

      when I need to type a dangerous command, i prepend it with #, so it’s just a comment.

      Only when I’m really sure do i go back to the start of the line and remove the #

      • stoy@lemmy.zip
        link
        fedilink
        arrow-up
        1
        ·
        8 days ago

        That is a very good practice, it is better than my suggestion as it eliminates potential error when copy pasting

    • ulterno@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      8 days ago

      Once, while typing a dd command, I realised I was sleepy.
      I deferred until next day.


      Usually I keep partitionmanager open alongside, to cross-check my device selection.
      Unlike having to use other CLI tools to determine if I have it right, I get some handy icons (like the USB drive symbol). Still, make sure to check the contents just in case it got bugged and set the icon to the wrong type of drive.