[linux-lvm] Questions about issue_discards

Mike Snitzer snitzer at redhat.com
Fri Dec 7 14:18:27 UTC 2012


On Thu, Dec 06 2012 at  5:25pm -0500,
CJ Kucera <pez at apocalyptech.com> wrote:

> Hello, list!
> 
> I've started to play around with SSD drives and was curious about a
> couple aspects of the issue_discards configuration option.
> 
> 1) The lvm.conf comments note that when enabled, it'll still only
> (obviously) issue discards to storage which happens to support it.  Is
> there a way of querying block devices to find out if they support the
> feature?

lvm will only issue discards if the underlying device has non-zero
discard_granularity and discard_max_bytes, to check:

cat /sys/block/<dev>/queue/discard_granularity
cat /sys/block/<dev>/queue/discard_max_bytes

(replace <dev> accordingly, e.g. sda)

> 2) Would a change to the issue_discards parameter be picked up
> automatically by the running kernel?  The lvm.conf manpage mentions that
> it remembers the timestamp of the file "between commands" and will apply
> changes then, but it almost sounds like that'd be mostly for things like
> the device scanning list, etc.

lvm.conf's issue_discards doesn't have any affect on the kernel (or
underlying device's) discard capabilities.  It only controls whether
discards are issued by lvm for certain lvm operations (like when an LV
is removed).




More information about the linux-lvm mailing list