Skip to main content
To KTH's start page To KTH's start page

Disk quota in AFS

Most users' files at KTH are stored on network file systems. Typically, the disk space available is limited by quotas. There are many tools available to see what your quota is, and to find files that are taking up space.


AFS (Andrew File System) is used for home directories on many workstations and servers at KTH, in particular on Unix-like operating systems—Ubuntu and RedHat Linux, Solaris, macOS, etc. The home directories' AFS volumes use a disk quota. Students' home directories are typically limited to 3GiB, but you can receive more disk space if needed, as long as it is for study-related usage.

To see how much space you are using, open a terminal window and use

fs lq
AFS quota
Disk Usage Analyzer (Baobab)

What is using the space?


If your quota is near the limit, you can use Ubuntu's Disk Usage Analyzer (under Applications and then Accessories) to see what is taking up space. Once it starts, press "Scan Home" to analyze your home directory.

Note that configuration files are often hidden, or in hidden directories—that is, the file name has a leading period/full stop. To show hidden files, use Ctrl-H in the file manager, or ls -a in a terminal.

Can't log in?

If the grapical environment (Gnome) does not start, you can use a console login to clear some space. See the FAQ  for more information on console login. You can then use command-line tools to check disk usage. These tools can also be used when logged in to a shell server with SSH . See the example below for more information.


To get an overview for all storage locations, open

(apple menu), About This Mac, “Storage” tab and then “Manage…”

The left column will show different storage locations. For each, you can sort by size, “kind” (data type), etc. and remove files if needed.

You can also use command-line tools, see the example below.

.OldFiles does not count

Note that the directory .OldFiles does not count as part of your quota. It actually links to a backup directory, a copy of your home directory from yesterday, which is a separate AFS volume. (You can't modify the files there, and it will be updated again when the daily backup is made, sometime during the night.)

Need more space?

Full quotas are automatically increased for active accounts, but the increase is only a few percent so that logging in won't be blocked. But if the space is filled by e.g. a browser cache, you will likely fill up the quota again next time you log in. Also, the quota scans only run once every night.


If course work requires a lot of space, check with your course leader. Sometimes, large files can be stored in course directories so that students don't need copies in their home directory. If each student must store large files, or if an application requires a lot of space, the course leader can request additional space for all who are registered on the course. However, late registrants may have been left out; if you think this applies to you, contact your course leader. If they have already requested larger quotas, contact IT support, but please be sure to refer to their ticket ID.


Employees can get larger quotas, although their accounts are usually created with the default quota. However, if a particular project (or some other purpose) requires a lot of disk space, we may also suggest creating a separate AFS volume. This is more effective for the backend servers, and their backups, but can also make it easier to share data with others working on the same project.

Employees with a personal workstation can also store temporary files on local disk. These files are NOT BACKED UP, so this should be used with caution. Contact IT Support for more information.

Command-line tools (example)

You can use du (see manual site for du(1) (external link) ) with some options to show MiB, then sort by size. But note that it is not AFS aware—it won't recognize AFS mountpoints (like OldFiles) as separate filesystems. To check all directories (trailing /):

$ du -sm */ .[a-z]*/ | sort -n | tail
147     .mozilla/
197     .vscode/
532     .OLD_gnome_20190201T165603/
903     .matlab/
987     .local/
1408    .config/
1712    .ros/
1826    Library_kth_20190617 
2276    .cache/
4418    OldFiles/

OldFiles can be ignored, see above.

The .OLD_gnome_xxx directory has been created by gnome-cleanup ( see FAQ ). But as it is more than a year old, it can probably be deleted using rm. You can use the -r (--recursive) option to delete entire directories—but make sure you do not accidentally delete too much! There is a huge difference between removing a* (all files starting with a) and a * (the file a, then all other files).

The Library_kth_2019… directory was used for settings in an older version of macOS. Old Library directories were renamed as the macOS used in computer classrooms after 2019 was no longer compatible, and migrating the settings on login would have taken a very long time. If you no longer need the old settings, the directory can be removed.

To see what's in other large directories:

$ du -sm .config/* .matlab/* .ros/* .cache/* | sort -n | tail -12
11      .cache/thunderbird
183     .matlab/R2020a
231     .matlab/R2018a
248     .matlab/R2015b
252     .matlab/R2017a
268     .cache/google-chrome
520     .config/google-chrome
706     .cache/pip
783     .config/Code
967     .local/lib
1130    .cache/mozilla
1711    .ros/log

The old Matlab directories can be removed. As of 2020–2021 only R2020A is available in the standard environment.

The Python pip cache can be cleared, and if you are no longer using personal python packages (sub directories to ~/.local/lib), you may be able to remove them as well.

The browser caches for Firefox (~/.cache/mozilla) and Google Chrome can be cleared. However, if you delete the files the browser may still try to use the cached data, showing broken web pages. It is better to clear from within the browser:

  • Firefox: Edit » Preferences » Privacy & Security » Cookies and Site Data » Clear Data...
  • Google Chrome: Ctrl+Shift+Del will open Clear browsing data. Be very careful to make sure only Cached images and files are marked, using Time range: All time. Click Clear data. You do not want to delete your history and saved passwords!

The other directories, such as logs from ROS Melodic, or Visual Studio Code's ~/.vscode and ~/.config/Code, may or may not be needed—you will need to decide for yourself.