EX200 · Question #26
EX200 Question #26: Real Exam Question with Answer & Explanation
Sign in or unlock EX200 to reveal the answer and full explanation for question #26. The question stem and answer options stay visible for context.
Question
26. Create Logical Volume According to the given requirements, create a new logical volume: - Logical volume named "mylv" belonging to the volume group "myvg" with a size of 50 extents. - Extent size of logical volumes in volume group "myvg" should be 16 MiB. - Format the new logical volume with the VFAT filesystem. - The logical volume should be automatically mounted at /mnt/mydata during system startup. Solution: # Check the disk layout [root@node2 ~]# lsblk # Partition the disk [root@node2 ~]# fdisk /dev/vdb Welcome to fdisk (util-linux 2.37.4). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): n # Add a new partition Partition type p primary (1 primary, 0 extended, 3 free) # Primary partition e extended (container for logical partitions) # Extended partition Select (default p): p Partition number (2-4, default 2): # Press Enter First sector (1026048-20971519, default 1026048): # Press Enter ***Note: The partition size must be larger than the total size, it should not be exactly equal to. It is recommended to add an extra 200M. Last sector, +/-sectors or +/-size{K,M,G,T,P} (1026048-20971519, default 20971519): +1200M # Partition size Created a new partition 2 of type 'Linux' and of size 512 MiB. Command (m for help): w # Save and exit The partition table has been altered. # Create volume group and logical volume [root@node2 ~]# vgcreate -s 16M myvg /dev/vdb4 [root@node2 ~]# lvcreate -l 50 -n mylv myvg # Install vfat support [root@node2 ~]# yum provides */mkfs.vfat [root@node2 ~]# yum -y install dosfstools # Format the logical volume with vfat filesystem [root@node2 ~]# mkfs.vfat /dev/myvg/mylv # Create mount point [root@node2 ~]# mkdir /mnt/mydata # Update /etc/fstab for automatic mounting [root@node2 ~]# vim /etc/fstab /dev/myvg/mylv /mnt/mydata vfat defaults 0 0 # Mount the logical volume [root@node2 ~]# mount -a
Unlock EX200 to see the answer
You've previewed enough free EX200 questions. Unlock EX200 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.