Project
5 min read

Linux in the Cloud

Scenario 1: The database server called centos-host is running short on space! You have been asked to add an LVM volume for the Database team using some of the existing disks on this server.

 

 

 

Inspect the requirements in detail by clicking on the icons of the interactive architecture diagram on the right and complete the tasks. Once done click on the Check button to validate your work.

Solution:

 

1. The first step is to switch from bob@centos to a root user and then check any of the logical volumes

 

[bob@centos-host sudo su - [root@centos-host pvs -bash: pvs: cc—and not found [root@centos-host IVS -bash: IVs: cc—and not found [root@centos-host -qa I grep Ivm [root@centos-host

 

2. Next I need to install the correct packages so that I can use lvm on the centos machine using the command "yum install -y lvm2"

Verifying Verifying Upgraded : : device-mapper-1ibs-8 : device-mapper-1ibs-8 :1.Ø2.177-1Ø.e18.x86 64 :1.Ø2.171-5.e18.x86 64 device -mapper-1ibs-8 : 1. device-mapper-8:1.Ø2.177-1Ø. e18 -x86 64 Installed : device -mapper- event-8 : 1.02.177-10. e18. x86 Ivm2-8:2.Ø3.12-1Ø.e18.x86 64 Ccmplete ! [root@centos-host C] 64 device-mapper-event-1ibs-8:1.Ø2.177-1Ø. e18 -x86 64 Ivm2-1ibs-8:2.æ.12-1ø.e18.x86 64 device -mapper-

 

3. Next I need to create a physical volume for "/dev/vdb" and "/dev/vdc", then create a volume  group titled "dba_storage by using the physical volumes of  "/dev/vdb" and "/dev/vdc". Then, I'll create an "lvm" called volume_1 taken from the volume group of "dba_storage" It is important to use the entire space available within the volume group.

 

Ccmplete ! [ root@centos - host pvcreate /dev/vdb Physical voltme " /dev/vdb" successfully created. [ root@centos - host pvcreate /dev/vdc Physical voltme " /dev/vdc" successfully created. [ root@centos - host vgcreate dba_storage /dev/vdb /dev/vdc Voltme group "dba storage" successfully created 1Ø2Ø.ØØm 1Ø2Ø.ØØm 1Ø2Ø.ØØm 1Ø2Ø.ØØm [root@centos-host pvs Fmt Attr PSize /dev/vdb dba_storage Ivm2 a - - /dev/vdc dba_storage Ivm2 a - - [root@centos-host IVS [root@centos-host Ivcreate -n voltme_l Logical voltme "voltme 1" created. [root@centos-host IVS PFree -1 dba_storage LV Attr voltme 1 dba storage -wi-a- [root@centos-host LSize Pool Data% Meta% Move Log Cpy%Sync Convert - 1.99g

 

4. Next, I need to format the lvm volume as an XFS filesystem, then mount the filesystem at the path "/mnt/dba_storage"

 

Last login: 8 UTC 2Ø23 on pts/l [bob@centos-host sudo su - Last login: 8 07:38:13 UTC 2023 on pts/l [root@centos-host üfs .xfs /dev/dba storage/volwne 1 isize=512 agcount=4, agsize=13Ø56Ø blks data log —version 2 —internal log realtime —none sectsz=512 crc=l reflink=l bsize=4Ø96 sunit=ø bsize=4Ø96 bsize=4Ø96 sectsz=512 extsz=4Ø96 projid32bit=1 finobt=l, sparse—I, rmapbt=ø blocks=52224ø, imaxpct=25 swidth=ø blks ascii -ci=ø, ftype=l blocks=256ø, version—2 sunit=ø blks, lazy-count—I blocks=ø, rtextents=Ø [root@centos-host üdir -p /mnt/dba_storage [root@centos-host mount -t xfs /dev/dba_storage/voltme I/mnt/dba storage mount: /dev/dba storage/volwne I/mnt/dba storage: can't find in /etc/fstab. [root@centos-host mount -t xfs /dev/dba_storage/volwne 1 /mnt/dba_storage [root@centos-host df -h /mnt/dba_storage/ File system Size Used Avail Use% t'%unted on /dev/mapper/dba storage-voltme 1 2.øG 47M 2.øG 3% /mnt/dba_storage [root@centos-host

 

5. I need to make sure that this mount point is persistent across reboots configured with the right default options

 

/ etc/fstab Created by anaconda on Fri Dec 4 17:37:32 2020 Accessible filesystans, by reference, are maintained under ' /dev/disk/' See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info. After editing this file, run ' systanctl to update systand units generated frcm this file. UUID=a62c5b49-755e-41bø-9d36-de3d95e17232 / /swapfile none swap defaults #adånyinputhere /dev/mapper/dba_storage-volwnel /mnt/dba_storage xfs default #VAGRANT-BEGIN xfs defaults # The contents below are autcmatically generated by Vagrant. Do not modify. #VAGRANT-END - mSERT -

 

 

6. Next I need to create a group called "dba_users" and add the user "bob" to this group

[root@centos - host [ root@centos - host [ root@centos - host [root@centos-host groupadd dba_users usermod -G dba_users bob id bob

 

7. Last, I need to make sure that the mountpoint of /mnt/dbastorage has the group ownership set to the dba_users group. Then make sure that the mount point /mnt/dba_storage has read/write and execute permissions for the owner and group and no permissions for anybody else.

 

[root@centos - host [ root@centos - host [ root@centos - host [ root@centos - host drwxr-xr-x. drwxr-xr-x. drwxrwx- [ root@centos groupadd dba_users usermod -G dba_users bob id bob 11 -Isd /mnt/dba_storage/ / mnt / dba_storage/ 2 root root 6 8 07:38 [root@centos-host chown :dba_users /mnt/dba_storage/ [root@centos-host 11 -Isd /mnt/dba_storage/ 2 root dba_users 6 8 07:38 /mnt/dba_storage/ [root@centos-host a-mod 770 /mnt/dba_storage/ [root@centos-host 11 -Isd /mnt/dba_storage/ 2 root dba_users 6 8 07:38 /mnt/dba_storage/ -host

 

The database server called centos-host is running short on space! You have been asked to add an LVM volume for the Database team using some of the existing disks on this server. Inspect the requirements in detail by clicking on the icons ofthe interactive architecture diagram on the right and complete the tasks. Once done click on the Check button to validate your work. dba _ users Iinux-server /dev.%.Cb persistent-mo untpoint group-permissions volume-group Complete Next Format the Ivm volume "volume_l" as an "XFS" filesystem Mount the filesystem at the path "/mnt/dba_storage". Make sure that this mount point is persistent across reboots with the correct default options.

Previous

network security and python software engineer

Next

Linux Cloud 2