Storage Management

1 hour
  • 4 Learning Objectives

About this Hands-on Lab

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.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create a 2 GB GPT Partition
  1. Create the partition:

    gdisk /dev/nvme1n1
  2. Enter n to create a new partition.

  3. Accept the default for the partition number.

  4. Accept the default for the starting sector.

  5. For the ending sector, enter +2G to create a 2 GB partition.

  6. Accept the default partition type.

  7. Enter w to write the partition information.

  8. Enter y to proceed.

  9. Finalize the settings:

    partprobe
Create a 2 GB MBR Partition
  1. Create the partition:

    fdisk /dev/nvme2n1
    1. Enter n to create a new partition.

    2. Accept the default partition type.

    3. Accept the default for the partition number.

    4. Accept the default for the starting sector.

    5. For the ending sector, type +2G to create a 2 GB partition.

    6. Enter w to write the partition information.

    7. Finalize the settings:

    partprobe
Format the GPT Partition with XFS and Mount the Device persistently
  1. Format the partition:

    mkfs.xfs /dev/nvme1n1p1

Getting It Ready for Mounting

  1. Run the following:

    blkid
  2. Copy the UUID of the partition at /dev/nvme1n1p1.

  3. Open the /etc/fstab file:

    vim /etc/fstab
  4. Add the following, replacing <UUID> with the UUID you just copied:

    UUID="<UUID>" /mnt/gptxfs xfs defaults 0 0
  5. Save and exit the file by pressing Escape followed by :wq.

Create a Mount Point

  1. Create the mount point we specified in fstab:

    mkdir /mnt/gptxfs
  2. Mount everything that’s described in fstab:

    mount -a
Format the MBR Partition with ext4 and Mount the Device.

Format the MBR Partition with ext4 and Mount the Device on /mnt/mbrext4

  1. Format the partition:

    mkfs.ext4 /dev/nvme2n1p1

Create a Mount Point

  1. Create the mount point:

    mkdir /mnt/mbrext4
  2. Mount it:

    mount /dev/nvme2n1p1 /mnt/mbrext4
  3. Check that it’s mounted:

    mount

    The partition should be listed in the output.

  4. Mount the disk:

    mount /dev/nvme2n1p1 /mnt/mbrext4

Additional Resources

There are two disks advertised to this server. You've been tasked with setting one up with a GPT partition table and allocating 2GB to a single partition. The other needs to be a MBR partition with a 2GB partition.

Note: The Block devices have changed for the lab environment. To see the available block devices to use, run: lsblk The commands in the lab instructions have been updated for the new change.

What are Hands-on Labs

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.

Get Started
Who’s going to be learning?

How many seats do you need?

  • $499 USD per seat per year
  • Billed Annually
  • Renews in 12 months

Ready to accelerate learning?

For over 25 licenses, a member of our sales team will walk you through a custom tailored solution for your business.


$2,495.00

Checkout
Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!