Which sequence correctly describes creating a new logical volume on new disks using LVM, including preparing disks, PVs, VG, LV, and filesystem, then mounting?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which sequence correctly describes creating a new logical volume on new disks using LVM, including preparing disks, PVs, VG, LV, and filesystem, then mounting?

Explanation:
Creating storage with LVM follows a straightforward sequence: turn the disks into physical volumes, group those PVs into a volume group, carve out a logical volume from that VG, format the LV with a filesystem, and then mount it. In this scenario two partitions on the new disks are prepared as LVM physical volumes. Initializing them with pvcreate /dev/xvdf1 /dev/xvdg1 makes them usable by LVM. Then both physical volumes are combined into a single volume group named battlestar via vgcreate battlestar /dev/xvdf1 /dev/xvdg1, giving a central pool of storage from which you can allocate logical volumes. A logical volume galactica is created in that VG with lvcreate -n galactica -L 20G battlestar, reserving 20 gigabytes for this LV. The next step formats the new LV with a filesystem, here mkfs -t xfs /dev/battlestar/galactica, so it can store data in a usable filesystem. Finally, mount it with mount /dev/battlestar/galactica /mnt/mydir, after ensuring the mount point exists (typically you’d run mkdir /mnt/mydir first). This sequence correctly reflects the standard workflow: PVs → VG → LV → filesystem → mount. Other options skip or misorder these steps, or rely on only one disk’s PV, or omit necessary steps like creating the mount point, making them inappropriate for correctly provisioning a new LVM-based filesystem.

Creating storage with LVM follows a straightforward sequence: turn the disks into physical volumes, group those PVs into a volume group, carve out a logical volume from that VG, format the LV with a filesystem, and then mount it.

In this scenario two partitions on the new disks are prepared as LVM physical volumes. Initializing them with pvcreate /dev/xvdf1 /dev/xvdg1 makes them usable by LVM. Then both physical volumes are combined into a single volume group named battlestar via vgcreate battlestar /dev/xvdf1 /dev/xvdg1, giving a central pool of storage from which you can allocate logical volumes. A logical volume galactica is created in that VG with lvcreate -n galactica -L 20G battlestar, reserving 20 gigabytes for this LV. The next step formats the new LV with a filesystem, here mkfs -t xfs /dev/battlestar/galactica, so it can store data in a usable filesystem. Finally, mount it with mount /dev/battlestar/galactica /mnt/mydir, after ensuring the mount point exists (typically you’d run mkdir /mnt/mydir first). This sequence correctly reflects the standard workflow: PVs → VG → LV → filesystem → mount.

Other options skip or misorder these steps, or rely on only one disk’s PV, or omit necessary steps like creating the mount point, making them inappropriate for correctly provisioning a new LVM-based filesystem.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy