Site Feed

Tuesday, October 2, 2018

Create a Symlink as a Workaround for Partition Full Error

Sometimes, a mounted partition does not have enough space, and it may take time to expand the LVM volume, if there is not currently enough physical space available, and a separate team handles storage.

As a quick workaround, it is fairly common to use a symbolic link, or as sysadmins affectionately call it, a symlimk.

Let's say an app wants to install under /opt, and you are out of space in /opt, but have plenty of space in /app.  You can use a symlink to trick the system into thinking that it is using /opt, when in fact it is using /app/opt.

I like to perform a directory move and symlink creation at the same time.

      mv /opt /app/ && ln -s /app/opt /opt

Results of ls -l, should give something like this:

     lrwxrwxrwx   1 root   root       8 Oct  1 18:01 opt -> /app/opt


Sometimes this will fail, if there is not enough space at the target location, or if files are in use.  You can use fuser -c /opt to see which files are open, and if necessary, close them with fuser -ck /opt.

No comments: