I've initialised one large primary partition with the -T small
flag to mke2fs
, small
on the system is configured as follows:
small = {
blocksize = 1024
inode_size = 128
inode_ratio = 4096
}
This is a 800 GB SSD (cloud drive) which will be a home for the 10+ million small files, ranging from ~10KB to ~100KB.
I tried to go thoroughly the man pages of mount
and figure out the best combo of flags and here's my list:
rw
- read and writenosuid
- no need for user or group ID on executionnodev
- block dev files should never appear in herenoexec
- files with exec bit set are also not welcomeauto
- allowmount -a
nouser
- onlyroot
can (re)mountasync
- async writingrelatime
- update access time only when files are modified.data=ordered
- presumably should improve read performanceerrors=remount-ro
- stop writing when errorsdiscard
- recommended for SSDauto_da_alloc
- fight filesystem corruption in case of power failure (perhaps not needed, as this is a cloud drive?)inode_readahead_blks=16
- file system will be a home for the great bunch of small files, hence big readahead should be nothing more but a performance penalty. I didn't know the optimal value for files of average size 50KB, so just put here twice as less value as the default.debug
I really need a second opinion from someone more experienced in these matters. I'm particularly unsure about the discard
, relatime
, data=ordered
, auto_da_alloc
, inode_readahead_blks
and other flags, which I have missed or misunderstood. How dangerous is data=writeback
? How much data I may loose with such flag, is it just the last 5 sec (default value of commit)? Other insight regarding this exercise?