Gentoo Archives: gentoo-user

From: Volker Armin Hemmann <volkerarmin@××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Recover on SSD
Date: Mon, 06 May 2013 17:34:32
Message-Id: 5187E99C.2030105@googlemail.com
In Reply to: Re: [gentoo-user] Recover on SSD by Hinnerk van Bruinehsen
1 Am 06.05.2013 13:00, schrieb Hinnerk van Bruinehsen:
2 > On Mon, May 06, 2013 at 07:50:52AM +0100, Stroller wrote:
3 >> On 5 May 2013, at 17:16, Hinnerk van Bruinehsen wrote:
4 >>> ... The data on a SSD is not
5 >>> necessarily stored linar so it's not said that a new partition is using
6 >>> the same memory cells as the old one.
7 >>> …
8 >>> For a HDD I'd advise to create a copy
9 >>> using dd but from my understanding of SSD technology it's not
10 >>> guaranteed to copy the right (now unused marked) blocks.
11 >> Is anyone able to elaborate on this, please?
12 >>
13 >> 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.
14 >>
15 >> Surely flash memory devices must present themselves to the o/s as block devices, because that's how all storage devices work, right?
16 >>
17 >> 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.
18 > The problem is that you can't delete on a flash cell. The process is
19 > simplified: read cell - delete to be deleted stuff in memory - write
20 > memory contents back.
21 >
22 > Since flash cells can only be written to a fixed amount of times
23 > (afterwards they become unreliable) there is a concept called wear
24 > leveling. This means essentially that your 128 GB flash drive in reality
25 > hasn't just 128 GB of storage but e.g. 256GB. To spread out the writes
26 > it reads one cell, does the memory operation and write the contents back
27 > to another cell while marking the old cell as unused.
28
29 emm - no. Wear leveling does not need any spare blocks. A lot of drives
30 do have spare blocks, but those are never the same size of the original
31 size (at least not on drives you can buy for a sensible amount of
32 money). More like 120+8 or 160+16 or 256+16.
33
34 The spare blocks are used like on a hdd: some block goes bad, another
35 one is mapped in.
36
37 Since the sdd firmware does not know if something was deleted or not* -
38 it does know shit about filesystems**, you can of course dd an image, if
39 you want to. Just like on a hdd.
40
41 *there are drives that do garbage collection without TRIM for fat and or
42 ntfs.. so they seem to know a bit about filesystems.
43
44 ** and this is why TRIM exists in the first place. To tell the drive:
45 yes, this data is gone. You don't need to care about it anymore.

Replies

Subject Author
Re: [gentoo-user] Recover on SSD Hinnerk van Bruinehsen <h.v.bruinehsen@×××××××××.de>