Why fstrim doesn't work for thin volumes on the storage system?

There is storage Dell MD3600f. It created thin 12TB volume. On the target machine, the volume mounted as the drive for the Proxmox path. Here is the problem. If the volume began to approach the end part of the data was moved to another location (copied via NFS from the path, then OS via the same new path and arrived data). The system began to write, freely 8TB. In fact, the place soon came to an end (according to the data from the storage interface itself), to record anything. Accordingly, the question is how to free up space, the data from which, as it was removed.

I tried to do so:
on the Proxmox server is connected to storage mounted
mount-t ext4-o discard /dev/vg-name/vm-xxx-disk-1 /mnt/mnt-name/
or
mount-t ext4 -o discard /dev/mapper/vg--vm--name--xxx--disk--1 /mnt/mnt-name/
or via fstab:
/dev/mapper/vg--name-vm--xxx--disk--1 /mnt/mnt-name ext4 defaults,noatime,discard 0 1
(tried this way and that)


Trying to do fstrim:
# fstrim /mnt/mnt-name
fstrim: /mnt/mnt-name: the discard operation is not supported


What am I doing wrong? How to "return" the free space? Remove a volume from the storage system interface, of course, possible, but I would like to understand how to free up space without losing the ENTIRE volume.
June 5th 19 at 21:33
2 answers
June 5th 19 at 21:35
Solution
no one in the General case. To reduce the size of the allocated volume storage needs, and it is about FS in volume anything do not know and therefore have no idea that there is something removed...
June 5th 19 at 21:37
Faced with a similar situation, but in a different configuration of hardware and software (ESXi + hranica from HP).
But the procedure is the same:
If you have all the volumes in virtualcad thin, one delete files in virtual reality and not enough vacant place was given to the hypervisor needs to score this place with zeros (at least in my case it was so), and this place should be at the end of the disk.

If the volumes are thick, then:
1.You should reduce the size of the partition in a virtual machine, with correctly - so there was a vacant place in the end of the volume. This can be done in the case of thin volumes.
2.Reduce the volume allocated to this virtual machine in the hypervisor. Only after this free place will be available for other VMS.

PS: this is dangerous, and thin Tom - you always need to monitor free disk space.

Find more questions by tags ProxmoxLVMDebianSystem administration