PDA

View Full Version : [SOLVED] Unwanted kernel entries



Usksider
May 3rd, 2010, 11:45 AM
Hi all

I realise there are tutorials for editing GRUB entries and removing unwanted kernels, BUT nothing seems to work... or maybe I'm just dim and missing the obvious. :(

The thing is I have a number of kernel entries in my boot menu and I simply can't find a way of removing them: they don't appear in Ubuntu Tweak or Synaptic Package Manager and apt-get remove doesn't work either.

I should mention the kernels I want to remove are as follows:


vmlinuz-2.6.31-20-generic-pae
vmlinuz-2.6.32-19-generic-pae
vmlinuz-2.6.32-20-generic-pae
vmlinuz-2.6.32-21-generic-pae

My current ubuntu install is Lucid Lynx 64 - seems really excellent! I just wish there was an easy/obvious way of removing the pre-release kernels. Can anyone help? :confused:

I'm including my boot info script in the hope it'll be useful.


Boot Info Script 0.55 dated February 15th, 2010

============================= Boot Info Summary: ==============================

=> Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
partition #5 for /boot/grub.

sda1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files/dirs: /bootmgr /Boot/BCD /Windows/System32/winload.exe

sda2: __________________________________________________ _______________________

File system: Extended Partition
Boot sector type: -
Boot sector info:

sda5: __________________________________________________ _______________________

File system: ext2
Boot sector type: Grub
Boot sector info: Grub is installed in the boot sector of sda5 and looks
at sector 544367254 of the same hard drive for the
stage2 file, but no stage2 files can be found at this
location.
Operating System: Ubuntu 10.04 LTS
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab /grub/core.img
/boot/grub/core.img

sda6: __________________________________________________ _______________________

File system: swap
Boot sector type: -
Boot sector info:

sda7: __________________________________________________ _______________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 9.10
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda8: __________________________________________________ _______________________

File system: swap
Boot sector type: -
Boot sector info:

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start End Size Id System

/dev/sda1 * 63 283,482,989 283,482,927 7 HPFS/NTFS
/dev/sda2 283,483,114 976,768,064 693,284,951 f W95 Ext d (LBA)
/dev/sda5 522,674,838 958,630,679 435,955,842 83 Linux
/dev/sda6 958,630,743 976,768,064 18,137,322 82 Linux swap / Solaris
/dev/sda7 283,483,116 512,875,124 229,392,009 83 Linux
/dev/sda8 512,875,188 522,674,774 9,799,587 82 Linux swap / Solaris


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/sda1 14F43F5CF43F3F74 ntfs
/dev/sda2: PTTYPE="dos"
/dev/sda5 7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ext2
/dev/sda6 5ba4e3bf-aed1-4cd3-9d43-9ce7b465c12c swap
/dev/sda7 1343b796-1de0-4b3e-a032-dfce6b214379 ext4
/dev/sda8 f4a4f7f8-263b-426e-ae2b-b86f331c13f0 swap
/dev/sda: PTTYPE="dos"

============================ "mount | grep ^/dev output: ===========================

Device Mount_Point Type Options

/dev/sda5 / ext2 (rw,errors=remount-ro)


=========================== sda5/boot/grub/grub.cfg: ===========================

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.32-22-generic root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro quiet splash
initrd /boot/initrd.img-2.6.32-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
echo 'Loading Linux 2.6.32-22-generic ...'
linux /boot/vmlinuz-2.6.32-22-generic root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.32-21-generic-pae root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
echo 'Loading Linux 2.6.32-21-generic-pae ...'
linux /boot/vmlinuz-2.6.32-21-generic-pae root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
echo 'Loading Linux 2.6.32-21-generic ...'
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-20-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.32-20-generic-pae root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro quiet splash
initrd /boot/initrd.img-2.6.32-20-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.32-20-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
echo 'Loading Linux 2.6.32-20-generic-pae ...'
linux /boot/vmlinuz-2.6.32-20-generic-pae root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-20-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.32-19-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.32-19-generic-pae root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro quiet splash
initrd /boot/initrd.img-2.6.32-19-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.32-19-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
echo 'Loading Linux 2.6.32-19-generic-pae ...'
linux /boot/vmlinuz-2.6.32-19-generic-pae root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-19-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.31-20-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.31-20-generic-pae root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro quiet splash
initrd /boot/initrd.img-2.6.31-20-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.31-20-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
echo 'Loading Linux 2.6.31-20-generic-pae ...'
linux /boot/vmlinuz-2.6.31-20-generic-pae root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.31-20-generic-pae
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 14f43f5cf43f3f74
chainloader +1
}
menuentry "Ubuntu, Linux 2.6.31-20-generic-pae (on /dev/sda7)" {
insmod ext2
set root='(hd0,7)'
search --no-floppy --fs-uuid --set 1343b796-1de0-4b3e-a032-dfce6b214379
linux /boot/vmlinuz-2.6.31-20-generic-pae root=UUID=1343b796-1de0-4b3e-a032-dfce6b214379 ro quiet splash
initrd /boot/initrd.img-2.6.31-20-generic-pae
}
menuentry "Ubuntu, Linux 2.6.31-20-generic-pae (recovery mode) (on /dev/sda7)" {
insmod ext2
set root='(hd0,7)'
search --no-floppy --fs-uuid --set 1343b796-1de0-4b3e-a032-dfce6b214379
linux /boot/vmlinuz-2.6.31-20-generic-pae root=UUID=1343b796-1de0-4b3e-a032-dfce6b214379 ro single
initrd /boot/initrd.img-2.6.31-20-generic-pae
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

=============================== sda5/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda5 during installation
UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 / ext2 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=5ba4e3bf-aed1-4cd3-9d43-9ce7b465c12c none swap sw 0 0
# swap was on /dev/sda8 during installation
UUID=f4a4f7f8-263b-426e-ae2b-b86f331c13f0 none swap sw 0 0

=================== sda5: Location of files loaded by Grub: ===================


381.4GB: boot/grub/core.img
278.8GB: boot/grub/grub.cfg
381.5GB: boot/grub/stage2
381.3GB: boot/initrd.img-2.6.31-20-generic-pae
381.4GB: boot/initrd.img-2.6.32-19-generic-pae
381.4GB: boot/initrd.img-2.6.32-20-generic-pae
312.9GB: boot/initrd.img-2.6.32-21-generic
312.8GB: boot/initrd.img-2.6.32-21-generic-pae
312.8GB: boot/initrd.img-2.6.32-22-generic
381.3GB: boot/vmlinuz-2.6.31-20-generic-pae
399.1GB: boot/vmlinuz-2.6.32-19-generic-pae
381.3GB: boot/vmlinuz-2.6.32-20-generic-pae
389.5GB: boot/vmlinuz-2.6.32-21-generic
381.3GB: boot/vmlinuz-2.6.32-21-generic-pae
393.3GB: boot/vmlinuz-2.6.32-22-generic
283.1GB: grub/core.img
312.8GB: initrd.img
312.9GB: initrd.img.old
393.3GB: vmlinuz
389.5GB: vmlinuz.old

=========================== sda7/boot/grub/grub.cfg: ===========================

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set 1343b796-1de0-4b3e-a032-dfce6b214379
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-20-generic-pae" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set 1343b796-1de0-4b3e-a032-dfce6b214379
linux /boot/vmlinuz-2.6.31-20-generic-pae root=UUID=1343b796-1de0-4b3e-a032-dfce6b214379 ro quiet splash
initrd /boot/initrd.img-2.6.31-20-generic-pae
}
menuentry "Ubuntu, Linux 2.6.31-20-generic-pae (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set 1343b796-1de0-4b3e-a032-dfce6b214379
linux /boot/vmlinuz-2.6.31-20-generic-pae root=UUID=1343b796-1de0-4b3e-a032-dfce6b214379 ro single
initrd /boot/initrd.img-2.6.31-20-generic-pae
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set 14f43f5cf43f3f74
chainloader +1
}
menuentry "'Ubuntu, with Linux 2.6.32-22-generic' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.32-22-generic root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro quiet splash
initrd /boot/initrd.img-2.6.32-22-generic
}
menuentry "'Ubuntu, with Linux 2.6.32-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.32-22-generic root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro single
initrd /boot/initrd.img-2.6.32-22-generic
}
menuentry "'Ubuntu, with Linux 2.6.32-21-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.32-21-generic-pae root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic-pae
}
menuentry "'Ubuntu, with Linux 2.6.32-21-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.32-21-generic-pae root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro single
initrd /boot/initrd.img-2.6.32-21-generic-pae
}
menuentry "'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry "'Ubuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro single
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry "'Ubuntu, with Linux 2.6.32-20-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.32-20-generic-pae root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro quiet splash
initrd /boot/initrd.img-2.6.32-20-generic-pae
}
menuentry "'Ubuntu, with Linux 2.6.32-20-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.32-20-generic-pae root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro single
initrd /boot/initrd.img-2.6.32-20-generic-pae
}
menuentry "'Ubuntu, with Linux 2.6.32-19-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.32-19-generic-pae root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro quiet splash
initrd /boot/initrd.img-2.6.32-19-generic-pae
}
menuentry "'Ubuntu, with Linux 2.6.32-19-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.32-19-generic-pae root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro single
initrd /boot/initrd.img-2.6.32-19-generic-pae
}
menuentry "'Ubuntu, with Linux 2.6.31-20-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.31-20-generic-pae root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro quiet splash
initrd /boot/initrd.img-2.6.31-20-generic-pae
}
menuentry "'Ubuntu, with Linux 2.6.31-20-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 7b4f54b8-5154-4d6e-baa8-46cb683a4db4
linux /boot/vmlinuz-2.6.31-20-generic-pae root=UUID=7b4f54b8-5154-4d6e-baa8-46cb683a4db4 ro single
initrd /boot/initrd.img-2.6.31-20-generic-pae
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

=============================== sda7/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# / was on /dev/sda7 during installation
UUID=1343b796-1de0-4b3e-a032-dfce6b214379 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda8 during installation
UUID=f4a4f7f8-263b-426e-ae2b-b86f331c13f0 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

=================== sda7: Location of files loaded by Grub: ===================


145.3GB: boot/grub/core.img
145.3GB: boot/grub/grub.cfg
145.6GB: boot/initrd.img-2.6.31-20-generic-pae
145.3GB: boot/vmlinuz-2.6.31-20-generic-pae
145.6GB: initrd.img
145.3GB: vmlinuz

Doug11
May 3rd, 2010, 12:01 PM
You should be able to remove them through synaptic package manager. Just search the unwanted kernel versions and remove them.

wojox
May 3rd, 2010, 12:08 PM
You should be able to remove them through synaptic package manager. Just search the unwanted kernel versions and remove them.

+1 Just search for linux-image in the Search box. You want to remove all but this one 2.6.32-22-generic

Usksider
May 3rd, 2010, 12:47 PM
You should be able to remove them through synaptic package manager. Just search the unwanted kernel versions and remove them.

Yes that's what I thought, but as stated the unwanted kernels don't appear in synaptic package manager - I have no idea why.

Usksider
May 3rd, 2010, 12:51 PM
+1 Just search for linux-image in the Search box. You want to remove all but this one 2.6.32-22-generic

Hi wojox

As stated above, the kernels don't appear in synaptic. No idea why... unless it's because they were 32 bit and I've gone to 64 bit.

Vishal Agarwal
May 3rd, 2010, 01:08 PM
use apt-get autoremove
it will remove all unwanted packages.
autoremove - Remove automatically all unused packages

lechien73
May 3rd, 2010, 01:11 PM
Do these kernel files exist in the /boot directory? If so, delete them and then run:


sudo grub-mkconfig -o /boot/grub/grub.cfg

You could also check out this forum post, which ensures you'll only ever have the most current kernel entry in your grub menu:

http://ubuntuforums.org/showthread.php?t=1454122

Vishal Agarwal
May 3rd, 2010, 01:16 PM
do these kernel files exist in the /boot directory? If so, delete them and then run:


sudo grub-mkconfig -o /boot/grub/grub.cfgyou could also check out this forum post, which ensures you'll only ever have the most current kernel entry in your grub menu:

http://ubuntuforums.org/showthread.php?t=1454122

+1

wojox
May 3rd, 2010, 01:21 PM
Copy this into Gedit, save, and make it executable and run it. Call it cleaner and execute


sudo ./cleaner



#!/bin/bash

OLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')
CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')
LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"
METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"
OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)
BLUE="\033[1;34m"
ENDCOLOR="\033[0m"

echo -e $BLUE"Cleaning apt cache..."$ENDCOLOR
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get autoremove

echo -e $BLUE"Removing old config files..."$ENDCOLOR
sudo apt-get purge $OLDCONF

echo -e $BLUE"Removing old kernels..."$ENDCOLOR
sudo apt-get purge $OLDKERNELS

echo -e $BLUE"Script Finished!"$ENDCOLOR

Usksider
May 3rd, 2010, 07:56 PM
Do these kernel files exist in the /boot directory? If so, delete them and then run:


sudo grub-mkconfig -o /boot/grub/grub.cfgYou could also check out this forum post, which ensures you'll only ever have the most current kernel entry in your grub menu:

http://ubuntuforums.org/showthread.php?t=1454122


Hi Lechien

Yes I can see all the kernels in the /boot directory. I can't delete them though... it says I'm not the owner of the files :confused:

I want to retain my last two kernels as well as the current one, so really don't want to clear out everything.

Usksider
May 3rd, 2010, 07:59 PM
+1

Vishal: how do I delete the files? It says I'm not the owner so don't have permission :confused:

Sorry... I'm really just a novice at this.

Usksider
May 3rd, 2010, 08:02 PM
Copy this into Gedit, save, and make it executable and run it. Call it cleaner and execute


sudo ./cleaner

#!/bin/bash

OLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')
CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')
LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"
METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"
OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)
BLUE="\033[1;34m"
ENDCOLOR="\033[0m"

echo -e $BLUE"Cleaning apt cache..."$ENDCOLOR
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get autoremove

echo -e $BLUE"Removing old config files..."$ENDCOLOR
sudo apt-get purge $OLDCONF

echo -e $BLUE"Removing old kernels..."$ENDCOLOR
sudo apt-get purge $OLDKERNELS

echo -e $BLUE"Script Finished!"$ENDCOLOR



Okay... won't this delete all my old kernels though? Apologies if I'm being thick here... I'm really a novice at this Linux stuff... I'm trying to learn though. :)

wojox
May 3rd, 2010, 08:24 PM
Yes it will delete all your old kernel packages except the current one. I thought that's what you wanted. I run it all the time on my box. It even updates grub for you.

Usksider
May 3rd, 2010, 08:32 PM
Yes it will delete all your old kernel packages except the current one. I thought that's what you wanted. I run it all the time on my box. It even updates grub for you.

No, I wanted to keep Karmic and the original Lucid.... I've learned from experience it's a good idea to keep something to drop to if needed.

linuxonbute
May 3rd, 2010, 08:57 PM
Vishal: how do I delete the files? It says I'm not the owner so don't have permission :confused:

Sorry... I'm really just a novice at this.

That is because you need to be the owner which in this case is root.

So

cd /boot

sudo rm vmlinuz-2.6.31-20-generic-pae
sudo rm vmlinuz-2.6.32-19-generic-pae
sudo rm vmlinuz-2.6.32-20-generic-pae
sudo rm vmlinuz-2.6.32-21-generic-pae


will remove them for you.

Usksider
May 3rd, 2010, 09:07 PM
That is because you need to be the owner which in this case is root.

So

cd /boot

sudo rm vmlinuz-2.6.31-20-generic-pae
sudo rm vmlinuz-2.6.32-19-generic-pae
sudo rm vmlinuz-2.6.32-20-generic-pae
sudo rm vmlinuz-2.6.32-21-generic-pae


will remove them for you.

Thank you so much... brilliant! Problem solved :D