Which filesystem / filesystem option to use for /tmp partition

ext4filesystemstmptmpfs

When using a separate disk partition for /tmp, ie /dev/sda4, what filesystem is most suitable ?

ext4 seems inappropriate: I don't need journal, I don't need that lost+found directory there either.

Preferably I would reformat the partition anew at ever boot, so
filesystem/check recovery does not make sense.

In a situation where I don't want to use tmpfs for /tmp, what filesystem would be best for /tmp ?

Best Answer

I would personally go for tmpfs, as it stores files in memory, overall much faster.

I found this: https://askubuntu.com/questions/1637/good-filesystem-for-tmp

tmpfs: is a filesystem which stores its files in RAM. This doesn't mean that the filesystem will eat all your RAM. Instead it takes only that amount it really needs. Usually only some MB are needed. If you'll use it, add a line like: none /tmp tmpfs size=64M,mode=1777 0 0 to your /etc/fstab. You can change the size to a value you like. If you think at some point that it is too less, you can use mount to increase the size: mount -t tmpfs tmpfs /tmp -o size=128M,mode=1777,remount. The size will be increased in place without deleting existing files.

ext2/3: You said in your question that you don't need any fancy features. However I would advice for using a journal. Because if you use ext2 and you have a quite large /tmp it would take some time for checking it. ext3 boots any many cases faster. Therefore I would suggest the use of journalling.

ext4, reiserfs etc.: Some software uses /tmp for storing large amounts of small files. So in some cases there are no more free blocks and the filesystem is full. ext4 and also reiserfs store files in a different way. So it could be a good choice to use those for your /tmp.

If your computer runs for a long time, it is a good idea to delete unused files in /tmp. tmpreaper is one solution which does that for you.

However my first choice would be using tmpfs.

EDIT: Since you do not want a Lost+Found directory nor tmpfs, btrfs and reiserfs/reiser4 do not have a Lost+Found, afaik, maybe you would want to use one of those? I would recommend btrfs over reiserfs/reiser4.

Comparison of file systems: http://www.phoronix.com/scan.php?page=article&item=linux-40-hdd&num=1

Related Question