Post History
Yes, bind mounts or possibly rbind mounts is most likely what you want here. You need a rbind mount if you want the contents of file systems mounted below the specified mount point to be accessibl...
Answer
#1: Initial revision
Yes, **bind mounts** or possibly *rbind* mounts is most likely what you want here. You need a rbind mount if you want the contents of file systems mounted below the specified mount point to be accessible in the new location as well; you need a bind mount if you don't want or need that. Given the situation you describe in your question (`/` and `/home` separate, everything else in `/`), a bind mount should be exactly what you want. As with any operation that makes large-scale changes, making sure to refresh your backups first is a good idea. The easiest way to set this up is if you can tolerate shutting the system down. In that case: - boot with live media (such that there is nothing running from the file systems you're working with) - mount both file systems *in separate locations* (let's say that you mount your current `/` at /mount/root and `/home` at /mount/home); depending on partitioning, this can also include setting up MD RAID arrays, opening LUKS containers, or other steps to make the actual file systems accessible - move (not copy) everything from (in this case) /mount/root/var/log to, say, /mount/home/var/log, making sure to preserve the permissions from both the original /var as well as /var/log; but *leave the original directory* (/mount/root/var/log = /var/log) in place - update /mount/root/etc/fstab (that is to say, your main system's /etc/fstab) to include an entry on the form: /home/var/log /var/log none bind 0 0 - repeat for each file system you want to move - reboot when done Take it nice and slow; this isn't terribly complex, but you can easily cause mayhem if you aren't careful in matching up old and new locations, including permissions and ownership. The fstab entry is on the usual "what where type options" form, with the options being `bind` and the file system type being irrelevant for a bind mount. See [mount(8)](https://man7.org/linux/man-pages/man8/mount.8.html) under the "bind mount operation" heading. Doing the equivalent on a running system is *in principle* possible in much the same way, but requires significantly greater care regarding files that are in use, particularly ones being written to. I don't recommend going that route. I don't see any particular reason why you'd need to do something special depending on exactly which directory you're moving.