Hello and welcome to this section on the Linux file system. A file system controls how data is stored 1
and retrieved. Without a file system data placed on a storage medium, like a hard disk drive or USB stick, 2
would be one large body of data with no way of telling where one piece of it stops and where another 3
one begins. By separating the data into pieces and giving each piece a name 4
the data is easily isolated and identified. Before computers 5
the term file system was used to describe a method of storing and retrieving paper documents. 6
Now each group of data is called a file and the structure and the logic is used to manage the files 7
and their names are called file systems. 8
In other words, a file system is a logical collection of files on a partition or disk. 9
Your hard drive can have multiple partitions, which usually contain only one file system. 10
On a Linux system, everything is considered to be a file, including physical devices like a USB stick. 11
Even a directory is also a special kind of file and, if something is not a file, then it's a process. 12
On Linux the structure of the file system is hierarchical, much like an upside down three, the 13
root directory, which is a /, lies at the base of the file system and all other directories are 14
spreading from there. 15
Note that most of the times, the terms folder and the directory are interchangeable; directory is 16
a classical term used since the early times of the file systems 17
while folder is a sort of friendly name which may sound more familiar to Windows users. A directory 18
is a file system concept and the graphical user interface metaphor that is used to represent it is called 19
folder. 20
So a folder is more like a graphical interface object. 21
However, I think that's not such a big deal if you use them interchangeably. 22
There's also the concept of Filesystem Hierarchy Standard (or FHS) which defines the directory structure 23
and contets for Linux distributions. 24
Let's go to the terminal and the list the contents of the root directory. 25
This is the contents of the root directly , 26
the forward slash. In the file system hierarchy standard 27
all files and directories appear under the root directory, even if they are stored on different physical 28
devices like on different disks or partitions. 29
This is one of the differences when comparing to Windows file system where there isn't such a unique 30
file system tree. 31
Imagine that on Windows you can have more partitions or disks which are accessed as drive letters in 32
my computer without a common directory at the base. In Linux 33
there is only one file system tree under the root directory at the very top. 34
When you want to access an additional file system, like the one on a USB stick, you need to mount it 35
or logically attach it to an existing directory of the unique file system. That directory is called Mount Point. 36
Just to make it clear, I’ll insert a USB stick. 37
If you’ve installed VirtualBox extension pack you’ll be able to access the USB stick in the VM. 38
To make it available to the Guest OS, in the VirtualBox window, 39
Go to Devices and select the USB drive. 40
This is the drive. 41
Now it's available on Ubuntu. 42
On most modern Linux distributions, a USB drive will automount when inserted, but sometimes you may need 43
to manually mount the drive. 44
We'll discuss that in our future lecture, where we'll talk about the system administration. 45
For the moment 46
I just want to show you how the file system on the USB drive will be mounted in a directory of the existing 47
file system. 48
To see the mount point, you can run df -h 49
This is the disk. 50
You notice how it has been automatically mounted in /media /student, the username and the 51
name of the disc. 52
You can access its contents in that directory. 53
This is the contents of the USB disk. 54
You can access it in the graphical environment as well. 55
Note that there are no drive letters like in Windows. Now that you have a basic idea about the Linux 56
file system, we'll take a short break 57
and in the next lecture, I'll talk about the common directories of any Linux file system. 58
See you in a second!