<div dir="ltr">Hi there,<div><br></div><div>I was trying to understand why fstrim would fail on an LVM thin provisioned volume and figured out that the discard_max_bytes is reported as 0 in /sys/block/dm-N/queue/discard_max_bytes (I checked the device that corresponded to the LVM pool that the volume is created within). The discard options are also disabled for the thin volume itself. I'm observing this issue on an Ubuntu 12.04 system, running kernel 3.8.0-32, and LVM2 2.02.98 backported to Ubuntu 12.04 (<a href="https://launchpad.net/~timur-alperovich/+archive/ubuntu/ppa/+packages">https://launchpad.net/~timur-alperovich/+archive/ubuntu/ppa/+packages</a>).</div>
<div><br></div><div>I did a small experiment where I created another LVM pool within the same volume group and the discard value was set to 65536 for that device. I'm not sure if it matters, but the system is an running on ESXi 5.0 host. While I don't necessarily expect discard to propagate to the host, I was hoping to reclaim the block in the thin pool itself.</div>
<div><br></div><div>Could anyone shed some light on why discard may be disabled on an LVM thin pool device? I tried looking for any bugs specific to TRIM or discard subsequent to 2.02.98, but could not find anything definitive.</div>
<div><br></div><div>Also, is there a way to enable discard without having to recreate the thin pool?</div><div><br></div><div>Thank you,</div><div>Timur</div></div>