You are not logged in.

#1 2012-10-07 00:57:36

Registered: 2012-08-23
Posts: 14

How to discard unused space on an SSD?

Dear forum,

I have bought an ssd several days ago and I've wiped the whole drive to prepare for system encryption.

I now realized that it may not be really good to keep that random data on the ssd due to performance reasons. So now I would like to discard all unsed space except the space used by my partitions.

How could I easily accomplish this?
I have tried with hdparm and the trim option, but I do not think that worked quite well.
I am uncertain what values to use for the initial sector and sector count. I'd be very happy if someone could explain me how to use this properly or even show me another way to accomplish this in case there is one.



#2 2012-10-07 02:22:30

From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: How to discard unused space on an SSD?

I am not sure if this applies to what you are asking about encryption, but you can use tune2fs to apply the dicard option to the parition (maybe disk, I havenot tried).  See the wiki on SSD's.

Edit: BTW, welcome to the forums.  You probably do not need to start your posts with "Dear Forums," but it is up to you.

Last edited by WonderWoofy (2012-10-07 02:23:24)


#3 2012-10-07 16:54:44

From: Germany
Registered: 2011-09-05
Posts: 1,277

Re: How to discard unused space on an SSD?

If the unused space on the SSD is continuous, the easiest & safest is probably to create a partition in the unused space and then wipe it with /dev/zero again (man shred).
Using tune2fs on it should do it also (once the 'unused' partition is setup), but then you have to mount it with the discard option also. With a partition setup temporarily for it, you get away without getting hdparm parameters correct.


Board footer

Powered by FluxBB