The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

boot partition getting full?

Discussion in 'General Discussion' started by noimad1, Dec 3, 2004.

  1. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    On one of our servers the boot partition is getting full. I went in there to see what was going on and I didn't see anything out of the ordinary. I did see a lot of these files:

    -rwxr-xr-x 1 root root 3498644 Jun 16 22:09 vmlinux-2.4.21-15.0.2.ELsmp
    -rwxr-xr-x 1 root root 2884052 Jun 29 17:27 vmlinux-2.4.21-15.0.3.EL
    -rwxr-xr-x 1 root root 3498644 Jun 29 17:16 vmlinux-2.4.21-15.0.3.ELsmp
    -rwxr-xr-x 1 root root 2884052 Jul 31 00:39 vmlinux-2.4.21-15.0.4.EL
    -rwxr-xr-x 1 root root 3502740 Jul 31 00:31 vmlinux-2.4.21-15.0.4.ELsmp
    -rwxr-xr-x 1 root root 2884048 Apr 21 2004 vmlinux-2.4.21-15.EL
    -rwxr-xr-x 1 root root 3498640 Apr 21 2004 vmlinux-2.4.21-15.ELsmp
    -rwxr-xr-x 1 root root 2892244 Nov 24 19:50 vmlinux-2.4.21-20.0.1.EL
    -rwxr-xr-x 1 root root 3523220 Nov 24 19:44 vmlinux-2.4.21-20.0.1.ELsmp
    -rwxr-xr-x 1 root root 2892240 Aug 18 20:03 vmlinux-2.4.21-20.EL
    -rwxr-xr-x 1 root root 3523216 Aug 18 19:57 vmlinux-2.4.21-20.ELsmp
    -rwxr-xr-x 1 root root 2900384 Oct 23 2003 vmlinux-2.4.21-4.0.1.EL
    -rwxr-xr-x 1 root root 3519072 Oct 23 2003 vmlinux-2.4.21-4.0.1.ELsmp
    -rw-r--r-- 1 root root 1241330 Jun 16 22:23 vmlinuz-2.4.21-15.0.2.EL
    -rw-r--r-- 1 root root 1343113 Jun 16 22:09 vmlinuz-2.4.21-15.0.2.ELsmp
    -rw-r--r-- 1 root root 1241379 Jun 29 17:27 vmlinuz-2.4.21-15.0.3.EL
    -rw-r--r-- 1 root root 1342372 Jun 29 17:15 vmlinuz-2.4.21-15.0.3.ELsmp
    -rw-r--r-- 1 root root 1240137 Jul 31 00:39 vmlinuz-2.4.21-15.0.4.EL
    -rw-r--r-- 1 root root 1343256 Jul 31 00:31 vmlinuz-2.4.21-15.0.4.ELsmp
    -rw-r--r-- 1 root root 1241318 Apr 21 2004 vmlinuz-2.4.21-15.EL
    -rw-r--r-- 1 root root 1342168 Apr 21 2004 vmlinuz-2.4.21-15.ELsmp
    -rw-r--r-- 1 root root 1243818 Nov 24 19:49 vmlinuz-2.4.21-20.0.1.EL
    -rw-r--r-- 1 root root 1353915 Nov 24 19:43 vmlinuz-2.4.21-20.0.1.ELsmp
    -rw-r--r-- 1 root root 1243768 Aug 18 20:03 vmlinuz-2.4.21-20.EL
    -rw-r--r-- 1 root root 1353783 Aug 18 19:56 vmlinuz-2.4.21-20.ELsmp
    -rw-r--r-- 1 root root 1237061 Oct 23 2003 vmlinuz-2.4.21-4.0.1.EL
    -rw-r--r-- 1 root root 1339556 Oct 23 2003 vmlinuz-2.4.21-4.0.1.ELsmp


    which I think have something to do with the kernal......can i remove the old ones? Like the ones from June to Oct 2003
     
  2. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    18
    Hello,

    rpm -qa | grep kernel-*

    Will provide the names and versions of kernels installed.

    Yes you can delete old unused kernels and the smp kernels (if you don't have dual cpu's in your servers, you don't need the smp kernels)

    rpm -e kernel-version-number

    This will remove the kernel rpm packages from your system and clear out space, I would suggest that you keep at least 2 good kernels at all times however.
     
  3. Sinewy

    Sinewy Well-Known Member

    Joined:
    May 15, 2004
    Messages:
    367
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Sydney, Australia
    cPanel Access Level:
    DataCenter Provider
    do a rpm -qa |grep kernel

    show us the results before you do any removing just in case you accidentally remove one you need.

    also,

    cat /etc/grub.conf, show us the result
    cat /etc/lilo.conf, show us the result
     
  4. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    Thank you for the help.

    Here is the rpm -qa |grep kernel:

    PHP:
    kernel-2.4.21-20.EL
    kernel
    -pcmcia-cs-3.1.31-13
    kernel
    -2.4.21-15.EL
    kernel
    -utils-2.4-8.37.6
    kernel
    -source-2.4.21-20.0.1.EL
    kernel
    -smp-2.4.21-4.0.1.EL
    kernel
    -smp-2.4.21-15.EL
    kernel
    -2.4.21-15.0.2.EL
    kernel
    -2.4.21-15.0.4.EL
    kernel
    -smp-2.4.21-20.EL
    kernel
    -smp-2.4.21-20.0.1.EL
    kernel
    -2.4.21-4.0.1.EL
    kernel
    -smp-2.4.21-15.0.2.EL
    kernel
    -2.4.21-15.0.3.EL
    kernel
    -smp-2.4.21-15.0.4.EL
    kernel
    -2.4.21-20.0.1.EL
    kernel
    -smp-2.4.21-15.0.3.EL

    the cat /etc/grub.conf
    PHP:
    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE:  You have a /boot partition.  This means that
    #          all kernel and initrd paths are relative to /boot/, eg.
    #          root (hd0,0)
    #          kernel /vmlinuz-version ro root=/dev/hda3
    #          initrd /initrd-version.img
    #boot=/dev/hda
    default=12
    timeout
    =10
    splashimage
    =(hd0,0)/grub/splash.xpm.gz
    title Red Hat Enterprise Linux ES 
    (2.4.21-20.0.1.ELsmp)
            
    root (hd0,0)
            
    kernel /vmlinuz-2.4.21-20.0.1.ELsmp ro root=/dev/hda3
            initrd 
    /initrd-2.4.21-20.0.1.ELsmp.img
    title Red Hat Enterprise Linux ES 
    (2.4.21-20.0.1.EL)
            
    root (hd0,0)
            
    kernel /vmlinuz-2.4.21-20.0.1.EL ro root=/dev/hda3
            initrd 
    /initrd-2.4.21-20.0.1.EL.img
    title Red Hat Enterprise Linux ES 
    (2.4.21-20.EL)
            
    root (hd0,0)
            
    kernel /vmlinuz-2.4.21-20.EL ro root=/dev/hda3
            initrd 
    /initrd-2.4.21-20.EL.img
    title Red Hat Enterprise Linux ES 
    (2.4.21-20.ELsmp)
            
    root (hd0,0)
            
    kernel /vmlinuz-2.4.21-20.ELsmp ro root=/dev/hda3
            initrd 
    /initrd-2.4.21-20.ELsmp.img
    title Red Hat Enterprise Linux ES 
    (2.4.21-15.0.4.ELsmp)
            
    root (hd0,0)
            
    kernel /vmlinuz-2.4.21-15.0.4.ELsmp ro root=/dev/hda3
            initrd 
    /initrd-2.4.21-15.0.4.ELsmp.img
    title Red Hat Enterprise Linux ES 
    (2.4.21-15.0.4.EL)
            
    root (hd0,0)
            
    kernel /vmlinuz-2.4.21-15.0.4.EL ro root=/dev/hda3
            initrd 
    /initrd-2.4.21-15.0.4.EL.img
    title Red Hat Enterprise Linux ES 
    (2.4.21-15.0.3.ELsmp)
            
    root (hd0,0)
            
    kernel /vmlinuz-2.4.21-15.0.3.ELsmp ro root=/dev/hda3
            initrd 
    /initrd-2.4.21-15.0.3.ELsmp.img
            initrd 
    /initrd-2.4.21-15.0.3.ELsmp.img
    title Red Hat Enterprise Linux ES 
    (2.4.21-15.0.3.EL)
            
    root (hd0,0)
            
    kernel /vmlinuz-2.4.21-15.0.3.EL ro root=/dev/hda3
            initrd 
    /initrd-2.4.21-15.0.3.EL.img
    title Red Hat Enterprise Linux ES 
    (2.4.21-15.0.2.ELsmp)
            
    root (hd0,0)
            
    kernel /vmlinuz-2.4.21-15.0.2.ELsmp ro root=/dev/hda3
            initrd 
    /initrd-2.4.21-15.0.2.ELsmp.img
    title Red Hat Enterprise Linux ES 
    (2.4.21-15.0.2.EL)
            
    root (hd0,0)
            
    kernel /vmlinuz-2.4.21-15.0.2.EL ro root=/dev/hda3
            initrd 
    /initrd-2.4.21-15.0.2.EL.img
    title Red Hat Enterprise Linux ES 
    (2.4.21-15.ELsmp)
            
    root (hd0,0)
            
    kernel /vmlinuz-2.4.21-15.ELsmp ro root=/dev/hda3
            initrd 
    /initrd-2.4.21-15.ELsmp.img
    title Red Hat Enterprise Linux ES 
    (2.4.21-15.EL)
            
    root (hd0,0)
            
    kernel /vmlinuz-2.4.21-15.EL ro root=/dev/hda3
            initrd 
    /initrd-2.4.21-15.EL.img
    title Red Hat Enterprise Linux ES 
    (2.4.21-4.0.1.ELsmp)
            
    root (hd0,0)
            
    kernel /vmlinuz-2.4.21-4.0.1.ELsmp ro root=LABEL=/
            
    initrd /initrd-2.4.21-4.0.1.ELsmp.img
    title Red Hat Enterprise Linux ES 
    (2.4.21-4.0.1.EL)
            
    root (hd0,0)
            
    kernel /vmlinuz-2.4.21-4.0.1.EL ro root=LABEL=/
            
    initrd /initrd-2.4.21-4.0.1.EL.img

    and the cat /etc/lilo.conf
    PHP:
    prompt
    timeout
    =50
    default=2.4.21-4.0.1.E1
    boot
    =/dev/hda
    map
    =/boot/map
    install
    =/boot/boot.b
    message
    =/boot/message
    lba32

    image
    =/boot/vmlinuz-2.4.21-20.0.1.ELsmp
        label
    =2.4.21-20.0.1.1
        initrd
    =/boot/initrd-2.4.21-20.0.1.ELsmp.img
        read
    -only
        append
    ="root=/dev/hda3"

    image=/boot/vmlinuz-2.4.21-20.0.1.EL
        label
    =2.4.21-20.0.1.E
        initrd
    =/boot/initrd-2.4.21-20.0.1.EL.img
        read
    -only
        append
    ="root=/dev/hda3"

    image=/boot/vmlinuz-2.4.21-20.EL
        label
    =2.4.21-20.EL
        initrd
    =/boot/initrd-2.4.21-20.EL.img
        read
    -only
        append
    ="root=/dev/hda3"

    image=/boot/vmlinuz-2.4.21-20.ELsmp
        label
    =2.4.21-20.ELsmp
        initrd
    =/boot/initrd-2.4.21-20.ELsmp.img
        read
    -only
        append
    ="root=/dev/hda3"

    image=/boot/vmlinuz-2.4.21-15.0.4.ELsmp
        label
    =2.4.21-15.0.4.1
        initrd
    =/boot/initrd-2.4.21-15.0.4.ELsmp.img
        read
    -only
        append
    ="root=/dev/hda3"

    image=/boot/vmlinuz-2.4.21-15.0.4.EL
        label
    =2.4.21-15.0.4.E
        initrd
    =/boot/initrd-2.4.21-15.0.4.EL.img
        read
    -only
        append
    ="root=/dev/hda3"

    image=/boot/vmlinuz-2.4.21-15.0.3.ELsmp
        label
    =2.4.21-15.0.3.1
        initrd
    =/boot/initrd-2.4.21-15.0.3.ELsmp.img
        read
    -only
        append
    ="root=/dev/hda3"

    image=/boot/vmlinuz-2.4.21-15.0.3.EL
        label
    =2.4.21-15.0.3.E
        initrd
    =/boot/initrd-2.4.21-15.0.3.EL.img
        read
    -only
        append
    ="root=/dev/hda3"

    image=/boot/vmlinuz-2.4.21-15.0.2.ELsmp
        label
    =2.4.21-15.0.2.1
        initrd
    =/boot/initrd-2.4.21-15.0.2.ELsmp.img
        read
    -only
        append
    ="root=/dev/hda3"

    image=/boot/vmlinuz-2.4.21-15.0.2.EL
        label
    =2.4.21-15.0.2.E
        initrd
    =/boot/initrd-2.4.21-15.0.2.EL.img
        read
    -only
        append
    ="root=/dev/hda3"

    image=/boot/vmlinuz-2.4.21-15.ELsmp
        label
    =2.4.21-15.ELsmp
        initrd
    =/boot/initrd-2.4.21-15.ELsmp.img
        read
    -only
        append
    ="root=/dev/hda3"

    image=/boot/vmlinuz-2.4.21-15.EL
        label
    =2.4.21-15.EL
        initrd
    =/boot/initrd-2.4.21-15.EL.img
        read
    -only
        append
    ="root=/dev/hda3"

    image=/boot/vmlinuz-2.4.21-4.0.1.ELsmp
        label
    =2.4.21-4.0.1.E1
        initrd
    =/boot/initrd-2.4.21-4.0.1.ELsmp.img
        read
    -only
        append
    ="root=LABEL=/"

    image=/boot/vmlinuz-2.4.21-4.0.1.EL
        label
    =2.4.21-4.0.1.EL
        initrd
    =/boot/initrd-2.4.21-4.0.1.EL.img
        read
    -only
        append
    ="root=LABEL=/"
     
  5. ukpro

    ukpro Active Member

    Joined:
    Aug 25, 2004
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Thanks

    Hey guys, just want to say that this helped me out too.

    Thanks
    Liam
     
  6. eglwolf

    eglwolf Well-Known Member

    Joined:
    Jan 1, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    I am having the same problem and I ran those commands, however where can I tell which kernels to keep?

     
  7. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    If you isse the following:

    uname -a

    It will tell you which kernel you are running. You can basically delete any that are older (though it might be a good idea to keep the one immediately preceeding it).
     
  8. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    I too am trying to clear out some old unnecessary kernels and am running into some slight problems when using rpm -e to remove old kernels.

    Firstly, if I run rpm -qa | grep kernel-* I get:

    Code:
    kernel-2.4.21-27.0.4.EL
    kernel-smp-2.4.21-27.0.4.EL
    kernel-2.4.21-32.EL
    kernel-pcmcia-cs-3.1.31-13
    kernel-smp-2.4.21-27.0.2.EL
    kernel-smp-2.4.21-32.EL
    kernel-2.4.21-32.0.1.EL
    kernel-utils-2.4-8.37.12
    kernel-smp-2.4.21-27.0.1.EL
    kernel-smp-2.4.21-32.0.1.EL
    kernel-2.4.21-27.0.2.EL
    From looking at the file modification dates, I figured that kernel-2.4.21-27.0.2.EL is not needed and so tried to remove it with rpm -e kernel-2.4.21-27.0.2.EL, resulting in:

    Code:
    root@host [~]# rpm -e kernel-2.4.21-27.0.2.EL
    stdin: is not a tty
    Not that I know why, but I think that stdin: is not a tty is not a good thing.

    When I subsequently run rpm -qa | grep kernel-*, rpm -e kernel-2.4.21-27.0.2.EL is no longer listed however not all the files that I would expect get deleted from /boot.

    It seems that the relevant initrd-*.img is deleted, but the relevant vmlinux-*, System.map-*, config-* and vmlinuz-* files remain (which, quite unfairly, tend to be the ones that take up the most space).

    Any ideas as to what I'm doing wrong?
     
  9. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    No, the TTY error is normal and you can ignore it the rrpm -e would have completed. Not sure about the leftover files - are you sure they don't beling to the SMP version of the kernel that is still installed?
     
  10. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Thanks Chirpy. As always, you're right and apparently leftover files were for the SMP version.
     
  11. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    18
    I'd say if you need to be asking these questions then you shouldn't be uninstalling any kernels.. not to be rude but getting someone in to do it, such as an experienced admin, on a live box seems like a good option to start off with. Ask them what they did afterwards.
    Posting these types of How to's on forums often leads to confusions and mistakes.

    You can always practice on a spare box or one at home first before making any mistakes on a live server that could lead to an unbootable machine. Your NOC will thank you too maybe :)
     
Loading...

Share This Page