CompTIA Linux+ (XK0-006)System ManagementMedium
A technician has attached a new 4TB disk, /dev/sdb, to a Linux server. Because MBR partition tables cannot support disks larger than 2TB, the technician needs to create a GPT partition table before adding partitions. Which command accomplishes this?
- Aparted /dev/sdb mklabel gpt
- Bmkswap /dev/sdb
- Cfdisk /dev/sdb -l
- Dmkfs.ext4 /dev/sdb
Show answer & explanationAnswer & explanation
Correct answer: A. parted /dev/sdb mklabel gpt
The 'parted' utility can create a GPT partition table using 'mklabel gpt', which is required for disks larger than 2TB since traditional MBR is limited to that size. The other commands format filesystems, create swap space, or only list partitions.
Why the other options are wrong
- B. mkswap initializes swap space, unrelated to partition tables.
- C. fdisk -l only lists existing partitions; it doesn't create a GPT label (and classic fdisk has limited GPT support).
- D. mkfs.ext4 formats a filesystem, it doesn't create a partition table.
GPT Partition Table Creation
GUID Partition Table (GPT) supports disks larger than 2TB and up to 128 partitions by default; created using tools like parted or gdisk.
- parted /dev/sdX mklabel gpt creates the table
- GPT stores partition info redundantly for reliability
- MBR is limited to 2TB and 4 primary partitions
Memory trick: GPT = 'Giant Partition Table' for giant disks over 2TB