Courseiva
Devices, Filesystems and FHSmediumMultiple ChoiceObjective-mapped

LVM: Creating a Volume Group and Logical Volume

A Linux system has two SATA disks: /dev/sda (250GB) and /dev/sdb (500GB). The administrator wants to create a logical volume group named 'vgdata' using partitions on both disks, then create a 600GB logical volume named 'lvdata' for a database. Which sequence of commands should be used?

Quick Answer

The correct sequence is pvcreate, vgcreate, then lvcreate, as shown in option C. This order is mandatory because LVM requires physical volumes (PVs) to exist before they can be grouped into a volume group (VG), and the VG must exist before a logical volume (LV) can be carved from it. On the LPIC-1 exam, this question tests your understanding of the foundational LVM workflow, often appearing as a command-ordering trap where candidates mistakenly try to create the VG before initializing the partitions with pvcreate. A common pitfall is confusing the device names—note that the correct answer uses /dev/sdb1 and /dev/sdc1, not the full disks, as partitions must be prepared first. To remember the sequence, think of the mnemonic "People Vote Loudly" for pvcreate, vgcreate, lvcreate.

⚠ Common exam trap

The trap is that candidates may confuse the order of LVM commands (pvcreate, vgcreate, lvcreate) or mistakenly use whole disks (e.g., /dev/sdb) instead of partitions (e.g., /dev/sdb1). Additionally, candidates must ensure the device names match the scenario: here the disks are /dev/sda and /dev/sdb, so partitions should be /dev/sda1 and /dev/sdb1, not /dev/sdc1.

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/sda1 /dev/sdb1; vgcreate vgdata /dev/sda1 /dev/sdb1; lvcreate -L 600G -n lvdata vgdata

It follows the proper LVM sequence: first create physical volumes (PVs) on partitions /dev/sda1 and /dev/sdb1 (the partitions on the two disks given in the scenario), then create the volume group 'vgdata' from those PVs using vgcreate, and finally create the logical volume 'lvdata' with a size of 600GB using lvcreate. This order ensures that the PVs exist before the VG is created, and the VG exists before the LV is created. Only option C uses the correct device names that match the system's disks (/dev/sda and /dev/sdb).

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/sdb1 /dev/sdc1; lvcreate -L 600G -n lvdata vgdata; vgcreate vgdata /dev/sdb1 /dev/sdc1

    Why it's wrong here

    lvcreate requires an existing volume group.

  • pvcreate /dev/sdb /dev/sdc; vgcreate vgdata /dev/sdb /dev/sdc; lvcreate -L 600G -n lvdata vgdata

    Why it's wrong here

    pvcreate should be on partitions like /dev/sdb1, not whole disks.

  • pvcreate /dev/sda1 /dev/sdb1; vgcreate vgdata /dev/sda1 /dev/sdb1; lvcreate -L 600G -n lvdata vgdata

    Why this is correct

    Correct order: pvcreate, vgcreate, lvcreate.

  • vgcreate vgdata /dev/sdb1 /dev/sdc1; pvcreate /dev/sdb1 /dev/sdc1; lvcreate -L 600G -n lvdata vgdata

    Why it's wrong here

    vgcreate requires prior pvcreate.

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

Same concept, more angles

1 more way this is tested on LPIC-1

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. 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?

hard
  • A.pvcreate /dev/sdc1; vgextend vg_web /dev/sdc1; lvextend -L +300G /dev/vg_web/lv_web
  • B.pvcreate /dev/sdc; vgextend vg_web /dev/sdc; lvextend -L +300G /dev/vg_web/lv_web; resize2fs /dev/vg_web/lv_web
  • C.pvcreate /dev/sdc1; vgextend vg_web /dev/sdc1; lvextend --resizefs -L +300G /dev/vg_web/lv_web
  • D.pvcreate /dev/sdc1; vgextend vg_web /dev/sdc1; lvextend -L +300G /dev/vg_web/lv_web; resize2fs /dev/vg_web/lv_web

Why C: 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.

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.