Exam EX200 All QuestionsBrowse all questions from this 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.

    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
MELO225

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

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

don't forget: mkdir /mnt/data

kysj

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

xinivat265

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

lvcreate -n lv1 -L 50 vg1

Roger95

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

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)

gunwantk

why question statement are so confusing?

RedQuasar

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

jmm18

Where do we get UUID value?

sugisho

just blkid

cb52

run lsblk -fs

ktd971

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

Rahul95

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 #

kenkct

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

eid

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

zqc

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