RedHat Red Hat Certified System Administrator - RHCSA - EX200 Exam Practice Test
Configure AutoFS to automount two NFS shares under /automount.
Correct Answer:
See the solution below in Explanation.
Explanation:
Solution:
dnf install -y autofs
mkdir -p /automount
echo "/automount /etc/auto.automount --timeout=30" > > /etc/auto.master
echo "public -ro,sync nfs.lab.example.com:/public" > > /etc/auto.automount
echo "private -rw,sync nfs.lab.example.com:/private" > > /etc/auto.automount
systemctl enable --now autofs
Detailed Explanation:
* /etc/auto.master defines the main AutoFS map.
* /etc/auto.automount defines the indirect map entries.
* public will mount read-only.
* private will mount read-write.
* AutoFS mounts on access rather than permanently at boot.
Explanation:
Solution:
dnf install -y autofs
mkdir -p /automount
echo "/automount /etc/auto.automount --timeout=30" > > /etc/auto.master
echo "public -ro,sync nfs.lab.example.com:/public" > > /etc/auto.automount
echo "private -rw,sync nfs.lab.example.com:/private" > > /etc/auto.automount
systemctl enable --now autofs
Detailed Explanation:
* /etc/auto.master defines the main AutoFS map.
* /etc/auto.automount defines the indirect map entries.
* public will mount read-only.
* private will mount read-write.
* AutoFS mounts on access rather than permanently at boot.
Extend swap by 400 MB using a new partition and make it persistent.
Correct Answer:
See the solution below in Explanation.
Explanation:
Solution:
* Create the swap partition:
fdisk /dev/sdb
partprobe /dev/sdb
* Format it for swap:
mkswap /dev/sdb2
* Enable it:
swapon /dev/sdb2
* Persist it in /etc/fstab:
echo "/dev/sdb2 swap swap defaults 0 0" > > /etc/fstab
* Verify:
swapon --show
Detailed Explanation:
* mkswap prepares the partition as swap space.
* swapon activates it immediately.
* Adding an /etc/fstab entry ensures it survives reboot.
* The lab uses a partition-based swap workflow.
Explanation:
Solution:
* Create the swap partition:
fdisk /dev/sdb
partprobe /dev/sdb
* Format it for swap:
mkswap /dev/sdb2
* Enable it:
swapon /dev/sdb2
* Persist it in /etc/fstab:
echo "/dev/sdb2 swap swap defaults 0 0" > > /etc/fstab
* Verify:
swapon --show
Detailed Explanation:
* mkswap prepares the partition as swap space.
* swapon activates it immediately.
* Adding an /etc/fstab entry ensures it survives reboot.
* The lab uses a partition-based swap workflow.
Find Files
Find all files belonging to the user "jacques" and move them to the directory /root/findfiles under the root directory.
Find all files belonging to the user "jacques" and move them to the directory /root/findfiles under the root directory.
Correct Answer:
Solution:
[root@node1 ~]# mkdir /root/findfiles
[root@node1 ~]# find / -user jacques
[root@node1 ~]# find / -user jacques -exec cp -a {} /root/findfiles \;
# Verification
[root@node1 ~]# ll /root/findfiles/
[root@node1 ~]# mkdir /root/findfiles
[root@node1 ~]# find / -user jacques
[root@node1 ~]# find / -user jacques -exec cp -a {} /root/findfiles \;
# Verification
[root@node1 ~]# ll /root/findfiles/
Create a tar archive of /var/log named /root/logs.tar, then extract it into /backup.
Correct Answer:
See the solution below in Explanation.
Explanation:
Solution:
mkdir -p /backup
tar -cvf /root/logs.tar /var/log
tar -xvf /root/logs.tar -C /backup
Detailed Explanation:
* tar -cvf creates an uncompressed archive.
* tar -xvf extracts the archive.
* -C /backup tells tar where to extract the files.
* This is a common RHCSA-style archive and restore task.
Explanation:
Solution:
mkdir -p /backup
tar -cvf /root/logs.tar /var/log
tar -xvf /root/logs.tar -C /backup
Detailed Explanation:
* tar -cvf creates an uncompressed archive.
* tar -xvf extracts the archive.
* -C /backup tells tar where to extract the files.
* This is a common RHCSA-style archive and restore task.
Configure Network Settings
Configure node1 with the following network settings:
Hostname: node1.domain250.example.com
IP address: 172.25.250.100
Subnet mask: 255.255.255.0
Gateway: 172.25.250.254
Configure node1 with the following network settings:
Hostname: node1.domain250.example.com
IP address: 172.25.250.100
Subnet mask: 255.255.255.0
Gateway: 172.25.250.254
Correct Answer:
Solution:
# Connect to servera via console for IP modification, then check using the ip addr command.
# After confirming no issues, SSH to servera for hostname modification. This way, you can copy the hostname to avoid typos.
[root@clear ~] nmcli con show
[root@clear ~] nmcli con mod 'network configuration name' ipv4.method manual ipv4.addresses 172.25.0.25/24 ipv4.gateway 172.25.0.254 ipv4.dns 172.25.0.254
autoconnect yes
[root@clear ~] nmcli con up 'network configuration name'
[root@clear ~] ip a
[root@clear ~] ssh [email protected]
[root@clear ~] hostnamectl set-hostname red.lab0.example.com
# Verification
[root@node1 ~] ip a //Check if the IP is correct
[root@node1 ~] hostname //Check if the hostname is correct
# Connect to servera via console for IP modification, then check using the ip addr command.
# After confirming no issues, SSH to servera for hostname modification. This way, you can copy the hostname to avoid typos.
[root@clear ~] nmcli con show
[root@clear ~] nmcli con mod 'network configuration name' ipv4.method manual ipv4.addresses 172.25.0.25/24 ipv4.gateway 172.25.0.254 ipv4.dns 172.25.0.254
autoconnect yes
[root@clear ~] nmcli con up 'network configuration name'
[root@clear ~] ip a
[root@clear ~] ssh [email protected]
[root@clear ~] hostnamectl set-hostname red.lab0.example.com
# Verification
[root@node1 ~] ip a //Check if the IP is correct
[root@node1 ~] hostname //Check if the hostname is correct
Set Root Password
Set the root password of node2 to "redhat." You need to gain system access to perform this operation.
Set the root password of node2 to "redhat." You need to gain system access to perform this operation.
Correct Answer:
Solution:
***Restart the node2 machine and wait for the screen shown in Exhibit 1.

Press "e" to enter the screen shown in Exhibit 2.

The original configuration is as shown in the image. Modify the original configuration to the part highlighted in red box, as shown in Exhibit 2. Then press "Ctrl+X" to
execute the following commands:
# chroot /sysroot
# echo redhat |passwd --stdin root
# touch /.autorelabel
# sync
# exit
# reboot
***Restart the node2 machine and wait for the screen shown in Exhibit 1.

Press "e" to enter the screen shown in Exhibit 2.

The original configuration is as shown in the image. Modify the original configuration to the part highlighted in red box, as shown in Exhibit 2. Then press "Ctrl+X" to
execute the following commands:
# chroot /sysroot
# echo redhat |passwd --stdin root
# touch /.autorelabel
# sync
# exit
# reboot
Create a VDO-backed logical volume with physical size 5 GB and logical size 50 GB, then format it with XFS.
Correct Answer:
See the solution below in Explanation.
Explanation:
Solution:
dnf install -y vdo kmod-kvdo lvm2
pvcreate /dev/sdc
vgcreate vdo-volumegroup /dev/sdc
lvcreate --type vdo -n vdo-logicalvolume -L 5G -V 50G vdo-volumegroup/vdo-pool
mkfs.xfs /dev/vdo-volumegroup/vdo-logicalvolume
Detailed Explanation:
* VDO provides compression and deduplication.
* -L 5G sets the physical backing size.
* -V 50G sets the logical exposed size.
* This allows thin, optimized storage presentation.
* The exact commands are taken from the RHCSA dataset embedded in the uploaded lab HTML.
Explanation:
Solution:
dnf install -y vdo kmod-kvdo lvm2
pvcreate /dev/sdc
vgcreate vdo-volumegroup /dev/sdc
lvcreate --type vdo -n vdo-logicalvolume -L 5G -V 50G vdo-volumegroup/vdo-pool
mkfs.xfs /dev/vdo-volumegroup/vdo-logicalvolume
Detailed Explanation:
* VDO provides compression and deduplication.
* -L 5G sets the physical backing size.
* -V 50G sets the logical exposed size.
* This allows thin, optimized storage presentation.
* The exact commands are taken from the RHCSA dataset embedded in the uploaded lab HTML.