Difficulty: Easy
Correct Answer: fdisk
Explanation:
Introduction / Context:
Before a Linux system can format a filesystem or mount storage, the disk must be partitioned. Partitioning defines start and end sectors for one or more logical areas on a physical drive. The traditional utility for this task on MBR-style disks is fdisk, which provides interactive commands to add, delete, and change partition types.
Given Data / Assumptions:
Concept / Approach:
Partitioning precedes filesystem creation. The correct tool must manipulate the disk’s partition table. fdisk edits partition entries at the block device level, allowing administrators to create primary/extended/logical partitions and set partition types and bootable flags.
Step-by-Step Solution:
Verification / Alternative check:
Verify with lsblk, blkid, or fdisk -l that the partition table reflects your changes. Try mounting the new partition to ensure it is accessible after creating a filesystem.
Why Other Options Are Wrong:
a: mkfs creates a filesystem inside a partition; it does not partition the disk.
c: fsck checks and repairs an existing filesystem; it does not edit a partition table.
d: mount attaches an existing filesystem to the directory tree; it does not create partitions.
e: Not applicable since fdisk is correct for partitioning.
Common Pitfalls:
Confusing partitioning with formatting, writing changes to the wrong device, and forgetting to update /etc/fstab for persistent mounts. Always back up critical data before changing partitions.
Final Answer:
fdisk
Discussion & Comments