Courseiva
Devices, Filesystems and FHShardMultiple ChoiceObjective-mapped

LPIC-1 pvcreate Practice Question

A company runs a web server on Linux with two hard disks: /dev/sda (500GB) and /dev/sdb (500GB). The root filesystem is on /dev/sda1, and /var is on /dev/sda2. The administrator wants to add a new disk /dev/sdc (500GB) to be used as additional storage for /var/www/html. The new disk should be configured as an LVM physical volume and added to an existing volume group named 'vg_web'. The volume group currently has 200GB free space from /dev/sdb1. The administrator intends to extend the logical volume 'lv_web' mounted at /var/www/html by 300GB. Which of the following is the correct sequence of commands to achieve this without data loss?

⚠ Common exam trap

The trap is that candidates might think only one method (explicit resize2fs) is correct, but modern LVM also supports the --resizefs flag. Both are valid.

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

pvcreate /dev/sdc1; vgextend vg_web /dev/sdc1; lvextend --resizefs -L +300G /dev/vg_web/lv_web

Both options C and D are correct for extending an ext4 filesystem. Option C uses the `--resizefs` flag with `lvextend`, which automatically resizes the filesystem after extending the logical volume. This flag is supported in modern LVM2 for ext4 and other filesystems. Option D performs the resize explicitly with `resize2fs`. Both achieve the same result. Option A omits the filesystem resize, so the new space is not usable. Option B uses the whole disk without a partition, which is not standard practice and may cause issues. Therefore, the correct sequence includes either the `--resizefs` flag or an explicit resize step.

Answer analysis

Option-by-option breakdown

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

  • pvcreate /dev/sdc1; vgextend vg_web /dev/sdc1; lvextend -L +300G /dev/vg_web/lv_web

    Why it's wrong here

    This sequence omits the filesystem resize step (`resize2fs` or `--resizefs`), so the new space is not usable. Incorrect.

  • pvcreate /dev/sdc; vgextend vg_web /dev/sdc; lvextend -L +300G /dev/vg_web/lv_web; resize2fs /dev/vg_web/lv_web

    Why it's wrong here

    Using the whole disk `/dev/sdc` without a partition is not standard practice and may cause issues; moreover, the partition step is expected. Incorrect.

  • pvcreate /dev/sdc1; vgextend vg_web /dev/sdc1; lvextend --resizefs -L +300G /dev/vg_web/lv_web

    Why this is correct

    This sequence uses the `--resizefs` flag with `lvextend`, which automatically resizes the filesystem. This is a valid method in modern LVM2. Correct.

  • pvcreate /dev/sdc1; vgextend vg_web /dev/sdc1; lvextend -L +300G /dev/vg_web/lv_web; resize2fs /dev/vg_web/lv_web

    Why this is correct

    This sequence explicitly resizes the filesystem with `resize2fs` after extending the logical volume. This is the traditional and portable method. Correct.

About these practice questions

One of 527 original LPIC-1 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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-1 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-1 exam.