Managing Disks, Partitions, and File Systems in SUSE Linux Enterprise

30 minutes
  • 3 Learning Objectives

About this Hands-on Lab

In this hands-on lab, we will work with disks in SUSE Linux Enterprise. We will add and mount disks to an existing system. Once that is completed, we will ensure the added disks are ready for use by the users on the system.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create a Partition and a Filesystem on the Three Empty Disks, Using `lsblk` to Determine the Device Names
  1. View the available block devices on your lab system:

    lsblk
  2. Your output should look similar to this:

    NAME        MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    nvme0n1     259:0    0   2G  0 disk 
    nvme1n1     259:1    0   2G  0 disk 
    nvme2n1     259:2    0   2G  0 disk 
    nvme3n1     259:3    0  10G  0 disk 
    ├─nvme3n1p1 259:4    0   2M  0 part 
    ├─nvme3n1p2 259:5    0  20M  0 part /boot/efi
    └─nvme3n1p3 259:6    0  10G  0 part /
  3. In this example nvme0n1, nvme1n1, and nvme2n1 are the blank disks. You will be adding partitions to these disks below.

Partition and Create a Filesystem Using YaST

  1. Open YaST:

    sudo yast
  2. Choose System > Partitioner > hit Enter at the warning.

  3. On the left side under Hard Disks, select one of the new disks and hit Enter, which shows a pale panel with device info on it.

  4. Use Tab to navigate to the [Partition Table] entry at the bottom of the pale panel, and hit Enter.

  5. Select Create New Partition Table, and hit Enter.

  6. Select GPT and Tab to Next, and hit Enter.

  7. You will be back on the main screen now.

  8. Tab to Overview and then Right Arrow to the Partitions menu.

  9. Then Tab to Add Partition at the bottom.

  10. Select Max size and Tab to Next, and hit Enter.

  11. Select Data and ISV Applications, Tab to Next, and hit Enter.

  12. On the next screen, select Format as ext4 Partition.

  13. ID will stay Linux Native.

  14. Do not mount the device, Tab to Next, and hit Enter.

  15. This will take you back to the start screen and will display the partition under the drive.

Repeat the process for the other two drives.

  1. When done with the partitioning, Tab to the System View panel, select the Hard Disks item, and hit Enter to show the totality of the disks and partitions, including the three about to be committed to disk.

  2. Tab to Next and hit Enter.

  3. The final screen should show the tasks to be performed. Review this, and then Tab to Finish, and hit Enter.

  4. Quit YaST.

Mount the Drives to the System as Directed in the *Additional Information and Resources* Instructions

Now, you’ll mount the three new filesystems you just created onto /mnt/account, /mnt/humanresources, and /mnt/videolab, respectively.

On each drive, as is appropriate from the instructions, run the following.

  1. Create the directory that will be the mount point:

    sudo mkdir /mnt/accounting
  2. Mount the drive at that location:

    sudo mount /dev/nvme0n1p1 /mnt/accounting

Repeat these steps for each drive using the parameters in the Additional Information and Resources instructions.

Create the Directories and Files in Each Drive as Instructed and Verify Existence
  1. Create the appropriate directory, and take ownership if necessary:

    sudo mkdir /mnt/accounting/data
    sudo chown -R cloud_user: /mnt/accounting/data
  2. Create the example file, and verify that it exists:

    touch /mnt/accounting/data/test
    ls -l /mnt/accounting/data

Repeat these steps for each drive using the parameters in the Additional Information and Resources instructions.

Additional Resources

In your organization, you have been tasked with deploying a server for internal teams. You have gotten an update to your datacenter ticket in which you requested three drives be added to the server — the NVMe drives have been added.

You will need to provision the drives so that:

  • One drive is an ext4 partition mounted at /mnt/accounting containing a directory named data; this directory should be owned by cloud_user and contain a file named test.
  • One drive is an ext4 partition mounted at /mnt/humanresources containing a directory named employees; this directory should be owned by root and contain a file named test.
  • One drive is an ext4 partition mounted at /mnt/videolab containing a directory named lessons; this directory should be owned by cloud_user and contain a file named test.

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.

Sign In
Welcome Back!

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

Get Started
Who’s going to be learning?