Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

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

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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