During a recent update I received this:

Installing: kernel-default- [error]
Installation of kernel-default- failed:
(with --nodeps --force) Error: Subprocess failed. Error: RPM failed:    installing package kernel-default- needs 147MB on the / filesystem

Abort, retry, ignore? [a/r/i] (a): i
Installing: kernel-desktop- [error]
Installation of kernel-desktop- failed:
(with --nodeps --force) Error: Subprocess failed. Error: RPM failed:    installing package kernel-desktop- needs 148MB on the / filesystem

Abort, retry, ignore? [a/r/i] (a): i
Installing: kernel-source- [error]
Installation of kernel-source- failed:
(with --nodeps --force) Error: Subprocess failed. Error: RPM failed:    installing package kernel-source- needs 432MB on the / filesystem

Which I am assuming means my / partition needs some room. So I checked the size/space:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              25G   24G  208M 100% /

How did / grow to be so huge!? Is this a common occurrence and is there a quick trick to freeing up some space? I assume that there are things I'm not using in there and I've been able to update kernels easily for the past year -- so something is accumulating.

I'd rather figure out what I free up (are old kernels kept?) instead of re-partitioning my whole drive to grow /.

  • 1
    I don't know if this will help you, but with du you can find out which directories are largest. You probably want to use --max-depth=N and --human-readable (-h) – Bernhard Jan 26 '12 at 15:15
  • @Bernhard: I don't know why I didn't think of this earlier... thanks mate. Post this as an answer and I'll accept. – n0pe Jan 26 '12 at 15:18
  • I think you already got a more extensive answer – Bernhard Jan 26 '12 at 15:40
  • Most distros don't clean up old kernels by default. It's been a while since I used an rpm distro, but I think rpm -qf /lib/modules/* might show you old kernels. – Paul Tomblin Jan 26 '12 at 18:23
  • The version smells like linux. Here is a related question: askubuntu.com/q/52728/10068 – user unknown Jan 26 '12 at 19:38

Make a backup before making any of the following changes
Do not proceed without either a backup or the willingness to lose all data.


du -sh /home

to get the size used by /home directory.
If it's sufficiently large(>=4G), /home is a good candidate to have its own partition.

Boot from either a livecd or SystemRescueCd
Depending on your partition table type (GPT or MBR), use either gdisk, parted, or fdisk.

Create a new partition
Format using your preferred fstype

mkfs.ext4 /dev/sda2
mkdir /mnt/os
mkdir /mnt/home
mount /dev/sda1 /mnt/os    # mount your OS, now all on /
mount /dev/sda2 /mnt/home  # mount newly formatted partion
cp -a /mnt/os/home/* /mnt/home/ # copy current /home data to new partition
cd /mnt/os/home                 # remove old home data, leaving mountpoint
rm -rf .

Now you need to cd to /mnt/os/etc and edit fstab and add

/dev/sda2 /home ext4 defaults 0 1

There's more than one way to do this. Depending on your experience and skill you could mount by UUID (preferred, but not necessary).

One could do the same for other filesystems, if you've installed a lot of google tools, or eclipse, they get intalled in /opt and it is also a good candidate to be in its own partition.

If you get to the point where you have many partitions, you'll want to switch to GPT partitioning and/or LVM. If so, re-ask the question

  • Thanks for the well written answer. /home is already in its own (200G) partition so that wasn't the issue. You're right though, it turned out that /opt had a fair amount of bulk. I removed some applications and freed around 10G. – n0pe Jan 26 '12 at 15:42
  • you're welcome, I'm glad you solved your problem. my /usr is >6G and Arch complains with /usr on its own fs. This can be a real pain :( – bsd Jan 26 '12 at 16:17

Whether a 25GB system partition is huge or tiny depends on how much software you have installed (is this a single-purpose server or a shared workstation with a lot of domain-specific software?) and on how much data is lurking in /var (do you have 200 users' mail in that partition?).

Good places to look for accumulated cruft include:

  • /tmp: any old, large files in there? You may want to make /tmp a tmpfs filesystem, so that it doesn't consume disk space and starts afresh at every boot.
  • /var/tmp: any huge files in there?
  • /var/log: did a runaway service produce gigabytes of logs?
  • /var/cache: is there a large cache that isn't being purged properly? Especially check where your distribution puts downloaded packages (e.g. /var/cache/apt/archives/ on APT-based distributions).
  • Do you have any unused software installed? That's usually not much, but you may be able to find library versions that aren't used by any executable still on your system. Programs like deborphan (on Debian and derivatives) can help. Check if you're encumbered by old kernels, too.

If you can't find what to delete, you can at least see what's taking up space with du or a graphical alternative such as Baobab (a Gnome utility).

If you have space left elsewhere, you can move some large chunk of /usr or /var (or /opt or /srv if relevant) to a different partition and make a symbolic link.

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.