← All sims
CompTIA Linux+ / LPIC-1

PBQ1 — Linux Disk Partitioning

Performance-Based Question — Disk Management & Filesystem Creation

Scenario: A new drive was recently added to a Linux system. Using the environment and tokens provided, complete the following tasks: The current working directory is /.
Instructions: Use the drop-down menus to select the correct object to complete each command. Not all objects will be used, and some may be used more than once. Click Check Answers for detailed feedback — including exactly why each wrong choice is incorrect.

Available objects

sdb
ext4
mkpart
/dev/dev1
secondary
mklabel
gpt
parted
mkdir
/dev/sdc1
/data
/dev/sdc
ext2
ext3
sdc
lsblk
primary
root@linux:~#
Command 1 — create partition table
parted -s
gpt
Command 2 — create partition
parted -s
1 10G
Command 3 — format filesystem
mkfs.
8  / 9 correct
All correct! Excellent work.
✓ Correctparted -s /dev/sdc mklabel gpt
✓ Correctparted -s /dev/sdc mkpart primary ext4 1 10G
✓ Correctmkfs.ext4 /dev/sdc1
parted -s /dev/sdc mklabel gpt
parted is the primary Linux disk partitioning utility. The -s flag enables script (non-interactive) mode, which suppresses all confirmation prompts so the command runs unattended — essential in scripts and automation.

/dev/sdc is the target disk (third SATA/SCSI device). The full /dev/ path is mandatory — bare names like sdc are rejected.

mklabel writes a completely new partition table to the disk, destroying any previous layout. The argument gpt (already provided) sets the GUID Partition Table format — the modern standard that supports disks larger than 2 TB, stores up to 128 primary partitions, and keeps a backup copy of the table at the end of the disk for recovery.
parted -s /dev/sdc mkpart primary ext4 1 10G
mkpart adds a new partition entry to the table created in Command 1. It requires four arguments: partition type, filesystem type hint, start, and end.

primary — the partition type. In GPT all partitions are technically primary; parted still accepts the keyword for compatibility. secondary is not a valid parted type at all.

ext4 here is a metadata hint only — it stores the intended filesystem type in the partition entry but performs no formatting. The actual filesystem is created in Command 3.

1 10G (pre-filled) defines start and end: starting at 1 MB clears the GPT header area and aligns to modern 4K-sector drives for optimal I/O performance; ending at 10G produces a ~10 GB partition.
mkfs.ext4 /dev/sdc1
mkfs. is the make-filesystem command family. The filesystem type is appended directly with no space, forming the binary mkfs.ext4. This step actually creates the filesystem — writing the superblock, inode tables, block group descriptors, extent tree, and journal onto the partition.

/dev/sdc1 is the first partition on sdc — exactly the partition just created in Command 2. Using /dev/sdc (the whole disk) would overwrite the partition table written in Command 1, destroying all partition data immediately.