-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LVS showing wrong size of data used #48
Comments
If i put in my fstab |
Yep this is all ok/normal - you can either mount your ext4 filesystem with automatic discard - or you can mount it without discard and run 'fstrim' periodically i.e. by cron - if you wonder why is the 2nd. option better is - it's performing way better as discarding data with each removed block is quite expensive and also you may not get big enough 'blocks' for discard as clearly the minimal 'worth' discard must discard at least single think chunk. Hopefully this makes it more clear. |
Ok thanks for your explanation ! Will have to think about this :) |
Triming the filesystem makes sense if the underlying devices is processing it. So the graph extX -> thin -> thinpool -> hdd/sdd - makes obvious that whenever you use thin - and you want to release space in thin-pool for some reason - you need to discard unused space - for this 'fstrim' command your best option. When you use 'extX -> NVMe' - trimming can release blocks on device allowing disk to prepare such block for reuse - this was helpful in past to avoid slowdown of SSDs - but nowaydays it's not so much useful.... (note - usually the size of this block is 512KiB or more.... - so discard of unaligned blocks bellow this size will not help at all.... |
Ok thanks for all information. In my case i have one pool and about 30 volumes in it. So i have to create a crontab to fstrim all volumes ? Or there is something that i can do on the whole pool ? Volumes's data in my case are really changing a lot. |
Thin pool itself has no idea who is user of allocated thin-pool chunks - so it always has to be driven through the filesystem. Also it's good idea to trim your fs before you take its thin snapshot. If you remove space in your filesystem - and you continue to use your filesystem - then this space gets quickly reused anyway - and in the case the space is not discarded in thin-pool - there is no need to provision chunks again - so it's faster! Note - filesystem is on the top of block device which is your thin volume - there is no connection between those two. |
Yesterday i had the case where I put some data, I deleted the data, I add again some data ( 50% space of the maximum possible), and the thin pool was 100% with warnings So i don't think the space is guickly reused.. |
Here I think you are comparing apples & oranges. If you know you will not need the space in any given filesystem - aka you know you are mostly deleting all data in FS and you are not going to fill it again - then clearly 'fstrim' IS the tool you want to use after such massive delete. If this is your typical use-case - then you may need to schedule 'fstrim' to be run more often. Also note - thin-pool IS not meant to be used around its boundary conditions as a part of regular workflow - condition of the full thin-pool is not equivalent case to full filesystem. |
My goal is to use it on a torrent system. So users can add content, delete it few days later, so the content is regularly changing. |
Hopefully you now understand associated logic around thus closing the issue. |
I encouter a problem/bug with Debian 10 and my LVM Thin just installed.
I setup my lvm with this :
No problem, all is working.
I add some data, ok space is growing up..
I delete the data, and.. the lvs report again the same value, the value of never decrease.
df-h report the right value 1% used, but lvs report 30% used.
If i use this command :
fstrim -v /home/whisper40/data/user
it updates the data value. But i don't understand what's wrong with this, it should report me all time the right value. I don't want to execute this command everytime.. that makes no senseThis is my discard mode
I already read the Discard part of this documentation : https://man7.org/linux/man-pages/man7/lvmthin.7.html
My windows machine has NVME disk
I'm running thoses commands on Debian 10 on Vmware
The text was updated successfully, but these errors were encountered: