1

I am trying to upgrade a server to : kernel.x86_64 0:2.6.32-696.23.1.el6.

I got the message :

Transaction Check Error:
  installing package kernel-2.6.32-696.23.1.el6.x86_64 needs 29MB on the /boot filesystem

Error Summary
-------------
Disk Requirements:
  At least 29MB more space needed on the /boot filesystem.

We currently have two kernels installed:

rpm -q kernel

kernel-2.6.32-696.10.3.el6.x86_64
kernel-2.6.32-696.20.1.el6.x86_64

We find remaining packages from old versions in the /boot folder:

ls -lah /boot/2.6.32-504| nl

 1  -rw-r--r-- 1 root root 104K Mar 10  2015 /boot/config-2.6.32-504.16.2.el6.x86_64
 2  -rw-r--r-- 1 root root 104K May 29  2015 /boot/config-2.6.32-504.23.4.el6.x86_64
 3  -rw-r--r-- 1 root root 104K Dec 19  2014 /boot/config-2.6.32-504.8.1.el6.x86_64
 4  -rw------- 1 root root  18M May  6  2015 /boot/initramfs-2.6.32-504.16.2.el6.x86_64.img
 5  -rw------- 1 root root  18M May 12  2016 /boot/initramfs-2.6.32-504.23.4.el6.x86_64.img
 6  -rw------- 1 root root  18M May 12  2016 /boot/initramfs-2.6.32-504.23.4.el6.x86_64.img.bak
 7  -rw------- 1 root root  18M Feb  4  2015 /boot/initramfs-2.6.32-504.8.1.el6.x86_64.img
 8  -rw------- 1 root root 4.5M Sep 23  2016 /boot/initrd-2.6.32-504.23.4.el6.x86_64kdump.img
 9  -rw-r--r-- 1 root root 196K Mar 10  2015 /boot/symvers-2.6.32-504.16.2.el6.x86_64.gz
10  -rw-r--r-- 1 root root 196K May 29  2015 /boot/symvers-2.6.32-504.23.4.el6.x86_64.gz
11  -rw-r--r-- 1 root root 196K Dec 19  2014 /boot/symvers-2.6.32-504.8.1.el6.x86_64.gz
12  -rw-r--r-- 1 root root 2.5M Mar 10  2015 /boot/System.map-2.6.32-504.16.2.el6.x86_64
13  -rw-r--r-- 1 root root 2.5M May 29  2015 /boot/System.map-2.6.32-504.23.4.el6.x86_64
14  -rw-r--r-- 1 root root 2.5M Dec 19  2014 /boot/System.map-2.6.32-504.8.1.el6.x86_64
15  -rwxr-xr-x 1 root root 4.0M Mar 10  2015 /boot/vmlinuz-2.6.32-504.16.2.el6.x86_64
16  -rwxr-xr-x 1 root root 4.0M May 29  2015 /boot/vmlinuz-2.6.32-504.23.4.el6.x86_64
17  -rwxr-xr-x 1 root root 4.0M Dec 19  2014 /boot/vmlinuz-2.6.32-504.8.1.el6.x86_64 

All attempts to delete the files are unsuccessful:

rm /boot/initramfs-2.6.32-504.23.4.el6.x86_64.img.bak

rm: remove regular file `/boot/initramfs-2.6.32-504.23.4.el6.x86_64.img.bak'? y
rm: cannot remove `/boot/initramfs-2.6.32-504.23.4.el6.x86_64.img.bak': Read-only file system

Any ideas to solve the problem?

Regards

3

Install yum-utils package then remove the old kernels :

# package-cleanup --oldkernels --count=2

count=2 will keep only 2 kernels. To keep the runing kernel:

# package-cleanup --oldkernels --count=1
4
  • 1
    Thank's! I didn't ask, but your suggestion is very good and helpful for me. Earlier, I removed all old kernels by hand. May 15 '18 at 12:56
  • 1
    Seems the OP may need to remount /boot as read-write before this will be successful?
    – Jeff Schaller
    May 15 '18 at 12:59
  • Thanks, I managed to remove an old kernel kernel-devel-2.6.32-696.3.1.el6.x86_64, but the free space on the /boot did not change at all!
    – Fdv
    May 15 '18 at 13:01
  • @Jeff Schaller, How do I remount /boot as read-write ?
    – Fdv
    May 15 '18 at 13:03
2

Thanks for you help, the /boot was mounted in RO mode, I changed that by :

mount -o remount,rw /boot 

Then I deleted the files remaining from old versions in the /boot folder:

rm -fr $(ls | grep "2.6.32-504")

And I got enough space to upgrade the kernel.

Remaining question, is it advised to put back the /boot in RO mode ?

Regards

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.