2

I always remove files from my machine using sudo rm -rf file, and today I found that shred does a better job in terms of preventing files from being recovered later.

My question is: I have an SSD only in my machine, and I'd like to know if removing files using shred instead of rm will decrease the lifespan of my SSD a lot, or since it's just a file it does not matter that much.

Disclaimer:

  • I know that flash disks are not bullet-proof when using shred, I read in many places that it's impossible to guarantee 100% that the files will not be recoverable, but I'm not hiding files from gov etc, just want to delete them for good in case I sell my computer in the future.

  • I keep shred's default 3 overwrite passes.

Zanna
  • 70,465
ryoishikawa74
  • 303
  • 2
  • 4
  • 8
  • Running rm as super user is only necessary if a regular user doesn't have the file system permission to delete the file. Just to clarify: sudo rm is not more secure than rm. – Matthias Braun Jun 11 '21 at 05:07

2 Answers2

3

Memory used by SSD disks has a limit on write-cycles. If you use shred, it means you will overwrite all blocks occupied by file 3 times (default settings). So, if you use it consistently, the limit for memory cells will be reached faster.

According to answers on the following question at SuperUser:
How can I securely format a solid-state drive?
shred with a single random pass should be secure enough and will have less impact (1 write vs. 3 writes by default) on SSD memory.

If you are concerned about security, it might be better to use encryption.

And if you want to pass (e.g. sell) your SSD to other party - securely erase its content then.

Zanna
  • 70,465
Alex'LP
  • 93
1

In performing a man shred I notice this...


CAUTION: Note that shred relies on a very important assumption: that the file system overwrites data in place. This is the traditional way to do things, but many modern file system designs do not satisfy this assumption. The following are examples of file systems on which shred is not effective, or is not guaranteed to be effective in all file system modes:

   * log-structured or journaled file systems, such as those supplied with
   AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)

Which means that it's not effective on Ext4 file systems, which is what you have in Ubuntu.

heynnema
  • 70,711
  • damn...not sure how to securely delete files anymore these days =/ – ryoishikawa74 Sep 11 '17 at 19:28
  • @heynnema However, the next paragraph below states: In the case of ext3 file systems, the above disclaimer applies (and shred is thus of limited effectiveness) only in data=journal mode, which journals file data in addition to just metadata. In both the data=ordered (default) and data=writeback modes, shred works as usual. so unless you've changed your mount to data=journal then shred works as intended on ext filesystems. – dansimau Nov 25 '19 at 15:43