Skip to content

Storage and Disk Usage

Disk fills up in three predictable places:

Location Grows because
User home directories Data copies, R libraries per R version,1 Python venvs, renv caches,2 core dumps
Connect DataDir Bundles (kept forever by default; BundleRetentionLimit defaults to 0, meaning unlimited),3 runtime caches, rendered output4
Package Manager DataDir Cached package files and binaries, Git build artifacts5

Find the big home directories

Check filesystems first:

df -hT

Rank users (adjust the path to where homes are mounted):

sudo du -sh /home/* 2>/dev/null | sort -hr | head -20

Find large individual files:

sudo find /home -xdev -type f -size +1G -printf '%s\t%u\t%p\n' 2>/dev/null | sort -nr | head -20 | numfmt --field=1 --to=iec

%u prints the owner, which matters when users share directories. -xdev stays on one filesystem.

Inside one home directory

Drill into one user:

sudo du -ah /home/<username> 2>/dev/null | sort -hr | head -20

Common culprits inside a home directory:

sudo du -sh /home/<username>/{R,.cache/R/renv,.local/lib,.vscode-server,.positron-server} 2>/dev/null

.cache/R/renv is the current default renv cache location on Linux (RENV_PATHS_ROOT overrides it).2 .vscode-server and .positron-server are the default per-user data directories for Workbench's VS Code and Positron Pro sessions.89 .local/lib holds pip install --user packages.10

The posit-host script prints the command that ranks home directories by size. It needs root, so the script leaves it for your sudo administrator.

Reading reports in R

To chart usage, read the du output into R and split the size and unit:

library(dplyr)
library(tidyr)

usage <- read.table("home-usage.txt", col.names = c("size", "user_dir"), skip = 1) |>
  mutate(user = basename(user_dir)) |>
  extract(size, into = c("amount", "unit"), regex = "([0-9.]+)([KMGT]?)", convert = TRUE) |>
  mutate(gb = amount * c(K = 1e-6, M = 1e-3, G = 1, T = 1e3)[unit]) |>
  arrange(desc(gb))

Product data directories

sudo du -sh /var/lib/rstudio-connect/* 2>/dev/null | sort -hr
sudo du -sh /var/lib/rstudio-pm/* 2>/dev/null | sort -hr

The posit-workbench, posit-connect, and posit-pm scripts report the free space for each product's data directory and print the command that measures its size.

Reclaiming space:

Product Action
Connect Set Applications.BundleRetentionLimit3 (consider your retention SOP first); remove unused content; clear runtime caches (rebuilt on demand)
Package Manager rspm evict --type=clear evicts cached files that will be re-downloaded on demand;7 relocate or alert on individual [FileStorage] classes via [StorageAlerts]6
Workbench Ask users to remove old R libraries for retired R versions1 and stale venvs; set quotas on the home filesystem

Never delete files inside a product's data directory by hand. Use the product's own tools.45

Quotas

Shared home directories without quotas eventually fill up and take everyone's sessions down at once. Use filesystem or NFS server quotas (XFS project quotas,11 NetApp qtree/tree quotas,12 Azure Files share quotas13) and warn users at a soft limit.