Courseiva
EX200Chapter 11 of 20Objective 3.2

Creating and Mounting File Systems

Creating and mounting file systems is the method computers use to organise and access storage space. Without it, your hard drive would be a vast, unlabelled sea of data with no way to find anything. For the EX200 exam, you need to understand how Linux partitions, formats, and attaches storage so it becomes usable by the operating system and applications.

12 min read
Intermediate
Updated Jul 23, 2026
Reviewed by Johnson Ajibi· Senior Network & Security Engineer · MSc IT Security

A simple way to picture Creating and Mounting File Systems

The Apartment Filing Cabinet Analogy

A shared apartment with a brand new filing cabinet in the living room. The cabinet is empty, just a frame with drawers and rails. The first roommate, Alex, buys a pack of hanging folders and starts arranging them: 'Bills' in the top drawer, 'Photos' in the middle. Alex is creating a file system on a blank hard drive. The second roommate, Priya, comes home and sees the cabinet. She doesn't want to rummage through Alex's folders for her own stuff, so she buys a second filing cabinet from the same store. But the apartment is too small for two cabinets. Instead, she rearranges the existing cabinet by adding a divider labelled 'Priya's Documents'. This is like mounting a new partition.

Now, every evening, they need the cabinet accessible. They plug it into the wall outlet so the electrical system powers the drawer light. This is like mounting a drive — making it available at a specific spot in the directory tree. If the power goes out, the cabinet doesn't vanish; the folders are still inside. But if Priya forgets to 'eject' the cabinet before yanking the power cord, she might lose her latest folder. That is the difference between a mounted and unmounted file system — the OS needs to be told to disconnect safely to prevent data corruption.

How It Actually Works

A file system is the structure and rules that a computer uses to store and retrieve data on a storage device. Think of it as a set of shelves in a warehouse: you decide the shelf sizes, how to label each box, and the order in which boxes are placed. Linux supports many file systems, but the two most common for EX200 are ext4 (the standard for most Linux installations) and XFS (often used for large volumes).

Before you can use a storage device, you usually need to partition it. A partition is a logically separate section of a hard disk. It is like dividing a large room into smaller cubicles — each cubicle can hold a different filing system or even a different operating system. You create partitions using tools like fdisk, gdisk, or parted. Each partition gets a device name, such as /dev/sda1, where sda is the disk and 1 is the partition number.

After partitioning, you must format the partition with a file system. Formatting writes the necessary data structures onto the partition so that Linux knows how to read and write files. The command to format a partition with ext4 is mkfs.ext4 /dev/sda1. This step is like painting the cubicle walls and installing shelves — it prepares the space for use.

Now comes mounting. Mounting is the act of attaching a file system to a specific directory in the Linux directory tree. The Linux filesystem hierarchy is a single tree starting at the root directory, /. Every file and directory in the system lives somewhere under this root. When you plug in a USB stick, you cannot access its contents until you mount it. The directory where the file system becomes accessible is called the mount point. For example, if you mount /dev/sdb1 at /mnt/usb, then any file stored on that USB will appear under /mnt/usb.

The mount command is used to attach file systems temporarily. A simple example: mount /dev/sdb1 /mnt/usb. This tells the operating system to make the contents of that partition available at that location. The mount will only last until the system is rebooted. To make the mount persist across reboots, you add an entry to the /etc/fstab file. The fstab file is a configuration table that tells the system which file systems to mount automatically at boot time. Each line in fstab specifies the device, mount point, file system type, mount options, dump flag, and fsck order. For example:

/dev/sdb1 /mnt/usb ext4 defaults 0 0

This line means 'automatically mount /dev/sdb1 at /mnt/usb using the ext4 file system with default options, skip backup (0), and run fsck on this partition second (0 means the check order after root)'. If you get this wrong, the system might fail to boot or the partition might not mount.

Common mount options include: - defaults: use standard settings (including read-write, async, dev, exec, auto, nouser, suid) - noexec: prevent any binary files from being executed on the mounted file system (important for security) - ro: mount the file system as read-only - auto: allow the file system to be mounted automatically at boot (the default behaviour when listed in fstab)

To see what file systems are currently mounted, you can run the mount command without any arguments. It will list all mounted file systems, their device names, mount points, and options. Another important command is umount (note: it is 'umount', not 'unmount'). You use umount followed by either the device name or the mount point to detach a file system safely. Never simply power off a device without unmounting it first — this can cause data corruption or even damage to the file system.

Finally, the concept of a logical volume manager (LVM) is often tested alongside file systems. LVM allows you to create flexible storage volumes that can be resized, snapshotted, and moved across physical disks. It adds an abstraction layer between the physical disks and the file systems. For EX200, you should know how to create physical volumes, volume groups, and logical volumes, and then format and mount a logical volume exactly as you would a partition.

Flowchart showing the process from a raw disk to a mounted, permanently available file system.

Walk-Through

1

Identify the disk or partition

Use lsblk or fdisk -l to list all available disks and partitions. This shows you the device names (like /dev/sdb) and their sizes. You must know exactly which device you want to work with before partitioning or mounting.

2

Create a partition (if needed)

Run fdisk /dev/sdb (replace sdb with your disk). Inside fdisk, use n to create a new partition, then specify size and type. Write the changes with w. This step divides the disk into logical sections for different uses.

3

Format the partition with a file system

Use mkfs.ext4 /dev/sdb1 (or mkfs.xfs for XFS). This writes the file system structures onto the partition, making it ready to store data. Skipping this step leaves the partition unformatted and unusable.

4

Create a mount point directory

Use mkdir /mnt/mydata to create a directory that will serve as the access point for the new file system. Without this directory, the mount command will fail because there is no destination to attach to.

5

Mount the file system temporarily

Run mount /dev/sdb1 /mnt/mydata. This attaches the file system to the directory. Verify it worked with mount or df -h. The mount is temporary and will not survive a reboot.

6

Make the mount permanent via /etc/fstab

Edit /etc/fstab with a text editor (e.g., vim /etc/fstab). Add a line like: /dev/sdb1 /mnt/mydata ext4 defaults 0 0. You can also use UUID from blkid. Then run mount -a to test the entry without rebooting. This step ensures the file system mounts automatically after every boot.

What This Looks Like on the Job

Consider a small e-commerce company running a Linux web server that hosts an online store. The server has a single 500 GB hard drive installed. The system administrator needs to set up storage for three key areas: the operating system itself (about 50 GB), the customer database (about 200 GB), and user-uploaded product images (about 250 GB).

The admin starts by booting from a live USB and using fdisk to create three partitions on the hard drive: /dev/sda1 for the OS, /dev/sda2 for the database, and /dev/sda3 for the images. Each partition is sized to match the expected usage. If the admin were using a single partition for everything, a runaway log file could fill the entire disk and crash the database. Separating them prevents one application from starving the others.

Next, the admin formats each partition. The OS partition gets ext4 because it's reliable and standard. The database partition also gets ext4, though the team might later migrate to XFS for better performance with large files. The images partition is formatted as ext4 as well, but with the noexec mount option to prevent any uploaded files from being executed as programs (a security measure against malicious uploads).

The admin then mounts the OS partition at / (root) during installation. The database partition is mounted at /var/lib/mysql (the typical location for MySQL or MariaDB data), and the images partition is mounted at /var/www/html/images. These mount points are chosen because they match where the applications expect to find their data. The admin adds entries to /etc/fstab so that after every reboot, the partitions are mounted automatically at the correct locations.

A few months later, the company grows and the images partition is nearly full. The admin uses LVM to add a second hard drive, extend the volume group, and resize the logical volume and file system without any downtime. This is a practical scenario heavily tested in the real world.

Common actions an IT professional takes with file systems include:

Checking available disk space using df -h to see mounted file systems and their usage

Checking disk partitions with lsblk or fdisk -l

Adding a new disk, partitioning it, formatting it, and mounting it

Editing /etc/fstab to add permanent mount points

Using umount before removing a USB drive or unmounting a network share

Troubleshooting a system that fails to boot because of an incorrect fstab entry (often by booting into rescue mode and editing the file)

All of these tasks are directly relevant to EX200 exam objectives and daily system administration.

How EX200 Actually Tests This

The EX200 exam tests objective 3.2 in a very hands-on, practical way. You will be given a virtual machine environment and asked to perform specific tasks. There are no multiple-choice questions — you either complete the task correctly or you do not. The exam is performance-based.

Here is exactly what the exam expects you to be able to do:

Create a partition on a disk using fdisk or parted

Format a partition with a file system (most often ext4 or XFS)

Mount a file system to a specific mount point temporarily (mount command)

Add an entry to /etc/fstab to make the mount permanent

Verify that the mount is active by checking output from mount or df -h

Unmount a file system using umount

Create a logical volume, format it, and mount it (LVM tasks are also tested)

Common traps the exam sets:

Trailing slashes in mount points: The mount point must exist as a directory. If you write /mnt/data/ with a trailing slash, it will fail because that directory does not exist. You must create the directory with mkdir first.

Forgetting to create the mount point directory before mounting. The mount command will fail if the target directory does not exist.

Using the wrong device name. For example, on a system with multiple disks, /dev/sda might become /dev/sdb after a reboot. This is why UUIDs are often preferred in fstab.

Incorrect fstab syntax. Each field must be in the correct order, separated by spaces or tabs. A common mistake is reversing the device and mount point columns.

Using mount -a without double-checking fstab. If fstab has an error, mount -a might hang the system or give a cryptic error.

Not understanding that a mount point must be empty. If you mount a file system over a directory that already contains files, those files become hidden until the mount is removed. They are not deleted, just inaccessible.

Key definitions to memorise:

Partition: a logical section of a disk

File system: the structure used to store and retrieve files (e.g., ext4, XFS)

Mount point: the directory where a file system is attached to the directory tree

/etc/fstab: the file system table that defines permanent mounts

UUID: a universally unique identifier assigned to a file system, used in fstab to avoid device name changes

mkfs: the command to create a file system (format) a partition

mount: the command to attach a file system

umount: the command to detach a file system

LVM (logical volume manager): a system for managing disk storage flexibly across multiple disks

The exam will ask you to edit /etc/fstab directly. Be comfortable using a text editor like vim or nano. You may also be asked to set mount options such as noexec, ro, or defaults. Knowing the syntax for specifying the file system type (e.g., ext4, xfs, swap) is essential. Swap is a special type of file system used for virtual memory. Mounting a swap partition requires a different approach (using swapon).

Finally, practice using blkid to find UUIDs, and be able to interpret the output of mount and df -h. The exam may ask you to identify which file system is nearly full and then take action to free space or add more storage.

Key Takeaways

A file system must be created on a partition using mkfs before it can be used.

Mounting attaches a file system to a directory (mount point) in the Linux directory tree.

The /etc/fstab file defines which file systems mount automatically at boot time.

Always unmount a file system with umount before physically removing a storage device to prevent data corruption.

A mount point must be an existing empty directory; mounting over a non-empty directory hides its contents.

Use the blkid command to find the UUID of a partition, which is safer than using device names in fstab.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

ext4

Designed for general-purpose use and backwards compatibility

Supports volumes up to 1 exabyte

Often used for boot partitions and smaller file systems

More mature and widely supported in older environments

XFS

Optimised for large files and high-performance computing

Supports volumes up to 8 exabytes

Commonly used for large data stores and media servers

Better at handling parallel I/O operations

Partition (MBR)

Uses Master Boot Record table

Supports up to 4 primary partitions (or 3 primary + 1 extended)

Maximum disk size of 2 TB

Older standard, still common for legacy systems

Partition (GPT)

Uses GUID Partition Table

Supports up to 128 partitions on most systems

Supports disks larger than 2 TB

Required for UEFI boot, modern standard

Temporary mount (mount command)

Does not survive a reboot

No configuration file needed

Useful for testing or one-time access like USB drives

Can be done quickly from command line

Permanent mount (/etc/fstab)

Persists across reboots

Requires editing /etc/fstab

Standard for server storage that must always be available

Uses correct syntax to avoid boot failures

Watch Out for These

Mistake

A file system is the same thing as a file.

Correct

A file system is the entire structure for organising and storing files, while a file is a single unit of data within that structure.

Beginners often confuse the container (the file system) with the content (files). This misunderstanding leads to errors when choosing formatting commands.

Mistake

Once a partition is formatted, it is automatically available to the system.

Correct

Formatting only prepares the partition for use. You must mount it to a mount point before the operating system can access it.

Windows hides this with automatic mounting, so learners assume Linux works the same way. The manual mount step is a fundamental difference.

Mistake

Mounting a file system deletes the data on the target directory.

Correct

Mounting only hides the existing contents of the mount point directory. The original files remain intact and reappear when the file system is unmounted.

Users who mount a drive to /home and then see their home directory empty panic, thinking they have lost data. This confusion is common in practical labs.

Mistake

You can unmount a file system while a process is using it without any issue.

Correct

If any process is accessing a file on the mounted file system, umount will fail with a 'device is busy' error. You must kill the process or use lazy unmount (umount -l) with caution.

Beginners do not realise that open file handles block unmounting. This is a frequent cause of frustration during exam labs.

Mistake

/etc/fstab requires a UUID; you cannot use the device name like /dev/sdb1.

Correct

You can use either a UUID or a device name in fstab, but UUID is preferred because it persists even if disk order changes at boot.

Some older guides recommend only UUIDs, making learners think device names are invalid. The exam expects you to know both methods.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the difference between a partition and a file system?

A partition is a logical section of a hard disk, like a room in a house. A file system is the structure inside that room (like shelves and labels) that organises files. You must create both for storage to work.

Why does mount say 'mount point does not exist'?

The mount point directory does not exist. You need to create it first using mkdir. The directory must already be on the root file system before you can attach another file system to it.

Can I mount a file system over a non-empty directory?

Yes, but the existing files in that directory become hidden until you unmount the new file system. The files are not deleted, just temporarily inaccessible. This can confuse users who do not expect it.

How do I find the UUID of a partition?

Run the blkid command. It will show the UUID for each partition. You can use this UUID in /etc/fstab instead of the device name to avoid problems if disk order changes.

What does mount -a do?

It reads /etc/fstab and attempts to mount all file systems listed there that are not already mounted. Use it to test your fstab changes without rebooting.

Why can't I unmount a file system that I just mounted?

A process is likely using a file on that mount point. Use lsof or fuser to see which process is blocking the unmount, then stop that process first. Alternatively, use umount -l for a lazy unmount, but it is riskier.

Terms Worth Knowing

Keep going

You've finished Creating and Mounting File Systems. Continue through the EX200 study guide to build a complete picture of the exam.

Done with this chapter?