Difficulty: Easy
Correct Answer: 82
Explanation:
Introduction / Context:
On MBR-partitioned disks, fdisk assigns a one-byte hexadecimal “system ID” to each partition. Linux tools recognize certain IDs for filesystems and special purposes. Correctly tagging a partition as swap ensures the system can format and activate it during boot or on demand.
Given Data / Assumptions:
Concept / Approach:
By convention, 0x82 identifies a Linux swap partition, while 0x83 identifies a standard Linux filesystem partition (e.g., ext2/3/4, xfs when using MBR). Setting the correct ID helps initramfs and system tools like swapon/fstab recognize the partition's role.
Step-by-Step Solution:
Create the partition with fdisk.Set the type with the “t” command and enter 82 for Linux swap.Write changes, then run mkswap /dev/sdXN to format it.Add an entry in /etc/fstab using UUID=… with type swap and options like defaults.
Verification / Alternative check:
Use blkid to confirm type and UUID, then run swapon --show to verify activation. /proc/swaps lists active swap areas.
Why Other Options Are Wrong:
83 corresponds to Linux filesystem partitions, not swap.5 is the old DOS extended partition type, not swap.4 is FAT16 <32M type in old DOS schemes, not swap.
Common Pitfalls:
Final Answer:
82
Discussion & Comments