Linux system administrators need to know how to add a new disk drive to a system, create a file system on that drive, and have it permanently mounted via the `/etc/fstab` file. This exercise will assist you in your practice of creating a new file system and mounting the file system to a directory, and configuring the system so that this mount persists across reboots.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Create a New Partition
Run the
lsblk
command to verify that you have a/dev/nvme1n1
device available. Once confirmed, create a partition on the/dev/nvme1n1
disk usingfdisk
(note you will need to runsudo
for these commands) that uses the entire disk:lsblk sudo fdisk /dev/nvme1n1
- Create the File System
Create a new XFS file system on this partition with the
mkfs.xfs
command. Once that is complete, run theblkid
command on the newly created partition to obtain the UUID. Make a note of this UUID:sudo mkfs.xfs /dev/nvme1n1p1 sudo blkid /dev/nvme1n1p1
- Mount the new File System and Make it Permanent
Edit the
/etc/fstab
file and create a new entry at the bottom for your new disk. The format should follow the following (be sure to use your disk’s UUID from the previous step):UUID=YOURUUID /opt xfs defaults 0 0
Save and close the file, then run the
sudo mount -a
command to mount your new partition.
Adf -h /opt
command should show you roughly 5GB available for the/opt
directory.