Sample Header Ad - 728x90

LVM SSD cachepool how to trim (Debian 10)

1 vote
0 answers
477 views
I was playing with LVM and I was setting up a volume with ext4 on an HDD and I want to use an SSD as a cache. What I first done was lvcreate --type cache-pool -l 100%FREE -n datacache SSD /dev/sda3 lvcreate --type cache -l 100%FREE -n data --cachepool datacache SSD --cachemode writeback /dev/sdb1 So respectivily I created a cache-pool voume called datacache and than a vomume called data attached to datacache. I think (the problem is I don't remember) that fstrim works perfectly in this way. Then I had to do some operations on disk and I had to deattach my cache. So I uncached my disk lvconvert --uncache /dev/mapper/SSD-data Then I moved the disk (and other thinks) and at the end I reattached my disk to a cache-pool lvcreate --type cache-pool -l 100%FREE -n datacache SSD /dev/sda3 lvconvert --type cache --cachemode writeback --cachepool datacache SSD/data The problem is that now if I fstrim i obtain root@me:~# fstrim -a fstrim: /mnt/data: FITRIM ioctl failed: Argument not valid I am not completly sure that before detaching and reattaching the cache it worked, but I suppose to because I tested fstrim and I don't remember any errors. I am using debian buster. root@me:~# uname -a Linux me 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 GNU/Linux Thank you in advice. If I missed some important information I am really sorry. Tell me what you need and I'll post it :D
Asked by Ruggero (11 rep)
Mar 18, 2021, 11:27 AM