I have a program that writes files to disk. I want to test the programs behaviour when the filesystem written to is full.

What is the best option for creating a small filesystem to test this without having to order disk setup which on the SAN... I guess Ram disk requires reboots which is not great.

2 Answers 2


Use a loop device sounds good. You can dd to a file, and then make an fs on the file, and loop mount it for testing. You can even simulate partitions. http://www.andremiller.net/content/mounting-hard-disk-image-including-partitions-using-linux


You should use /dev/full as it is made available just for that.
/dev/full is virtual device that is always full.

$ echo "Hello world" > /dev/full
bash: echo: write error: No space left on device

See http://en.wikipedia.org/wiki//dev/full

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.