Ubuntu is complaining that my root file system is nearly full, but when I use baobab
(aka "Disk Usage Analyser") or du -h
it summarises the usage of all the other mounted file systems as well.
How can I exclude the other file systems which are mounted in assorted subdirectories?
baobab: If you want to use baobab, this is possible by mounting the root filesystem in another place and analysing that. This way, other filesystems will not be mounted in the new root mount and any files hidden by mounts under
/
will be uncovered and counted in your analysis.Assuming your root filesystem is on
sda1
(df
will tell you which device it is):and then tidy up when you're done:
Alternatively you could unmount said file systems manually. You can also scan just your home folder, because it will most likely contain the source of the excessive disk space usage.
du has two options which are able to prevent counting other filesystems:
Thus,
would ignore all other mounted filesystems or
would ignore all files in
/media
where most filesystems are mounted.If you're using
du
, sorting so that the biggest things appear at the bottom of the list can help decipher the output. eg:Depending on the type of filesystem you might not be allowed to mount the root filesystem on a mount point under
/
. You'll get something similar to this:Mounting read only (
-o ro
) might help. If that fails, use a bind mount:Once mounted, use whatever tool to analyse the disk usage, ie
du -sh * | sort -h
This bug report explains how it is possible to configure baobab to ignore directories. Unfortunately you cannot do it inside the app itself, but you have to use
dconf-editor
and openorg.gnome.baobab.preferences
. Here you will find an itemexcluded-uris
; change this to['file:///path/to/ignore']
(worked with single quotes for me).Baobab attempts to give you control of the devices/partitions that you scan -- go to
Edit->Preferences
. Typically, you only want to scan the device at Mount Point/
. This doesn't recognize all types of links/mounts/bindings though, so ultimately Baobab may still produce confusing results if you have a non-trivial configuration.For
du
, the following shell function calleddutop
will display the top-level of the specified folder (or the current folder). With this, you can probe sub-folders one at a time.This will likely report inconsequential "Permission denied" errors if you apply it to
/
, but you could resolve those with somethink like the following, which will ask for your password (if you haven't recently provided it).For large folders, these may take a while. They won't report any incremental status because the sort operation is buffering all of the intermediate results. It's fine to abort with Ctrl-C if you get tired of waiting.