Linux partition type codes (MBR) In fdisk with Master Boot Record (MBR) partitioning, which hexadecimal codes designate a Linux swap partition and a Linux native (filesystem) partition, respectively?

Difficulty: Easy

Correct Answer: 82 and 83

Explanation:


Introduction / Context:
On MBR-partitioned disks, fdisk assigns a one-byte hexadecimal type to each partition. Correctly labeling partitions ensures the operating system recognizes their intended use, such as swap or a Linux filesystem. Although GPT now uses GUIDs, many legacy systems and exams still reference these classic MBR codes.


Given Data / Assumptions:

  • Using MBR (not GPT).
  • Creating Linux swap and Linux native filesystem partitions.
  • Need to recall the correct hex identifiers.


Concept / Approach:
The standard codes are: 0x82 = Linux swap and 0x83 = Linux native filesystem (for ext2/3/4, xfs when using MBR). Setting these correctly helps tools like the initramfs, swapon, and mount identify partitions at boot.


Step-by-Step Solution:
Create partitions with fdisk.Use the “t” command to set types: enter 82 for swap and 83 for native.Format swap via mkswap and filesystems via mkfs.ext4 or similar.Add entries to /etc/fstab for persistence and test with swapon --show and findmnt.


Verification / Alternative check:
Use blkid to confirm types and UUIDs. lsblk -f also displays filesystem and mount information for quick verification.


Why Other Options Are Wrong:
92/93 and 63/64: not standard Linux swap/native MBR codes.82 and 85: 85 is typically Linux extended partition on some tools, not Linux native filesystem.


Common Pitfalls:

  • Forgetting to run mkswap after labeling a partition as swap.
  • Using device names instead of UUIDs in /etc/fstab, risking renumbering issues.
  • Confusing MBR codes with GPT partition type GUIDs.


Final Answer:
82 and 83

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion