SSD drives

Roberto Ragusa mail at
Mon May 28 14:55:07 UTC 2012

On 05/26/2012 03:53 PM, Juan Orti Alcaine wrote:

> I suspect it isn't working because "cryptsetup status
> /dev/mapper/luks-uuid" does not say anything about discards. I think
> it must say "flags: discards"
> Any suggestion?

Directly testing if discard is working is doable, but not easy.
Create a file with known content, and identify the hardware sector
where it is mapped.
You can use "filefrag -v", but you will have to compensate for
all the layers (LV, PV, luks).

Maybe it is easier to play with

blktrace -o - --dev <<<YOUR_DEVICE>>> |blkparse -i -

and identify the physical blocks you are writing your file to
(sync, start blktrace, create the file, sync, stop blktrace).

Then you read (with dd) the blocks from the crypted device (that is,
the one which does not do any decryption, e.g. /dev/sda), delete the file
and read the block again. If you get all zeros, discard is really
working; if not, it is probably not working.

Thinking about it: maybe blktrace is able to show you the discard command
in its output...

   Roberto Ragusa    mail at

More information about the devel mailing list