LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Why is my /boot directory so very crowded? (https://www.linuxquestions.org/questions/linux-newbie-8/why-is-my-boot-directory-so-very-crowded-4175678445/)

BigVig 07-09-2020 04:29 PM

Why is my /boot directory so very crowded?
 
I am using Linux Mint 20 Ulyana Xfce on an old laptop I bought from Freegeek Chicago. The original install was Linux Mint 19.4, I think.

Below is my boot directory.
matthew@matthew-ThinkPad-T430:~$ ls /boot
config-4.15.0-101-generic memtest86+.elf
config-4.15.0-106-generic memtest86+_multiboot.bin
config-4.15.0-108-generic System.map-4.15.0-101-generic
config-4.15.0-109-generic System.map-4.15.0-106-generic
config-4.15.0-54-generic System.map-4.15.0-108-generic
config-4.15.0-96-generic System.map-4.15.0-109-generic
config-4.15.0-99-generic System.map-4.15.0-54-generic
config-5.0.0-32-generic System.map-4.15.0-96-generic
config-5.3.0-45-generic System.map-4.15.0-99-generic
config-5.3.0-46-generic System.map-5.0.0-32-generic
config-5.3.0-51-generic System.map-5.3.0-45-generic
config-5.3.0-53-generic System.map-5.3.0-46-generic
config-5.3.0-59-generic System.map-5.3.0-51-generic
config-5.3.0-61-generic System.map-5.3.0-53-generic
config-5.3.0-62-generic System.map-5.3.0-59-generic
config-5.4.0-40-generic System.map-5.3.0-61-generic
grub System.map-5.3.0-62-generic
initrd.img System.map-5.4.0-40-generic
initrd.img-5.3.0-45-generic vmlinuz
initrd.img-5.3.0-46-generic vmlinuz-5.3.0-45-generic
initrd.img-5.3.0-51-generic vmlinuz-5.3.0-46-generic
initrd.img-5.3.0-53-generic vmlinuz-5.3.0-51-generic
initrd.img-5.3.0-59-generic vmlinuz-5.3.0-53-generic
initrd.img-5.3.0-61-generic vmlinuz-5.3.0-59-generic
initrd.img-5.3.0-62-generic vmlinuz-5.3.0-61-generic
initrd.img-5.4.0-40-generic vmlinuz-5.3.0-62-generic
initrd.img.old vmlinuz-5.4.0-40-generic
memtest86+.bin vmlinuz.old
matthew@matthew-ThinkPad-T430:~$


matthew@matthew-ThinkPad-T430:~$ uname -a
Linux matthew-ThinkPad-T430 5.4.0-40-generic #44-Ubuntu SMP Tue Jun 23 00:01:04 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux


My question is why is there so much stuff in the /boot directory? It doesn't seem to be affecting the operation of the computer, but it does bug me that there could so much 'cruft' (is that what is called?) on my laptop.

Is it worth erasing all of the init, vmlinuz, System.map and config files that are not the current kernel?

The laptop runs fine, and I have used it for personal and professional tasks with almost no problem.

Thanks in advance!

Meow1234 07-09-2020 04:37 PM

You have upgraded your kernel many times, it seems. That’s why there are many kernels and initrds. If you want you can delete some but I recommend you keep at least 2 kernels with their config files and initrds. Also keep the memory test and don’t touch the grub folder. Then run sudo update-grub to remove any useless entries in the grub menu.

teckk 07-09-2020 04:39 PM

Code:

initrd.img-5.3.0-45-generic vmlinuz
initrd.img-5.3.0-46-generic vmlinuz-5.3.0-45-generic
initrd.img-5.3.0-51-generic vmlinuz-5.3.0-46-generic
initrd.img-5.3.0-53-generic vmlinuz-5.3.0-51-generic
initrd.img-5.3.0-59-generic vmlinuz-5.3.0-53-generic
initrd.img-5.3.0-61-generic vmlinuz-5.3.0-59-generic
initrd.img-5.3.0-62-generic vmlinuz-5.3.0-61-generic
initrd.img-5.4.0-40-generic vmlinuz-5.3.0-62-generic

Those are kernels. When you update, looks like the old kernels are staying put. Are you suppose to delete them manually, or with your package manager?

Meow1234 07-09-2020 04:45 PM

Oh, one more thing. DON’T DELETE YOUR CURRENT KERNEL!!! Applications and drivers might become incompatible and you’ll brick your Linux Mint install.

quickbreakfast 07-09-2020 04:50 PM

Quote:

Originally Posted by BigVig (Post 6143570)
My question is why is there so much stuff in the /boot directory?

AS the previous poster has said, the kernel appears to have been updated a few times, and each time the kernel is updated the system creates the necessary files it needs to boot the "new" kernel.

The previous poster also suggested keeping at least two kernels. Which means you have a rescue kernel if something changes and the latest kernel does not boot.

Quote:

Is it worth erasing all of the init, vmlinuz, System.map and config files that are not the current kernel?
My return question is are they taking up so much room that space on the hard drive that your data can not be retained? If not I'd leave them there.

Quote:

The laptop runs fine, and I have used it for personal and professional tasks with almost no problem.
Why would you consider fixing something which is giving you almost no problem?

By the way, when you say almost no problem, what are the problem(s)?

BigVig 07-09-2020 05:21 PM

Quote:

Originally Posted by quickbreakfast (Post 6143579)
Why would you consider fixing something which is giving you almost no problem?

By the way, when you say almost no problem, what are the problem(s)?

The short answer is just Mint being Mint. Plus, it bugs me when I look at it.

Long answer is I wanted some of the functionality to be the same as when typing in Windows10. For example, ctrl+esc opens a floating menu, not the 'start' menu, in Mint Xfce. And I have not had the time to search for the way to change that. So just little things.

Also, due to the way things are, I am working from home about 70% of the time, and I cannot take the chance of not being able to work on Windows files while at home. That is not to say I don't have a Windows pc, but it is pretty old and my linux mint laptop runs much better than the Windows laptop with nearly identical specs and only being a couple of years younger. T410 vs. T430.

I am not planning on going in and erasing most of the older files. I was just curious. Thank you for the knowledge.

mrmazda 07-10-2020 06:14 PM

Apt autoremove will erase all but the two most recent kernels, and orphaned packages.

Soadyheid 07-10-2020 07:42 PM

In Mint you can remove older kernels via the update manager (Small shield icon, bottom right panel, usually has a tick in it if everything's up to date.) Under the "View" tab at the top you can access the kernels. You get a big "Warning! Proceed with caution." windoid. Hitting "continue" will give you a list of kernels; 4.8, 4.10, etc. 5.3 is current, select that to get a list of the kernels installed plus the one active one. (The one you're using) Clicking on any of them will add a "Remove" button which will remove the kernel and associated config-version-generic, initrd.img-version-generic, System.map-vesion-generic and vmlinuz-version-generic files. It'll then run a grub update to refresh the grub menu.

I used to remove old kernels directly from the /boot directory with a knife and fork (command line, files deleted one at a time!) but doing it via the update manager is much neater and quicker and less prone to mistakes being made.

I've currently got seven kernels available which can be accessed via the advanced bit of the grub menu during boot, I'll have to clean some out but generally keep a couple of the newest ones plus the active one just in case I get boot problems and need to drop down a version for maintenance.

My :twocents:

Play Bonny!

:hattip:

Meow1234 07-11-2020 03:26 PM

I always just manually delete the kernels because it’s easier. More prone to mistakes though and one time I accidentally deleted the whole /boot folder (oops). I backed up /etc, /var, /home, /root, /usr, /bin, and /sbin. Formatted my swap partition to ext4 and put them there. Reinstalled and put them back then reformatted the swap drive.

Also there was no Linux Mint 19.4 AFAIK.


All times are GMT -5. The time now is 11:48 PM.