今天想给系统升级一下,所以就运行了yum upgrade命令,结果没有升级成功,原因是我的/boot目录空间不够了
Transaction Check Error:
installing package kernel-2.6.32-220.17.1.el6.x86_64 needs 18MB on the /boot filesystem
Error Summary
-------------
Disk Requirements:
At least 18MB more space needed on the /boot filesystem.
好吧,查看了一下boot目录
[root@CC boot]# ls
config-2.6.32-131.0.15.el6.x86_64
config-2.6.32-220.13.1.el6.centos.plus.x86_64
config-2.6.32-220.13.1.el6.x86_64
config-2.6.32-220.7.1.el6.x86_64
efi
grub
initramfs-2.6.32-220.13.1.el6.centos.plus.x86_64.img
initramfs-2.6.32-220.13.1.el6.x86_64.img
initramfs-2.6.32-220.7.1.el6.x86_64.img
initrd-2.6.32-131.0.15.el6.x86_64kdump.img
lost+found
symvers-2.6.32-131.0.15.el6.x86_64.gz
symvers-2.6.32-220.13.1.el6.centos.plus.x86_64.gz
symvers-2.6.32-220.13.1.el6.x86_64.gz
symvers-2.6.32-220.7.1.el6.x86_64.gz
System.map-2.6.32-131.0.15.el6.x86_64
System.map-2.6.32-220.13.1.el6.centos.plus.x86_64
System.map-2.6.32-220.13.1.el6.x86_64
System.map-2.6.32-220.7.1.el6.x86_64
vmlinuz-2.6.32-131.0.15.el6.x86_64
vmlinuz-2.6.32-220.13.1.el6.centos.plus.x86_64
vmlinuz-2.6.32-220.13.1.el6.x86_64
vmlinuz-2.6.32-220.7.1.el6.x86_64
config-2.6.32-131.0.15.el6.x86_64
config-2.6.32-220.13.1.el6.centos.plus.x86_64
config-2.6.32-220.13.1.el6.x86_64
config-2.6.32-220.7.1.el6.x86_64
efi
grub
initramfs-2.6.32-220.13.1.el6.centos.plus.x86_64.img
initramfs-2.6.32-220.13.1.el6.x86_64.img
initramfs-2.6.32-220.7.1.el6.x86_64.img
initrd-2.6.32-131.0.15.el6.x86_64kdump.img
lost+found
symvers-2.6.32-131.0.15.el6.x86_64.gz
symvers-2.6.32-220.13.1.el6.centos.plus.x86_64.gz
symvers-2.6.32-220.13.1.el6.x86_64.gz
symvers-2.6.32-220.7.1.el6.x86_64.gz
System.map-2.6.32-131.0.15.el6.x86_64
System.map-2.6.32-220.13.1.el6.centos.plus.x86_64
System.map-2.6.32-220.13.1.el6.x86_64
System.map-2.6.32-220.7.1.el6.x86_64
vmlinuz-2.6.32-131.0.15.el6.x86_64
vmlinuz-2.6.32-220.13.1.el6.centos.plus.x86_64
vmlinuz-2.6.32-220.13.1.el6.x86_64
vmlinuz-2.6.32-220.7.1.el6.x86_64
以前更新内核后,旧内核还留在boot目录里,便于还原。现在新内核经过多天运行,很稳定,所以旧内核都可以删除了
1.查看现运行的内核版本
[root@CC boot]# uname -r
2.6.32-220.13.1.el6.centos.plus.x86_64
2.6.32-220.13.1.el6.centos.plus.x86_64
2.列出所有的内核文件
[root@CC boot]# rpm -q kernel
kernel-2.6.32-131.0.15.el6.x86_64
kernel-2.6.32-220.13.1.el6.x86_64
kernel-2.6.32-220.13.1.el6.centos.plus.x86_64
kernel-2.6.32-220.7.1.el6.x86_64
kernel-2.6.32-131.0.15.el6.x86_64
kernel-2.6.32-220.13.1.el6.x86_64
kernel-2.6.32-220.13.1.el6.centos.plus.x86_64
kernel-2.6.32-220.7.1.el6.x86_64
3.删除所有旧的内核文件
(注意不要删除当前系统正在运行的内核文件)
[root@CC boot]# rpm -e kernel-2.6.32-131.0.15.el6.x86_64
[root@CC boot]# rpm -e kernel-2.6.32-220.7.1.el6.x86_64
[root@CC boot]# rpm -e kernel-2.6.32-220.7.1.el6.x86_64
到此,旧的内核文件就安全删除
[root@CC boot]# rpm -q kernel
kernel-2.6.32-220.13.1.el6.x86_64
kernel-2.6.32-220.13.1.el6.centos.plus.x86_64
kernel-2.6.32-220.13.1.el6.x86_64
kernel-2.6.32-220.13.1.el6.centos.plus.x86_64
文章评论