1

I have run out of inodes (IUse% = 100%) and repeatedly running the command from this answer, I narrowed the culprit to /usr/src, specifically linux-headers*. From the same post but different answer, I want to remove said linux-headers but am confused about which are the oldest (and not used so can safely be deleted).

The contents of /usr/src/linux-headers* is:

linux-headers-3.13.0-24
linux-headers-3.13.0-24-generic
linux-headers-3.13.0-33
linux-headers-3.13.0-33-generic
linux-headers-3.13.0-34
linux-headers-3.13.0-34-generic
linux-headers-3.13.0-37
linux-headers-3.13.0-37-generic
linux-headers-3.13.0-39
linux-headers-3.13.0-39-generic
<snip>
linux-headers-3.13.0-112
linux-headers-3.13.0-112-generic
linux-headers-3.13.0-113
linux-headers-3.13.0-113-generic

From uname -r gives 3.13.0-34-generic.

So which can I delete? If I am running -34 then -37 through to -113 are newer and so cannot be deleted.

Now at AskUbuntu.

Community
  • 1
  • 1
Bernmeister
  • 267
  • 9
  • 17
  • Off-topic here. My recommendation might be to reinstall your Linux distribution on some larger system disk partition. And you are wrong in believing that `/usr/src` is the culprit. Perhaps running `apt-get clean` might be enough. – Basile Starynkevitch Mar 31 '17 at 05:46
  • https://superuser.com/ or http://unix.stackexchange.com/ or http://askubuntu.com/ are better places to ask ; but you need to give a lot more details: what distribution, what packages, output of both `df -h` & `df -i`, etc.... And don't delete files in `/usr/src` but do remove some old packages. – Basile Starynkevitch Mar 31 '17 at 05:48

1 Answers1

2

You can avoid removal if you move the src directory to another mounted volume which has more space, and create a symbolic link /usr/src which will point to the new location.

Typically, the /usr/src is only required to be able to build some SW which has dependencies from your kernel, or to rebuild the kernel itself. Also, if this is not your case, then you can remove /usr/src at all. Beforewards check that you don't boot the built kernel from this tree by a chance.

UPDATED. If you use all the time the same kernel version (3.13.0-34-generic), you can harmfree remove headers of all other versions. Always remember about backups however!

dmi
  • 1,424
  • 1
  • 9
  • 9