[SOLVED] Why is my /boot directory so very crowded?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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)?
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.
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,675
Rep:
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.