LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Clearing partition on SSD (https://www.linuxquestions.org/questions/linux-software-2/clearing-partition-on-ssd-4175576394/)

Weapon S 04-01-2016 08:31 AM

Clearing partition on SSD
 
I have a solid state drive and I need to format one partition (Windows :rolleyes: ). I thought doing a low-level clearing of blocks would be better than a standard formatting that is unaware of SSDs.
The recommended utility to do what I described seems to be blkdiscard. I have only found one good example of its use, but it is straight-forward. It seems also to have risks (i.e. manual computation/obtaining of bytes to clear).
Yet, I also came across mentions that contemporary partitioning tools already use SSD TRIM-commands (which I think is what blkdiscard also uses?). I haven't found any definitive confirmations; I've even come across mentions that gdisk does it in the old platter-disk way. So, could someone definitely confirm, that using parted or gdisk performs the same cell clearing as blkdiscard? I would prefer using those programs, because they leave less room for me to fumble.

/dev/random 04-01-2016 10:06 AM

Quote:

Originally Posted by Weapon S (Post 5524576)
I have a solid state drive and I need to format one partition (Windows :rolleyes: ). I thought doing a low-level clearing of blocks would be better than a standard formatting that is unaware of SSDs.
The recommended utility to do what I described seems to be blkdiscard. I have only found one good example of its use, but it is straight-forward. It seems also to have risks (i.e. manual computation/obtaining of bytes to clear).
Yet, I also came across mentions that contemporary partitioning tools already use SSD TRIM-commands (which I think is what blkdiscard also uses?). I haven't found any definitive confirmations; I've even come across mentions that gdisk does it in the old platter-disk way. So, could someone definitely confirm, that using parted or gdisk performs the same cell clearing as blkdiscard? I would prefer using those programs, because they leave less room for me to fumble.

Here is the proper way to do it.

https://ata.wiki.kernel.org/index.php/ATA_Secure_Erase

Weapon S 04-01-2016 11:41 AM

Secure erase is indeed the best (even for platter disks), but it is only for the whole disk. I want to wipe one partition.
I eventually did what the link said:
E.g. (abridged)
Quote:

# parted -m /dev/sda unit b print free
1:17408B:1048575B:1031168B:free;
# blkdiscard --offset 17408 --length 1031168 /dev/sda
The -m option just makes it less human readable (unadvised). The free option also lists free space on disk, which is nice to assure is discarded by disk.


All times are GMT -5. The time now is 11:09 AM.