Are there any benefits, in terms of performance or security in ‘wiping’ or overwriting an SSD before reinstalling Linux? And if so, what is the best way of doing it?

I’m planning on doing a clean install of Debian 13 on my laptop soon.

I’m currently on Fedora and using encryption and will be using encryption on Debian too. I do not have a separate home partition.

Thanks :)

  • slackness@lemmy.ml
    link
    fedilink
    arrow-up
    4
    ·
    16 days ago

    Are there any benefits, in terms of performance or security in ‘wiping’ or overwriting an SSD before reinstalling Linux?

    No

  • infinitevalence@discuss.online
    link
    fedilink
    English
    arrow-up
    2
    ·
    16 days ago

    There’s no performance improvement to wiping an SSD. At least not meaningfully, on a completely empty SSD that has been factory wiped. You may see a first time right improvement but that goes away as soon as the SSD starts doing garbage collection.

    As for your other reasons, they’re completely up to you.

  • 𝘋𝘪𝘳𝘬@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    16 days ago

    Security … Depends. If you want to sell the SSD, then yes, wiping the SSD is advised. You don’t need complicated random multiple-write patterns. Just make sure to wipe everything (keywords: wear-leveling, cache), you could use blkdiscard for that.

    Performance-wise nothing noticeable would change. Physically, SSDs are fast enough to modify the charge traps to store the bits as needed to store files regardless of what’s in those traps (that’s quite a rabbit hole).

    If you plan using the SSD for your own, you don’t need to wipe it, just repartition as needed and create the file systems in the partitions. What I do, is writing some data to the storage to destroy the partition table (dd if=/dev/urandom of=/dev/XYZ where XYZ is my target device – and then leave it runninf for a few seconds).

    Since you’re using encryption, the common tools only see garbage and no data (i.e. file system). So simply don’t decrypt and work with the mapped partition but use the device directly.

  • Papamousse@beehaw.org
    link
    fedilink
    arrow-up
    1
    ·
    16 days ago

    If you are using encryption now, you do not need to wipe the SSD, after a new install the remaining data on the “disk” will still be encrypted, without the key.

  • DrDystopia@lemy.lol
    link
    fedilink
    arrow-up
    1
    ·
    16 days ago

    Are there any benefits, in terms of performance or security in ‘wiping’ or overwriting an SSD before reinstalling Linux?

    Yes, you remove the possibility of theoretically restoring the old data previously stored on the storage device.

    And if so, what is the best way of doing it? I’m planning on doing a clean install of Debian 13

    Select encrypted storage when partitioning, make sure you select the “Overwrite with random data” option.

    I’m currently on Fedora and using encryption and will be using encryption on Debian too.

    If it’s a full disk encryption on both current and future setup, there’s no benefit from overwriting.

  • Takapapatapaka@tarte.nuage-libre.fr
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    16 days ago

    I’ve heard that SSD have a relatively limited number of write cycles, and that wiping/compacting data can even be a slightly bad thing in this regard. I am not sure at all if this is true though, don’t take my word for it and correct me if i’m wrong.

    • Hawke@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      16 days ago

      It’s sort-of true. Write cycles are limited.

      However most modern-ish SSDs have a secure-erase command which would allow clearing without actually re-writing each sector from the OS level. It’s also much faster.

      There are utilities to do this: hdparm and blkdiscard

      That said, there’s little reason to do this.

      • TXL@sopuli.xyz
        link
        fedilink
        arrow-up
        1
        ·
        16 days ago

        In my experience it’s also very very hard to wear out an SSD. It’s limited, but mostly the limit is very very far away. I treat those warnings as largely fud. Most common failure more seems to be that the controller in the drive dies for some reason and the drive just goes completely dead and never gets detected again. There won’t be warnings from any smart values either.

        Or the drive is just replaced with a bigger faster one, maybe on a different bus/connector or something, and forgotten in a drawer or a box somewhere.

        Naturally it’s still worth trying to enable trim and limit writes if there’s no downside. It can only help in case the drive does get an exceptionally long service life. But I’d say use it while it’s still useful and keep fresh and verified backups.