RHCSA Exam Practice
RHCSA Practice exams¶
-
How to create a local YUM repository using a RHEL 9 ISO image, assuming the image is mounted on either /mnt or /run in a Linux VM?
To set up a local YUM repository on RHEL 9, follow these steps: Mount the RHEL 9 ISO to a directory, typically /mnt or /run/media. Create a repo file under `**/etc/yum.repos.d/**`, e.g., `**rhel9-local.repo**`. In the file, add: 1. [rhel9-local] 2. name=RHEL 9 Local Repository 3. baseurl=file:///mnt 4. enabled=1 5. gpgcheck=0 Adjust `**baseurl**` according to the mount point. Update the repository list using `**yum update**`. This method turns the mounted ISO into a local repository, enabling package installation directly from the ISO image. -
How to configure a network interface in Red Hat Enterprise Linux 9 to use a static IP address setup with these parameters: IPv4 address 192.168.1.211 with a 24-bit subnet mask, a gateway of 192.168.1.1, and a DNS server address of 8.8.8.8?
In RHEL 9, configure a static IP by editing the network interface config file at `**/etc/sysconfig/network-scripts/ifcfg-[InterfaceName]**`. Replace `**[InterfaceName]**` with your interface name (e.g., `**eth0**`). Add these lines:
1. BOOTPROTO=static
2. ONBOOT=yes
3. IPADDR=192.168.1.211
4. PREFIX=24
5. GATEWAY=192.168.1.1
6. DNS1=8.8.8.8
Save the file and restart the network service: `**sudo systemctl restart NetworkManager**`.
This sets a static IP (`**IPADDR**`), subnet mask (`**PREFIX**`=24), gateway (`**GATEWAY**`), and DNS (`**DNS1**`). `**BOOTPROTO=static**` enables static IP setup, and `**ONBOOT=yes**` activates it on boot.
- Add secondary IP via nmcli NetworkManager.
Restart Network Manager or down/up eth0
-
Setup NTP
-
enable and start chronyd daemon
- Check sources
-
Create Thin provisioned volume named 1thinpool
-
Setup process history from scratch starting with
- fdisk /dev/sda - create sda1
- pvcreate /dev/sda1 - create physical volume
- vgcreate thimvg /dev/sda1
- lvcreate --type thin-pool --size 5000M --name 1thinpool thimvg
- mkdir /mnt/thinpool
- mkfs.xfs /dev/thimvg/1thinpool
- mount /dev/thimvg/1thinpool /mnt/thinpool/
-
df -h /mnt/thinpool/
-
Copy files larger than 5M from /etc/ to /tmp/files3m/
Configure detailed messages on boot¶
- Edit grub configuration at /etc/default/grub , edit the GRUB_CMDLINE_LINUX add debug and remove quite and rhgb
- Then configure it with grub2-mkconfig -o /boot/grub2/grub.cfg