V
V
vlarkanov2018-05-17 11:31:36
Debian
vlarkanov, 2018-05-17 11:31:36

Why doesn't fstrim work for a thin storage volume?

There is a storage system Dell MD3600f. It created 12tb thin volume. On the target machine, this volume is mounted as a disk for the Proxmox virtual machine. The problem is this. When the space on the volume began to come to an end, part of the data was transferred to another storage (copied via NFS from the virtual machine itself, then through the OS of the same virtual machine and nailed the data). The system began to write that 8TB is free. In fact, the place soon ended (judging by the data from the interface of the storage system itself), nothing can be written down. Accordingly, the question is how to free up space, the data from which has already been deleted.
I tried to do this:
on the Proxmox server connected to the storage system, I 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--name--vm-- 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 way)

I'm trying to make fstrim:
# fstrim /mnt/mnt-name
fstrim: /mnt/mnt-name: the discard operation is not supported

What am I doing wrong? How to "reclaim" free space? Of course, you can delete a volume from the storage interface, but I would like to understand how to free up space without losing the ENTIRE volume.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ruslan Fedoseev, 2018-05-17
@vlarkanov

not at all in the general case. The storage system should reduce the size of the allocated volume, but it knows nothing about the FS in the volume and, accordingly, has no idea that you deleted something there ...

R
res2001, 2018-05-17
@res2001

Faced a similar situation, but in a different hardware and software configuration (ESXi + storage from HP).
But the scheme of actions is the same:
If all the volumes in virtual machines are thin, then deleting files in the virtual machine is not enough for the freed space to be given to the hypervisor - you need to fill this space with zeros (at least in my case it was), and this location must be at the end of the disk.
If the volumes are thick, then:
1. You must reduce the size of the partition in the virtual machines, and correctly - so that the free space is at the end of the volume. This can be done for thin volumes as well.
2.Reduce the volume allocated to this virtual machine in the hypervisor. Only after that the free space will be available for other VMs.
PS: this is what thin volumes are dangerous for - you should always control free disk space.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question