How to Increase the Size of the /tmp Folder on Linux

If Linux reports that /tmp is full, do not resize it blindly. First check what filesystem actually backs the directory. If /tmp is a tmpfs mount, you can raise its size limit immediately with a remount and make that limit persistent in /etc/fstab. If it is part of an ext4, XFS, Btrfs, or other disk-backed filesystem, the size= tmpfs option does not apply.

Check how /tmp is mounted

Open a terminal and run:

findmnt -T /tmp -o TARGET,SOURCE,FSTYPE,OPTIONS
df -hT /tmp

The findmnt command identifies the filesystem that contains /tmp, while df shows its size and current usage. The upstream findmnt documentation recommends using the target option to resolve the filesystem for a path.

If FSTYPE is tmpfs, continue with the steps below. If it is something such as ext4, xfs, or btrfs, skip to the disk-backed section.

Linux terminal showing findmnt and df output for a tmpfs mounted at /tmp with a 1 GiB size limit
Confirm that /tmp is actually a tmpfs mount before changing a tmpfs size limit.

Temporarily increase a tmpfs /tmp

You do not need to unmount /tmp. Linux tmpfs supports changing its maximum size during a remount without discarding the files already stored there. For example, to raise the limit to 5 GiB, run:

sudo mount -o remount,size=5G /tmp

Then verify the result:

df -h /tmp

The Linux kernel's tmpfs documentation states that the size= limit can be changed on remount. A value such as 5G is a capacity ceiling, not 5 GiB of RAM reserved immediately. tmpfs consumes memory as files are stored and can use swap when swap is available.

Do not set an unnecessarily huge limit. A workload that fills a large tmpfs can create severe memory pressure. Also, a remount like this is temporary: the original boot configuration returns after a reboot unless you change the persistent mount settings.

Linux terminal remounting /tmp tmpfs with size=5G and showing 5.0G capacity in df output
A remount changes the live tmpfs size limit without unmounting /tmp.

Make the larger /tmp size persistent

Only use this method after confirming that /tmp is meant to be tmpfs. Back up /etc/fstab first:

sudo cp /etc/fstab /etc/fstab.backup

Open the file with your preferred root-capable editor, for example:

sudoedit /etc/fstab

If an existing /tmp tmpfs line is present, keep its current security and compatibility options and change only its size= value. If your system uses systemd's default tmpfs-backed /tmp and has no /tmp entry in fstab, systemd documents that an /etc/fstab entry can be used to change the tmpfs mount options. A typical example is:

tmpfs /tmp tmpfs rw,nosuid,nodev,size=5G,mode=1777 0 0

The mode=1777 setting keeps the normal world-writable temporary-directory permissions with the sticky bit. Do not add options such as noexec just for resizing; changing unrelated mount behavior can break software that expects the existing configuration. See systemd's API file systems guidance and the upstream fstab documentation.

Text editor showing an /etc/fstab tmpfs entry for /tmp with size=5G and mode=1777
For a persistent limit, set size= in the existing or intended tmpfs configuration for /tmp.

On a systemd-based distribution, reload generated units after editing fstab:

sudo systemctl daemon-reload

If /tmp is already mounted as tmpfs, you can apply the new fstab options immediately with:

sudo mount -o remount /tmp

Otherwise, reboot at a convenient time. Afterward, check both the mount options and capacity:

findmnt -T /tmp -o TARGET,FSTYPE,OPTIONS
df -h /tmp
Linux terminal verifying /tmp as tmpfs with size=5G and 5.0G total capacity
Verify the filesystem type, mount options, and reported capacity after the change.

What if /tmp is not tmpfs?

If findmnt shows that /tmp lives on your root filesystem or another disk-backed filesystem, there is no independent tmpfs limit to enlarge. You must free space or expand the underlying filesystem, partition, or logical volume. Another option is to point a specific program at a larger temporary directory if it honors TMPDIR:

mkdir -p "$HOME/tmp"
chmod 700 "$HOME/tmp"
TMPDIR="$HOME/tmp" your-command

systemd's temporary-directory guidance notes that software should use $TMPDIR when it is set and that /var/tmp is generally better suited to larger temporary data that should survive a reboot.

If you still get “No space left on device”

Check inode usage as well as byte usage:

df -h /tmp
df -i /tmp

A filesystem can run out of inodes even when it still has free bytes. Also investigate which application is producing the temporary data rather than repeatedly enlarging /tmp. Resizing is appropriate when the normal workload legitimately needs more temporary capacity, but uncontrolled growth is usually better fixed at its source.

Leave a Comment

How to Record Speaker Output on Linux with Audacity

How to Record Speaker Output on Linux with Audacity

Capture Linux desktop audio in Audacity by routing its recording stream to your output device’s monitor source. Follow PulseAudio and PipeWire steps, export tips, and fixes for silent tracks.

How to Use Dropbox on Linux: Install and Sync Your Files

How to Use Dropbox on Linux: Install and Sync Your Files

Install Dropbox on Linux from the official package, sign in, sync a local folder, manage selective sync, and check status from the command line.

How to Install Inkscape on Linux: Ubuntu, Fedora, Arch, and More

How to Install Inkscape on Linux: Ubuntu, Fedora, Arch, and More

Install Inkscape from your Linux distribution’s repositories, the Ubuntu stable PPA, Snap, or Flathub, with current commands and notes for choosing a package source.

How to Find and Remove Duplicate Files on Linux With FSlint

How to Find and Remove Duplicate Files on Linux With FSlint

Use FSlint to scan selected Linux folders, review duplicate groups, and safely delete redundant files or learn when hard-link merging is appropriate.

How to Install SABnzbd on Linux and Configure It

How to Install SABnzbd on Linux and Configure It

Install SABnzbd on Ubuntu or Debian, or run it in Docker on another Linux host. Then open the web interface and configure your provider and download folders.

How to Install the Paper GTK Theme on Linux

How to Install the Paper GTK Theme on Linux

Install the Paper GTK theme from supported Linux repositories, enable it for GTK apps in GNOME Tweaks, and see what the legacy theme can and cannot change.

How to Install and Set Up Plex on OpenMediaVault with Compose

How to Install and Set Up Plex on OpenMediaVault with Compose

The old OpenMediaVault Plex plugin is archived. Set up Plex on OMV 8 with OMV-Extras, the Compose plugin, persistent storage, and Plex’s official container.

How to Clean and Speed Up Ubuntu Safely

How to Clean and Speed Up Ubuntu Safely

Clean and speed up Ubuntu with safe APT cleanup, storage checks, and startup controls that help free space and troubleshoot a sluggish desktop.

How to Install the Hiri Email Client on Linux

How to Install the Hiri Email Client on Linux

Install Hiri on Linux with its Snap package or official tarball, add a desktop launcher, and check supported accounts plus a warning about Hiri’s old Snap release.

How to Get System Specifications for a Linux PC

How to Get System Specifications for a Linux PC

Use Fastfetch and built-in Linux commands to check your distro, kernel, CPU, memory, graphics, storage, and connected devices, then save a clear report.