Our storage layers are the following in a standard setup:
- Outside of the OS:
- LUN on SAN
- VMware VMFS volume on LUN
- virtual disks (VMDKs) on the VMFS
- Inside the OS (Linux):
- the VMDK corresponds to an LVM PV (physical volume) directly on the device (no partitions)
- 1 PV = 1 VG = 1 LV, which finally contains:
- the filesystem (ext3)
Note that we are not talking about the root disk here.
Now to the question.
Sometimes there are users who need more space on a volume temporarily. Meaning: They want to give the space back after they are done. / I want to take it back after they are done.
- It's not as easy as creating a symlink to a second volume that we can create temporarily, in order to be removed again later. That is because sometimes it is not known in advance exactly where the space is required. Also, in that case it may not be 100% transparent because data may have to be moved around for this. So I won't consider this an acceptable answer.
- I won't expand the physical volume (because that would require making the VMDK bigger and you can't easily make it smaller again).
- The same applies to the filesystem.
- The only solution thus seems to use the LVM layer for which it is no problem to expand and reduce at will.
- But: the filesystem on top of it can only be easily expanded, not shrinked.
So what would be a possibility to do this on-the-fly and without any sort of downtime, thus completely transparently?