Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How can I wipe out my whole drive - an ssd? Including /boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
john_deaux
n00b
n00b


Joined: 16 Sep 2013
Posts: 56
Location: On the banks of the Pontchartrain

PostPosted: Tue Jun 14, 2016 6:29 pm    Post subject: How can I wipe out my whole drive - an ssd? Including /boot Reply with quote

The reason I ask is I am seeing constant issues with a persistent memory of the drive.

I can remove partitions and rebuild them but I still see something that was set before that I did not set now.

Thanks,

JD
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Tue Jun 14, 2016 6:36 pm    Post subject: Reply with quote

Define something.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43420
Location: 56N 3W

PostPosted: Tue Jun 14, 2016 6:52 pm    Post subject: Reply with quote

john_deaux,

Partition tables are just pointers to data. Removing partitions or indeed, the entire partition table, makes the data inacessable. It does not remove the data.
If you recreate the pointers, the data will reappear.

You cannot wipe a whole drive. Modern drives remap sectors that are becoming difficult to read.
These sectors cannot be accessed by normal drive commands but the data is still there.

Some drives support the security erase command. That does the best it can in a single pass.
On an ssd it will 'trim' the entire drive.
Be sure your backups are current and validated. There is no recovery after the command is issued.
Security erase will continue across power cycles.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
john_deaux
n00b
n00b


Joined: 16 Sep 2013
Posts: 56
Location: On the banks of the Pontchartrain

PostPosted: Tue Jun 14, 2016 7:20 pm    Post subject: Reply with quote

Buffoon wrote:
Define something.


OK, sometimes when I go to make a directory it's already there. This, after telling parted to remove all partitions - rm 1, rm 2, rm 3, rm 4, and issuing the command makelabel gpt, to clear the partition table.

Sometimes parted tells me that /mnt/sda4 is already formatted as /sda4. How would it know if I zeroed everything out?

I really want to know...

Oh, and this affects portage. It keeps trying to pull in the same package that fails to compile "dev-qt/dev-qtchooser-0_p20151008" no matter what profile I use.

The qt-chooser package may be to blame for the emerge issues but I think there is a persistence, or hysteresis issue with the ssd in my T440s because it remembers things it shouldn't. Especially since I'm using a rescue CD to install Gentoo.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2562

PostPosted: Tue Jun 14, 2016 8:10 pm    Post subject: Reply with quote

https://wiki.archlinux.org/index.php/SSD_memory_cell_clearing

To erase the entire drive, any SSD should have a secure erase feature.

It's a command you issue with hdparm:

Code:
hdparm --user-master u --security-erase PasSWorD /dev/sdX


You could also use --security-erase-enhanced but in some cases that seems to be the same as the standard --security-erase since they both take the same time.

BTW I would strongly recommend that you boot from some other device and leave this drive completely unmounted when performing this action.
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2586

PostPosted: Tue Jun 14, 2016 8:51 pm    Post subject: Reply with quote

You don't reinstall Gentoo, you fix the problem. Reinstalling only gives you the opportunity to remake any mistakes unlike a binary distro. I suspect this is your real problem.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
john_deaux
n00b
n00b


Joined: 16 Sep 2013
Posts: 56
Location: On the banks of the Pontchartrain

PostPosted: Tue Jun 14, 2016 8:57 pm    Post subject: Reply with quote

1clue wrote:
https://wiki.archlinux.org/index.php/SSD_memory_cell_clearing

To erase the entire drive, any SSD should have a secure erase feature.

It's a command you issue with hdparm:

Code:
hdparm --user-master u --security-erase PasSWorD /dev/sdX


You could also use --security-erase-enhanced but in some cases that seems to be the same as the standard --security-erase since they both take the same time.

BTW I would strongly recommend that you boot from some other device and leave this drive completely unmounted when performing this action.


Thanks 1clue,

I'm currently doing a Lenovo restore to Win7, and usually I need to install another distro to zero my partitions, with no memories of the gentoo partition's. I do have legacy wipe-disks from a DOD former life. I may try to copy an image to a boot CD and see what it sees.

JD
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43420
Location: 56N 3W

PostPosted: Tue Jun 14, 2016 9:12 pm    Post subject: Reply with quote

john_deaux,

Making filesystems is all you need to do,
When mke2fs says there is already a filesystem there, its quite correct. You can destroy it if you wish.

Making a filesystem does not rewove the data either. It creates new metadata that makes it look like the filesystem is empty.
Poke about with hexedit to see what's really there.

SSDs are a nest of uncertainty with wear levelling and trim.
Free blocks may or may not be erased and if they are in the process of being trimmed, you have no way to know when the data will actually be erased.
Nor can you tell, if data has been remapped by wear levelling but not yet erased, its just 'gone'.

Its hard work and time consuming to erase a HDD, so its not done routinely and there is no need to, unless you want to scrap the drive, or pass it on to a new owner.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
jots
n00b
n00b


Joined: 05 Jun 2016
Posts: 9

PostPosted: Tue Jun 14, 2016 9:51 pm    Post subject: Reply with quote

Helau, before issuing the SSD secure erase command, you might need to unplug and replug the power plug of your SSD. That's because the SSD is in status "FROZEN" ... when replugging the power, it becomes *not* FROZEN, and you can continue. Of course you need to do that when the machine is running.

Code:
# hdparm -I /dev/sda


output should contain now "not frozen"

Code:
# hdparm --user-master u --security-set-pass Secret /dev/sda


and then:

Code:
# hdparm --user-master u --security-erase Secret /dev/sda
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum