[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Filesystem and free space



On Sun, Dec 12, 2021 at 02:13:19PM -0500, Polyna-Maude Racicot-Summerside wrote:
I know there's quota but what I want to ensure is simply that no user
can write to disk unless there's at least 2 GB left free on partition.
Is this possible ?

As another has mentioned, there's reserved-blocks-percentage at
filesystem creation time, but it only distinguishes between superuser
and not-superuser. But you could set the % such that the reserved space
was 2GiB that way.

Personally, I leave the reserved block quota at the default (which means
I can always do some basic things as root) and for the filesystems which
need reserved space to operate, I create an empty non-sparse file of the
appropriate size:

▶ stat /mnt/emergencySpace File: /mnt/emergencySpace
  Size: 1073741824      Blocks: 2097152    IO Block: 4096   regular file

If/when the filesystem fills up such that the operations that need space
fail, I can quickly remove the emergencySpace file, run those operations,
and then do a deeper clean-up (removed old backup increments, or whatever
has caused the fill-up).


--
Please do not CC me for listmail.

👱🏻	Jonathan Dowland
✎	 jmtd@debian.org
🔗	https://jmtd.net


Reply to: