--get your your Linux knowledge
> Linux Reviews > System administration >

File system guide

A quick guide to Linux filesystems

  1. Maximum On-Disk Sizes of the Filesystems
  2. ext2 - the choice for your boot partation
  3. ext3
  4. reiserfs
  5. xfs
  6. defragging

Note that all filesystems need to be supported by the kernel if you with to use them (compiled in or by modules. Your root filesystem must be compiled into the kernel).

The filesystems manual page shows an overview of Linux filesystems.

1. Maximum On-Disk Sizes of the Filesystems

Filesystem File Size Limit Filesystem Size Limit
ext2 with 1 KiB blocksize 16448 MiB (~ 16 GiB) 2048 GiB (= 2 TiB)
ext2 with 2 KiB blocksize 256 GiB 8192 GiB (= 8 TiB)
ext2 with 4 KiB blocksize 2048 GiB (= 2 TiB) 16384 GiB (= 16 TiB)
ext2 with 8 KiB blocksize (1) 65568 GiB (~ 64 TiB) 32768 GiB (= 32 TiB)
ReiserFS 3.5 (Linux 2.2) 4 GiB 16384 GiB (= 16 TiB)
ReiserFS 3.6 (Linux 2.4) 1 EiB 16384 GiB (= 16 TiB)
XFS 8 EiB 8 EiB
JFS with 512 Bytes blocksize 8 EiB 512 TiB
JFS with 4KiB blocksize 8 EiB 4 PiB
NFSv2 (Client side) 2 GiB 8 EiB
NFSv3 (Client side) 8 EiB 8 EiB

(1) Systems with 8 KiB pages like Alpha only

2. ext2 - the choice for your boot partation

Simple and old filesystem, stable but has no fancy features. Your /boot partation should be ext2 because this is the most compatible choice.

/etc/fstab example:

   /dev/hda1       /boot   ext2           noauto,noatime                     1 2

/dev/hda referes to the first harddrive in the system and 1 point to the first partation on that drive. noauto means the partation should not be mounted automatically at boot; this is a good choice because you only need to access your boot partation when doing maintainance/changes.

3. ext3

ext3 is the modern version of ext3, a ext3 partition is actually just a ext2 file system with a journal. ext3 partitions can without problems be mounted as ext2. Though it is not fastest or more efficient file system, is it the one most commonly used by distributions. Reiserfs is faster and more efficient than ext3, **but does not provide equally good protection against file corruption and loss of data on unclean shutdowns (power failure and other negative events).

ext3 is the best and obvious choice for production systems.

4. reiserfs

This is a very fast file system and is efficient for both for small and large files. Reiserfs is a good choice for the / filesystem as well as /home and /public for home users. Reiserfs is not as good as ext3 when it comes to protection against loss of data.

In /etc/fstab you can choose between mounting reiserfs with the options noatime and notail.

/etc/fstab example:

   /dev/hda3       /       reiserfs       noatime,notail                     0 1
   /dev/hda5       /home   reiserfs       noatime,notail,rw,user,exec,auto   1 1
  • noatime turns off atimes for increased performance (atimes normally aren't needed)
  • notail increases performance of ReiserFS (at the expense of storage efficiency).
  • rw read & write...
  • user any user can mount it, not just root,
  • auto mounted at bootup

fstab manual page

Drop the noatime options if you want and to switch between notail and tail freely.

5. xfs

If you have or want a large partition that will contain mainly very large files (your xvid and vcd collection), xfs is your choice.

6. defragging

Old and poor filesystems like fat cause file fragmentation, hence the DOS/Window "defrag" tools. This is not needed with any Linux filesystem, as these handle these issues in a far more fancy way.

thanks to everbody @ #gentoo on efnet

Meet new people