Leaving presentation mode.

Access Linux File Systems

Dennis Kibbe

Mesa Community College

Keyboard Shortcuts

This slide presentation was created by B6Plus. The audio accompanying this presentation is AI-generated.

Module Outline

Here’s our roadmap: We’ll start by identifying file systems and devices, then dive into mounting and unmounting file systems. After a graded quiz and guided exercise, we’ll cover file-searching with find and locate, followed by a graded lab.

Learning Objectives

After completing the work in this module you will be able to:

By the end of this module, you’ll be able to: identify which devices are mounted where; mount and unmount filesystems; and search for files using find and locate.

Identify File Systems and Devices

Supported file systems in Red Hat Enterprise Linux

This section introduces key file systems supported by Red Hat Enterprise Linux: XFS, ext4, exFAT, and GFS2—each serving different use cases. XFS is a high-performance 64-bit journaling file system created by Silicon Graphics, Inc. in 1993. Red Hat Enterprise Linux uses it as the default file system.

Storage Management Concepts

Red Hat Enterprise Linux uses the Extents File System (XFS) as the default local file system. Red Hat Enterprise Linux supports the Extended File System (ext4) file system for managing local files. Starting with Red Hat Enterprise Linux 9, the Extensible File Allocation Table (exFAT) file system is supported for removable media use. In an enterprise server cluster, shared disks use the Global File System 2 (GFS2) file system to manage concurrent multi-node access.

File Systems and Mount Points

To use a file system, it must be mounted to an empty directory—typically under /mnt. That’s how Linux integrates volumes into its directory tree.

File Systems, Storage, and Block Devices

A block device is a file that provides low-level access to storage devices. A block device must be partitioned, and a file system created before the device can be mounted. The /dev directory stores block device files, which Red Hat Enterprise Linux creates automatically for all devices. In Red Hat Enterprise Linux 9, the first detected SATA, SAS, SCSI, or USB hard drive is called the /dev/sda device; the second is the /dev/sdb device; and so on.

Disk Partitions

Block devices are split into partitions—commonly /boot, /home, and /var are on separate partitions. This allows separate management of critical directories.

Logical Volumes

Logical volumes add flexibility, enabling dynamic resizing while in use. They sit atop physical or partitioned block devices.

Free Extents

Free extents are unused storage segments that can be added to logical volumes as needed—think of them as pre-allocated ‘slices’ of space.

Examine File Systems

[student@servera ~]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        892M     0  892M   0% /dev
tmpfs           915M     0  915M   0% /dev/shm
tmpfs           915M   17M  899M   2% /run
tmpfs           915M     0  915M   0% /sys/fs/cgroup
/dev/vda3       8.0G  1.4G  6.7G  17% /
/dev/vda1      1014M  166M  849M  17% /boot
tmpfs           183M     0  183M   0% /run/user/1000
      

The df -h command lists mounted filesystems with human-readable sizes. Listed are device names, size, usage, and mount points.

Graded Quiz

Identify File Systems and Devices

Complete this short quiz in Canvas that tests your understanding of devices, partitions, and mount points.

Identify a Block Device

[root@host ~]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda    252:0    0   10G  0 disk
├─sda1 252:1    0    1M  0 part /boot
├─sda2 252:2    0  200M  0 part /boot/efi
├─sda3 252:3    0  9.3G  0 part /
└─sda4 252:4    0  500M  0 part /home
      

The lsblk command reveals block device hierarchy: disks and their partitions along with sizes and mount points—useful for visualizing device structure.

Mount File System with the Partition Name

[root@host ~]# mount /dev/sda4 /home
      

The mount point directory must exist before mounting the file system. The /mnt directory exists for use as a temporary mount point.

Mount File System with Partition UUID

The list block device command

[root@host ~]# lsblk -fp
NAME        FSTYPE FSVER LABEL UUID                   FSAVAIL FSUSE% MOUNTPOINTS
/dev/sda
├─/dev/sda1
├─/dev/sda2 vfat   FAT16       7B77-95E7              192.3M     4% /boot/efi
├─/dev/sda3 xfs          boot  2d67e6d0-...-1f091bf1  334.9M    32% /boot
└─/dev/sda4 xfs          root  efd314d0-...-ae98f652    7.7G    18% /
      

Use lsblk -fp to list device UUIDs. Mounting by UUID improves consistency, especially for removable or re-ordered drives

Mount File System with Partition UUID

[root@host ~]# mount UUID="efd314d0-...-3f32ae98f652" /mnt/data
      

The UUID is truncated to fit the slide.

Unmount File Systems

[root@host ~]# umount /mnt/data
      

To detach a filesystem, use the umount /mnt/data command. Important: it's not unmount. Ensure no active processes are using the mount point before unmounting.

Guided Exercise

Mount and Unmount File Systems

Let's practice mounting and unmounting filesystems. Verify success with the df command or by checking the mount point's contents.

Locate Files on the System

Now we shift to searching for files. We'll contrast locate (fast and database-driven) vs. find (real-time and flexible).

Locate Files by Name

Update file database

[root@host ~]# updatedb
      

The updatedb command refreshes the database that locate uses. Normally run via cron, but you can run it manually.

Locate Files by Name

The locate command

[developer@host ~]$ locate passwd
/etc/passwd
/etc/passwd-
/etc/pam.d/passwd
...output omitted...
      

The locate passwd command quickly lists all files with passwd in their paths fast because it queries a database of file names and not the actual filesystem.

Search for Files in Real Time

Case sensitive

[root@host ~]# find /etc -name '*pass*'
/etc/passwd-
/etc/passwd
/etc/security/opasswd
...output omitted...
      

The locate command can not find a file that isn't in the database. The find command searches in real time and can find files based on size, modification time, owner, and other criteria.

Search by Name

Case insensitive

[root@host ~]# find / -iname '*messages*'
/sys/power/pm_debug_messages
/usr/lib/locale/C.utf8/LC_MESSAGES
/usr/lib/locale/C.utf8/LC_MESSAGES/SYS_LC_MESSAGES
...output omitted...
      

Use -iname for case-insensitive searches. In this example find matches the search term regardless of letter case.

Search for Files Based on Ownership or Permission

[developer@host ~]$ find -user developer
.
./.bash_logout
./.bash_profile
...output omitted...
      

This example finds files owned by the developer user which is handy for auditing or cleanup.

Find Files Based on Size

[user@host ~]$ find -size +1G
ubuntu-25.04-desktop-amd64.iso 5.8G
      

This example searches for files larger than 1 GB. Useful for tracking down large downloads or backups.

Search for Files Based on Modification Time

[user@host ~]# find ~/Documents -mmin -20
test.sh
      

In this example the find command displays files changed in the last 20 minutes.

Search for Files Based on File Type

This example shows how to search by file type using type f for files or type d for directories.

Guided Exercise

Locate Files on the System

Your turn: use both locate and find to locate specific files on a mounted filesystem. Compare speed and results.

Module Summary

Access Linux File Systems

  1. Storage devices are represented by the block device file type.
  2. The df command reports total disk space, used disk space, and free disk space on all mounted regular file systems.
  3. The root user can use the mount command to manually mount a file system.
  4. To successfully unmount a device, all processes must stop accessing the mount point.
  5. The removable storage devices are mounted in the /run/media directory when using the graphical environment.
  6. The lsblk command lists the details of block devices, such as the size and the UUID.
  7. The find command searches in real time in the local file systems for files according to search criteria.

Key takeaways: block devices represent storage; the df command shows mounted filesystems; root mounts and unmounts file systems with the mount and umount commands; lsblk reveals device details; find and locate help locate files.

Resources

Explore these resources for deeper learning: block device explanations, lsblk and du tutorials, and authoritative Red Hat documentation on fstab and find.

Graded Lab

Access Linux File Systems

In your lab, you’ll mount a local filesystem, locate specific files, and demonstrate both processes. This will reinforce what we’ve learned.

Thanks for Watching

Thank you for your attention! You’ve now covered essential Linux file system management topics. Feel free to reach out if you have questions.

Created on 17 February 2025 by Dennis Kibbe. Last modified on 16 July by DNK.