What files are OK to delete?

elpmet
elpmet used Ask the Experts™
on
Hi,

I'm running Redhat Linux 7.1 (2.4.9-34smp) on my dual-CPU box.
I'd like to delete unnecessary files in my /boot directory to save some space for new updates.

Since I have 2 CPUs, it is Ok to delete all files that do not have .smp extension?  Can I also delete .img files too?

[root@somesystem /boot]# ls
boot.0800                    module-info-2.4.18-17.7.x
boot.b                       module-info-2.4.18-17.7.xsmp
chain.b                      module-info-2.4.9-34
config-2.4.18-17.7.x         module-info-2.4.9-34smp
config-2.4.18-17.7.xsmp      os2_d.b
initrd-2.4.18-17.7.x.img     System.map
initrd-2.4.18-17.7.xsmp.img  System.map-2.4.18-17.7.x
initrd-2.4.2-2.img           System.map-2.4.18-17.7.xsmp
initrd-2.4.2-2smp.img        System.map-2.4.9-34
initrd-2.4.9-34.img          System.map-2.4.9-34smp
initrd-2.4.9-34smp.img       vmlinux-2.4.18-17.7.x
kernel.h                     vmlinux-2.4.18-17.7.xsmp
kernel.h-2.4.9               vmlinuz
lost+found                   vmlinuz-2.4.18-17.7.x
map                          vmlinuz-2.4.18-17.7.xsmp
message                      vmlinuz-2.4.9-34
message.ja                   vmlinuz-2.4.9-34smp


For example, given the following files,

config-2.4.18-17.7.x
config-2.4.18-17.7.xsmp
initrd-2.4.18-17.7.x.img
initrd-2.4.18-17.7.xsmp.img

can I delete the first one (because I'm running multiple CPU), and the 3rd and 4th ones (because they are images?)


Thanks for your help!!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2005

Commented:
Don't delete the uniprocessor kernel for the SMP kernel that you are running. An SMP kernel won't fit on a boot floppy and you need the uniprocessor kernel available to be able to make a boot floppy.

There are things in /boot that you can safely remove, the  2.4.2-2 & 2.4.9-34 kernels would be good candidates. Personally I keep the original distribution kernel and the current one and toss the intervening ones. To do it the right way one should use rpm to remove the older, un-needed, kernels. Do an 'rpm -qa | grep kernel' and remove the packages associated with the old kernels that you don't want any more.

Author

Commented:
Hi jlevie!

Thanks for looking at my question again, and for your suggestion!!
I ran the command you told me again, which showed the following:

[root@somesystem /boot]# rpm -qa | grep kernel
kernel-smp-2.4.9-34
kernel-2.4.18-17.7.x
kernel-2.4.9-34
kernel-headers-2.4.9-34
kernel-smp-2.4.18-17.7.x

You told me it's Ok to dump "2.4.9-34," but my current kernel is "smp2.4.9-34."  Should I keep this uniprocessor version to make a bootable floppy?

Also, is it safe to delete files ending with ".img" too?

The reason I'm asking this question again is that I'm getting another similar error message when updating my linux ("installing kernel-2.4.18-18.7.x needs 3Mb on the /boot filesystem").  By the way, does this ".x" extension mean "x window" file...?

"df" says:
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/sda3                23333     14347      7782  65% /boot

I'm sorry, jlevie, for asking this seemingly basic question again.  I'd be grateful if you could come back to me.  Thanks!

elpmet

p.s.  Are all Linux administrators having this problem?  Is there a tool to clean up old files automatically...?
Top Expert 2005
Commented:
Hmm, all of the files associated with the 2.4.18 kernel appear to be present in /boot and both of those kernels are shown as installed in the rpm database. What do you see if you do:

rpm -q --verify kernel-2.4.18-17.7.x

and

rpm -q --verify kernel-smp-2.4.18-17.7.x

You could delete:

initrd-2.4.2-2.img
initrd-2.4.2-2smp.img

as they are from an earlier kernel that isn't installed any more.

I don't know how others handle this, but I always make /boot at least twice as large as the installer suggests to avoid running out of room when doing updates.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial