Understanding Linux file system for Windows users
The file system is integral to an Operating System to store and organize data. It can be fixed (e.g. internal Hard Disk Drive) or removable (e.g. Optical Drive or Flash Drive) media devices.
|Filenames are case sensitive||Filenames are not case sensitive|
|Path separator is
||Path separator is
|No drive letter for devices||Devices denoted by drive letters|
|File system has a main
||No common root directory|
Windows users are familiar with disk letters to access the different file systems. Each storage device is given a “drive letter” and disjoint from each other. So each drive is accessed from its own root directory.
Linux does it differently. It makes the file system seamless across the different storage devices. Other device file systems are accessible at arbitrary directories under the root directory. The root directory can be considered as the main directory and is denoted by
/ (single forward slash). In other words, you
mount (connect) the file systems and they appear as just another sub-directory at the mount points.
The structural layout is best explained with an example. Let’s say we have 4 storage devices.
Device1 – Internal HDD where the OS is installed
Device2 – Internal HDD which is used to store data
Device3 – Optical CD/DVD drive
Device4 – External flash drive
On Linux it could be made to appear as shown below. You simply create a “standard” directory structure and
mount the various devices at those end points (called
mount points). Then just like on Windows you could add sub-directories and files under the
/ Device1 |__ some | |__ nested | |__ directory | |__foo2 Device2 |__ foo3 Device3 |__ media |__ foo4 Device4
So you would access these file systems differently on Linux and Windows.
A good example to see how Windows drive letters can be emulated on Linux is to have a look at
Cygwin. It creates an intermediate
cygdrive directory for organizing but could be done without it. Directories
e are created to which the devices are mounted.
Users from a Windows background might find the mounting of devices a bit odd. But once you understand the underlying design, it’s a powerful and flexible concept.