| |

LFCS 79 ๐Ÿง Mounting Filesystems โ€” mount

โฑ๏ธ Estimated read: 15 min | |

A filesystem that has been created but not mounted is inert. The kernel sees a block device with metadata on it, but no path leads from the directory tree to the files inside. mount is the command that connects the two: it attaches a filesystem to a directory, making the filesystem’s contents appear at that location. The LFCS exam expects you to perform this operation manually, understand the options that change what the mounted filesystem permits, and know how to make the mount survive a reboot through /etc/fstab.

This chapter covers the mounting step of the storage workflow. It begins with the syntax of mount and the distinction between the explicit device-and-directory form and the abbreviated forms that consult /etc/fstab. It then explains the options that matter in practiceโ€”read-only, noexec, remountโ€”and the unmount discipline that prevents data loss. The final sections address the persistent configuration in /etc/fstab, the use of UUIDs instead of device names, and the verification steps that confirm a mount will survive a reboot.


Key point: mount without arguments shows what is already mounted. mount with arguments attaches something new. The two forms are easy to confuse, and the abbreviated form consults /etc/fstab in ways that are not always obvious.


Why mounting works this way

The unified directory tree. Linux does not assign drive letters to partitions. Every filesystem is attached to a directory somewhere in the single tree that begins at /. The directory is called the mount point, and mounting is the act of making the filesystem’s root appear at that directory . This is why /home can be a separate partition without any special path syntax: the partition is mounted at /home, and the directory tree continues seamlessly.

The temporary versus persistent distinction. A mount command executed at the shell is temporary. It lasts until the system reboots or the filesystem is explicitly unmounted. To make a mount persistent, the entry must be written to /etc/fstab, the file that the boot process reads to reconstruct the mount layout . The mount command and /etc/fstab are two interfaces to the same kernel operation: one immediate, one deferred to boot.

The fstab consultation behavior. When mount is given both a device and a directory, it mounts immediately and does not consult /etc/fstab. When it is given only one of them, it searches /etc/fstab for the matching entry and fills in the missing argument . This behavior is convenient for entries that are already configured, but it can produce surprising results if the fstab entry is stale or if the device name has changed.

The options that change permissions. A mounted filesystem inherits a set of mount options that determine whether it is writable, whether executables can run from it, and whether setuid binaries are honored. The defaults option is a bundle that includes rw, suid, dev, exec, auto, nouser, and async . Overriding individual options is how an administrator hardens a mount or makes it read-only for a specific purpose.

The busy unmount problem. A filesystem cannot be unmounted while any process has a file open on it or while the shell’s current working directory is inside it. The kernel returns “target is busy” and refuses the operation . This is a safety mechanism, not an obstacle: unmounting a filesystem with active writers would corrupt data. The solution is to leave the mount point and close the processes that are using it.


a. The syntax and the abbreviated forms

The explicit form of mount takes the filesystem type, the device, the mount point, and options. Every argument is present, and /etc/fstab is not consulted.

# Explicit mount: type, device, mount point, options.
sudo mount -t ext4 /dev/sdb1 /mnt/data -o defaults

# The type is optional if the kernel can detect it.
# The kernel reads the filesystem superblock and selects the driver.
sudo mount /dev/sdb1 /mnt/data

# Mount a read-only ISO image using the loop device.
# The loop option treats the file as a block device.
sudo mount -o loop,ro /path/to/image.iso /mnt/iso

The abbreviated form supplies only one argument, and mount searches /etc/fstab for the rest. If the device is given, it looks up the matching mount point and type. If the directory is given, it looks up the matching device .

# Abbreviated: only the device. mount looks up the rest in fstab.
sudo mount /dev/sdb1

# Abbreviated: only the mount point. mount looks up the device in fstab.
sudo mount /mnt/data

The mount command with no arguments is a different operation entirely: it lists every mounted filesystem, including virtual filesystems like proc and sysfs. The output format is device on directory type (options) .

# List all mounted filesystems.
mount

# A filtered view is easier to read.
mount | grep /dev/sd

The findmnt command is a more modern alternative for inspecting mounts. It produces tree-formatted output and can filter by device, mount point, or filesystem type.

# Show the mount tree in a readable format.
findmnt

# Show only mounts backed by a specific device.
findmnt /dev/sdb1

b. The options that matter

The -o flag passes a comma-separated list of options to the kernel. The list is parsed strictly: a space after a comma is an error, because mount treats the text after the space as a separate argument . The options that appear most often in LFCS work are the ones that control write access and execution.

ro mounts the filesystem read-only. Writes fail with “read-only filesystem,” which is useful for forensics, for rescue operations, and for filesystems that should not change. rw is the opposite and is included in defaults. noexec prevents binaries on the filesystem from being executed, which hardens a data partition against malware that might be dropped there. nosuid ignores setuid bits, preventing privilege escalation through a mounted filesystem. nodev ignores device files on the filesystem.

# Mount read-only and without execution permission.
# This is a common hardening combination for data partitions.
sudo mount -t ext4 /dev/sdb1 /mnt/data -o ro,noexec

# Remount an already-mounted filesystem with different options.
# This is how a filesystem is switched from rw to ro without unmounting.
sudo mount -o remount,ro /mnt/data

# Remount back to read-write.
sudo mount -o remount,rw /mnt/data

The remount option deserves emphasis because it is the only way to change the options of a mounted filesystem without unmounting it. The device and mount point are still required, but the operation does not create a new mount; it updates the existing one. This is how the root filesystem is often switched to read-only before a filesystem check, and how a filesystem is made writable again afterward.

The user and nouser options control whether non-root users can mount the filesystem. user allows any user to mount it (and the user who mounted it can unmount it); nouser restricts mounting to root. The defaults bundle includes nouser, which is why ordinary partitions require root privileges .


c. Unmounting and the busy filesystem

The command to detach a filesystem is umount, spelled without an n. It takes either the device path or the mount point. Before unmounting, the kernel flushes all pending writes to the device, which is why unmounting is the safe way to remove removable media .

# Unmount by mount point.
sudo umount /mnt/data

# Unmount by device path.
sudo umount /dev/sdb1

# Lazy unmount: detach now, clean up when the device is no longer busy.
# This is for situations where a normal unmount is impossible.
sudo umount -l /mnt/data

The “target is busy” error occurs when a process has a file open on the filesystem or when a shell’s current directory is inside it . The solution is to identify and close the process. lsof lists open files by mount point, and fuser identifies processes using a device. Changing the shell’s directory with cd outside the mount point is the other common fix.

# Find processes with open files on the mount.
sudo lsof +f -- /mnt/data

# Find processes using the device.
sudo fuser -vm /mnt/data

# After closing the processes or leaving the directory, retry.
sudo umount /mnt/data

The -l (lazy) flag detaches the filesystem from the tree immediately but defers the actual cleanup until the filesystem is no longer busy. It is a last resort, not a routine operation: the filesystem is invisible to new accesses, but existing open files continue to work against the detached mount. For a clean shutdown or a removable device, a normal unmount is always preferred.


Complete Example Session

# ============================================
# PART 1: INSPECTION BEFORE MOUNTING
# ============================================
# Confirm the device exists and has a filesystem.

lsblk -f /dev/sdb
# Look for the FSTYPE column: ext4, xfs, or btrfs.
# An empty FSTYPE means mkfs has not been run yet.

# ============================================
# PART 2: CREATE THE MOUNT POINT
# ============================================
# The directory must exist before mounting.
# /mnt is the conventional location for temporary mounts.

sudo mkdir -p /mnt/data

# ============================================
# PART 3: THE EXPLICIT MOUNT
# ============================================
# Type, device, mount point. No fstab consultation.

sudo mount -t ext4 /dev/sdb1 /mnt/data

# ============================================
# PART 4: VERIFY THE MOUNT
# ============================================
# Confirm the filesystem is attached and writable.

findmnt /mnt/data
lsblk /dev/sdb
df -hT /mnt/data

# ============================================
# PART 5: MOUNT OPTIONS
# ============================================
# Remount read-only and test the restriction.

sudo mount -o remount,ro /mnt/data
touch /mnt/data/test 2>&1 | head -1
# Expected: "Read-only file system"

# Restore read-write.
sudo mount -o remount,rw /mnt/data

# ============================================
# PART 6: THE noexec OPTION
# ============================================
# Mount with noexec and verify that binaries cannot run.

sudo mount -o remount,noexec /mnt/data
# If an executable exists on the filesystem:
# /mnt/data/program  # Expected: "Permission denied"

sudo mount -o remount,exec /mnt/data

# ============================================
# PART 7: THE ABBREVIATED FORM
# ============================================
# With an fstab entry in place, only one argument is needed.
# Without an entry, this fails.

# sudo mount /mnt/data
# mount: /mnt/data: can't find in /etc/fstab.

# ============================================
# PART 8: THE FSTAB ENTRY
# ============================================
# Get the UUID, then write the persistent entry.

sudo blkid /dev/sdb1
# Note the UUID value.

# Add to /etc/fstab:
# UUID=xxxx /mnt/data ext4 defaults 0 2

# Test the entry without rebooting.
sudo mount -a
findmnt /mnt/data

# ============================================
# PART 9: UNMOUNTING
# ============================================
# Leave the mount point first, then unmount.

cd /root
sudo umount /mnt/data
findmnt /mnt/data  # should produce no output

# ============================================
# PART 10: THE BUSY CASE
# ============================================
# Re-mount, then attempt to unmount from inside.

sudo mount /dev/sdb1 /mnt/data
cd /mnt/data
sudo umount /mnt/data
# Expected: "target is busy"

cd /root
sudo umount /mnt/data
# Now it succeeds.

echo "Mount workflow complete."

The ten parts walk through the full lifecycle of a mount: inspect, create the mount point, mount explicitly, verify, change options, write the fstab entry, test it, and unmount. The final part demonstrates the most common operational obstacleโ€”the busy filesystemโ€”and its solution. The sequence is deliberately repetitive because the LFCS exam tests the ability to perform these steps from memory, without consulting documentation.


Quick Reference

Mount Command Forms

FormExampleConsults fstab?
List mountsmountNo
Explicitmount -t type /dev/X /mntNo
Device onlymount /dev/XYes
Mount point onlymount /mntYes
All fstab entriesmount -aYes
Remountmount -o remount,opt /mntNo

Common Mount Options

OptionEffectOpposite
roRead-onlyrw
rwRead-writero
noexecNo executionexec
nosuidIgnore setuidsuid
nodevIgnore device filesdev
defaultsBundle: rw,suid,dev,exec,auto,nouser,asyncโ€”
remountChange options on a mounted fsโ€”
loopTreat a file as a block deviceโ€”

/etc/fstab Fields

FieldExampleMeaning
DeviceUUID=xxxxBlock device or UUID
Mount point/mnt/dataDirectory to attach
Typeext4Filesystem type
OptionsdefaultsMount options
Dump0Backup flag (obsolete)
Pass2fsck order (0=skip, 1=root, 2=others)

Unmount Troubleshooting

SymptomCauseFix
“target is busy”Process has open file or shell is insidecd out, close processes
“not mounted”Wrong path or already unmountedCheck findmnt
“device is busy”Device in use by LVM/RAIDStop the dependent stack

Best Practices

โœ… Do This:

# Verify the mount after every operation.
findmnt /mnt/data                                                    # โœ…

# Use UUIDs in /etc/fstab, not device names.
UUID=xxxx /mnt/data ext4 defaults 0 2                                # โœ…

# Test fstab entries with mount -a before rebooting.
sudo mount -a && findmnt /mnt/data                                   # โœ…

# Leave the mount point before unmounting.
cd /root && sudo umount /mnt/data                                    # โœ…

# Use remount to change options on a live filesystem.
sudo mount -o remount,ro /mnt/data                                   # โœ…

# Use noexec and nosuid for data partitions.
sudo mount -o defaults,noexec,nosuid /dev/sdb1 /mnt/data             # โœ…

โŒ Don’t Do This:

# Don't use device names in fstab.
/dev/sdb1 /mnt/data ext4 defaults 0 2  # may change on reboot        # โŒ

# Don't unmount from inside the mount point.
cd /mnt/data && sudo umount /mnt/data  # busy                          # โŒ

# Don't rely on lazy unmount as a routine.
sudo umount -l /mnt/data  # last resort only                          # โŒ

# Don't forget the space rule in options.
-o ro, noexec  # space is an error                                    # โŒ

# Don't assume mount -a will fix a broken fstab.
# A syntax error in fstab can prevent boot.                           # โŒ

Common Pitfalls

PitfallWhy It HappensFix
“can’t find in /etc/fstab”Abbreviated form used without an entryUse explicit form or add the fstab entry
“target is busy”Shell or process inside the mountcd out, close files, retry
Mount does not survive rebootNo fstab entry, or entry has wrong UUIDAdd UUID-based entry, test with mount -a
“wrong fs type”-t omitted and detection failedSpecify -t explicitly
fstab typo prevents bootMalformed entry, no nofail optionUse nofail for non-critical mounts
Options ignoredSpace after comma in -o listRemove spaces
Remount failsDevice and mount point mismatchSpecify both correctly

Real-World Examples

1. Explicit Mount

sudo mount -t ext4 /dev/sdb1 /mnt/data

2. List Mounts

findmnt

3. Remount Read-Only

sudo mount -o remount,ro /mnt/data

4. Mount ISO

sudo mount -o loop,ro image.iso /mnt/iso

5. Unmount

sudo umount /mnt/data

6. Check Busy

sudo lsof +f -- /mnt/data

7. fstab Entry

UUID=xxxx /mnt/data ext4 defaults,noexec 0 2

8. Test fstab

sudo mount -a

9. Mount All

sudo mount -a

10. Find Mount Source

findmnt -T /mnt/data

Visual

The Mount Operation

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  BEFORE MOUNT                                           โ”‚
โ”‚                                                         โ”‚
โ”‚  / (root filesystem)                                    โ”‚
โ”‚  โ”œโ”€โ”€ bin/                                               โ”‚
โ”‚  โ”œโ”€โ”€ etc/                                               โ”‚
โ”‚  โ”œโ”€โ”€ mnt/          โ† empty directory                    โ”‚
โ”‚  โ””โ”€โ”€ var/                                               โ”‚
โ”‚                                                         โ”‚
โ”‚  /dev/sdb1: ext4 filesystem, not visible anywhere       โ”‚
โ”‚                                                         โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”‚
โ”‚                                                         โ”‚
โ”‚  AFTER: mount /dev/sdb1 /mnt/data                       โ”‚
โ”‚                                                         โ”‚
โ”‚  / (root filesystem)                                    โ”‚
โ”‚  โ”œโ”€โ”€ bin/                                               โ”‚
โ”‚  โ”œโ”€โ”€ etc/                                               โ”‚
โ”‚  โ”œโ”€โ”€ mnt/                                               โ”‚
โ”‚  โ”‚   โ””โ”€โ”€ data/     โ† /dev/sdb1 mounted here             โ”‚
โ”‚  โ”‚       โ”œโ”€โ”€ file1                                      โ”‚
โ”‚  โ”‚       โ””โ”€โ”€ file2                                      โ”‚
โ”‚  โ””โ”€โ”€ var/                                               โ”‚
โ”‚                                                         โ”‚
โ”‚  The filesystem's root appears at /mnt/data.            โ”‚
โ”‚  The original /mnt/data contents are hidden.            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The fstab Fields

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  /etc/fstab line:                                       โ”‚
โ”‚                                                         โ”‚
โ”‚  UUID=xxxx  /mnt/data  ext4  defaults,noexec  0  2     โ”‚
โ”‚    โ”‚          โ”‚         โ”‚     โ”‚              โ”‚  โ”‚      โ”‚
โ”‚    โ”‚          โ”‚         โ”‚     โ”‚              โ”‚  โ””โ”€ passโ”‚
โ”‚    โ”‚          โ”‚         โ”‚     โ”‚              โ””โ”€โ”€โ”€โ”€ dumpโ”‚
โ”‚    โ”‚          โ”‚         โ”‚     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ opts โ”‚
โ”‚    โ”‚          โ”‚         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ type โ”‚
โ”‚    โ”‚          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ mnt  โ”‚
โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ deviceโ”‚
โ”‚                                                         โ”‚
โ”‚  UUID is preferred: device names can change.            โ”‚
โ”‚  Test with mount -a before trusting a reboot.           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The Busy Unmount

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  umount /mnt/data                                       โ”‚
โ”‚         โ”‚                                               โ”‚
โ”‚         โ–ผ                                               โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  Kernel checks:                                   โ”‚  โ”‚
โ”‚  โ”‚                                                   โ”‚  โ”‚
โ”‚  โ”‚  1. Any process has a file open?                  โ”‚  โ”‚
โ”‚  โ”‚     โ†’ YES: "target is busy"                       โ”‚  โ”‚
โ”‚  โ”‚                                                   โ”‚  โ”‚
โ”‚  โ”‚  2. Any shell's cwd is inside?                    โ”‚  โ”‚
โ”‚  โ”‚     โ†’ YES: "target is busy"                       โ”‚  โ”‚
โ”‚  โ”‚                                                   โ”‚  โ”‚
โ”‚  โ”‚  3. No active users?                              โ”‚  โ”‚
โ”‚  โ”‚     โ†’ Flush writes, detach from tree              โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                                         โ”‚
โ”‚  Fix: cd /root; lsof +f -- /mnt/data; close files.      โ”‚
โ”‚  Then retry umount.                                     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Persistent Mount Workflow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  1. blkid /dev/sdb1                                     โ”‚
โ”‚         โ”‚                                               โ”‚
โ”‚         โ–ผ  UUID=abcd-1234                               โ”‚
โ”‚  2. Edit /etc/fstab                                     โ”‚
โ”‚         โ”‚                                               โ”‚
โ”‚         โ–ผ                                               โ”‚
โ”‚  UUID=abcd-1234 /mnt/data ext4 defaults 0 2            โ”‚
โ”‚         โ”‚                                               โ”‚
โ”‚         โ–ผ                                               โ”‚
โ”‚  3. mount -a                                            โ”‚
โ”‚         โ”‚                                               โ”‚
โ”‚         โ–ผ                                               โ”‚
โ”‚  4. findmnt /mnt/data                                   โ”‚
โ”‚         โ”‚                                               โ”‚
โ”‚         โ–ผ                                               โ”‚
โ”‚  5. Reboot and verify (optional but recommended)        โ”‚
โ”‚                                                         โ”‚
โ”‚  A wrong fstab entry can prevent boot.                  โ”‚
โ”‚  Use nofail for non-critical mounts:                    โ”‚
โ”‚  UUID=xxxx /mnt/data ext4 defaults,nofail 0 2           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Summary

ItemValue
Mount commandmount -t type device dir -o options
List mountsmount or findmnt
Abbreviated formmount /dev/X or mount /mnt (consults fstab)
Read-only-o ro
No execution-o noexec
Change options-o remount,newopt
Unmountumount /mnt or umount /dev/X
Persistent config/etc/fstab with UUID
Test fstabmount -a
Busy fixLeave directory, close files

Key takeaways:

  • Mounting attaches a filesystem to a directory. The directory is the mount point, and the filesystem’s root appears there. There are no drive letters.
  • The explicit form does not consult fstab. Give the type, device, and directory, and mount acts immediately. The abbreviated form fills missing arguments from fstab.
  • defaults is a bundle, not a single option. It includes rw, suid, dev, exec, auto, nouser, and async. Override individual options with a comma-separated list and no spaces.
  • remount changes options on a live filesystem. It is the only way to switch rw to ro (or back) without unmounting.
  • Unmounting flushes pending writes. A normal umount is the safe way to remove media or shut down a filesystem. Lazy unmount is a last resort.
  • “Target is busy” means something is using the filesystem. A shell inside the mount point or an open file prevents unmounting. Close the process or leave the directory.
  • /etc/fstab makes mounts persistent. Use UUIDs, not device names, and test with mount -a before rebooting.
  • A malformed fstab can prevent boot. For non-critical mounts, add nofail so a missing device does not block the boot process.
  • findmnt is the modern inspection tool. It shows the mount tree, can filter by device or mount point, and is easier to read than mount output.
  • Mounting is not the end of the workflow. Permissions, ownership, and application-level configuration are separate concerns that the administrator must address after the mount succeeds.

Remember: mount is the bridge between a filesystem on a block device and the directory tree that applications navigate. The explicit form gives you immediate control; the fstab entry gives you persistence. The options determine what the mounted filesystem permitsโ€”write access, execution, device filesโ€”and the remount flag changes them without disruption. Unmounting is the reverse operation, and the busy filesystem is the most common obstacle. The LFCS candidate should be able to mount a device manually, verify it with findmnt, harden it with ro or noexec, write a correct UUID-based fstab entry, test it with mount -a, and unmount it cleanly after leaving the mount point.


Was this helpful?


Stop using slow, ad-bloated tool sites! ๐Ÿคฎ

๐Ÿ”Ž Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
โœ… Finance (Mortgage, Interest, Inflation)
โœ… Tech (Base64, JSON, Dev Suite, IP)
โœ… Health (BMI, BMR, TDEE)
โœ… Productivity (Timer, Workspace, QR)

โšก๏ธ Fast & Private
๐Ÿ”’ No data leaves your device
๐Ÿ’Ž 100% Free

๐Ÿ”— Use it now: https://tools.kandz.me
๐Ÿ”– Bookmark itโ€”youโ€™ll need it later!