What is the safest way to clean up /boot partition?

1

That's because you're looking in the wrong direction. To see your disk partition information, use sudo fdisk -l /dev/sda.

Rather than risking fiddling with disk partitions (although I'll get to that), I suggest that you find out what is using 99% of /boot.

See the question and my answer at this post

And now, how to risk destroying your disk by "adjusting" partitions.

Step 1.

Make absolutely sure you have a backup that you can restore.

Step 2.

Download and burn to a USB key a "GParted Live" distribution. Google will help you find one.

Step 3.

Shutdown your system the official way, not by pulling the plug or the vulcan nerve pinch. This will let the system get the filesystems on the disk into stable, up-to-date states.

Step 4.

Boot from the GParted Live USB key

Step 5.

Tell GParted which disk you want to "fix". Once it's selected, GParted will show you a picture of the disk layout.

Step...

0 0
2

First check your kernel version, so you won't delete the in-use kernel image, running:

uname -r

Now run this command for a list of installed kernels:

sudo dpkg --list 'linux-image*'

and delete the kernels you don't want/need anymore by running this:

sudo apt-get remove linux-image-VERSION

Replace VERSION with the version of the kernel you want to remove.

When you're done removing the older kernels, you can run this to remove ever packages you won't need anymore:

sudo apt-get autoremove

And finally you can run this to update grub kernel list:

sudo update-grub

Ouput from df -h

Filesystem Size Used Avail Use% Mounted on /dev/sda1 5.5G 4.4G 786M 86% / udev 996M 4.0K 996M 1% /dev tmpfs 402M 880K 401M 1% /run none 5.0M 0 5.0M 0% /run/lock none 1004M 156K 1004M 1% /run/shm /dev/sdb1 30G 1.4G 27G 5% /home /dev/sdc1 299G 31G 268G 11%...
0 0
3
Mar 14, 2008

I've got Centos 4 and I'm wondering what's the best way to cleanup my /boot partition?

Tried to do a yum update tonight and it included kernel, amongst other updates that belonged there so it stopped. I've googled around for commands to run and whatnot, but no go... or I just can't find it... if I had to clean it up I have an idea already about what to do, but I want to ask for advice first to see if there's an easier way.

so, how do people here clean up that partition?

Raid Disk Partition Errorc :: Warning: Invalid Flag 0x0000 Of Partition Table Resize Partition/create New Partition/lvm RPM Clean Up /tmp Clean? How To Clean All IP From Iptables Trojan :: How To Clean Server? Clean Up Your Dedicated Server Best Way To Clean A Hacked Site? How To Clean Mail Inbox Clean Inboxs From Spam Clean Memory, Linux How To Be Sure That IP Addresses Assigned From Host Are 'clean' How To Install Gcc On A Clean Slackware Server Clean Old Accounts...
0 0
4

NOTE: this is only if you can't use apt to clean up due to a 100% full /boot

If apt-get isn't functioning because your /boot is at 100%, you'll need to clean out /boot first. This likely has caught a kernel upgrade in a partial install which means apt has pretty much froze up entirely and will keep telling you to run apt-get -f install even though that command keeps failing.

Get the list of kernel images and determine what you can do without. This command will show installed kernels except the currently running one sudo dpkg --list 'linux-image*'|awk '{ if ($1=="ii") print $2}'|grep -v `uname -r`. Note the two newest versions in the list. You don't need to worry about the running one as it isn't listed here. You can check that with uname -r.

Craft a command to delete all files in /boot for kernels that don't matter to you using brace expansion to keep you sane. Remember to exclude the current and two newest kernel images. Example: sudo rm -rf...

0 0
5

Your boot partition may contain older images of Linux kernals - they can be removed, and there is a procedure to do this outlined in What is the safest way to clean up /boot partition?

Update 2014-06-28

It looks as though you will need to increase the size of your /boot partition. This is not terribly fast, and of course if something goes wrong you will be glad you made a backup!

It may actually be / faster / easier / better all around / to reinstall Ubuntu.

You cannot resize partitions while you are using them, and Ubuntu is using them right now. So, you will need to boot from a live USB, and choose 'try Ubuntu'. When that is running, you open a terminal window and enter

sudo apt-get gparted

This will load the partition manager onto the USB. You can then run the partition manager to resize the partitions of you hard disk.

You want to make your /boot partition (/dev/sda1) larger - to do this you need to have some space available...

0 0
6

if you can’t use apt to clean up due to a 100% full /boot

From: http://askubuntu.com/questions/345588/what-is-the-safest-way-to-clean-up-boot-partition
The solution that worked from me.

NOTE: this is only if you can’t use apt to clean up due to a 100% full /boot

If apt-get isn’t functioning because your /boot is at 100%, you’ll need to clean out /boot first. This likely has caught a kernel upgrade in a partial install which means apt has pretty much froze up entirely and will keep telling you to run apt-get -f install even though that command keeps failing.

Get the list of kernel images and determine what you can do without. This command will show installed kernels except the currently running one sudo dpkg –list ‘linux-image*’|awk ‘{ if ($1==”ii”) print $2}’|grep -v `uname -r`. Note the two newest versions in the list. You don’t need to worry about the running one as it isn’t listed here. You can check that with uname...

0 0
7

Sometimes you forget to clean up the old kernels and your boot partition full. That may cause you trouble when upgrading new kernel. Here is how you can clean up the boot partition when apt-get keeps telling you to "-f install" (that command keeps failing):

1. Check your current installed kernels:

The running one:

$ uname -r

All kernels instlled:

$ sudo dpkg --list 'linux-image*'

Note the two newest versions in the list and the one in use (for example 68, 69, 70).

2. Remove the unused kernels (remember to exclude the current and two newest kernel images), for example:

$ sudo rm -rf /boot/*-3.2.0-{23,45,49,51,52,53,54,55}-*

3. Run 'sudo apt-get -f install' to fix the partial install

4. Finally, run 'sudo apt-get autoremove' to clear out the old kernel image packages.

Note: to see available space on the boot partition:

$ sudo df -h

Reference:...

0 0
8
Mar 8, 2010

After the recently 2.6.31-20 kernel update, my 100MB /boot partition is starting to lack space. When I examine it, I have a lot of old kernel files all the way back to 2.6.31-14.

Is it safe to just delete all the kernel files except for the 2.6.31-20 ones?

The only files and folders on that partition is just the grub folder and all the kernel files anyway.



ADVERTISEMENT

Mar 2, 2011

Using gparted as shown on the partitions in the image:

sda1 is Windows 7
sda2 is swap
sda3 is root
sda4 is home

I'd like to move sda4 to the end of the drive, thus shrinking it by 20GB, and shunt every other partition along to make an extra 20GB for sda1 at the start of the drive, and expand this partition into the 20GB of space I created.

When I start moving and shrinking sda4 (before I apply and execute the command) I get a warning saying that it is very dangerous to move a boot partition...

0 0
9

why does Ubuntu keep doing this?

Short version: safety.

Long version: the kernel is the most important part of an OS. It handles communication between hardware and software, among other things that I won't cover in detail here.

Changing the kernel might give you problems. Most of the time everything goes well, but the one time that something is screwed up you do want to have it working again quickly.

Say you are researching materials for your thesis and the deadline is approaching... suddenly a kernel upgrade breaks your Wi-Fi. Do you prefer to postpone your graduation for saving 150 MB of disk space?

I guess no, you don't want that. Here's why you reboot, select the previous kernel and go on with your work. Things like this don't happen often, but they may happen rarely and on some specific hardware, maybe only for one kernel release.

I actually experienced seeing my parents' PC not accepting any keyboard input after a kernel upgrade (a...

0 0
10

In the interest of preserving the information in case the TechNet article moves, here is how to "activate" the Microsoft disk cleanup utility on server 2008 or 2008 R2:

Windows Server 2008 R2

64-bit

C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe

Windows Server 2008 R2

64-bit

C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui

Windows Server 2008

64-bit

C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.0.6001.18000_en-us_b9f50b71510436f2\cleanmgr.exe.mui

Windows Server 2008

64-bit

C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.0.6001.18000_none_c962d1e515e94269\cleanmgr.exe.mui

Windows Server...

0 0
11

I am no expert, but I have used the following method numerous times, and it has worked just fine for me.
Each time a new kernel is distributed, the /boot directory gets filled up a little more by housing the new kernel. If you run the command

$ ls /boot
it will list many files with similar names, but with different version numbers. Some of the files in my /boot right now are:

initrd.img-3.13.0-49-generic vmlinuz-3.13.0-49-generic initrd.img-3.13.0-52-generic vmlinuz-3.13.0-52-generic initrd.img-3.13.0-53-generic vmlinuz-3.13.0-53-generic

So currently there are 3 different kernels on my PC, numbers 49, 52, and 53.
Now I run the command:

$ uname -r 3.13.0-53-generic

which confirms that I am using the latest version 53. I need to keep two or three versions, but would remove older ones. Suppose I decide to remove version 49. I find the exact name of the package by this command:

dpkg --get-selections | grep linux-image...
0 0