On Mon, May 06, 2013 at 07:50:52AM +0100, Stroller wrote:
> 
> On 5 May 2013, at 17:16, Hinnerk van Bruinehsen wrote:
> > ... The data on a SSD is not
> > necessarily stored linar so it's not said that a new partition is using
> > the same memory cells as the old one.
> > … 
> > For a HDD I'd advise to create a copy
> > using dd but from my understanding of SSD technology it's not
> > guaranteed to copy the right (now unused marked) blocks.
> 
> Is anyone able to elaborate on this, please?
> 
> I think I've had a eureka! moment of understanding whilst preparing to 
> compose this reply, but I've always been sceptical of these kinds of 
> statements in the past.
> 
> Surely flash memory devices must present themselves to the o/s as block 
> devices, because that's how all storage devices work, right?
> 
> If I'm now understanding correctly, SSDs present themselves to the o/s as 
> block devices more or less as convenient or necessary. They can be treated as 
> such as long as all the data required is listed in the file allocation table. 
> I'm left wondering how the SSD knows that a file has been deleted, and 
> whether this works for all conceivable file-systems.

The problem is that you can't delete on a flash cell. The process is
simplified: read cell - delete to be deleted stuff in memory - write
memory contents back.

Since flash cells can only be written to a fixed amount of times
(afterwards they become unreliable) there is a concept called wear
leveling. This means essentially that your 128 GB flash drive in reality
hasn't just 128 GB of storage but e.g. 256GB. To spread out the writes
it reads one cell, does the memory operation and write the contents back
to another cell while marking the old cell as unused.
This means two things: you can't really delete something securely
(noteven with tools like shred) and you can't access "overwritten" data
(because it's now inside the unused-marked area).

There is a special command (TRIM [1]) that does the marking after
something was deleted to counter perfomance degradation.

Fun fact: most SSDs that offer a "secure delete" feature (whole disk)
don't really delete anything but are internally encrypted and throw away
the encryption key and generate a new one on receiving the secure delete
command which leads to unreadable data and therefore is a kind of secure
deletion (unless the underlying crypto is broken).

WKR
Hinnerk

[1] http://en.wikipedia.org/wiki/TRIM

Attachment: signature.asc
Description: Digital signature

Reply via email to