Allocating uninitialized file blocks
Allocating uninitialized file blocks
Posted Apr 19, 2012 9:48 UTC (Thu) by epa (subscriber, #39769)Parent article: Allocating uninitialized file blocks
If enough already-zeroed blocks aren't available (or they aren't contiguous enough) then you still have to go to the work of initializing blocks when fallocate() is called. But if those blocks are never used and the file is then shrunk or deleted, the zeroed blocks are still available for next time so the work isn't entirely wasted.
Posted Apr 19, 2012 14:56 UTC (Thu)
by vonbrand (subscriber, #4458)
[Link] (9 responses)
The problem is that zeroing blocks is work, and besides SSDs (and RAIDs) shouldn't be written except when really needed. Why not just split the range fallocated and just rewrite the affected blocks, not the whole range?
Posted Apr 19, 2012 17:01 UTC (Thu)
by epa (subscriber, #39769)
[Link]
Posted Apr 19, 2012 18:40 UTC (Thu)
by slashdot (guest, #22014)
[Link]
Posted Apr 20, 2012 7:32 UTC (Fri)
by Cyberax (✭ supporter ✭, #52523)
[Link] (6 responses)
Posted Apr 20, 2012 19:31 UTC (Fri)
by drag (guest, #31333)
[Link] (5 responses)
Anyways, I believe TRIM just tells them that the blocks are no longer being used. It's not a order to zero out the blocks. Without trim the SSD doesn't know if the file system still expects them to be used or not.
Posted Apr 20, 2012 20:17 UTC (Fri)
by dlang (guest, #313)
[Link]
If you were to take apart the drive and bypass the controller to read the flash chips directly, you would have a chance at recovering the data.
Posted Apr 20, 2012 21:33 UTC (Fri)
by Cyberax (✭ supporter ✭, #52523)
[Link] (3 responses)
Its presence is indicated by the 'Deterministic read data after TRIM' capability (you can check it using "hdparm -I"). So it's not like you need to blindly trust your SDD.
>Anyways, I believe TRIM just tells them that the blocks are no longer being used. It's not a order to zero out the blocks.
With deterministic zeros one can also use it as a way to quickly erase blocks.
Besides, overwriting something on SDD in most cases would NOT actually overwrite it in the real hardware flash due to load balancing and remapping.
Posted Apr 20, 2012 21:39 UTC (Fri)
by dlang (guest, #313)
[Link] (2 responses)
Posted Apr 20, 2012 21:45 UTC (Fri)
by Cyberax (✭ supporter ✭, #52523)
[Link] (1 responses)
However, TRIM command can't be queued. So it probably makes no sense to use it for large allocations and/or to keep a pool of recently-trimmed pages for immediate small allocations.
Posted Apr 20, 2012 21:51 UTC (Fri)
by dlang (guest, #313)
[Link]
The SSD does keep a pool of unused pages for new allocations. What trim does is it lets the SSD know that you no longer care about the data on that block, and so it can add the block back to that pool.
If the SSD runs out of this pool, writing slows drastically as it must first erase a block before it can write anything. If you are expecting to do a LOT of writing to a SSD, you may want to make sure that you partition it to something less than the advertised size so that that extra space will remain in the pool (this works as long as that extra space has never been written to, or is explicitly relased via a TRIM command)
Allocating uninitialized file blocks
Allocating uninitialized file blocks
Allocating uninitialized file blocks
Allocating uninitialized file blocks
Allocating uninitialized file blocks
Which is a very very unsafe assumption.
Allocating uninitialized file blocks
Allocating uninitialized file blocks
Allocating uninitialized file blocks
Allocating uninitialized file blocks
Allocating uninitialized file blocks