Free-up space on logical volume under LVM?
I have a logical volume on an SSD drive that is filled to capacity. Both the VG and the PV are shown as full. I'm thinking I should run fstrim to free-up unused space on the LV. However, the fstrim command requires that I specify a mount point and I'm not sure what the mount point is for an LV under LVM.
I tried "fstrim -av", but this did not trim the LV in question. I also tried using "fstrim -v /dev/mapper/myLVM", but this just gives an error saying the specified mount point is not a directory. So, I'm wondering how to free up space. Thanks for any advice, Eric |
Are your logical volumes full or filesystems on top of them?
If latter, you should remove some useless files. |
Thanks for the reply. Both "pvs" and "vgs" show zero for free space. If I do an "lvs" and add up the used space of all the LVs, it's far less than the capacity of the SSD drive. So, I'm thinking there are unused files within the VG that need to be discarded.
Am I correct? Eric |
Usually volume group and logical volumes are full because it means that all the space is allocated to such resources. This does not mean that your filesystems are full.
You can get disk space statistics using df -h command. |
I really appreciate your help, as I'm totally confused. The main problem I'm trying to solve is to extend the metadata for a certain VG (satassd), but I get an error...
Code:
root@pve:~# lvextend --poolmetadatasize +1G satassd/data Code:
root@pve:~# pvs Despite this report of zero free space, lvs does not seem to show enough usage to fill the satassd VG... Code:
root@pve:~# lvs -a Is the satassd VG locked in some way? Thanks for any insights. Eric P.S. Here's the result of "df -h" Code:
root@pve:~# df -h |
The usual solution is to simply add another physical volume to the pool, thereby increasing its capacity. Then, re-size the logical volume's filesystem to take advantage of the new additional space.
FYI: If you're routinely dealing with a situation where "various directories are automatically filled-up with various things that you really don't need to keep forever," the logrotate utility is a remarkably-versatile thing. Although it is customarily used to keep parts of /var/log under control, it can actually be used anywhere. It will automatically compress files after a specified time period and, if you wish, automatically discard those which have exceeded a specified age. |
Code:
bleachbit |
You have an LV named data that occupies 1.8TB. Therefore, the VG is full. I guess data is your thin pool, so that you should be able to create more thin LVs.
Actually, it's not quite clear to me what you want. data can't be extended without adding PVs to the VG, that's certain. |
As I understand it, thin-pools are made up of two components: data and metadata, each of which are stored in their own specialised type of lv.
e.g. data [data_tdata] [data_tmeta] Problem seems to be that OP, or a predecessor thereof, didn't make the data_tmeta lv big enough and now wants to increase it, but all remaining space in the VG is allocated to the the data_tdata component of the thin pool. OP has free space in the data component, but non in the vg itself. The problem (s)he has now is that -- unless things have changed recently -- there's no way to non-destructively shrink the LV holding the data_tdata component in order to free up unused extents to expand data_tmeta with. 1st rule of LVM Club: never allocate it all. Always leave a portion free for unforeseen growth -- Doesn't help OP now of course, but it's a valuable lesson for the future, and the rest of us. Personally, I'm not a fan of thin-provisioning. While it has its niche uses, unless one is very attentive, and can quickly and easily respond to the requirement of additional storage for the pool, under-provisioning storage is just asking for trouble somewhere down the line. |
Hmmm ... I had failed to notice that. Yes, "thin pools" are definitely an edge-case and I have never liked the idea of them. I don't know if the OP ever said why a decision might have been made to use them in his shop.
|
All times are GMT -5. The time now is 05:52 PM. |