LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-01-2016, 09:31 AM   #1
Weapon S
Member
 
Registered: May 2011
Location: Netherlands
Distribution: Debian, Archlinux
Posts: 260
Blog Entries: 2

Rep: Reputation: 49
Clearing partition on SSD


I have a solid state drive and I need to format one partition (Windows ). 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.
 
Old 04-01-2016, 11:06 AM   #2
/dev/random
Member
 
Registered: Aug 2012
Location: Ontario, Canada
Distribution: Slackware 14.2, LFS-current, NetBSD 6.1.3, OpenIndiana
Posts: 319

Rep: Reputation: 112Reputation: 112
Quote:
Originally Posted by Weapon S View Post
I have a solid state drive and I need to format one partition (Windows ). 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
 
Old 04-01-2016, 12:41 PM   #3
Weapon S
Member
 
Registered: May 2011
Location: Netherlands
Distribution: Debian, Archlinux
Posts: 260

Original Poster
Blog Entries: 2

Rep: Reputation: 49
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.

Last edited by Weapon S; 04-13-2016 at 11:41 AM.
 
  


Reply

Tags
blkdiscard, partitioning, ssd


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Migrate Mint 17.3 from HDD partition to SSD johnniedoo Linux - Newbie 40 05-22-2016 05:48 PM
Access To Encrypted SSD Partition With Native Password in SSD>SATA Enclosure skidvicious Linux - Hardware 5 12-03-2015 05:40 PM
Do I need a swap partition on a SSD drive? Billy W Linux - Newbie 15 11-25-2015 05:57 PM
Can I partition ssd drive for Ubuntu John02139 Linux - Laptop and Netbook 1 10-13-2013 10:05 AM
[SOLVED] Partition Strategy -> SSD Drive jv2112 Linux - Hardware 10 10-20-2010 04:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:57 AM.

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