Creating a folder with limited size
To create a folder with fixed size, one of the solutions is to create a limited size filesystem and mount it.
Create a file that will be a container of the filesystem. Just take ANY file on your system that has a suitable size, or create one by
$ dd if=/dev/null of=~/myfs bs=SIZE_OF_BLOCK_IN_BYTES count=SIZE
Format the file with the FS you want
$ mkfs.ext4 ~/myfs
It will say that it creates an FS on a non-block device.Mount the FS
mount -o loop,rw,usrquota,grpquota ~/myfs /path/of/mount/point
alternative link download