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
View the available block devices on your lab system:
lsblk
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 /
In this example
nvme0n1
,nvme1n1
, andnvme2n1
are the blank disks. You will be adding partitions to these disks below.
Partition and Create a Filesystem Using YaST
Open YaST:
sudo yast
Choose System > Partitioner > hit Enter at the warning.
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.
Use Tab to navigate to the [Partition Table] entry at the bottom of the pale panel, and hit Enter.
Select Create New Partition Table, and hit Enter.
Select GPT and Tab to Next, and hit Enter.
You will be back on the main screen now.
Tab to Overview and then Right Arrow to the Partitions menu.
Then Tab to Add Partition at the bottom.
Select Max size and Tab to Next, and hit Enter.
Select Data and ISV Applications, Tab to Next, and hit Enter.
On the next screen, select Format as ext4 Partition.
ID will stay Linux Native.
Do not mount the device, Tab to Next, and hit Enter.
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.
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.
Tab to Next and hit Enter.
The final screen should show the tasks to be performed. Review this, and then Tab to Finish, and hit Enter.
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.
Create the directory that will be the mount point:
sudo mkdir /mnt/accounting
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
Create the appropriate directory, and take ownership if necessary:
sudo mkdir /mnt/accounting/data sudo chown -R cloud_user: /mnt/accounting/data
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.