• sylver_dragon@lemmy.world
    link
    fedilink
    English
    arrow-up
    46
    ·
    4 days ago

    For a physical machine:
    for f in $(lsblk | grep disk | cut -d ' ' -f 1); do sudo dd if=/dev/zero of=/dev/$f bs=4MB status=progress; done

    That will remove all your current software problems. You’ll have new ones, but the old ones will be gone.

    • cron@feddit.org
      link
      fedilink
      arrow-up
      29
      ·
      3 days ago

      Nice that you added “status=progress” so I can closely follow what is happening.

      • sylver_dragon@lemmy.world
        link
        fedilink
        English
        arrow-up
        18
        ·
        3 days ago

        Gotta have that progress bar, otherwise you might be tempted to <Ctrl>-C and you will be left with some of your software problems.

      • sylver_dragon@lemmy.world
        link
        fedilink
        English
        arrow-up
        7
        ·
        edit-2
        3 days ago

        Yes, and you can probably get better performance with different block sizes. This is just what I used to fix drives as it was fast enough and I couldn’t be arsed to do any real testing to find the right speed. Also, my stash of drives was no where near homogeneous, so the right size for one type of drive may not have worked for a different type of drive. I also used the 4MB block size when imaging drives to have an ok-ish speed while not losing too much data if there were read errors.