Summary
In this challenge, you learned how to list, create, and delete partitions on both MBR and GPT disks using the fdisk
and gdisk
commands. This is an essential skill for system administrators, as it allows you to configure local storage on Linux systems. By completing this challenge, you have demonstrated your understanding of partition management and are one step closer to passing the RHCSA exam.
If you need to initialize the challenge environment, you can use the following setup.sh
script:
#!/bin/bash
## Create MBR disk
dd if=/dev/zero of=/tmp/mbrtest.img bs=1M count=20
sudo losetup /dev/loop0 /tmp/mbrtest.img
sudo fdisk /dev/loop0 << EOF
n
p
1
+20G
w
EOF
## Create GPT disk
dd if=/dev/zero of=/tmp/gpttest.img bs=1M count=20
sudo losetup /dev/loop1 /tmp/gpttest.img
sudo gdisk /dev/loop1 << EOF
n
1
+20G
w
y
EOF
The script creates two virtual disks, one with an MBR partition table and the other with a GPT partition table. You can use these disks to practice the partition management tasks in this challenge.