Courseiva
Block Devices, Filesystems and Advanced StoragemediumMultiple ChoiceObjective-mapped

LPIC-2 Practice Question: Block Devices, Filesystems and Advanced Storage

A system administrator needs to create a new 500 MB ext4 filesystem on /dev/sdb1 and mount it persistently at /data. Which set of commands accomplishes this task?

⚠ Common exam trap

Test-takers frequently choose Option A because it seems to create and mount the filesystem, but they overlook the requirement for persistent mounting via /etc/fstab, or they may pick Option C because they confuse ext4 with XFS, not reading the filesystem type specification carefully.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

mkfs.ext4 /dev/sdb1 && echo '/dev/sdb1 /data ext4 defaults 0 2' >> /etc/fstab && mount -a

It first creates an ext4 filesystem on /dev/sdb1 using mkfs.ext4, then appends a mount entry to /etc/fstab with the correct filesystem type (ext4) and mount point (/data), and finally runs mount -a to mount all filesystems from fstab, including the new one. This sequence ensures the filesystem is created, persistently configured, and immediately mounted.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • mkfs -t ext4 /dev/sdb1 && mount /dev/sdb1 /data

    Why it's wrong here

    Mounts immediately but not persistently; no fstab entry.

  • blkid /dev/sdb1 && echo 'UUID=... /data ext4 defaults 0 2' >> /etc/fstab && mount -a

    Why it's wrong here

    blkid only displays UUID, does not create filesystem.

  • mkfs.xfs /dev/sdb1 && echo '/dev/sdb1 /data xfs defaults 0 2' >> /etc/fstab && mount -a

    Why it's wrong here

    Uses XFS instead of ext4.

  • mkfs.ext4 /dev/sdb1 && echo '/dev/sdb1 /data ext4 defaults 0 2' >> /etc/fstab && mount -a

    Why this is correct

    Correctly creates ext4 filesystem and adds fstab entry for persistent mount.

About these practice questions

Courseiva writes every LPIC-2 question from scratch — 507 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This LPIC-2 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-2 exam.