Filesystems
| Disambiguation |
filesystem (data structure) and filesystem (directories organization) |
-
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
-
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
-
-
Cis 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
/ ├── 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 |
4 GiB |
16 TiB |
? |
NTFS |
255 chars |
32,760 Unicode chars |
Win32: Unicode except |
8 PiB |
8 PiB |
232 |
ext4 |
255 bytes |
No limit |
Any byte except |
16 TiB |
1 EiB |
232 |
Excerpt from: Comparison of file systems (Wikipedia)
References
-
"Unix Text Processing", Dale Dougherty and Tim O’Reilly, Hayden Books, 1987
https://www.oreilly.com/openbook/utp/ -
Christophe Blaess cheat sheets[FR]
https://www.blaess.fr/christophe/developpements/aides-memoires/-
Unix commands[FR]
https://www.blaess.fr/christophe/memo_commandes_unix.html -
Shell programming[FR]
https://www.blaess.fr/christophe/memo_programmation_shell.html
-
-
Rich’s sh (POSIX shell) tricks
https://www.etalabs.net/sh_tricks.html -
Bash Reference Manual
https://www.gnu.org/software/bash/manual/bashref.html
-
Advanced Bash-Scripting Guide
http://tldp.org/LDP/abs/html/ -
"Mastering Regular Expressions, 3rd Edition — Understand Your Data and Be More Productive", Jeffrey Friedl
https://www.oreilly.com/library/view/mastering-regular-expressions/0596528124/ -
"GAWK: Effective AWK Programming", Edition 4.1
http://www.gnu.org/software/gawk/manual -
Manual pages‡ :
bash(1),grep(1),regex(7),gawk(1)
‡ : read thoses pages on your own operating system, not on the Internet!