We have created an ext4 filesystem on the partition /dev/sdb1. Now we need to mount our filesystem somewhere in the Linux directory tree.
WHAT IS MOUNTING?
Mounting refers to the process of attaching any filesystem or any storage device (like USB flash drives, CDs, etc.) to a directory.
Mounting refers to the process of attaching any filesystem or any storage device (like USB flash drives, CDs, etc.) to a directory.
But why do we need to mount? I mean we have just created an ext4 filesystem on the 2 GB partition /dev/sdb1. Can't we just start creating files in /dev/sdb1? The answer is a big FAT NO! Remember, /dev/sdb1 is only a file that represents a partition.
To mount a filesystem, we use the mount command as follows:
mount filesystem mount_directory
So let's assume we are going to use the filesystem /dev/sdb1 to store our games. In this case, let's create a new directory /games:
root@ubuntu-linux:~# mkdir /games
Now the only thing left is to mount our filesystem /dev/sdb1 on the /games directory:
root@ubuntu-linux:/# mount /dev/sdb1 /games
We can verify our work by running the...