Exam EX200 All QuestionsBrowse all questions from this exam
Question 109

SIMULATION -

Create a new logical volume according to the following requirements:

The logical volume is named database and belongs to the datastore volume group and has a size of 50 extents.

Logical volumes in the datastore volume group should have an extent size of 16 MB.

Format the new logical volume with a ext3 filesystem.

The logical volume should be automatically mounted under /mnt/database at system boot time.

    Correct Answer:

    To create a new logical volume according to the given requirements, follow these steps: 1. Identify the unused disk or partition using a command like `lsblk`. For example, assume `/dev/sda1` is the unused partition. 2. Prepare the physical volume with `pvcreate /dev/sda1`. 3. Create the volume group with an extent size of 16 MB using `vgcreate -s 16M datastore /dev/sda1`. 4. Create the logical volume with a size of 50 extents using `lvcreate -l 50 -n database datastore`. 5. Format the new logical volume with an ext3 filesystem using `mkfs.ext3 /dev/datastore/database`. 6. Create the mount point with `mkdir -p /mnt/database`. 7. Mount the new logical volume with `mount /dev/datastore/database /mnt/database`. 8. To ensure the logical volume is automatically mounted at boot time, add the following line to `/etc/fstab`: `/dev/datastore/database /mnt/database ext3 defaults 0 0`. 9. Finally, run `mount -a` to validate the `/etc/fstab` entries.

Discussion
loloski

parted /dev/sdb mklabel msdos partprobe /dev/sdb parted /dev/sdb mkpart primary 1 900 set rm 1 lvm on pvcreate /dev/sdb1 vgcreate datastore -s 16M VG1 /dev/sdb1 lvcreate -l 50 -n database datastore mkfs -t ext3 /dev/mapper/datastore-database mkdir /mnt/database /dev/mapper/datastore-database /mnt/database ext3 defaults 0 0

wizojlo

#lsblk -pf (to check unused disks and partitions - let's say sda1 and sda2 are empty) #pvcreate /dev/sda1 /dev/sda2 #vgcreate -s 16M datastore /dev/sda1 /dev/sda2 #lvcreate -l 50 -n database datastore #mkfs.ext3 /dev/datastore/database #mkdir -p /mnt/database #lsblk -pf (to see the UUIDs) #echo 'UUID=XXX /mnt/data ext4 defaults 0 0' >> /etc/fstab (use real UUID of "database" volume from previous step instead of XXX) #systemctl daemon-reload #mount -a

gaven186

view unused disk with 'lsblk -af'. -p means to Print the full device path, not sorting of unused.