Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Configure /etc/fstab to Persistently Mount a File System

Learning to create file systems and persistently mount them across reboots is an essential skill for Linux administrators. In this lab, we format two new system disks and create filesystems on the newly-created disk partitions. Then we create the directories for the mount points and configure `/etc/fstab` to persistently mount the file systems so they are available on system startup.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Jul 26, 2025
Duration
30m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Log in to the Lab Server and Gain `root` Access
    # sudo -i
    
  2. Challenge

    Format `xvdb`

    List the available system disks and format /dev/xvdb. Enter n for new partition, p for primary, and take the defaults. Type w to write the changes to the system.

    # lsblk
    # fdisk /dev/xvdb
    Welcome to fdisk (util-linux 2.23.2).
    
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.
    
    Device does not contain a recognized partition table
    Building a new DOS disklabel with disk identifier 0xae23de7b.
    
    Command (m for help): n
    Partition type:
       p   primary (0 primary, 0 extended, 4 free)
       e   extended
    Select (default p): p
    Partition number (1-4, default 1): 
    First sector (2048-4194303, default 2048): 
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-4194303, default 4194303): 
    Using default value 4194303
    Partition 1 of type Linux and of size 2 GiB is set
    
    Command (m for help): w
    The partition table has been altered!
    
    Calling ioctl() to re-read partition table.
    Syncing disks.
    
  3. Challenge

    Create the File System and Directory for `dbadmin`
    # mkfs.xfs /dev/xvdb1
    
    # mkdir /dbadmin
    
  4. Challenge

    Configure `xvdb1` to Be Persistently Mounted

    Configure /etc/fstab to persistently mount the /dbadmin file system as read-only. Mount the file system, verify it mounted successfully, and test creating a file in that directory.

    # blkid /dev/xvdb1
    
    # vim /etc/fstab	
    	UUID:<YOURDEVICESUUID>		/dbadmin	xfs	ro,defaults	0	0
    
    # mount -a
    # df -h
    # cd /dbadmin
    # touch test
     touch: cannot touch ‘test’: Read-only file system
    
  5. Challenge

    Format `xvdc`

    List the available system disks and format /dev/xvdc. Enter n for new partition, p for primary, and take the defaults. Type w to write the changes to the system.

    # lsblk
    # fdisk /dev/xvdc
    Welcome to fdisk (util-linux 2.23.2).
    
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.
    
    Device does not contain a recognized partition table
    Building a new DOS disklabel with disk identifier 0xae23de7b.
    
    Command (m for help): n
    Partition type:
       p   primary (0 primary, 0 extended, 4 free)
       e   extended
    Select (default p): p
    Partition number (1-4, default 1): 
    First sector (2048-4194303, default 2048): 
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-4194303, default 4194303): 
    Using default value 4194303
    Partition 1 of type Linux and of size 2 GiB is set
    
    Command (m for help): w
    The partition table has been altered!
    
    Calling ioctl() to re-read partition table.
    Syncing disks.
    
  6. Challenge

    Create the File System and Directory for `www`
    # mkfs.xfs /dev/xvdc1
    
    # mkdir /www
    
  7. Challenge

    Configure `xvdc1` to Be Persistently Mounted

    Configure /etc/fstab to persistently mount the /www file system. Mount the file system and verify it mounted successfully.

    # blkid /dev/xvdc1
    
    # vim /etc/fstab	
    	UUID:<YOURDEVICESUUID>		/www	xfs	defaults	0	0
    
    # mount -a
    # df -h
    
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight