- Lab
- A Cloud Guru
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.*
Path 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
-
What's a lab?
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.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.