RedHat Red Hat Certified System Administrator - RHCSARHEL 10 - EX200 Exam Practice Test
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.
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.
Correct Answer:
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.
Syncing disks.
# 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
# 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.
Syncing disks.
# 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
Create a snapshot of the Stratis file system fs1 in pool pool1 named fs1-snap.
Correct Answer:
See the solution below in Explanation.
Explanation:
Solution:
stratis filesystem snapshot pool1 fs1 fs1-snap
stratis filesystem list
Detailed Explanation:
* This creates a snapshot of the existing Stratis file system.
* Snapshots are useful for rollback, backup, and testing operations.
* Stratis features, including pool and file-system management, are part of RHEL 10 file-system
administration. ( Red Hat Documentation )
Explanation:
Solution:
stratis filesystem snapshot pool1 fs1 fs1-snap
stratis filesystem list
Detailed Explanation:
* This creates a snapshot of the existing Stratis file system.
* Snapshots are useful for rollback, backup, and testing operations.
* Stratis features, including pool and file-system management, are part of RHEL 10 file-system
administration. ( Red Hat Documentation )
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
Configure autofs
Configure autofs to automatically mount the home directory of a remote user as described below:
- materials.example.com (172.25.254.254) exports /rhome via NFS to your system. This filesystem contains a pre-configured home directory for the user
remoteuser1.
- The home directory of remoteuser1 is materials.example.com:/rhome/remoteuser1.
- The home directory of remoteuser1 should be automatically mounted locally at /rhome/remoteuser1.
- The home directory must be writable by the user.
- The password for remoteuser1 is "flectrag".
Configure autofs to automatically mount the home directory of a remote user as described below:
- materials.example.com (172.25.254.254) exports /rhome via NFS to your system. This filesystem contains a pre-configured home directory for the user
remoteuser1.
- The home directory of remoteuser1 is materials.example.com:/rhome/remoteuser1.
- The home directory of remoteuser1 should be automatically mounted locally at /rhome/remoteuser1.
- The home directory must be writable by the user.
- The password for remoteuser1 is "flectrag".
Correct Answer:
Solution:
# Preparations (not required for the exam)
# Go back to foundation0, remote into classroom, create the remoteuser1 user and directory.
# This step is necessary to avoid issues with autofs mounting during testing.
[kiosk@foundation0 ~]$ ssh root@classroom 'useradd -u 1010 remoteuser1 && mkdir -p /rhome/remoteuser1 && chown remoteuser1: /rhome/remoteuser1'
# Install nfs-utils and autofs
[root@node1 ~]# yum -y install nfs-utils autofs
[root@node1 ~]# vim /etc/auto.master
/rhome /etc/auto.rhome
[root@node1 ~]# vim /etc/auto.rhome
remoteuser1 -rw materials.example.com:/rhome/remoteuser1
[root@node1 ~]# systemctl enable --now autofs
# Verification
[root@node1 ~]# ll /rhome/
[root@node1 ~]# ssh remoteuser1@localhost
remoteuser1@localhost\'s password: `flectrag`
$ pwd
/rhome/remoteuser1
$ touch my.file
$ mount | grep rhome
...
materials.example.com:/rhome/remoteuser1 on /rhome/remoteuser1 type nfs4
(`rw`,relatime,vers=4.2,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.25.250.100,local_lock=none,addr=1
72.25.254.254)
# Preparations (not required for the exam)
# Go back to foundation0, remote into classroom, create the remoteuser1 user and directory.
# This step is necessary to avoid issues with autofs mounting during testing.
[kiosk@foundation0 ~]$ ssh root@classroom 'useradd -u 1010 remoteuser1 && mkdir -p /rhome/remoteuser1 && chown remoteuser1: /rhome/remoteuser1'
# Install nfs-utils and autofs
[root@node1 ~]# yum -y install nfs-utils autofs
[root@node1 ~]# vim /etc/auto.master
/rhome /etc/auto.rhome
[root@node1 ~]# vim /etc/auto.rhome
remoteuser1 -rw materials.example.com:/rhome/remoteuser1
[root@node1 ~]# systemctl enable --now autofs
# Verification
[root@node1 ~]# ll /rhome/
[root@node1 ~]# ssh remoteuser1@localhost
remoteuser1@localhost\'s password: `flectrag`
$ pwd
/rhome/remoteuser1
$ touch my.file
$ mount | grep rhome
...
materials.example.com:/rhome/remoteuser1 on /rhome/remoteuser1 type nfs4
(`rw`,relatime,vers=4.2,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.25.250.100,local_lock=none,addr=1
72.25.254.254)
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 String
Find all lines containing the string "ng" in the file /usr/share/xml/iso-codes/iso_639_3.xml.
Save copies of all these lines to /root/list in the root directory.
/root/list must not contain empty lines, and all lines must be exact copies of the original lines in /usr/share/xml/iso-codes/iso_639_3.xml.
Find all lines containing the string "ng" in the file /usr/share/xml/iso-codes/iso_639_3.xml.
Save copies of all these lines to /root/list in the root directory.
/root/list must not contain empty lines, and all lines must be exact copies of the original lines in /usr/share/xml/iso-codes/iso_639_3.xml.
Correct Answer:
Solution:
[root@node1 ~]# grep ng /usr/share/xml/iso-codes/iso_639_3.xml
[root@node1 ~]# grep ng /usr/share/xml/iso-codes/iso_639_3.xml > /root/list
# Verification
[root@node1 ~]# cat /root/list
[root@node1 ~]# grep ng /usr/share/xml/iso-codes/iso_639_3.xml
[root@node1 ~]# grep ng /usr/share/xml/iso-codes/iso_639_3.xml > /root/list
# Verification
[root@node1 ~]# cat /root/list
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.