Filesystems

Disambiguation

filesystem (data structure) and filesystem (directories organization)

Data structure
  • Dictate the way files are stored on a physical medium

    • Responsible for organizing and keeping track of them

  • Strongly dependant on the Operating System

  • Exist in several flavours

    • FAT, FAT32, NTFS, ext{2,3,4}, HFS, xfs, APFS, ISO9660, UDF, NFS, SMB, …​

Filesystems

Data structure
  • Rule the way files and directories may be named
    ⇒ filename length, case sensitiveness, character encoding

  • May provide metadata for each file
    ⇒ # sector used, creation/access/modification time, …​

  • May provide data journaling
    ⇒ To recover from system crash or power failure

The Windows Filesystems

  • Is the reason why the 8.3 naming scheme exists

  • Has good interoperability

  • Lifts the 8.3 limit on filenames

  • Allows for scalability, security (ACL, encryption), journaling, transactions, quotas

  • Has poor interoperability outside of the Windows ecosystem

The Windows Organization

  • Windows volumes represent partitions on physical disks formatted with a recognized FS

    • Mostly NTFS, some FAT, vFAT and FAT32

  • You can have as many volumes as there are letters in the English alphabet

    • C, D …​

    • Each volume has its own formatting scheme

  • C is usually the System Disk with a well known set of directories

  • File separator is \ (backslash)

    • ex. C:\Windows\System32\wsl.exe

  • Case insensitive in the general case

The Linux Filesystems

  • Linux default FS is ext4 [Extended File System]

  • Can read almost every FS, whatever its origin and age

  • Most of them can be written too

The Linux Filesystem Hierarchy Standard

  • Linux inherits the Unix filesystem hierarchy where everything is united into a single tree

    • With a single root named /

  • A common set of directories (under the root directory) regardless of the distribution

  • Partitions of physical drives are attached to mount points into this tree

  • There is no concept of volume as there is with Windows

  • File separator is / (slash)

    • ex. /usr/bin/ls

  • Strictly case sensitive

The Linux Filesystem Hierarchy Standard

The FHS well known structure
/
├── bin
├── boot
├── dev
├── etc
├── home
├── lib
├── mnt
├── opt
├── proc
├── root
├── run
├── sbin
├── sys
├── tmp
├── usr
└── var

Filesystems comparison

FS

Max length

Allowable chars

Max size

Max #files

filename

pathname

file

volume

FAT32

8.3 (255 UCS-2 chars with LFN)

32,760 Unicode chars

Unicode except NUL, "*/:<>?\|

4 GiB

16 TiB

?

NTFS

255 chars

32,760 Unicode chars

Win32: Unicode except NUL, "*/:<>?\| (case insensitive).
POSIX: any UTF-16 except NUL and / (case sensitive)

8 PiB

8 PiB

232

ext4

255 bytes

No limit

Any byte except NUL and /

16 TiB

1 EiB

 232

Excerpt from: Comparison of file systems (Wikipedia)

References

‡ : read thoses pages on your own operating system, not on the Internet!