I am giving away a shitty 128GB SSD, which was used with LUKS 2 for most of it’s lifetime. As far as I know, it’s good practice to secure-erase it, but I’m too lazy to reinstall the OS on it (I already did it once). Is it really needed?

  • groet@feddit.org
    link
    fedilink
    arrow-up
    36
    ·
    3 months ago

    Everything that was luks encrypted is unrecoverable once you overwrite the luks header. Trying to guess the master key takes longer than the lifetime of the universe.

    Just make sure that is gone and you are good. If you deleted all partitions and installed another (unencrypted) OS on the drive there is a very good chance the luks headers are gone for good.

  • TrollAccount69@lemmy.ml
    link
    fedilink
    arrow-up
    26
    ·
    3 months ago

    Secure erase just drops the ssd controllers table of where logical blocks are in the physical memory and trims the disk. Which is good and you should do.

    That means a person would have to address the memory directly with flying leads or a bed of nails or something. Or have special software that makes the controller tell them what’s on each physical block and then put that data together into a bunch of files.

    If that worries you, do dd if=/dev/urandom of=/dev/<disk> before you secure erase.

    Then everything on the drive will be random static before the secure erase drops the block table and trims, so even if someone uses magic power to read the block contents directly they just get to see static.

    That has the benefit of speeding up the drive by resetting read fatigue at the expense of one layer of writes which is always worth it.

    • boonhet@sopuli.xyz
      link
      fedilink
      arrow-up
      23
      ·
      3 months ago

      Ah, fun fact, dd won’t actually cover all the blocks since SSDs have reserve blocks and IIRC they do rotate which ones are in use vs which are not, to even out wear

      • TrollAccount69@lemmy.ml
        link
        fedilink
        arrow-up
        4
        ·
        3 months ago

        Yes of course this will only rewrite some number of blocks that total the disks reported capacity. In the case that a person is worried about hidden blocks being preserved by a wear leveling algorithm they could just run the same command again and that would get em all.

  • Multiplexer@discuss.tchncs.de
    link
    fedilink
    arrow-up
    13
    ·
    3 months ago

    You don’t have to install anything on it, just connect it to a running PC and do a dd if=/dev/zero, that should be enough to get rid of any remnants directly accessible.
    Unless you are part of a drug distribution organization, in that case just use a hammer, a microwave and a blowtorch.

  • daggermoon@piefed.world
    link
    fedilink
    English
    arrow-up
    10
    ·
    3 months ago

    I think one TRIM cycle should make any data unrecoverable by all but the most determined. Feel free to correct me if i’m wrong though.

  • Majestic@lemmy.ml
    link
    fedilink
    arrow-up
    4
    ·
    3 months ago

    Follow the steps here to perform a secure erase that resets the cells and wipes any on-device encryption keys:

    https://wiki.archlinux.org/title/Solid_state_drive/Memory_cell_clearing

    You can do this from a live-boot environment if you wish. I would very strongly recommend disconnecting ALL other drives before performing this step as the best precaution against accidentally nuking the wrong drive. However if you choose to do this with other drives connected triple check you have the right drive selected before each step.

    • adarza@lemmy.ca
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 months ago

      parted_magic has gui tools for this (among many other things) on a bootable image. it’s not free, but a one-off download is only like 20 bucks (use that version forever). secure erase and running smart tests are about the only things i use it for, and even just for that it is definitely worth the lunch money.

  • IcePee@lemmy.beru.co
    link
    fedilink
    arrow-up
    4
    ·
    3 months ago

    You said that:

    I am giving away a shitty 128GB SSD, which was used with LUKS 2 for most of it’s lifetime.

    This leads me to assume that it is not now? Is this the case? If it still has LUK2 on it, you can run cryptsetup-erase on the luks2 container. This won’t wipe any unencrypted data, though.

    One needs to be careful and avoid block level wipes wherever possible for SSD as this will wear it out quicker. Obviously, if you have sensitive data unencrypted, you may have to. Shred is your friend, here. It works on entire devices as well as individual files. The individual files option is preferable if you the sensitive data is at known locations.

  • The_Hideous_Orgalorg@sh.itjust.works
    link
    fedilink
    arrow-up
    3
    ·
    3 months ago

    Most likely not. Did you have anything on it that you would even be concerned about someone else finding? Is anyone even likely to be curious enough to look?

    • Multiplexer@discuss.tchncs.de
      link
      fedilink
      arrow-up
      7
      ·
      3 months ago

      Is anyone even likely to be curious enough to look?

      Well, can only speak for me, but first thing I do.
      I mean, you can never know which administrative scandal you might uncover…
      I stop the moment I find private stuff, though.
      Had that three or four times already, the only case I was considering doing something about it was a completely unsecured and unerased phone still containing a bunch of business emails that clearly were sensitive or even confidential stuff.
      I just told the seller how he screwed up here, instead of making a bigger fuss out of it.

        • Multiplexer@discuss.tchncs.de
          link
          fedilink
          arrow-up
          4
          ·
          3 months ago

          The devices in question all were fat formatted, for which it is quite easy to reconstruct most of the “deleted” content using readily available simple tools (which I did).
          But that was some time in the past, nowadays most systems use some kind of base encryption, making it less likely to easily find something.
          The phone, on the other hand, was just not doing a factory reset before selling it, but only deleting files (and missing stuff, like some mail folders) and not having a password-protection at all… 😬

  • SteveTech@aussie.zone
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    What type of SSD? NVMe usually has a special instruction which will reset each whole NAND chip, and usually takes a few seconds. I think SATA does as well, but it’s not commonly supported.