Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Deleting files on /boot

  1. #1
    Join Date
    Dec 2012
    Beans
    52

    Deleting files on /boot

    Hi all. I have a question to the *buntu masters. Presently in my Xubuntu 13.10 installation i have the following kernels
    Code:
    ~$ dpkg-query -l | grep linux-image
    ii  linux-image-3.11.5-031105-generic    3.11.5-031105.201310132235          i386         Linux kernel image for version 3.11.5 on 32 bit x86 SMP
    ii  linux-image-3.12.0-031200-generic    3.12.0-031200.201311031935          i386         Linux kernel image for version 3.12.0 on 32 bit x86
    and the contents of my /boot folder is the following:
    Code:
    ~$ ls -lh /boot
    total 233M
    -rw-r--r-- 1 root root 978K Oct 14 03:50 abi-3.11.5-031105-generic
    -rw-r--r-- 1 root root 985K Nov  4 00:53 abi-3.12.0-031200-generic
    -rw-r--r-- 1 root root 834K Oct  9  2012 abi-3.5.0-17-generic
    -rw-r--r-- 1 root root 837K Jan  8  2013 abi-3.5.0-22-generic
    -rw-r--r-- 1 root root 837K Jan 24  2013 abi-3.5.0-23-generic
    -rw-r--r-- 1 root root 839K Feb  7  2013 abi-3.5.0-24-generic
    -rw-r--r-- 1 root root 839K Feb 25  2013 abi-3.5.0-25-generic
    -rw-r--r-- 1 root root 839K Mar  8  2013 abi-3.5.0-26-generic
    -rw-r--r-- 1 root root 841K Mar 25  2013 abi-3.5.0-27-generic
    -rw-r--r-- 1 root root 904K Apr 17  2013 abi-3.8.0-19-generic
    -rw-r--r-- 1 root root 164K Oct 14 03:50 config-3.11.5-031105-generic
    -rw-r--r-- 1 root root 163K Nov  4 00:53 config-3.12.0-031200-generic
    -rw-r--r-- 1 root root 151K Oct  9  2012 config-3.5.0-17-generic
    -rw-r--r-- 1 root root 151K Jan  8  2013 config-3.5.0-22-generic
    -rw-r--r-- 1 root root 151K Jan 24  2013 config-3.5.0-23-generic
    -rw-r--r-- 1 root root 151K Feb  7  2013 config-3.5.0-24-generic
    -rw-r--r-- 1 root root 151K Feb 25  2013 config-3.5.0-25-generic
    -rw-r--r-- 1 root root 151K Mar  8  2013 config-3.5.0-26-generic
    -rw-r--r-- 1 root root 152K Mar 25  2013 config-3.5.0-27-generic
    -rw-r--r-- 1 root root 158K Apr 17  2013 config-3.8.0-19-generic
    drwxr-xr-x 5 root root 4.0K Dec  5 00:36 grub
    -rw-r--r-- 1 root root  16M Nov 13 21:42 initrd.img-3.11.5-031105-generic
    -rw-r--r-- 1 root root  17M Dec  4 23:28 initrd.img-3.12.0-031200-generic
    -rw-r--r-- 1 root root  15M Jan 25  2013 initrd.img-3.5.0-17-generic
    -rw-r--r-- 1 root root  15M Jan 25  2013 initrd.img-3.5.0-22-generic
    -rw-r--r-- 1 root root  15M Jan 31  2013 initrd.img-3.5.0-23-generic
    -rw-r--r-- 1 root root  15M Feb 19  2013 initrd.img-3.5.0-24-generic
    -rw-r--r-- 1 root root  15M Feb 26  2013 initrd.img-3.5.0-25-generic
    -rw-r--r-- 1 root root  15M Mar 28  2013 initrd.img-3.5.0-26-generic
    -rw-r--r-- 1 root root  15M Apr 30  2013 initrd.img-3.5.0-27-generic
    -rw-r--r-- 1 root root  16M Apr 30  2013 initrd.img-3.8.0-19-generic
    -rw-r--r-- 1 root root 173K Jun 17 10:52 memtest86+.bin
    -rw-r--r-- 1 root root 175K Jun 17 10:52 memtest86+_multiboot.bin
    -rw------- 1 root root 2.6M Oct 14 03:50 System.map-3.11.5-031105-generic
    -rw------- 1 root root 2.7M Nov  4 00:53 System.map-3.12.0-031200-generic
    -rw------- 1 root root 2.3M Oct  9  2012 System.map-3.5.0-17-generic
    -rw------- 1 root root 2.3M Jan  8  2013 System.map-3.5.0-22-generic
    -rw------- 1 root root 2.3M Jan 24  2013 System.map-3.5.0-23-generic
    -rw------- 1 root root 2.3M Feb  7  2013 System.map-3.5.0-24-generic
    -rw------- 1 root root 2.3M Feb 25  2013 System.map-3.5.0-25-generic
    -rw------- 1 root root 2.3M Mar  8  2013 System.map-3.5.0-26-generic
    -rw------- 1 root root 2.3M Mar 25  2013 System.map-3.5.0-27-generic
    -rw------- 1 root root 2.4M Apr 17  2013 System.map-3.8.0-19-generic
    -rw------- 1 root root 5.5M Oct 14 03:50 vmlinuz-3.11.5-031105-generic
    -rw------- 1 root root 5.6M Nov  4 00:53 vmlinuz-3.12.0-031200-generic
    -rw-r--r-- 1 root root 5.0M Oct 17  2012 vmlinuz-3.5.0-17-generic
    -rw------- 1 root root 5.0M Jan  8  2013 vmlinuz-3.5.0-22-generic
    -rw------- 1 root root 5.0M Jan 24  2013 vmlinuz-3.5.0-23-generic
    -rw------- 1 root root 5.0M Feb  7  2013 vmlinuz-3.5.0-24-generic
    -rw------- 1 root root 5.0M Feb 25  2013 vmlinuz-3.5.0-25-generic
    -rw------- 1 root root 5.0M Mar  8  2013 vmlinuz-3.5.0-26-generic
    -rw------- 1 root root 5.0M Mar 25  2013 vmlinuz-3.5.0-27-generic
    -rw------- 1 root root 5.2M Apr 17  2013 vmlinuz-3.8.0-19-generic
    So my question is: can I safely remove all those files that relate to previous versions of kernels from /boot​, which I think are the ones I highlighted in red, leaving just the ones that relate to the existent kernels in my computer?

    Thanks in advance for helping.

  2. #2
    Join Date
    Jun 2007
    Location
    K-o-T,
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Deleting files on /boot

    You should be able to use
    Code:
    sudo apt-get autoremove
    to reduce the number of kernels.

    It will keep the current and previous kernel,just in case you need to boot into an earlier kernel.

    This was introduced in an earlier release (13.04?).

    On earlier releases.I always used Synaptic Package Manager to remove kernels and headers.


    Good Luck
    Hypertension = Take with a pinch of salt
    | Psychocats | Ubuntu Documentation | Howto [Solved] | BBcode list | Brother Website |

  3. #3
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Deleting files on /boot

    I would advise you on using Synaptic, also.

  4. #4
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    5,840
    Distro
    Xubuntu 15.04 Vivid Vervet

    Re: Deleting files on /boot

    I have also been through an exercise of removing old kernels from /boot like that. I checked with aptitude rather than dpkg though I imagine the results would be the same, then manually deleted all the ones that it didn't think were installed, just as you are suggesting. No harm came of doing so.

    And actually, because the default install options create a 500M /boot partition, if you don't clear out in time eventually an upgrade fails partway through because the partition is full. Then it can take hours to clean up the mess - it refuses to either upgrade or downgrade because of broken dependencies. I'm not that familiar with the dependency management, and I think that reinstalling can be the quickest solution when that happens.

  5. #5
    Join Date
    Dec 2012
    Beans
    52

    Re: Deleting files on /boot

    Firstly let me thank you for your answers and helpful advices.

    Quote Originally Posted by plucky View Post
    You should be able to use
    Code:
    sudo apt-get autoremove
    to reduce the number of kernels.
    It will keep the current and previous kernel,just in case you need to boot into an earlier kernel.
    This was introduced in an earlier release (13.04?).
    On earlier releases.I always used Synaptic Package Manager to remove kernels and headers.
    Good Luck
    I removed the previous/old kernels using
    Code:
    sudo apt-get purge linux-imagexxxxxx
    and that left all those files in my /boot folder, hence why I'm questioning if they're safe for deletion since the kernels that they relate to are no longer in the computer.

    Quote Originally Posted by The Cog View Post
    I have also been through an exercise of removing old kernels from /boot like that. I checked with aptitude rather than dpkg though I imagine the results would be the same, then manually deleted all the ones that it didn't think were installed, just as you are suggesting. No harm came of doing so.

    And actually, because the default install options create a 500M /boot partition, if you don't clear out in time eventually an upgrade fails partway through because the partition is full. Then it can take hours to clean up the mess - it refuses to either upgrade or downgrade because of broken dependencies. I'm not that familiar with the dependency management, and I think that reinstalling can be the quickest solution when that happens.
    I'm no expert by all means, just a curios and eager to learn user, but it strikes me as logical that no harm would come of removing them since they were installed by kernels that I already purged from the computer. Is this assumption I'm making correct?

  6. #6
    Join Date
    Jul 2007
    Location
    UK
    Beans
    16,938
    Distro
    Ubuntu Development Release

    Re: Deleting files on /boot

    I use this (step 5 is the main bit) now and again to remove all but the latest kernel. I make sure I'm happy with any new kernel. Usually a few days in use.

    I always use the dry run in step 5 before doing a purge,

    http://tuxtweaks.com/2010/10/remove-...h-one-command/

  7. #7
    Join Date
    Dec 2012
    Beans
    52

    Re: Deleting files on /boot

    Quote Originally Posted by philinux View Post
    I use this (step 5 is the main bit) now and again to remove all but the latest kernel. I make sure I'm happy with any new kernel. Usually a few days in use.

    I always use the dry run in step 5 before doing a purge,

    http://tuxtweaks.com/2010/10/remove-...h-one-command/
    Thanks for you input philinux. I've tried already the dry run you suggested but that doesn't seems to delete the files I mentioned which leaves me pretty much with my initial doubt.

  8. #8
    Join Date
    Jul 2007
    Location
    UK
    Beans
    16,938
    Distro
    Ubuntu Development Release

    Re: Deleting files on /boot

    Post the output of the dry run for us. Don't forget the code tags.

  9. #9
    Join Date
    Jun 2007
    Location
    K-o-T,
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Deleting files on /boot

    Have you tried the
    Code:
    sudo apt-get autoremove
    command,as that will also remove any dependencies that are no longer required?

    I'm no expert by all means, just a curios and eager to learn user, but it strikes me as logical that no harm would come of removing them since they were installed by kernels that I already purged from the computer. Is this assumption I'm making correct?
    I see no problem with removing them now as you have already removed the kernel images.They might still be there as the linux-headers are still installed.

    See what the "autoremove" command tells you.

    Good Luck
    Hypertension = Take with a pinch of salt
    | Psychocats | Ubuntu Documentation | Howto [Solved] | BBcode list | Brother Website |

  10. #10
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    5,840
    Distro
    Xubuntu 15.04 Vivid Vervet

    Re: Deleting files on /boot

    Quote Originally Posted by desesperado View Post
    I'm no expert by all means, just a curios and eager to learn user, but it strikes me as logical that no harm would come of removing them since they were installed by kernels that I already purged from the computer. Is this assumption I'm making correct?
    Yes, I think you are correct.
    I don't really understand how it came to have all those kernels and initrd files left in /boot when aptitude said they weren't installed, but these were quite old machines (many years out of date) and I think the handling of /boot has improved since then. But even if you remove everything except the kernel that it's currently configured to boot, no harm happens.
    Last edited by The Cog; December 5th, 2013 at 03:39 PM.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •