Disabling kdump to reclaim missing RAM on CentOS 8

Saturday, January 25, 2020

After setting up a Droplet on DigitalOcean (a VPS) using their CentOS 8 image, I found that various sources (like top, free, and even /proc/meminfo) were reporting only 821 MB of total RAM, even though the instance should have had 1 GB. Where did the missing ~200 MB go?

It turns out that kdump is enabled by default. In short, it uses a second kernel to capture dumps in case the running kernel crashes. I don't need this since I'm not going to do anything useful with those dumps anyway, so here's how to disable it and get the memory back.

First, check to see if it's enabled by looking for a nonzero value in /sys/kernel/kexec_crash_size:

$ cat /sys/kernel/kexec_crash_size

You'll also see a line like this in dmesg:

kernel: Reserving 160MB of memory at 672MB for crashkernel (System RAM: 1023MB)

To disable it, edit /etc/default/grub and change crashkernel=auto to crashkernel=no, then:

# grub2-mkconfig -o /boot/grub2/grub.cfg
# systemctl disable kdump
# reboot

On EL9 (AlmaLinux 9, Rocky Linux 9, etc) with BLS, try grubby instead:

# grubby --info=DEFAULT
# grubby --update-kernel ALL --args 'crashkernel=no'
# reboot

Now you should have your memory back!

Tags: centos, linux | Posted at 18:16 | Comments (3)


Rick on Saturday, June 13, 2020 at 14:36

Thanks for the info - made short work of figuring this out!

XAVZBgMN on Friday, July 19, 2024 at 16:16


JTYDAduPGojhKr on Monday, July 22, 2024 at 09:05


Add a comment

Email: (optional, not displayed to public)
URL: (do not fill this in — leave blank!)