- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud

Storage Management
In this lab, we’re going to go over managing and formatting partitions. Having a solid understanding of how to use these tools is a fundamental component of a Linux sysadmin career. *This course is not approved or sponsored by Red Hat.*

Lab Info
Table of Contents
-
Challenge
Create a 2 GB GPT Partition
-
Create the partition:
gdisk /dev/nvme1n1
-
Enter
n
to create a new partition. -
Accept the default for the partition number.
-
Accept the default for the starting sector.
-
For the ending sector, enter
+2G
to create a 2 GB partition. -
Accept the default partition type.
-
Enter
w
to write the partition information. -
Enter
y
to proceed. -
Finalize the settings:
partprobe
-
-
Challenge
Create a 2 GB MBR Partition
- Create the partition:
``` fdisk /dev/nvme2n1 ```
-
Enter
n
to create a new partition. -
Accept the default partition type.
-
Accept the default for the partition number.
-
Accept the default for the starting sector.
-
For the ending sector, type
+2G
to create a 2 GB partition. -
Enter
w
to write the partition information. -
Finalize the settings:
partprobe
-
Challenge
Format the GPT Partition with XFS and Mount the Device persistently
-
Format the partition:
mkfs.xfs /dev/nvme1n1p1
Getting It Ready for Mounting
-
Run the following:
blkid
-
Copy the UUID of the partition at
/dev/nvme1n1p1
. -
Open the
/etc/fstab
file:vim /etc/fstab
-
Add the following, replacing
<UUID>
with the UUID you just copied:UUID="<UUID>" /mnt/gptxfs xfs defaults 0 0
-
Save and exit the file by pressing Escape followed by
:wq
.
Create a Mount Point
-
Create the mount point we specified in
fstab
:mkdir /mnt/gptxfs
-
Mount everything that's described in
fstab
:mount -a
-
-
Challenge
Format the MBR Partition with ext4 and Mount the Device.
Format the MBR Partition with ext4 and Mount the Device on
/mnt/mbrext4
-
Format the partition:
mkfs.ext4 /dev/nvme2n1p1
Create a Mount Point
-
Create the mount point:
mkdir /mnt/mbrext4
-
Mount it:
mount /dev/nvme2n1p1 /mnt/mbrext4
-
Check that it's mounted:
mount
The partition should be listed in the output.
-
Mount the disk:
mount /dev/nvme2n1p1 /mnt/mbrext4
-
About the author
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.