06.1 – Schedule tasks using at and corn
Overview
Scheduling tasks is a fundamental aspect of system administration. The at command is used for one-time task scheduling, while cron is used for recurring tasks. This guide covers how to use both tools to automate tasks.
Using at for One-Time Task Scheduling
Installing at
Ensure the at package is installed on your system.
sudo yum install atStarting the atd Service
Start and enable the atd service to ensure it runs at boot.
sudo systemctl start atdsudo systemctl enable atdScheduling a One-Time Task
Use the at command to schedule a one-time task.
Syntax
at <time>Examples
- Schedule a Task for a Specific Time:
echo "backup.sh" | at 02:00- Schedule a Task for a Specific Date and Time:
echo "backup.sh" | at 02:00 2023-10-01- Schedule a Task for a Relative Time:
echo "backup.sh" | at now + 1 hourViewing Scheduled at Jobs
Use the atq command to view the list of scheduled at jobs.
atqSample Output:
1 2023-10-01 02:00 a userRemoving Scheduled at Jobs
Use the atrm command to remove a scheduled at job.
atrm <job_id>Example
atrm 1Using cron for Recurring Task Scheduling
Understanding cron
cron is a time-based job scheduler that allows you to run commands or scripts at specified times and intervals.
Editing the Crontab
Use the crontab command to edit the cron table (crontab) for scheduling recurring tasks.
Syntax
crontab -eCrontab Format
The crontab file consists of lines with the following format:
<minute> <hour> <day_of_month> <month> <day_of_week> <command><minute>: Minute (0-59)<hour>: Hour (0-23)<day_of_month>: Day of the month (1-31)<month>: Month (1-12)<day_of_week>: Day of the week (0-7, where 0 and 7 represent Sunday)<command>: The command to execute
Examples
- Run a Script Every Day at 2 AM:
0 2 * * * /path/to/backup.sh- Run a Script Every Monday at 3 PM:
0 15 * * 1 /path/to/weekly_report.sh- Run a Script Every 15 Minutes:
*/15 * * * * /path/to/check_status.sh- Run a Script on the First Day of Every Month at Midnight:
0 0 1 * * /path/to/monthly_cleanup.shViewing Scheduled cron Jobs
Use the crontab -l command to list the current user’s scheduled cron jobs.
crontab -lRemoving Scheduled cron Jobs
Edit the crontab file and remove the line corresponding to the job you want to delete.
crontab -ePractical Examples
Example 1: Schedule a One-Time Task Using at
- Schedule a Task to Run a Script at 3 PM Today:
echo "/path/to/script.sh" | at 15:00- View Scheduled
atJobs:
atq- Remove a Scheduled
atJob:
atrm 1Example 2: Schedule a Recurring Task Using cron
- Edit the Crontab:
crontab -e- Add a Job to Run a Script Every Day at 5 AM:
0 5 * * * /path/to/daily_task.sh- View Scheduled
cronJobs:
crontab -l- Remove a Scheduled
cronJob:Edit the crontab file and delete the corresponding line.crontab -e
Additional Tips
- Check
cronLogs:View thecronlogs to troubleshoot scheduled jobs.
sudo tail -f /var/log/cron- Use
crontabfor Specific Users:Edit the crontab for a specific user.
sudo crontab -u username -e- Use Environment Variables in Crontab:Set environment variables in the crontab file.
MAILTO=user@example.com- Run
cronJobs with Specific Shell:Specify the shell to use forcronjobs.
SHELL=/bin/bashConclusion
Scheduling tasks using at and cron allows for automation of one-time and recurring tasks, respectively. Mastery of these tools ensures efficient system administration and is a key competency for the RHCSA exam.
These notes should help you understand how to schedule tasks using at and cron for the RHCSA exam.
06.2 – Start and stop services and configure services to start automatically at boot
Overview
Managing services is a fundamental task in system administration. In RHEL, services are managed using systemd and the systemctl command. This guide covers how to start, stop, and configure services to start automatically at boot.
Starting and Stopping Services
Starting a Service
Use the systemctl start command to start a service.
Syntax
sudo systemctl start <service_name>Example
Start the SSH service:
sudo systemctl start sshdStopping a Service
Use the systemctl stop command to stop a service.
Syntax
sudo systemctl stop <service_name>Example
Stop the SSH service:
sudo systemctl stop sshdRestarting a Service
Use the systemctl restart command to restart a service.
Syntax
sudo systemctl restart <service_name>Example
Restart the SSH service:
sudo systemctl restart sshdReloading a Service
Use the systemctl reload command to reload a service’s configuration without stopping it.
Syntax
sudo systemctl reload <service_name>Example
Reload the SSH service:
sudo systemctl reload sshdChecking the Status of a Service
Use the systemctl status command to check the status of a service.
Syntax
systemctl status <service_name>Example
Check the status of the SSH service:
systemctl status sshdSample Output:
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2023-10-01 12:00:00 UTC; 1h 30min ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 1234 (sshd)
Tasks: 1
Memory: 5.0M
CGroup: /system.slice/sshd.service
└─1234 /usr/sbin/sshd -DEnabling and Disabling Services at Boot
Enabling a Service
Use the systemctl enable command to configure a service to start automatically at boot.
Syntax
sudo systemctl enable <service_name>Example
Enable the SSH service to start at boot:
sudo systemctl enable sshdDisabling a Service
Use the systemctl disable command to prevent a service from starting automatically at boot.
Syntax
sudo systemctl disable <service_name>Example
Disable the SSH service from starting at boot:
sudo systemctl disable sshdChecking if a Service is Enabled
Use the systemctl is-enabled command to check if a service is enabled to start at boot.
Syntax
systemctl is-enabled <service_name>Example
Check if the SSH service is enabled:
systemctl is-enabled sshdSample Output:
enabledPractical Examples
Example 1: Start, Stop, and Restart the Apache HTTP Server
- Start the Apache HTTP Server:
sudo systemctl start httpd- Check the Status of the Apache HTTP Server:
systemctl status httpd- Restart the Apache HTTP Server:
sudo systemctl restart httpd- Stop the Apache HTTP Server:
sudo systemctl stop httpdExample 2: Enable and Disable the Firewall Service
- Enable the Firewall Service to Start at Boot:
sudo systemctl enable firewalld- Check if the Firewall Service is Enabled:
systemctl is-enabled firewalld- Disable the Firewall Service from Starting at Boot:
sudo systemctl disable firewalld- Check if the Firewall Service is Disabled:
systemctl is-enabled firewalldAdditional Tips
- List All Services:Use the
systemctl list-unitscommand to list all services.
systemctl list-units --type=service- List All Enabled Services:Use the
systemctl list-unit-filescommand to list all enabled services.
systemctl list-unit-files --type=service | grep enabled- Mask a Service:Use the
systemctl maskcommand to prevent a service from being started manually or automatically.
sudo systemctl mask <service_name>- Unmask a Service:Use the
systemctl unmaskcommand to remove the mask from a service.
sudo systemctl unmask <service_name>- Reload Systemd Configuration:Use the
systemctl daemon-reloadcommand to reload the systemd manager configuration.
sudo systemctl daemon-reloadConclusion
Starting, stopping, and configuring services to start automatically at boot are essential tasks for system administration. Mastery of these tasks ensures that services are managed efficiently and reliably, which is crucial for the RHCSA exam.
These notes should help you understand how to start and stop services and configure services to start automatically at boot for the RHCSA exam.
06.3 – Configure systems to boot into a specific target automatically
Overview
In RHEL, systemd uses targets to define different states or modes of operation for the system. Targets are similar to runlevels in the older SysV init system. Configuring the system to boot into a specific target automatically is essential for controlling the system’s behavior at startup.
Common Systemd Targets
- graphical.target: Multi-user system with a graphical interface (equivalent to runlevel 5).
- multi-user.target: Multi-user system without a graphical interface (equivalent to runlevel 3).
- rescue.target: Single-user mode with basic system services (equivalent to runlevel 1).
- emergency.target: Minimal environment for emergency maintenance.
- reboot.target: Reboots the system.
- poweroff.target: Shuts down the system.
Viewing the Current Default Target
Use the systemctl get-default command to view the current default target.
systemctl get-defaultSample Output:
graphical.targetSetting the Default Target
Use the systemctl set-default command to set the default target.
Syntax
sudo systemctl set-default <target>Examples
- Set the Default Target to Multi-User Mode:
sudo systemctl set-default multi-user.target- Set the Default Target to Graphical Mode:
sudo systemctl set-default graphical.targetVerify the Change
After setting the default target, verify the change using the systemctl get-default command.
systemctl get-defaultSample Output:
multi-user.targetChanging the Current Target
To change the current target without rebooting, use the systemctl isolate command.
Syntax
sudo systemctl isolate <target>Examples
- Switch to Multi-User Mode:
sudo systemctl isolate multi-user.target- Switch to Graphical Mode:
sudo systemctl isolate graphical.targetVerify the Change
Check the current target using the systemctl list-units --type=target command.
systemctl list-units --type=targetSample Output:
UNIT LOAD ACTIVE SUB DESCRIPTION
basic.target loaded active active Basic System
graphical.target loaded active active Graphical Interface
multi-user.target loaded active active Multi-User SystemPractical Examples
Example 1: Configure the System to Boot into Multi-User Mode
- Set the Default Target to Multi-User Mode:
sudo systemctl set-default multi-user.target- Verify the Default Target:
systemctl get-default- Reboot the System:
sudo reboot- Verify the Current Target After Reboot:
systemctl list-units --type=targetExample 2: Configure the System to Boot into Graphical Mode
- Set the Default Target to Graphical Mode:
sudo systemctl set-default graphical.target- Verify the Default Target:
systemctl get-default- Reboot the System:
sudo reboot- Verify the Current Target After Reboot:
systemctl list-units --type=targetAdditional Tips
- List All Available Targets:Use the
systemctl list-unit-files --type=targetcommand to list all available targets.
systemctl list-unit-files --type=target- Check Dependencies of a Target:Use the
systemctl list-dependencies <target>command to check the dependencies of a target.
systemctl list-dependencies multi-user.target- Create Custom Targets:Custom targets can be created by defining new unit files in the
/etc/systemd/system/directory. - Emergency and Rescue Targets:Use
emergency.targetandrescue.targetfor troubleshooting and maintenance.
sudo systemctl isolate emergency.target
sudo systemctl isolate rescue.targetConclusion
Configuring systems to boot into a specific target automatically is essential for controlling the system’s behavior at startup. Mastery of these tasks ensures that the system operates in the desired state, which is crucial for the RHCSA exam.
These notes should help you understand how to configure systems to boot into a specific target automatically for the RHCSA exam.
06.4 – Configure time service clients
Overview
Accurate timekeeping is crucial for system operations, logging, and security. In RHEL, chrony is the default NTP (Network Time Protocol) client and server used to synchronize the system clock with remote NTP servers. This guide covers how to configure chrony as a time service client.
Installing Chrony
Ensure the chrony package is installed on your system.
sudo yum install chronyConfiguring Chrony
Step 1: Edit the Chrony Configuration File
The main configuration file for chrony is /etc/chrony.conf.
sudo nano /etc/chrony.confStep 2: Configure NTP Servers
Add or modify the server lines to specify the NTP servers you want to use. You can use public NTP servers or your organization’s NTP servers.
Example Configuration
# Use public servers from the pool.ntp.org project.
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
# Allow NTP client access from local network.
allow 192.168.0.0/16
# Ignore stratum in source selection.
stratumweight 0
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift
# Enable kernel RTC synchronization.
rtcsyncserver <hostname> iburst: Specifies an NTP server to synchronize with. Theiburstoption speeds up the initial synchronization.allow <subnet>: Allows NTP client access from the specified subnet.driftfile: Specifies the location of the drift file.rtcsync: Enables synchronization of the system clock with the hardware clock.
Step 3: Start and Enable the Chrony Service
Start the chronyd service and enable it to start at boot.
sudo systemctl start chronyd
sudo systemctl enable chronydStep 4: Verify the Chrony Service
Check the status of the chronyd service to ensure it is running.
sudo systemctl status chronydSample Output:
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2023-10-01 12:00:00 UTC; 1h 30min ago
Docs: man:chronyd(8)
man:chrony.conf(5)
Main PID: 1234 (chronyd)
Tasks: 1
Memory: 1.5M
CGroup: /system.slice/chronyd.service
└─1234 /usr/sbin/chronydMonitoring and Managing Chrony
Check Synchronization Status
Use the chronyc tracking command to check the synchronization status.
chronyc trackingSample Output:
Reference ID : 203.0.113.1 (ntp.example.com)
Stratum : 3
Ref time (UTC) : Mon Oct 1 13:30:00 2023
System time : 0.000000123 seconds fast of NTP time
Last offset : +0.000001234 seconds
RMS offset : 0.000001234 seconds
Frequency : 0.123 ppm slow
Residual freq : +0.000 ppm
Skew : 0.123 ppm
Root delay : 0.012345 seconds
Root dispersion : 0.012345 seconds
Update interval : 64.0 seconds
Leap status : NormalCheck NTP Sources
Use the chronyc sources command to list the NTP sources.
chronyc sourcesSample Output:
210 Number of sources = 4
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* ntp1.example.com 2 6 17 64 +0ns[ +0ns] +/- 10ms
^+ ntp2.example.com 2 6 17 64 +0ns[ +0ns] +/- 10ms
^- ntp3.example.com 3 6 17 64 +0ns[ +0ns] +/- 10ms
^- ntp4.example.com 3 6 17 64 +0ns[ +0ns] +/- 10msForce a Manual Synchronization
Use the chronyc makestep command to force a manual synchronization.
sudo chronyc makestepPractical Examples
Example 1: Configure Chrony to Use Public NTP Servers
- Edit the Chrony Configuration File:
sudo nano /etc/chrony.conf- Add Public NTP Servers:
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst- Start and Enable the Chrony Service:
sudo systemctl start chronydsudo systemctl enable chronyd- Verify the Chrony Service:
sudo systemctl status chronyd- Check Synchronization Status:
chronyc trackingExample 2: Configure Chrony to Use Internal NTP Servers
- Edit the Chrony Configuration File:
sudo nano /etc/chrony.conf- Add Internal NTP Servers:
server ntp1.internal.example.com iburst
server ntp2.internal.example.com iburst- Allow NTP Client Access from the Local Network:
allow 192.168.0.0/16- Start and Enable the Chrony Service:
sudo systemctl start chronyd
sudo systemctl enable chronyd- Verify the Chrony Service:
sudo systemctl status chronyd- Check NTP Sources:
chronyc sourcesAdditional Tips
- Synchronize the Hardware Clock:Use the
hwclockcommand to synchronize the hardware clock with the system clock.
sudo hwclock --systohc- Check Chrony Logs:View the
chronylogs for troubleshooting.
sudo journalctl -u chronyd- Configure Time Zone:Use the
timedatectlcommand to configure the system time zone.
sudo timedatectl set-timezone America/New_York- Restart Chrony Service:Restart the
chronydservice after making configuration changes.
sudo systemctl restart chronydConclusion
Configuring time service clients using chrony ensures accurate timekeeping, which is essential for system operations, logging, and security. Mastery of these tasks is crucial for the RHCSA exam.
These notes should help you understand how to configure time service clients for the RHCSA exam.
06.5 – Install and update software packages from Red Hat Network, a remote repository, or from the local file system
Overview
Managing software packages is a fundamental task in system administration. In RHEL, the yum and dnf package managers are used to install, update, and remove software packages. This guide covers how to install and update packages from Red Hat Network (RHN), remote repositories, and the local file system.
Using yum and dnf
Installing Packages
From Red Hat Network (RHN) or Remote Repository
- Install a Package:
sudo yum install <package_name>
# or
sudo dnf install <package_name>Example:
sudo yum install httpd- Install Multiple Packages:
sudo yum install <package1> <package2>
# or
sudo dnf install <package1> <package2>Example:
sudo yum install httpd mariadb-serverFrom the Local File System
- Install a Package from a Local RPM File:
sudo yum install /path/to/package.rpm
# or
sudo dnf install /path/to/package.rpmExample:
sudo yum install /tmp/vim-enhanced-8.0.1763-15.el8.x86_64.rpmUpdating Packages
- Update a Specific Package:
sudo yum update <package_name>
#or
sudo dnf update <package_name>Example:
sudo yum update httpd- Update All Packages:
sudo yum update
# or
sudo dnf updateRemoving Packages
- Remove a Package:
sudo yum remove <package_name>
# or
sudo dnf remove <package_name>Example:
sudo yum remove httpdConfiguring Repositories
Viewing Enabled Repositories
Use the yum repolist or dnf repolist command to view the list of enabled repositories.
sudo yum repolistor
sudo dnf repolistSample Output:
repo id repo name
rhel-8-for-x86_64-baseos Red Hat Enterprise Linux 8 for x86_64 - BaseOS
rhel-8-for-x86_64-appstream Red Hat Enterprise Linux 8 for x86_64 - AppStreamAdding a Remote Repository
- Create a Repository Configuration File:
sudo nano /etc/yum.repos.d/myrepo.repo- Add Repository Information:
[myrepo]
name=My Custom Repository
baseurl=http://myrepo.example.com/repo
enabled=1
gpgcheck=1
gpgkey=http://myrepo.example.com/repo/RPM-GPG-KEY-myrepo- Save and Exit.
Adding a Local Repository
- Create a Repository Configuration File:
sudo nano /etc/yum.repos.d/localrepo.repo- Add Repository Information:
[localrepo]
name=Local Repository
baseurl=file:///mnt/localrepo
enabled=1
gpgcheck=0- Save and Exit.
Enabling and Disabling Repositories
- Enable a Repository:
sudo yum-config-manager --enable <repo_id>or
sudo dnf config-manager --set-enabled <repo_id>Example:
sudo yum-config-manager --enable rhel-8-for-x86_64-appstream- Disable a Repository:
sudo yum-config-manager --disable <repo_id>or
sudo dnf config-manager --set-disabled <repo_id>Example:
sudo yum-config-manager --disable rhel-8-for-x86_64-appstreamPractical Examples
Example 1: Install and Update Packages from RHN
- Install the Apache HTTP Server:
sudo yum install httpd- Update the Apache HTTP Server:
sudo yum update httpd- Remove the Apache HTTP Server:
sudo yum remove httpdExample 2: Install a Package from a Local RPM File
- Download the RPM File:
wget http://example.com/packages/vim-enhanced-8.0.1763-15.el8.x86_64.rpm -P /tmp- Install the RPM File:
sudo yum install /tmp/vim-enhanced-8.0.1763-15.el8.x86_64.rpmExample 3: Configure a Remote Repository
- Create a Repository Configuration File:
sudo nano /etc/yum.repos.d/myrepo.repo- Add Repository Information:
- Save and Exit.
[myrepo]
name=My Custom Repository
baseurl=http://myrepo.example.com/repo
enabled=1
gpgcheck=1
gpgkey=http://myrepo.example.com/repo/RPM-GPG-KEY-myrepo- Install a Package from the Custom Repository:
sudo yum install mypackageExample 4: Configure a Local Repository
- Mount the Local Repository:
sudo mount /dev/sr0 /mnt/localrepo- Create a Repository Configuration File:
sudo nano /etc/yum.repos.d/localrepo.repo- Add Repository Information:
[localrepo]
name=Local Repository
baseurl=file:///mnt/localrepo
enabled=1
gpgcheck=0- Save and Exit.
- Install a Package from the Local Repository:
sudo yum install mylocalpackageAdditional Tips
- Clean the Yum/DNF Cache:Use the
yum clean allordnf clean allcommand to clean the package cache.
sudo yum clean all
# or
sudo dnf clean all- List Installed Packages:Use the
yum list installedordnf list installedcommand to list all installed packages.
yum list installed
# or
dnf list installed- Search for Packages:Use the
yum search <keyword>ordnf search <keyword>command to search for packages.
yum search httpd
# or
dnf search httpd- Get Package Information:Use the
yum info <package_name>ordnf info <package_name>command to get detailed information about a package.
yum info httpd
# or
dnf info httpdConclusion
Installing and updating software packages from Red Hat Network, a remote repository, or the local file system is essential for managing software on RHEL systems. Mastery of these tasks ensures that systems are kept up-to-date and secure, which is crucial for the RHCSA exam.
These notes should help you understand how to install and update software packages from Red Hat Network, a remote repository, or from the local file system for the RHCSA exam.
06.6 – Modify the system bootloader
Overview
The system bootloader is responsible for loading the operating system kernel and initializing the system. In RHEL, GRUB2 (GRand Unified Bootloader version 2) is the default bootloader. This guide covers how to modify GRUB2 settings, including changing the default boot entry, setting kernel parameters, and managing the GRUB2 configuration.
GRUB2 Configuration Files
- Main Configuration File:
/etc/default/grub - Custom Configuration Files:
/etc/grub.d/ - GRUB2 Environment Block:
/boot/grub2/grubenv
Viewing the Current GRUB2 Configuration
To view the current GRUB2 configuration, you can use the grub2-editenv command:
sudo grub2-editenv listSample Output:
saved_entry=0Modifying GRUB2 Settings
Step 1: Edit the Main Configuration File
The main configuration file for GRUB2 is /etc/default/grub. Open this file in a text editor to make changes.
sudo nano /etc/default/grubStep 2: Common Modifications
Change the Default Boot Entry
To change the default boot entry, modify the GRUB_DEFAULT parameter. You can set it to a specific menu entry (starting from 0) or to the name of the menu entry.
Example: Set the default boot entry to the second menu entry (index 1):
GRUB_DEFAULT=1Example: Set the default boot entry to a specific kernel version:
GRUB_DEFAULT="Advanced options for RHEL>RHEL, with Linux 4.18.0-240.el8.x86_64"Set the GRUB Timeout
To set the timeout for the GRUB menu, modify the GRUB_TIMEOUT parameter. This value is in seconds.
Example: Set the GRUB timeout to 5 seconds:
GRUB_TIMEOUT=5Add Kernel Parameters
To add kernel parameters, modify the GRUB_CMDLINE_LINUX parameter.
Example: Add the rhgb and quiet parameters:
GRUB_CMDLINE_LINUX="rhgb quiet"Step 3: Generate the GRUB2 Configuration
After making changes to /etc/default/grub, generate the GRUB2 configuration file using the grub2-mkconfig command.
For BIOS Systems
sudo grub2-mkconfig -o /boot/grub2/grub.cfgFor UEFI Systems
sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfgStep 4: Reboot the System
Reboot the system to apply the changes.
sudo rebootPractical Examples
Example 1: Change the Default Boot Entry
- Edit the Main Configuration File:
sudo nano /etc/default/grub- Set the Default Boot Entry to the Second Menu Entry:
GRUB_DEFAULT=1- Generate the GRUB2 Configuration:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg- Reboot the System:
sudo rebootExample 2: Set the GRUB Timeout
- Edit the Main Configuration File:
sudo nano /etc/default/grub- Set the GRUB Timeout to 10 Seconds:
GRUB_TIMEOUT=10- Generate the GRUB2 Configuration:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg- Reboot the System:
sudo rebootExample 3: Add Kernel Parameters
- Edit the Main Configuration File:
sudo nano /etc/default/grub- Add the
rhgbandquietKernel Parameters:
GRUB_CMDLINE_LINUX="rhgb quiet"- Generate the GRUB2 Configuration:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg- Reboot the System:
sudo rebootAdditional Tips
- List Available Boot Entries:Use the
awkcommand to list available boot entries from the GRUB configuration file.
awk -F\' '/menuentry / {print $2}' /boot/grub2/grub.cfg- Set a Persistent Default Boot Entry:Use the
grub2-set-defaultcommand to set a persistent default boot entry.
sudo grub2-set-default 1- Boot into Rescue Mode:Add the
systemd.unit=rescue.targetparameter to the kernel command line.
GRUB_CMDLINE_LINUX="systemd.unit=rescue.target"- Boot into Emergency Mode:Add the
systemd.unit=emergency.targetparameter to the kernel command line.
GRUB_CMDLINE_LINUX="systemd.unit=emergency.target"- Rebuild the GRUB2 Environment Block:Use the
grub2-editenvcommand to rebuild the GRUB2 environment block.
sudo grub2-editenv /boot/grub2/grubenv createConclusion
Modifying the system bootloader is essential for controlling the boot process and configuring system behavior at startup. Mastery of these tasks ensures that the system boots correctly and efficiently, which is crucial for the RHCSA exam.
These notes should help you understand how to modify the system bootloader for the RHCSA exam.
Discover more from Altgr Blog
Subscribe to get the latest posts sent to your email.
