Hello, on my new server several friends are using their home folder to store things and it rapidly becomes a nightmare. So in order to restrict the usage of the 4 To of the server, each user will have a limited owned « file » size. For this purpose I will use quota on debian on the /home :

first check or install quota tools :

apt-get install quota quotatool

Once done we need to edit the fstab file to tell linux that we will use quota on the wanted mountpoint :

nano /etc/fstab

/dev/mv5        /home   ext4    defaults,relatime,usrquota      1       1

now we can remount the partition or restart the computer :

mount -o remount /home

Now we can create the needed quota files to store the needed quota, we can do it by using touch but the lazy manner is to use quota itself to create thoses files :

quotacheck -vagum -F vfsv0

you can now check if the files were written in the /home

kraken@ocean:~# ls -all /home/
total 40000
drwxr-xr-x  5 root   root  4096 Dec  7 15:28 .
drwxr-xr-x 22 root   root  4096 Dec  2 20:05 ..
-rw-------  1 root   root  7168 Dec  7 15:28 aquota.user

now you can edit a user quota : (here limited to 120 Go)

edquota -u uSEr

Disk quotas for user uSEr (uid 1000):
  Filesystem                   blocks       soft       hard     inodes     soft     hard
  /dev/mv5                          8          0 1200000          2        0        0

and finally starting and checking quota :

quotaon -a

kraken@ocean:~# repquota -a
*** Report for user quotas on device /dev/mv5
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --      20       0       0              2     0     0       
plex      --       8       0       0              2     0     0           
uSEr    --       8       0 1200000              2     0     0

everything is set you can enjoy the limit 😉