Re: Is fdisk, disklabel and newfs enough to reset an SSD

2013-05-15 Thread Clint Pachl

Jan Stary wrote:

If so, how does one reset a used SSD for
optimal operation with a fresh install?

Just treat it as any other disk - which it is.


This is wrong, unfortunately. From the OS perspective, sure, sort of. 
But there is more to the story.


There is overprovising, garbage collection, entire page write 
restrictions/design, TRIM, wear leveling, non-linear aspects, write 
amplification concerns, etc.


Anyway, Ted and Christer nailed it with the ATA Secure Erase command. 
That's exactly what I was looking for. It's a hardware level reset that 
reconstitutes the over provisioned areas, unsets core storage (not a 1 
or 0), and reinitializes wear leveling, etc.


Thanks,
Clint



Re: Is fdisk, disklabel and newfs enough to reset an SSD

2013-05-14 Thread Christer Solskogen
On Tue, May 14, 2013 at 7:50 AM, Clint Pachl pa...@ecentryx.com wrote:


 Would dd'ing to the drive all 1s then all 0s be effective?


Yes, and a complete waste of time. 'atactl drive secerase'  will do the job
for you.
hdparm in linux has a similar command. But dd-ing twice is just idiotic. If
you must use dd, one time is enough.


-- 
chs,



Re: Is fdisk, disklabel and newfs enough to reset an SSD

2013-05-14 Thread Jan Stary
On May 13 21:04:00, pa...@ecentryx.com wrote:
 I would like to reinstall a fresh system on an SSD that contains an
 existing installation. From my limited knowledge of SSDs, I wonder
 if the drive controller may retain data from the old filesystem,
 unaware that there is a new filesystem put in place.

The drive controller knows nothing about filesystems.
It just passes bytes to and from a device.

The OpenBSD installer will just use the disk portion
that you allocate to it. It will not waste time
inspectioing what was on the disk before.

Will there be pieces of the disk that still contain
untouched data blocks of files that existed on some
previous filesystem? Yes, they might.

 Is this a concern?

No.

 If so, how does one reset a used SSD for
 optimal operation with a fresh install?

Just treat it as any other disk - which it is.

On May 13 22:50:08, pa...@ecentryx.com wrote:
 Scott McEachern wrote:
 2) Do you mean there could still be data residing on unused parts
 of the SSD?  Yes, it can happen.
 Yes, this is what I'm referring to. I was hoping there was some way
 to instruct the drive controller that the entire drive space is
 free?

It is, if you say so in the installer.

Making sure there are no datablocks left over is another thing.
The first question would be why would you concern yoursewlf with this.



Re: Is fdisk, disklabel and newfs enough to reset an SSD

2013-05-14 Thread Ted Unangst
On Tue, May 14, 2013 at 15:01, Jan Stary wrote:
 
 If so, how does one reset a used SSD for
 optimal operation with a fresh install?
 
 Just treat it as any other disk - which it is.

Almost, but not entirely.

 
 On May 13 22:50:08, pa...@ecentryx.com wrote:
 Scott McEachern wrote:
 2) Do you mean there could still be data residing on unused parts
 of the SSD?  Yes, it can happen.
 Yes, this is what I'm referring to. I was hoping there was some way
 to instruct the drive controller that the entire drive space is
 free?
 
 It is, if you say so in the installer.

No. OpenBSD knows that space is free, the drive does not. Yes, the
drive cares.



Is fdisk, disklabel and newfs enough to reset an SSD

2013-05-13 Thread Clint Pachl
I would like to reinstall a fresh system on an SSD that contains an 
existing installation. From my limited knowledge of SSDs, I wonder if 
the drive controller may retain data from the old filesystem, unaware 
that there is a new filesystem put in place.


Is this a concern? If so, how does one reset a used SSD for optimal 
operation with a fresh install?




Re: Is fdisk, disklabel and newfs enough to reset an SSD

2013-05-13 Thread Scott McEachern

On 05/14/13 00:04, Clint Pachl wrote:
I would like to reinstall a fresh system on an SSD that contains an 
existing installation. From my limited knowledge of SSDs, I wonder if 
the drive controller may retain data from the old filesystem, 
unaware that there is a new filesystem put in place.


Is this a concern? If so, how does one reset a used SSD for optimal 
operation with a fresh install?




I've done a fresh install of OpenBSD over top of OpenBSD (and other 
OSes) many times across many SSDs and I've never had a problem.


But I'm not entirely sure what you mean...

1)  Do you mean your new installation will see files left over from a 
previous install?  No, it won't.


2)  Do you mean there could still be data residing on unused parts of 
the SSD?  Yes, it can happen.


SSDs have their own way of wear-leveling.  What the filesystem considers 
to be cylinder X, head Y and sector Z will probably not be the same 
*physical* cells on the SSD twice in a row.  That's not a function of 
the OS, but the SSD itself.


Do a little googling and you'll see what I mean:  There's no guaranteed 
way to erase an SSD.  I've read stories of people that have had SSDs 
crap out on them and instead of sending them back to the manufacturer 
for warranty repair/replacement, they just chuck them out and buy new 
ones.  Why?  Because there's no way to guarantee your private data has 
actually been erased.


--
Scott McEachern

https://www.blackstaff.ca

Those who would give up essential liberty to purchase a little temporary safety 
deserve neither liberty nor safety. -- Benjamin Franklin



Re: Is fdisk, disklabel and newfs enough to reset an SSD

2013-05-13 Thread Ted Unangst
On Mon, May 13, 2013 at 21:04, Clint Pachl wrote:
 I would like to reinstall a fresh system on an SSD that contains an
 existing installation. From my limited knowledge of SSDs, I wonder if
 the drive controller may retain data from the old filesystem, unaware
 that there is a new filesystem put in place.
 
 Is this a concern? If so, how does one reset a used SSD for optimal
 operation with a fresh install?

'atactl drive secerase' will tell the drive the old contents are no
longer needed. None of the other tools currently do that.

I don't think it's a concern.



Re: Is fdisk, disklabel and newfs enough to reset an SSD

2013-05-13 Thread Clint Pachl

Scott McEachern wrote:
2) Do you mean there could still be data residing on unused parts of 
the SSD?  Yes, it can happen.
Yes, this is what I'm referring to. I was hoping there was some way to 
instruct the drive controller that the entire drive space is free?


SSDs have their own way of wear-leveling.  What the filesystem 
considers to be cylinder X, head Y and sector Z will probably not be 
the same *physical* cells on the SSD twice in a row.  That's not a 
function of the OS, but the SSD itself.

I understand. That's why I'm concerned about #2 above.

Would dd'ing to the drive all 1s then all 0s be effective?

I see Intel has an SSD Toolbox that does secure erase. It requires 
windows so I am unable to check it out.


www.intel.com/go/ssdtoolbox

I wonder what this utility does to achieve secure erase? Can we 
replicate its functionality with standard Unix tools?