How to bind /tmp to /var/tmp

NethServer Version: 7.3.1611
Module: base

I’ve mounted /var on a separate partition with alot of space, now i would like to mount /tmp to /var/tmp or /var/tmp/tmp because my root partition is really small. What is the best way to implement this?

Added /var/tmp/tmp /tmp none rw,noexec,nosuid,nodev,bind 0 0 to fstab, seems to do the job. But the contents of the original /tmp is still on the root partition. It is always in use so could not be remove, and now I cant unmount /var/tmp/tmp from /tmp for the same reason. Any suggestions how I could remove them safely?

You should be able to unmount /tmp, which will expose the original contents to let you delete them. Then a mount /tmp will restore the mount where the /var/tmp contents will still be unchanged.

Update I guess the issue is the open files on /var/tmp. I’m not sure if a bind mount of / would expose the original contents of /tmp.

Cheers.

1 Like

Hi @indra
For simplicity, you can use a live CD, mount the disk and delete the contents of tmp.
Keep us updated :+1:

1 Like

Yes we did just that, worked like a charm, thanks.

2 Likes