How to Convert CentOS 8 to AlmaLinux OS, Enable Stub Resolvers, and Manage Hard Drive Space

This article explains how to convert a CentOS 8 server to AlmaLinux OS, how to enable stub resolvers, and how to manage and clean up hard drive space on a cPanel & WHM server. It includes commands, warnings, verification steps, and best practices for safe system maintenance.

CentOS to AlmaLinuxStub ResolversDisk Space Management

~3 min read · Updated Feb 18, 2026

1. Convert CentOS 8 to AlmaLinux OS


This process converts your CentOS 8 server to AlmaLinux OS, the CloudLinux fork of RHEL. Since CentOS 8 reached EOL in 2021, upgrading is essential for security and compatibility.


Step 1 — Update Packages


dnf clean all
dnf -y update

Step 2 — Reboot the Server


reboot

Step 3 — Download the AlmaLinux Deploy Script


curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh

Step 4 — Run the Conversion Script


bash almalinux-deploy.sh

After completion, the output should show:


Migration to AlmaLinux is completed

Step 5 — Verify Installation


cat /etc/redhat-release

Expected output:


AlmaLinux release 8.4 (Electric Cheetah)

Step 6 — Verify Kernel Boot


sudo grubby --info DEFAULT | grep AlmaLinux

Expected output:


title="AlmaLinux (4.18.0-305.el8.x86_64) 8.4"

2. Enable Stub Resolvers


Warning: This method is not recommended and is unsupported. It may cause configuration issues and reduce the usefulness of AutoSSL error messages.


Stub resolvers allow your system to use internal resolvers instead of external DNS, useful only when port 53 is intentionally blocked.


Step 1 — Test dig


/scripts/cpdig google.com mx

Step 2 — Create Symlink


ln -s stub /var/cpanel/dns_unbound_resolve_mode

Step 3 — Test with strace


strace -o cpdig.strace /scripts/cpdig google.com mx

Step 4 — Verify Stub Resolver


grep -A2 stub cpdig.strace

Expected output:


readlink("/var/cpanel/dns_unbound_resolve_mode", "stub", 4095) = 4

3. Manage Hard Drive Space


Keeping at least 10% free disk space is strongly recommended.


Step 1 — Check Disk Usage


df -h

Example output:


/dev/mapper/LogVol00  288G  189G   85G  70% /

Step 2 — Identify Large Directories


du -sh

Example:


113G home
5.4G /var

Step 3 — Inspect /var


du -sh /var/*

Example:


3.7G /var/log

Step 4 — Delete or Trim Log Files


To keep last 5000 lines:


tail -5000 filename > filename.new
mv filename.new filename
sync

To delete file:


cat /dev/null > filename

Step 5 — Restart Related Service


Restart the service that created the log file after cleanup.


4. SMART Errors


Warning: SMART errors may indicate disk failure. Disable only if you fully understand the risks.


touch /var/cpanel/disablesmartcheck
/scripts/upcp

5. Monitor Disk Usage


WHM » Home » Server Configuration » Tweak Settings

Add ignored mount points to:


/var/cpanel/chkservd_ignored_mounts

Conclusion


This guide covers converting CentOS 8 to AlmaLinux OS, enabling stub resolvers, and managing disk space safely. Following these steps ensures a stable, secure, and well‑maintained server environment.


Written & researched by Dr. Shahin Siami

Related Articles

How to Restore Your cPanel Account: A Complete Guide for New System Administrators

This guide explains how new system administrators can restore a cPanel account using WHM, transfer accounts and configurations between servers, and enable diagnostic logging for transfer and restore operations. It covers essential concepts such as WHM vs. cPanel, root access, backup handling, SFTP uploads, transfer methods, and advanced debugging tools.

Continue

آموزش کامل انتقال تمام اکانت‌های cPanel از یک سرور به سرور دیگر

این مقاله نحوه انتقال همه اکانت‌های cPanel، تنظیمات سرویس‌ها، گواهی‌های SSL و IP اصلی سرور را از یک سرور قدیمی (Source) به یک سرور جدید (Target) توضیح می‌دهد. شامل نصب سرور جدید، انتقال تنظیمات، انتقال اکانت‌ها، تغییر IP، تنظیم DNS و نصب مجدد SSL است.

Continue

How to Migrate a WordPress® Installation to a cPanel & WHM Server

This guide explains how to migrate a WordPress installation from a macOS-hosted environment to a cPanel & WHM server. It covers exporting the database, uploading WordPress files, creating and importing a MySQL database, updating URLs, configuring wp-config.php, fixing broken links, and finalizing the migration.

Continue

How to Manually Transfer an Account Between Servers in cPanel & WHM

This article explains how to manually transfer a cPanel account between servers when the account is too large for WHM’s automated transfer tools. It covers creating temporary directories, compressing public_html and log files, securely transferring data with SCP, and restoring the files on the destination server.

Continue

How to Manually Migrate Horde Calendars and Contacts to Roundcube in cPanel & WHM

This article explains how to manually migrate Horde calendars and contacts to Roundcube in cPanel & WHM version 108 through 118. It covers exporting Horde data, placing it in the correct directories, and importing it into Roundcube using built‑in plugins or manual import tools.

Continue

How to Manually Migrate Accounts to cPanel & WHM from Unsupported Control Panels

This article explains how experienced system administrators can manually migrate accounts from unsupported third‑party control panels to cPanel & WHM. It covers pre‑migration steps, installation requirements, file and directory transfers, database restoration, SSL migration, and post‑migration tasks.

Continue