D
D
Denis Savitsky2012-06-04 16:20:11
linux
Denis Savitsky, 2012-06-04 16:20:11

How to limit the maximum size of a directory?

Is it possible to limit the maximum size of a directory in linux? I need this in order to test how the application will behave when out of memory (maybe there are better ways).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Savitsky, 2012-06-04
@qweewq

Create a disk with a size of almost 100mb and mount to /home/user if such a directory exists:

dd if=/dev/zero of=/userdisk.fs bs=1024 count=100000
mkfs.ext3 /userdisk.fs
mount -t ext3 -o loop /userdisk.fs /home/user

Revert everything back:
umount /home/user
shred /userdisk.fs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question