[Solved] Does LVM2 enable trimming of hard disks – does it really get zeroed?

WGRM Asks: Does LVM2 enable trimming of hard disks – does it really get zeroed?
I recently had to buy a new hard disk for my system. I’m running on a ssd, but for virtual machines i tend to use a hard disk. Since it had to be partitioned and formatted, i used LVM to add it to its own volume group and created one logical volume which was formatted with ext4.

Everything works fine. But when i trimmed my ssd with fstrim it took way too long. Turns out, that my hard disk was trimmed, too!

The filesystem is created with:

Code:
Default mount options:    journal_data_ordered user_xattr acl
Mount options:            barrier nodiscard utf8

I confirmed this later with the tool blktrace which reports trimming calls to this logical volume. Somewhere between the lines i even saw a DEL or DL with some nummeric address.

My question is: Does enable LVM2 hard disks to be trimmed? Could it be, that the hard disk supports this? (IIRC it would have to, so that fstrim can work on it)

I’m old enough to know PIO. The first optimization was to eradicate the zeroing. I’d like to trim my hard disks, so that everything gets zeroed. I could disable trim when mounting and issue it with fstrimwhen the time fits. Would be great!

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.