Difficulty: Easy
Correct Answer: mkfs
Explanation:
Introduction / Context:Before a partition or block device can be used for storing files, it must be formatted with a file system. Linux provides a specific command for this purpose, which abstracts details of different file system types.
Given Data / Assumptions:
Concept / Approach:
The mkfs command ('make file system') initializes a partition with a chosen file system (ext4, xfs, vfat, etc.). Variants like mkfs.ext4 or mkfs.xfs provide specific implementations.
Step-by-Step Solution:
Identify device: lsblk or fdisk -l.Run: mkfs.ext4 /dev/sdb1 (example).Wait for formatting to complete.Mount the filesystem: sudo mount /dev/sdb1 /mnt.Verification / Alternative check:
Check with file -s /dev/sdb1 or blkid. Mount and verify with df -h.
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
mkfs.
Discussion & Comments