- Audience: Linux administrators, students, and power users on Rocky Linux 9.8 with Xfce
- Difficulty: Intermediate
- Time: About 20–30 minutes
- Reboot: Required after systemd and kernel argument changes
Introduction
Rocky Linux 9.8 is a solid enterprise operating system. Out of the box, it is tuned for servers and corporate environments. On a personal laptop with a lightweight Xfce desktop, some of those defaults add boot delay, reserve RAM you may never use, and keep background services running that you do not need.
This guide walks through practical optimizations used on a Rocky Linux 9.8 Xfce laptop:
- Faster
dnfdownloads - Shorter boot time by trimming systemd waits
- Reclaiming crash-dump (kdump) memory reservation
- Skipping legacy serial-port probing
- Lower Firefox power draw
- Automatic power profiles when you plug or unplug AC power
Why Optimize Rocky Linux on a Laptop?
Enterprise defaults favor reliability and diagnostics over snappy interactive use:
| Enterprise default | Effect on a laptop |
|---|---|
| Wait for network before login | Slower boot to Xfce |
| Wait for all devices to “settle” | Extra seconds on modern NVMe systems |
| Reserve RAM for kdump | Memory unavailable to applications |
| Probe legacy serial UARTs | Extra kernel init time |
Background dnf metadata refresh |
Random disk/CPU spikes |
| NFS / modem helper services | Idle work you may never use |
Tuning these areas improves boot speed, available RAM, and battery behavior without changing the Rocky Linux security or update model.
Before You Begin
System requirements
| Requirement | Details |
|---|---|
| OS | Rocky Linux 9.8 (Blue Onyx) |
| Desktop | Xfce (Xfce4) |
| Privileges | Account with sudo |
| Packages used | dnf, grubby, tuned, NetworkManager (usually already installed) |
Important warnings
crashkernel reclaim RAM, but you lose automatic crash dump capture.rpcbind / gssproxy if you mount NFS shares. Do not disable ModemManager if you use a cellular (WWAN) modem. Do not set 8250.nr_uarts=0 if you need a serial console.Create a simple backup of settings
Record what you have today so you can roll back:
mkdir -p ~/rocky-tune-backup
cp /etc/dnf/dnf.conf ~/rocky-tune-backup/dnf.conf.bak
sudo grubby --info=DEFAULT > ~/rocky-tune-backup/grubby-default.txt
systemctl list-unit-files > ~/rocky-tune-backup/unit-files.txt
free -h > ~/rocky-tune-backup/memory-before.txt
systemd-analyze > ~/rocky-tune-backup/boot-before.txt 2>/dev/null || true
What it does: Saves DNF config, current kernel boot args, service enablement state, memory summary, and boot timing. Reboot required: No Risk: None (read-only / copy only)
Check Current Resource Usage
Before changing anything, establish a baseline.
Disk usage
df -h /
What it does: Shows filesystem capacity and free space on the root volume. Expected output: Size, used, available, and use percentage for /. Reboot required: No
Memory usage
free -h
What it does: Shows total, used, and available RAM (and swap). Expected output: A table with Mem: and Swap: rows. Why it matters: After removing the crashkernel reservation, total usable RAM should increase (often by roughly 192–512 MiB, depending on the previous crashkernel= value). Reboot required: No for the check; yes before you will see the crashkernel change take effect.
Boot time baseline
systemd-analyze
systemd-analyze blame | head -20
What it does: Reports kernel/initrd/userspace boot time and the slowest units. Expected output: A total boot time, plus a ranked list of services/devices. Reboot required: No
1. Speed Up the DNF Package Manager
The problem
By default, dnf is conservative. Downloads are limited in parallelism, and mirror selection may not favor the lowest-latency mirror for your location. On a home or office connection, updates can feel slower than necessary.
The optimization
Open the DNF configuration file:
sudo nano /etc/dnf/dnf.conf
Under the [main] section, add:
max_parallel_downloads=10
fastestmirror=True
Save and exit (Ctrl+O, Enter, Ctrl+X in nano).
What it does:
| Setting | Purpose |
|---|---|
max_parallel_downloads=10 |
Allows up to 10 concurrent package downloads |
fastestmirror=True |
Prefer a faster mirror based on measured latency |
Why it is used: Shortens wall-clock time for dnf upgrade and package installs on typical broadband links. Expected result: The next sudo dnf upgrade should download packages with more parallelism. Reboot required: No Risk: Low. If a mirror misbehaves, you can remove fastestmirror=True and retry.
fastestmirror is a built-in dnf.conf option on Rocky Linux 9. It can add a brief mirror probe at the start of a transaction; the tradeoff is usually worth it for large updates.sudo dnf clean all
sudo dnf makecache
sudo dnf upgrade --refresh
2. Reduce Boot Delays (systemd Triage)
The problem
Server-oriented units often wait for network readiness, device settlement, or background package tasks before the desktop feels “ready.” On a laptop, those waits are usually unnecessary.
Also remember:
| Action | Behavior |
|---|---|
systemctl disable |
Stops a unit from starting at boot; another unit may still pull it in |
systemctl mask |
Points the unit at /dev/null so it cannot start at all |
Use mask only when you intentionally want to block reactivation.
Recommended service changes
# Allow graphical login without waiting for a full network "online" state
sudo systemctl disable NetworkManager-wait-online.service
# Skip legacy "wait for all devices to settle" pause on modern hardware
sudo systemctl mask systemd-udev-settle.service
# Stop automatic background DNF metadata refresh
sudo systemctl mask dnf-makecache.service
sudo systemctl disable dnf-makecache.timer
# Disable NFS helper listeners if you do not use NFS
sudo systemctl disable --now rpcbind.service rpcbind.socket gssproxy.service
# Disable cellular modem management if you have no WWAN modem
sudo systemctl disable --now ModemManager.service
Service reference
| Unit | Action | Why | Safe on typical Wi‑Fi laptop? |
|---|---|---|---|
NetworkManager-wait-online.service |
disable |
Stops boot from waiting for a fully ready IP/network before continuing | Yes |
systemd-udev-settle.service |
mask |
Removes an old-style wait for all devices to settle | Usually yes on NVMe laptops |
dnf-makecache.service / .timer |
mask + disable |
Prevents periodic background metadata downloads | Yes |
rpcbind.service / .socket |
disable --now |
NFS portmapper / RPC helper | Only if you do not use NFS |
gssproxy.service |
disable --now |
GSSAPI helper often used with NFS/Kerberos | Only if you do not need it |
ModemManager.service |
disable --now |
Manages cellular modems | Only if you have no WWAN modem |
What these commands do: Change enablement (and immediately stop units where --now is used). Expected output: systemctl reports the unit was disabled, masked, or stopped. Reboot required: Recommended, so you can measure a clean boot. Risk: Medium if you depend on NFS, WWAN, or unusual early-boot device ordering.
sudo systemctl unmask systemd-udev-settle.service
sudo systemctl unmask dnf-makecache.service
In-depth notes
NetworkManager-wait-online.service Forces parts of boot to wait until NetworkManager considers the network “online.” Disabling it lets Xfce reach the login screen sooner; Wi‑Fi or Ethernet can finish connecting while you type your password.
systemd-udev-settle.service Historically waited until udev queue activity settled. On modern NVMe laptops this often adds dead time. Masking it is a common desktop optimization; if a rare device race appears after install-time hardware changes, unmask it temporarily.
dnf-makecache.service / timer Periodically refreshes repository metadata. Useful on servers that automate patching; on a laptop it can cause surprise disk and CPU activity. Metadata still refreshes when you run dnf yourself.
rpcbind / gssproxy Used for NFS and related RPC/GSS flows. If you never mount NFS, disabling them removes idle listeners. If you use NFS home directories or NAS mounts, leave them enabled.
ModemManager.service Scans for mobile broadband hardware. Harmless but unnecessary on Wi‑Fi/Ethernet-only laptops.
3. Tune Kernel Boot Arguments with grubby
The problem
Rocky Linux 9 uses the Boot Loader Specification (BLS). Individual kernel entries live under /boot/loader/entries/. Editing only /etc/default/grub and running grub2-mkconfig is not always enough for the currently selected kernel.
Rocky also reserves memory for kdump via a crashkernel= argument so a crash dump environment can capture RAM after a kernel panic. On a personal laptop, you may prefer that RAM for applications.
Check current boot arguments
sudo grubby --info=DEFAULT
What it does: Shows the default kernel path and its current arguments. Expected output: Lines such as kernel=, args=, and root=. Look for any crashkernel=... value. Reboot required: No
Apply crashkernel and UART optimizations
Use the exact crashkernel=... string from grubby --info=DEFAULT in --remove-args. Do not copy an old example string from another machine; Rocky 9.x defaults can differ.
# Example pattern — replace the crashkernel=... value with YOURS from grubby --info
sudo grubby --update-kernel=DEFAULT \
--remove-args="crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M" \
--args="crashkernel=no 8250.nr_uarts=0"
If you are unsure of the exact string, a practical approach is:
- Copy the full
args=line fromgrubby --info=DEFAULT. - Remove the existing
crashkernel=...token from that line mentally. - Run
--remove-argswith that exactcrashkernel=...token. - Add
crashkernel=no 8250.nr_uarts=0with--args.
Also disable the kdump service so it is not expected to run without reserved memory:
sudo systemctl disable --now kdump.service
Verify:
sudo grubby --info=DEFAULT
You should see crashkernel=no and 8250.nr_uarts=0 in args=.
What it does: Updates the default BLS kernel entry and stops kdump. Expected output: Updated args= line; kdump.service disabled/inactive. Reboot required: Yes — memory reclaim and UART skip apply only after reboot. Risk: Medium.
| Argument | Meaning | Risk |
|---|---|---|
crashkernel=no |
Do not reserve RAM for kdump | No automatic crash dumps |
8250.nr_uarts=0 |
Do not probe legacy 8250 serial UARTs | Breaks serial console / some BMC SOL setups |
grubby on Rocky Linux 9. After a future kernel update, confirm grubby --info=DEFAULT still contains your intended args. Using --update-kernel=ALL instead of DEFAULT applies the change to every installed kernel entry.In-depth notes
crashkernel reservation Enterprise images reserve a slice of RAM (commonly on the order of hundreds of MiB, sized by RAM) for the dump kernel. Setting crashkernel=no returns that memory to normal use after reboot.
8250.nr_uarts=0 The kernel historically probes legacy serial ports (ttyS0 …). On many modern laptops with no real UARTs, that probe wastes time. Setting nr_uarts to 0 skips it.
4. Optimize Firefox for Lower Power and Heat
The problem
Firefox can spend significant CPU on compositing and media when hardware acceleration is off or when media buffering is too small. On dual-core or thermally limited laptops, that shows up as higher fan use and faster battery drain.
Step A — Enable hardware acceleration
- Open Firefox Settings.
- Open the General panel and find Performance.
- Uncheck Use recommended performance settings.
- Check Use hardware acceleration when available.
- Restart Firefox.
What it does: Allows Firefox to offload supported graphics/video work to the GPU (for example Intel Iris / AMD iGPU via Mesa). Expected result: Smoother scrolling/video with lower CPU use on supported hardware. Reboot required: No (Firefox restart is enough). Risk: Low. If graphics glitches appear, turn the option off again.
Step B — Increase media readahead buffer
- In the address bar, open
about:config. - Accept the risk warning.
- Search for
media.cache_readahead_limit. - Change the value from the default (often
60) to120.
What it does: Lets Firefox cache a larger window of media data ahead of playback. Why it helps: The CPU can fill the buffer in bursts and idle longer between fetches, which can reduce wakeups during streaming. Expected result: Preference shows 120. Reboot required: No. Risk: Very low. Uses a bit more memory for media cache.
5. Automate Power Profiles with udev and TuneD
The problem
tuned-adm can switch performance profiles, but doing it manually every time you plug or unplug AC power is tedious.
Prerequisites
Ensure TuneD is installed and running:
rpm -q tuned
sudo systemctl enable --now tuned
tuned-adm list
tuned-adm active
What it does: Confirms the package, starts the daemon, and shows available/active profiles. Expected output: Profiles such as balanced, powersave, throughput-performance, and on many systems balanced-battery. Reboot required: No Risk: Low
balanced (on AC) and powersave (on battery) is a simple, proven pair. Some Rocky systems also ship balanced-battery; you may prefer that on battery instead of powersave if you want a milder tradeoff.Create a udev rule
sudo nano /etc/udev/rules.d/99-power-profiles.rules
Add:
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/usr/sbin/tuned-adm profile balanced"
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/usr/sbin/tuned-adm profile powersave"
Reload rules:
sudo udevadm control --reload-rules
sudo udevadm trigger --subsystem-match=power_supply
What it does: When AC adapter online state changes, udev runs tuned-adm to switch profiles. Expected result: Plugging in AC selects balanced; unplugging selects powersave. Verify with tuned-adm active. Reboot required: No Risk: Low to medium. Wrong profile names fail the tuned-adm call; check spelling against tuned-adm list.
ATTR{type}=="Mains"), not the battery device. On this class of hardware the AC device often appears as names like ACAD or ADP0; using type=="Mains" keeps the rule portable.systemctl status tuned). If the daemon is stopped, profile switches will fail.In-depth notes
| Condition | Profile | Intent |
|---|---|---|
AC connected (online==1) |
balanced |
Responsive desktop performance |
On battery (online==0) |
powersave |
Lower frequency / power draw |
Exact wattage savings vary by CPU, display brightness, and workload. Treat power figures from any single laptop as observational, not guaranteed.
Verify Changes
After a reboot, confirm each layer.
1. DNF settings
grep -E 'max_parallel_downloads|fastestmirror' /etc/dnf/dnf.conf
Expected:
max_parallel_downloads=10
fastestmirror=True
2. Masked / disabled units
systemctl is-enabled NetworkManager-wait-online.service systemd-udev-settle.service dnf-makecache.timer rpcbind.service ModemManager.service kdump.service
Interpret:
| Result | Meaning |
|---|---|
disabled |
Will not start at boot (unless pulled in) |
masked |
Cannot start |
enabled |
Still enabled — re-check your commands |
3. Kernel arguments
cat /proc/cmdline
sudo grubby --info=DEFAULT
Confirm crashkernel=no and 8250.nr_uarts=0 are present.
4. Memory and boot time
free -h
systemd-analyze
Compare with your ~/rocky-tune-backup/ baseline files.
5. Power profile switching
tuned-adm active
# Unplug/plug AC, wait a moment, then:
tuned-adm active
Rollback / Restore
Restore DNF defaults
sudo cp ~/rocky-tune-backup/dnf.conf.bak /etc/dnf/dnf.conf
Or remove the two added lines from /etc/dnf/dnf.conf.
Re-enable services
sudo systemctl unmask systemd-udev-settle.service dnf-makecache.service
sudo systemctl enable NetworkManager-wait-online.service
sudo systemctl enable --now dnf-makecache.timer
sudo systemctl enable --now rpcbind.service rpcbind.socket gssproxy.service
sudo systemctl enable --now ModemManager.service
Only re-enable the units you actually need.
Restore kdump / crashkernel
- Put back a valid
crashkernel=value withgrubby(use Rocky’s default for your RAM size, or follow Red Hat/Rocky kdump documentation). - Re-enable kdump:
sudo systemctl enable --now kdump.service
- Reboot and verify with
cat /proc/cmdlineandsystemctl status kdump.
Remove UART skip
sudo grubby --update-kernel=DEFAULT --remove-args="8250.nr_uarts=0"
sudo reboot
Remove the power udev rule
sudo rm /etc/udev/rules.d/99-power-profiles.rules
sudo udevadm control --reload-rules
Troubleshooting
| Symptom | Likely cause | What to try |
|---|---|---|
| NFS mounts fail | rpcbind / gssproxy disabled |
Re-enable those units |
| No mobile data | ModemManager disabled |
sudo systemctl enable --now ModemManager.service |
| Profile never changes on unplug | TuneD stopped, or rule mismatch | systemctl status tuned; confirm /sys/class/power_supply/*/type shows Mains |
| Firefox tearing / black video | GPU acceleration issue | Disable hardware acceleration in Firefox settings |
grubby change missing after reboot |
Wrong kernel entry updated | Use grubby --info=ALL and update the entry you actually boot |
| Need crash dumps again | crashkernel=no |
Restore crashkernel= and enable kdump |
Frequently Asked Questions
Is this the same as “debloating” by removing packages?
No. This guide focuses on configuration and service tuning. Removing packages can save disk space, but it is easy to break a desktop group install. Prefer disabling unused services first.
Will this make Rocky Linux unsupported?
These are standard administrator actions (dnf.conf, systemctl, grubby, udev rules). They do not replace Rocky with another distribution. Keep your own notes so you can reverse changes during troubleshooting.
Should I use --update-kernel=ALL?
Use ALL if you want every installed kernel entry updated the same way. Use DEFAULT if you want to test on the current default kernel first.
Do I need to reboot after every section?
No. Reboot once after the systemd and grubby sections. DNF, Firefox, and udev/TuneD changes apply without a full reboot (TuneD/udev may need the trigger commands shown above).
Can I apply this on GNOME or KDE?
Most systemd/grubby/DNF steps are desktop-agnostic. Firefox and power-profile behavior still apply. This article is validated in spirit for Xfce on Rocky Linux 9.8.
Best Practices
- Change one layer at a time on critical machines; reboot and verify before the next layer.
- Keep kdump enabled where crash forensics matter.
- Document every masked unit and kernel argument.
- Re-check
grubby --info=DEFAULTafter kernel updates. - Prefer
disableovermaskunless a unit keeps coming back. - Do not chase absolute wattage claims; measure with your own baseline (
tuned-adm active, battery stats,systemd-analyze).
Conclusion
Rocky Linux 9.8 with Xfce is already a capable laptop OS. A few targeted changes — faster dnf, fewer boot waits, no unused crashkernel reservation, optional UART probe skip, Firefox GPU offload, and AC/battery TuneD switching — make the desktop feel closer to a personal workstation while keeping the enterprise base intact.
Work carefully, keep a rollback path, and verify after reboot. That is the difference between “tuning” and “breaking.”