EX200 Exam QuestionsBrowse all questions from this exam

EX200 Exam - Question 15


SIMULATION -

Create a volume group, and set 16M as a extends. And divided a volume group containing 50 extends on volume group lv, make it as ext4 file system, and mounted automatically under /mnt/data.

Show Answer
Correct Answer:

To create a volume group, set an extent size of 16MB, and create a logical volume with 50 extents formatted as ext4, and then mount it automatically under /mnt/data, follow these steps: First, create the physical volumes: # pvcreate /dev/sda7 /dev/sda8. Create the volume group with 16MB extent size: # vgcreate -s 16M vg1 /dev/sda7 /dev/sda8. Create the logical volume with 50 extents: # lvcreate -l 50 -n lv01 vg1. Format the logical volume as ext4: # mkfs.ext4 /dev/vg1/lv01. Next, obtain the UUID of the logical volume for /etc/fstab: # blkid /dev/vg1/lv01. Create the mount point: # mkdir -p /mnt/data. Add the volume to /etc/fstab for automatic mounting: UUID=<UUID> /mnt/data ext4 defaults 0 0, making sure to replace <UUID> with the actual UUID value you obtained. Lastly, mount all filesystems: # mount -a. Verify with # mount.

Discussion

12 comments
Sign in to comment
MELO225
Sep 21, 2021

Assuming /dev/sda1 and /dev/sda2 partitions already exist: # pvcreate /dev/sda1 /dev/sda2 # vgcreate -s 16M vg01 /dev/sda1 /dev/sda2 # lvcreate -l 50 -n lv01 vg01 # mkfs.ext4 /dev/vg01/lv01 # mkdir -p /mnt/data # blkid /dev/vg01/lv01 copy the UUID of /dev/vg01/lv01 in the output of that command. # vim /etc/fstab UUID="paste the UUID of /dev/vg01/lv01 here" /mnt/data ext4 defaults 0 0 # mount -ahttps://www.examtopics.com/exams/redhat/ex200/view/3/#

RedQuasar
Dec 12, 2020

ERRATA: vgcreate -s 16M vg01 /dev/sda1 /dev/sda2 lvcreate -l 50 -n lv01 vg01 mkfs.ext4 /dev/mapper/vg01_lv01 lsblk -pf (UUID=dde8c40f-fa74-4290-8ff9-252c614e8307) echo “UUID=dde8c40f-fa74-4290-8ff9-252c614e8307 /mnt/data xfs defaults 0 0” >> /etc/fstab

kemculka
Jul 7, 2021

don't forget: mkdir /mnt/data

kysj
Mar 6, 2022

it should be ext4 instead of xfs in /etc/fstab

xinivat265
Nov 22, 2020

This question have no sense only for me ? What means "And divided a volume group containing 50 extends on volume group lv".... Divided a volume group in another volume group !? Moreover the size of the volume group is not specified (50 extends or more !?), the size of the logical volume neither..

fullbenz
Oct 19, 2020

lvcreate -n lv1 -L 50 vg1

RedQuasar
Dec 12, 2020

vgcreate -s 16M vg01 /dev/sda1 /dev/sda2 lvcreate -l 50 -n lv01 vg01 mkfs.xfs /dev/mapper/vg01_lv01 lsblk -pf (UUID=dde8c40f-fa74-4290-8ff9-252c614e8307) echo “UUID=dde8c40f-fa74-4290-8ff9-252c614e8307 /mnt/data xfs defaults 0 0” >> /etc/fstab

gunwantk
Oct 15, 2021

why question statement are so confusing?

Roger95
Oct 16, 2021

assume that /dev/sdb2 and /dev/sdb3 were created (lsblk to verify it) #pvcreate /dev/sdb{2,3} #pvdisplay /dev/sdb* (verify) #vgcreate VG01 --physicalextentsize 16M /dev/sdb{2,3} #vgdisplay /dev/VG01 (verify) #lvcreate --extents 50 --name LV01 VG01 #lvdisplay /dev/VG01 (verify) #blkid /dev/VG01/LV01 (get UUID=XXX-XX-XX) #mkdir -p /mnt/data #echo "UUID=XXX-XX-XX /mnt/data ext4 defaults 0 0" | tee -a /etc/fstab #mount -a

kitkat
Jun 2, 2022

mkfs before getting UUID with help of blkid is missing. #lvdisplay /dev/VG01 (verify) #mkfs.ext4 /dev/VG01/LV0 #blkid /dev/VG01/LV01 (get UUID=XXX-XX-XX)

jmm18
May 20, 2021

Where do we get UUID value?

sugisho
Jun 26, 2021

just blkid

cb52
Jan 4, 2022

run lsblk -fs

eid
Dec 21, 2021

what is the correct lvcreate -l 50 -n lv01 vg01 or lvcreate -n lv1 -L 50 vg1

zqc
May 10, 2023

the -L option to set the LV size in bytes or the -l option to set the LV size in extents

kenkct
Feb 15, 2022

lsblk -pfs (locate the 2 empty HDD, sdb sdc) sudo pvcreate /dev/sdb /dev/sdc (2 empty HDD) sudo vgcreate -s 16M vg01 /dev/sdb /dev/sdc sudo lvcreate -l 50 -n lv01 vg01 sudo mkfs.ext4 /dev/mapper/vg01-lv01 lsblk -pfs sudo mkdir -p /mnt/data sudo su echo "UUID=XXXX-XXXX-XXXX /mnt/data ext4 defaults 0 0" >> /etc/fstab mount -a

Rahul95
Jun 1, 2023

Assuming dev/sda1 exist #lsblk -t check #vgcreate -s 16M testvg /dev/sda1 #vgdisplay #lvcreate -l 50 -n testlv testvg #lvdisplay #mkfs.ext4 /dev/test/test1 #mkdir /mnt/data #vi /etc/fstab #/dev/test/test1 /mnt/data ext4 defaults 0 0 #mount -a #df -hT - to verify #

ktd971
Feb 21, 2024

I don't understand why you used 2 "/dev/" instead of just one.