I am not so into Linux and I have the following problem related to the fact that my /boot partition seems to be full and it seems to cause a problem trying to install a program.

I am using Ubuntu Ubuntu 16.04.1 LTS

I try to explain in detail my doubts because I am not so into system engineering (I am a software developer).

1) Performing the lsblk statment lists information about all available or the specified block devices.

Empirically I think that it should show the list of all the partitions/mounted disks or something like this. What exactly means with the terms block devices?

So if I perform this statement on my Ubuntu system I obtain:

root@MyServer-VPS:~# lsblk
fd0              2:0    1    4K  0 disk
sda              8:0    0   20G  0 disk
├─sda1           8:1    0  476M  0 part /boot
├─sda2           8:2    0    1K  0 part
├─sda3           8:3    0   10G  0 part
│ └─vg-lv_root 252:0    0 18.6G  0 lvm  /
└─sda5           8:5    0  9.5G  0 part
  ├─vg-lv_root 252:0    0 18.6G  0 lvm  /
  └─vg-lv_swap 252:1    0  952M  0 lvm  [SWAP]
sr0             11:0    1 1024M  0 rom

So what is the difference between disk, part (it should be a partition of the parent disk), lvm and rom?

A specific partition is boot, this one:

sda1           8:1    0  476M  0 part /boot

that is a sda disk partition.

From what I know it should contains the Linux Kernel downloaded versions. Is it?

Ok, the mount point is /boot so I think that it is the /boot directory into my system (is it?), this is the content:

root@MyServer-VPS:/boot# ls
abi-4.4.0-21-generic  config-4.4.0-21-generic  grub                         System.map-4.4.0-21-generic  vmlinuz-4.4.0-21-generic
abi-4.4.0-31-generic  config-4.4.0-31-generic  initrd.img-4.4.0-21-generic  System.map-4.4.0-31-generic  vmlinuz-4.4.0-31-generic
abi-4.4.0-34-generic  config-4.4.0-34-generic  initrd.img-4.4.0-31-generic  System.map-4.4.0-34-generic  vmlinuz-4.4.0-34-generic
abi-4.4.0-38-generic  config-4.4.0-38-generic  initrd.img-4.4.0-34-generic  System.map-4.4.0-38-generic  vmlinuz-4.4.0-38-generic
abi-4.4.0-42-generic  config-4.4.0-42-generic  initrd.img-4.4.0-38-generic  System.map-4.4.0-42-generic  vmlinuz-4.4.0-42-generic
abi-4.4.0-45-generic  config-4.4.0-45-generic  initrd.img-4.4.0-42-generic  System.map-4.4.0-45-generic  vmlinuz-4.4.0-45-generic
abi-4.4.0-47-generic  config-4.4.0-47-generic  initrd.img-4.4.0-45-generic  System.map-4.4.0-47-generic  vmlinuz-4.4.0-47-generic
abi-4.4.0-51-generic  config-4.4.0-51-generic  initrd.img-4.4.0-47-generic  System.map-4.4.0-51-generic  vmlinuz-4.4.0-51-generic
abi-4.4.0-53-generic  config-4.4.0-53-generic  initrd.img-4.4.0-51-generic  System.map-4.4.0-53-generic  vmlinuz-4.4.0-53-generic
abi-4.4.0-57-generic  config-4.4.0-57-generic  initrd.img-4.4.0-53-generic  System.map-4.4.0-57-generic  vmlinuz-4.4.0-57-generic
abi-4.4.0-59-generic  config-4.4.0-59-generic  lost+found                   System.map-4.4.0-59-generic  vmlinuz-4.4.0-59-generic

So what these contents exactly represents? Are the differents Linux kernel versions downloaded on this system?

What are the difference between the abi-, config-, initrd.img-, System.map- and vmlinuz-4 files?

How can I detect the used kernel version?

2) Performing the df -h statment I obtain this output:

root@MyServer-VPS:~# df -h
Filesystem              Size  Used Avail Use% Mounted on
udev                    477M     0  477M   0% /dev
tmpfs                   100M   16M   84M  16% /run
/dev/mapper/vg-lv_root   19G   12G  6.3G  64% /
tmpfs                   497M     0  497M   0% /dev/shm
tmpfs                   5.0M     0  5.0M   0% /run/lock
tmpfs                   497M     0  497M   0% /sys/fs/cgroup
/dev/sda1               461M  458M     0 100% /boot
tmpfs                   100M     0  100M   0% /run/user/0

In particular I have that:

/dev/sda1               461M  458M     0 100% /boot

So it means that my /boot partition is completely full?

My problem is: can I safely delete all the old kernel version (the not used one) to free up space in the /boot ?

How can I do it?

  • Check out purge-old-kernels. – phk Feb 4 '17 at 17:39

These are many questions in one:

What exactly means with the terms block devices?

Block devices are special files that provide buffered access to hardware devices and a layer of abstraction to the operating system.

So what is the difference between disk, part (it should be a partition of the parent disk), lvm and rom?

disk and part as you guessed are your physical disks or drives and the partitions on them. lvm is short for Logical Volume Manager. It groups multiple partitions into a single logical volume to better manage disk space. rom is your cd-rom or dvd-rom drive named "sr0".

How can I detect the used kernel version?

You can detect your current kernel in use by typing into terminal:

uname -a

So it means that my /boot partition is completly full?

Indeed your boot partition is completely full, which will prevent ubuntu installing new versions of the kernel.

My problem is: can I saftly deetect delete all the old kernel version (the not used one) to free up space in the /boot ?

You can try to remove old packages from the system which should free up old kernels from the boot partitions. Type into the terminal this command, give the admin password, then answer "y" to remove old packages:

sudo apt autoremove

This will safely remove old kernel versions and update your boot options and initram-fs also.


If apt is not working try, dpkg -l 'linux-[ihs]*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\([-0-9]*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo dpkg -P

This purge every Kernel with headers besides your current running Kernel. If you are unsure you can look first with dpkg -l 'linux-[ihs]*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\([-0-9]*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' which packages will be purged


I'm sure The Ubuntu Way is to use the GUI package manager, but I'd just do it on the command line.

First, find out exactly what package names are installed -

dpkg -l | grep linux-image

The figure out what kernel is actually running

uname -a

Then use

sudo apt-get autoremove PackageName

Where PackageName is the name of the kernel image package you want to get rid of - it might be something like linux-image-4.4.0-21-generic. This will remove the kernel image (your /boot directory files), the /lib/modules/kernel_version directory structure, the kernel-headers package, etc. reconfigure grub as needed and so on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.