0% found this document useful (0 votes)
659 views

RHCSA ExamsPreparationFInal

Here are the steps to set the permissions: (a) All new creations by natasha and harry should be readable, writable and executable by them and their group "sysadms" only. Step 1: Add natasha and harry to group sysadms Step 2: Set default permissions for group sysadms: chmod g+rwx /home/natasha chmod g+rwx /home/harry (b) Files/directories created by sarah should be readable/writable by her only. Step 3: Set default permissions for sarah: chmod 700 /home/sarah This will set the permissions such that new files created by

Uploaded by

prajapatkaushik3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
659 views

RHCSA ExamsPreparationFInal

Here are the steps to set the permissions: (a) All new creations by natasha and harry should be readable, writable and executable by them and their group "sysadms" only. Step 1: Add natasha and harry to group sysadms Step 2: Set default permissions for group sysadms: chmod g+rwx /home/natasha chmod g+rwx /home/harry (b) Files/directories created by sarah should be readable/writable by her only. Step 3: Set default permissions for sarah: chmod 700 /home/sarah This will set the permissions such that new files created by

Uploaded by

prajapatkaushik3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

RHCSA EXAM PREPARATION

Author: Mehul Solanki


Date: 27-Dec-2023
Version: 1.0
Document History

Author Date Comments


Mehul Solanki 27-Dec-2023 RHCSA Exam preparation only.

Author: Mehul Solanki Page 1 of 28


Printed: 06 Jan 24
Table of Contents
1. Configure Network ..................................................................................................................... 5
2. Configure YUM repos.................................................................................................................. 5
3. Debug SELinux ............................................................................................................................ 6
4. Create user accounts with supplementary group. ........................................................................ 7
5. Set the permission ...................................................................................................................... 8
6. Set the password expire date ...................................................................................................... 8
7. Assign Sudo Privilege .................................................................................................................. 8
8. Configure a cron job. .................................................................................................................. 9
8.1 ............................................................................................. 9
8.2 logger "EX200 in progress" as the user natasha ............................................................................................. 9
9. Create a collaborative Directory................................................................................................ 10
10. Configure NTP .......................................................................................................................... 11
11. Configure AutoFS...................................................................................................................... 12
12. ACL. ......................................................................................................................................... 13
13. Create user and password......................................................................................................... 14
14. Locate all files owned by user "harry " and copy UNDER /root/harry-files .................................. 14
15. ....................... 15
16. create an archive '/root/backup.tar.bz2' of /usr/local directory and compress it with bzip2 ....... 15
17. Container Creation Method-1 ................................................................................................... 15
18. Container Creation Method-2 ................................................................................................... 17
19. Break the password .................................................................................................................. 18
20. Yum repository configuration ................................................................................................... 19
21. Add a swap partition ................................................................................................................ 19
22. Resize a logical Volume ............................................................................................................ 20
23. Configure system tuning ........................................................................................................... 20
24. Create a logical volume and mount it permanently. .................................................................. 20
25. Create the script file ................................................................................................................. 21
26. Create a VDO volume. .............................................................................................................. 21
27. Container creation Method-3 .................................................................................................... 23
28. Container Creation Method-4 ................................................................................................... 25
29. Container Creation Method-5 ................................................................................................... 27

Author: Mehul Solanki Page 2 of 28


Printed: 06 Jan 24
Author: Mehul Solanki Page 3 of 28
Printed: 06 Jan 24
Table of Figures
No table of figures entries found.

Author: Mehul Solanki Page 4 of 28


Printed: 06 Jan 24
1. CONFIGURE NETWORK
Configure Network

IP ADDRESS = 172.25.250.10
NETMASK = 255.255.255.0
GATEWAY = 172.25.250.254
DNS = 172.25.250.254 (Auto Off)
Domain name = lab.example.com
hostname = servera.lab.example.com

Step 1 : nmcli connection add con type ethernet con-name aa ifname


enp0s3 ipv4.addresses 172.25.250.10/24
Step 2 : nmcli connection modify (connection name) ipv4.gateway
172.25.250.254
Step 3 : nmcli connection modify (connection name) ipv4.dns
172.25.250.254
Step 4 : nmcli connection modify (connection name) ipv4.method
static
Step 5 : hostnamectl set-hostname servera.lab.example.com

2. CONFIGURE YUM REPOS


Configure YUM repos with the given link (2 repos: 1st is Base and 2nd is AppStream )
Base_url= http://content.example.com/rhel8.0/x86_64/dvd/BaseOS
AppSterm_url= http://content.example.com/rhel8.0/x86_64/dvd/AppStream

Step 1 : vim /etc/yum.repos.d/sky.repo (reponame with extension.


repo)

[BaseOS]
name = BaseOS
baseurl = http://content.example.com/rhel8.0/x86_64/dvd/BaseOS
enabled = 1
gpgcheck = 0

[AppStream]
name = AppStream
baseurl = http://content.example.com/rhel8.0/x86_64/dvd/AppStream
enabled = 1
gpgcheck = 0

Author: Mehul Solanki Page 5 of 28


Printed: 06 Jan 24
3. DEBUG SELINUX

A web server running on non-standard port 82 is having issues serving content. Debug and
fix issues.
The web server on your system can server all the existing HTML files from
/var/www/html (NOTE: Do not make any changes to these files)
Web service should automatically start at boot time

Step 1 : yum install httpd


Step 2 : systemctl enable httpd
Step 3 : systemctl start httpd
Step 4 : systemctl status httpd
Step 5 : vim /etc/httpd/conf/httpd.conf

Step 6 : yum install firewalld


Step 7 : systemctl enable firewalld
Step 8 : systemctl start firewalld
Step 9 : systemctl status firewalld
Step 10 : firewall-cmd --permanent --add-port=82/tcp
Step 11 : firewall-cmd --reload
Step 12 : firewall-cmd --list-all

Step 13 : semanage port -a -t http_port_t -p tcp 82


Step 14 : semanage port -l | grep http

Author: Mehul Solanki Page 6 of 28


Printed: 06 Jan 24
Step 15 : systemctl restart httpd
Step 16 : curl 172.25.250.10:82

4. CREATE USER ACCOUNTS WITH SUPPLEMENTARY GROUP.


Create the group a named "sysadms".
Create users as named "natasha" and "harry", will be the supplementary group "sysadms".
Create a user as named "sarah", should have non-interactive shell and it should be not the
member of "sysadms".
Password for all users should be "trootent

Step 1 : groupadd sysadms


Step 2 : cat /etc/group (Check group add or not)
Step 3 : adduser natasha
Step 4 : adduser harry
Step 5 : usermod -G sysadms natasha
Step 6 : useradd -G sysadms harry
Step 7 : useradd -s /sbin/nologin sarah
Step 8 : vim /etc/passwd (for checking user is added or not)
Step 9 : vim /etc/group (for checking group added or not)
Step 10 : passwd --stdin natasha
Step 11 : passwd --stdin harry
Step 12 : passwd --stdin sarah

Author: Mehul Solanki Page 7 of 28


Printed: 06 Jan 24
5. SET THE PERMISSION

(a)All new creating files for user natasha as -r-------- as default permission.
(b) All new creating directories for user natasha as dr-x------ as default permission.

Step 1 :
Step 2 : su - natasha
Step 3 : umask
Step 4 : mkdir dir1
Step 5 : ls -l ( o/p directory should have dr-x------ permissions)
Step 6 : touch file1
Step 7 : ls -l ( o/p file should have -r-------- permissions)
Step 8 : exit
Step 9 : extra
Step 10 : umask octal value permission
Step 11 : (0=rwx,1=rw-,2=r-x,3=r--,4=-wx,5=-w-,6=--x,7=---)

6. SET THE PASSWORD EXPIRE DATE


(a)The password for all new users in serverb.lab.example.com should expires after 20 days.

Step 1 : vim /etc/login.defs


PASS_MAX_DAYS 20

Step 2 : esc:wq

7. ASSIGN SUDO PRIVILEGE


(a)Assign the Sudo Privilege

Step 1 : vim /etc/sudoers (For Group)


%admin ALL=(ALL) NOPASSWD: ALL
Step 2 : esc:wq!

Step 3 : vim /etc/sudoers (For User)


harry ALL=(ALL) NOPASSWD: ALL
Step 4 : esc:wq!

Author: Mehul Solanki Page 8 of 28


Printed: 06 Jan 24
8. CONFIGURE A CRON JOB.

CONFIGURE A CRON JOB THAT RUNS EVERY 1 MINUTES AND EXECUTES:

8.1 LOGGER "EX200 IN PROGRESS AS THE USER NATASHA

Step 1 : crontab -eu natasha

Configure a cron job that runs every day at 12:23 and executes:

8.2 LOGGER "EX200 IN PROGRESS" AS THE USER NATASHA

Step 1 : crontab -eu natasha

Step 2 : crontab -lu natasha (To Check crontab)

Author: Mehul Solanki Page 9 of 28


Printed: 06 Jan 24
9. CREATE A COLLABORATIVE DIRECTORY.
Create the Directory "/home/manager " with the following characteristics.
Group ownership of "/home/manager" should go to "sysadms" group.
The directory should have full permission for all members of "sysadms" group but not to
the other users except "root". files created in future under "/home/manager" should get the
same group ownership.

Step 1 : mkdir -p /home/manager


Step 2 : chgrp sysadms /home/manager
Step 3 : ls -ld /home/manager

Step 4 : chmod 770 /home/manager


Step 5 : chmod g+s /home/manager
Step 6 : ls -ld /home/manager

Author: Mehul Solanki Page 10 of 28


Printed: 06 Jan 24
10. CONFIGURE NTP
Synchronize time of your system with the server classroom.example.com.

Step 1 : vim /etc/chrony.conf


(Server/pool) classroom.example.com iburst (you have to
type this line in server or pool as you saw upper line you
should have to comment the upper line)

Step 2 : dnf install chrony


Step 3 : systemctl enable chronyd.service
Step 4 : systemctl start chronyd.service
Step 5 : systemctl status chronyd.service
Step 6 : timedatectl set-ntp true
Step 7 : timedatectl
Step 8 : systemctl restart chronyd.service
Step 9 : chronyc sources -v

Step 10 : timedatectl

Author: Mehul Solanki Page 11 of 28


Printed: 06 Jan 24
11. CONFIGURE AUTOFS

All Ldapuser2 home directory is exported via NFS, which is available on


classroom.example.com (172.25.254.254) and your NFS-exports directory is /home/guests for
Ldapuser2,
Ldapuser2's home directory is classroom.example.com:/home/guests/ldapuser2
Ldapuser2's home directory should be automount autofs service.
Home directories must be writable by their users.

while you are able to log in as any of the user ldapuser1 through ldapuser20, the only home
directory that is accessible from your system is ldapsuser2

Step 1 : yum install autofs -y


Step 2 : getent passwd ldapuser2
Step 3 : systemctl enable autofs
Step 4 : systemctl start autofs
Step 5 : systemctl status autofs
Step 6 : vim /etc/auto.master (Put it in the file as per below).

Step 7 : vim /etc/auto.misc

Step 8 : su ldapuser2 (for checking useradded or not)

Author: Mehul Solanki Page 12 of 28


Printed: 06 Jan 24
12. ACL.

Copy the file /etc/fstab to /var/tmp/ and configure the "ACL" as mentioned following.
The file /var/tmp/fstab should be owned by the "root".
The file /var/tmp/fstab should belong to the group "root".
The file /var/tmp/fstab should not be executable by anyone.
The user "natasha" should be able to read and write to the file.

Other users (future and current) should be able to read /var/tmp/fstab.

Step 1 : cp -rvf /etc/fstab /var/tmp (User should be root for


copy).

Step 2 : ls -ld /var/tmp/fstab

Step 3 : setfacl -m u:natasha:rw /var/tmp/fstab


Step 4 : getfacl /var/tmp/fstab

Step 5 : setfacl -m u:sarah:--- /var/tmp/fstab


Step 6 : getfacl /var/tmp/fstab

Author: Mehul Solanki Page 13 of 28


Printed: 06 Jan 24
13. CREATE USER AND PASSWORD
Create user 'bob' with 2112 uid and set the password 'trootent

Step 1 : useradd -u 2112 bob


Step 2 : passwd --stdin bob

14. LOCATE ALL FILES OWNED BY USER "HARRY " AND COPY
UNDER /ROOT/HARRY-FILES
Locate all files owned by user "harry " and copy it under /root/harry-files

Step 1 : mkdir /root/harry-files


Step 2 : find / -user harry -exec cp -arvf {} /root/harry-files \;

Author: Mehul Solanki Page 14 of 28


Printed: 06 Jan 24
15. FIND A STRING 'ICH' FROM /USR/SHARE/DICT/WORDS
PUT IT INTO /ROOT/LINES FILE

Find a string 'ich' from " /usr/share/dict/words " and put it into /root/lines file

Step 1 : grep ich /usr/share/dict/words > /root/lines

16. CREATE AN ARCHIVE '/ROOT/BACKUP.TAR.BZ2' OF /USR/LOCAL


DIRECTORY AND COMPRESS IT WITH BZIP2

Create an archive '/root/backup.tar.bz2' of /usr/local directory and compress it with bzip2

Step 1 : tar -cjf /root/backup.tar.bz2 /usr/local (bzip)

Or
Step 1 : tar -cJf /root/backup.tar.xz /usr/local (xz)
Or
Step 2 : tar -czf /root/backup.tar.gz /usr/local (gzip)

17. CONTAINER CREATION METHOD-1


Q1.
Step 1 : [root@172 ~]# yum install podman container-tools -y
Step 2 : [root@172 ~]# podman --version
Step 3 : [root@172 ~]# systemctl enable podman
Step 4 : [root@172 ~]# systemctl start podman
Step 5 : [root@172 ~]# systemctl status podman
Step 6 : [root@172 ~]# useradd rhel
Step 7 : [root@172 ~]# loginctl enable-linger rhel
Step 8 : [root@172 ~]# loginctl list-users
Q2.
Step 9 : [root@172 ~]# mkdir /opt/incoming
Step 10 : [root@172 ~]# mkdir /opt/outgoing
Step 11 : [root@172 ~]# mkdir /opt/output
Step 12 : [root@172 ~]# mkdir /opt/input
Step 13 : [root@172 ~]# chown rhel /opt/incoming
Step 14 : [root@172 ~]# chown rhel /opt/outgoing
Step 15 : [root@172 ~]# chown rhel /opt/output
Step 16 : [root@172 ~]# chown rhel /opt/incoming
Step 17 : [root@172 ~]# semanage fcontext -a -t container_file_t
/opt/incoming
Step 18 : [root@172 ~]# semanage fcontext -a -t container_file_t
/opt/outgoing
Step 19 : [root@172 ~]# semanage fcontext -a -t container_file_t
/opt/output
Step 20 : [root@172 ~]# semanage fcontext -a -t container_file_t
/opt/input

Author: Mehul Solanki Page 15 of 28


Printed: 06 Jan 24
Step 21 : [root@172 ~]# restorecon -vRF /opt/incoming
Relabeled /opt/incoming from
unconfined_u:object_r:usr_t:s0 to
system_u:object_r:container_file_t:s0
Step 22 : [root@172 ~]# restorecon -vRF /opt/outgoing
Relabeled /opt/outgoing from
unconfined_u:object_r:usr_t:s0 to
system_u:object_r:container_file_t:s0
Step 23 : [root@172 ~]# restorecon -vRF /opt/output
Relabeled /opt/output from unconfined_u:object_r:usr_t:s0
to system_u:object_r:container_file_t:s0
Step 24 : [root@172 ~]# restorecon -vRF /opt/input
Relabeled /opt/input from unconfined_u:object_r:usr_t:s0
to system_u:object_r:container_file_t:s0

Step 25 : [root@172 ~]# ssh rhel@localhost


Step 26 : [rhel@172 ~]$ mkdir -p .config/systemd/user
Step 27 : [rhel@172 ~]$ podman login
Step 28 : [rhel@172 ~]$ username (as given in instructions)
Step 29 : [rhel@172 ~]$ password (as given in instruction)
Step 30 : [rhel@172 ~]$ podman image ls (for checking image
Step 31 : successfully downloaded or not)
Step 32 : [rhel@172 ~]$ podman pull httpd (Redhat Server will
provide the image path)

Step 33 : [rhel@172 ~]$ podman image ls

Step 34 : [rhel@172 ~]$ podman run -dit --name logserver -v


/opt/incoming:/opt/input -v /opt/outgoing/:/opt/output/
docker.io/library/httpd:latest

Step 35 : [rhel@172 ~]$ podman generate systemd logserver >>


.config/systemd/user/container-logserver.service

Step 36 : [rhel@172 ~]$ cat .config/systemd/user/container-


logserver.service

Author: Mehul Solanki Page 16 of 28


Printed: 06 Jan 24
Step 37 : [rhel@172 ~]$ systemctl --user daemon-reload

Step 38 : [rhel@172 ~]$ systemctl --user enable container-


logserver.service
Step 39 : [rhel@172 ~]$ systemctl --user start container-
logserver.service
Step 40 : [rhel@172 ~]$ systemctl --user status container-
logserver.service
Step 41 : [rhel@172 ~]$ reboot

18. CONTAINER CREATION METHOD-2


Create a container logserver from an image rsyslog in node1 from
registry.lab.example.com.
The storage
become persistent /var/log/journal is mount on container_journal which is presented in
Walhalla user.

Step 1 : [root@server ~]# yum install podman container-tools -y


Step 1 : [root@server ~]# systemctl enable podman
Step 2 : [root@server ~]# systemctl start podman
Step 3 : [root@server ~]# systemctl status podman
Step 4 : [root@server ~]# podman --version

Step 5 : [root@server ~]# loginctl enable-linger rhel


Step 6 : [root@server ~]# loginctl list-users (for checking user
added or not)

Step 7 : [root@server ~]# mkdir /var/log/journal


Step 8 : [root@server ~]# mkdir /home/rhel/container_journal

Step 9 : [root@server ~]# chown rhel /var/log/journal


Step 10 : [root@server ~]# chown rhel /home/rhel/container_journal

Step 11 : [root@server ~]# ls -ld /var/log/journal


Step 12 : [root@server ~]# ls -ld / home/rhel/container_journal

Step 13 : [root@server ~]# semanage fcontext -a -t container_file_t


/var/log/journal
Step 14 : [root@server ~]# semanage fcontext -a -t container_file_t
/home/rhel/container_journal

Author: Mehul Solanki Page 17 of 28


Printed: 06 Jan 24
Step 15 : [root@server ~]# restorecon -vRF /var/log/journal
Step 16 : [root@server ~]# restorecon -vRF
/home/rhel/container_journal

Step 17 : [root@server ~]# ssh rhel@localhost


Step 18 : [rhel@server ~]$ mkdir -p .config/systemd/user
Step 19 : [rhel@server ~]$ podman login
Step 20 : [rhel@server ~]$ username (as given in instructions)
Step 21 : [rhel@server ~]$ password (as given in instruction)
Step 22 : [rhel@server ~]$ podman pull
redhat.access.redhat.com/rsyslog (For Example)
Step 23 : [rhel@server ~]$ podman pull httpd (Redhat Server will
provide the image path)
Step 24 : [rhel@server ~]$ podman image ls (for checking image
successfully downloaded or not)

Step 25 : [rhel@server ~]$ podman run -dt --name logserver -v


/home/rhel/container_journal:/var/log/journal:Z
docker.io/library/httpd:latest

Step 26 : [rhel@server ~]$ podman generate systemd logserver >>


.config/systemd/user/container-logserver.service

Step 27 : [rhel@server ~]$ systemctl -- user daemon-reload

Step 28 : [rhel@server ~]$ systemctl -- user start container-


logserver.service
Step 29 : [rhel@server ~]$ systemctl -- user enable container-
logserver.service
Step 30 : [rhel@server ~]$ systemctl -- user status container-
logserver.service

19. BREAK THE PASSWORD


Break the password of root user and set password tootrent.

Step 1 : reboot
Step 2 : press e t kernel option (On Rescue Mode)
Step 3 : Type rd.break at last of the line which is start with
linux
Step 4 : Ctrl + x
Step 5 : mount -o remount,rw /sysroot
Step 6 : chroot /sysroot
Step 7 : passwd root
Step 8 : type passwd
Step 9 : touch /.autorelabel
Step 10 : ctrl + d (press twice)

Author: Mehul Solanki Page 18 of 28


Printed: 06 Jan 24
20. YUM REPOSITORY CONFIGURATION
Configure YUM repos with the given link ( 2 repos: 1st is Base and 2nd is AppStream)
Base_url= http://content.example.com/rhel8.0/x86_64/dvd/BaseOS
AppSterm_url= http://content.example.com/rhel8.0/x86_64/dvd/AppStream

Step 1 : vim /etc/yum.repos.d/sky.repo(reponame with extension


.repo)

[BaseOS]
name = BaseOS
baseurl= http://content.example.com/rhel8.0/x86_64/dvd/BaseOS
enabled = 1
gpgcheck = 0

[AppStream]
name = AppStream
baseurl = http://content.example.com/rhel8.0/x86_64/dvd/AppStream
enabled = 1
gpgcheck = 0

21. ADD A SWAP PARTITION


Add a swap partition of 512 MB and mount it permanently.

Step 1 : lsblk
Step 2 : fdisk /dev/vdb
Step 3 : p
Step 4 :
Step 5 :
Step 6 : press enter in first sector
Step 7 : enter size in last sector +512M
Step 8 : press t for assigning type in of partition
Step 9 : press 82 for swap
Step 10 :
Step 11 : lsblk (To check created partition)
Step 12 : partprobe /dev/vdb1
Step 13 : mkswap /dev/vdb1
Step 14 : swapon /dev/vdb1
Step 15 : blkid /dev/vdb1 >> /etc/fstab
Step 16 : vim /etc/fstab
UUID=0b9f9c46-35fb-49d5-9f59-8c2e40a6139d swap
swap 0 0(edit entry like this)
Step 17 : mount -a
Step 18 : lsblk (check partition added or not)
-swap 253:1 0 1.5G 0 part [SWAP]

Author: Mehul Solanki Page 19 of 28


Printed: 06 Jan 24
22. RESIZE A LOGICAL VOLUME
Resize the logical volume "mylv " so that after reboot the size should be in between 200
MB to 300MB.

Step 1 : df -h
Step 2 : lvdisplay
Step 3 : lsblk (check /mnt/database mount point disk)
Step 4 : lvextend -r -L 250M /dev/mapper-myvol-mylv
Or
Step 5 : resize2fs /dev/myvg/lv (if fstype is xfs then use
xfs_growfs [options] mountpoint)

23. CONFIGURE SYSTEM TUNING


Choose the recommended 'tuned' profile for your system and set it as the default.

Step 1 : yum install tuned


Step 2 : systemctl start tuned
Step 3 : systemctl enable tuned
Step 4 : tuned-adm recommend (below you show recommended profile)
virtual-guest
Step 5 : tuned-adm profile virtual-guest (type recommended profile
name) (for setting up recommended profile)
Step 6 : tuned-adm active (for showing activated profile).

24. CREATE A LOGICAL VOLUME AND MOUNT IT PERMANENTLY.

Create the logical volume with the name "wshare" by using 50PE's from the volume group
"wgroup".
Consider each PE size of the volume group as "8 MB".
Mount it on /mnt/wshare with file system vfat.

Step 1 : fdisk /dev/vdb


Step 2 : p
Step 3 :
Step 4 :
Step 5 : press enter in first sector
Step 6 : enter size in last sector +408M (lv extent multiply by vg
extent size add 1 vg extent)
Step 7 : press t for assigning type in of partition
Step 8 : press 8e for lvm partition type
Step 9 :
Step 10 : partprobe /dev/vdb2
Step 11 : pvcreate /dev/vdb2
Step 12 : vgcreate wgroup -s 8m /dev/vdb2 (i.e. wgroup is group
name).
Step 13 : lvcreate -n wshare (for lv name) -l 50 (for giving extent)
wgroup (vg name)
Step 14 : mkfs.vfat /dev/wgroup/wshare (for attaching file system)
Step 15 : blkid /dev/wgroup/wshare >> /etc/fstab

Author: Mehul Solanki Page 20 of 28


Printed: 06 Jan 24
Step 16 : vim /etc/fstab

UUID=0b9f9c46-35fb-49d5-9f59-8c2e40a6139d /mnt/wshare
vfat defaults 0 0(edit entry like this)

Step 17 : systemctl daemon-reload


Step 18 : mount -a

25. CREATE THE SCRIPT FILE

Step 1 : vim script.sh

!/bin/bash

i then

]; then

else
GM/GN 4
fi

Step 2 : chmod 755 script.sh


Step 3 : ./script.sh GM
Step 4 : ./script.sh GN

26. CREATE A VDO VOLUME.


Create the vectra volume using the VDO with the logical size 50GB and mount under test
directory.

Step 1 : yum install vdo kmod-kvdo -y


Step 2 : systemctl enable vdo
Step 3 : systemctl start vdo
Step 4 : systemctl status vdo
Step 5 : lsblk
Step 6 : vdo create --name=vectra --device=/dev/vdc --
vdoLogicalSize=50G
Step 7 : mkfs.xfs /dev/mapper/vectra
Step 8 : mkdir /test
Step 9 : vi /etc/fstab

/dev/mapper/vectra /test xfs defaults,x-


systemd.requires=vdo.service 0 0

Step 10 : systemctl daemon-reload


Step 11 : mount a
Step 12 : df -hT
Step 13 : lsblk
Step 14 : systemctl restart vdo
Step 15 : systemctl status vdo
Step 16 : reboot

Author: Mehul Solanki Page 21 of 28


Printed: 06 Jan 24

You might also like