Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fedemengo/0114db978915f24b07ae70d80aac8aec to your computer and use it in GitHub Desktop.
Save fedemengo/0114db978915f24b07ae70d80aac8aec to your computer and use it in GitHub Desktop.
Not enough space on /tmp for Matlab install? No problem.

Problem scenario:


  1. stupid Matlab installer wants to download several gigabytes into your /tmp directory.
  2. You don't have "several gigabytes" available on your root partition (where /tmp is). The installer warns you and/or fails.
  3. You DO have available disk space, but on some other disk/partition/wherever.

Solution:


Run the command inside Linux filesystem namespace. For example, create a folder in $HOME such as mkdir /home/USER/tmp`

sudo unshare --mount -- /bin/bash -c "mount -o bind,noexec,nosuid,nodev /home/USER/tmp /tmp && sudo -u USER ./matlab_VERSION_glnxa64/install"

So now the installer process runs as usual, but all writes into /tmp are actually written into /foobar/tmp, which has lots and lots of space available. The installer succeeds. Hooray!

More info

man namespaces man unshare

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment