LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-13-2019, 02:58 PM   #1
Spike8605
LQ Newbie
 
Registered: Apr 2017
Posts: 20

Rep: Reputation: Disabled
Post shred and ssd drives


Hello to all, while waiting amazon to ships all the component of my new pc, I was wondering, how does the shred utility relate to the "new" (for me) solid state drives?

Will it work the same, if used in combination of a "normal" filesystem, like ext3 or ext4?

Reading online, I found out that, given the "default" options of extX filesystem, it does work as advertised, even if they are journaling filesystems.

But how about the way sdds do physically works? will the good old shred utility still works?
As far as I know, it overwrite the file with random strings (default) then if the "-u" is passed, it will unlink the file and delete it in a unrecoverable way.

But will it apply to ssds too?
 
Old 08-13-2019, 04:31 PM   #2
deNiro
Member
 
Registered: Jun 2003
Distribution: Slackware-Current and Salix 14.2
Posts: 274
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by Spike8605 View Post
Hello to all, while waiting amazon to ships all the component of my new pc, I was wondering, how does the shred utility relate to the "new" (for me) solid state drives?

Will it work the same, if used in combination of a "normal" filesystem, like ext3 or ext4?

Reading online, I found out that, given the "default" options of extX filesystem, it does work as advertised, even if they are journaling filesystems.

But how about the way sdds do physically works? will the good old shred utility still works?
As far as I know, it overwrite the file with random strings (default) then if the "-u" is passed, it will unlink the file and delete it in a unrecoverable way.

But will it apply to ssds too?
I don't think that will work on ssd's. Because as far as I know the logical blocks that are controlled by the proprietary controllers are dynamic on the actual chips. so it's not one on one logical block allocation like a traditional harddrive does.

I don't know what brand SSD you have, but with my Intel SSD's I can do a security erase with hdparm. (which will only take about a minute or maybe 2)


I do that like this:

(you can simply use the slack ware install disk to boot and use hdparm from there, or any portable/live linux like puppy linux)
***
prepare the drive: secure erasing drive
( dev/sda is my first drive, check yourself for correct device name on your system)

# hdparm -I /dev/sda
(if drive is in frozen state, unplug and plug, while system is running. drive should then say NOT frozen)

step 1 set a temp master password (will be lost after secure erase)

# hdparm --user-master u --security-set-pass slack /dev/sda

step 2 issue the erase disk command

# hdparm --user-master u --security-erase slack /dev/sda

****

But I'm not sure whether that works on every SSD. I think samsung has their own utilities for that. Just look on the term "secure erase" and your type of ssd.

Last edited by deNiro; 08-13-2019 at 04:49 PM.
 
1 members found this post helpful.
Old 08-13-2019, 09:17 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
shred is totally pointless on an SSD for the simple reason that writing to an SSD block never overwrites the current data. Writing to a block is done by reading the old data, making the needed modifications, and then writing the modified data to a new physical block, which is then mapped to the original LBA. The old block is scheduled for future erasure, which will be done when the controller gets around to it. The repeated overwrites by shred consume the drive's lifetime write cycles for no benefit.
 
1 members found this post helpful.
Old 08-13-2019, 10:12 PM   #4
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware
Posts: 490

Rep: Reputation: Disabled
I think "fstrim" is what you're looking for. Delete the file, then issue "fstrim [mountpoint]" to discard unused blocks. Note: may not work with some SSD controllers, particularly ones that masquerade as /dev/sdX. But if your device is mounted as /dev/mmcblkN, you can probably use fstrim. An unsupported controller is not expected to cause data loss.
 
Old 08-14-2019, 08:30 AM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Note that fstrim does not guarantee that the data will ever be actually erased. The "erase blocks" in an SSD are quite large, perhaps 256KB or more. That block will not be scheduled for erasure until the whole thing can be erased. Data from some small file you are trying to eliminate can stick around for a long time.
 
Old 08-14-2019, 08:40 AM   #6
bifferos
Member
 
Registered: Jul 2009
Posts: 401

Rep: Reputation: 149Reputation: 149
Quote:
Originally Posted by rknichols View Post
shred is totally pointless on an SSD
Just to be pedantic, it's not totally pointless. It's better than nothing because most of your data will be shredded, but never all of it, agreed.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Way to shred all internal drives with one liner? anon091 Linux - Newbie 9 10-17-2018 11:31 PM
Install Linux in Toshiba u940 series with 32gb ssd and 750gb hdd I would like to have boot code in ssd only cvkchary Linux - Laptop and Netbook 4 08-31-2016 04:26 PM
[SOLVED] I have a SSD a 500GB drive and a 2TB drive and want to move Ubuntu from 500GB to SSD greatormesby Linux - Newbie 12 07-06-2015 09:58 AM
LXer: How To Securely Destroy/Wipe Data On Hard Drives With shred LXer Syndicated Linux News 0 02-22-2012 10:10 AM
LXer: Shred and secure-delete: tools for wiping files, partitions and disks in GNU/Li LXer Syndicated Linux News 0 12-02-2008 10:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration