dvas0004 / NerdNotes

A collection of notes: things I'd like to remember while reading technical articles, technical questions I couldn't answer, and so on.
12 stars 0 forks source link

Linux: Mount bind #52

Open dvas0004 opened 5 years ago

dvas0004 commented 5 years ago

Linux "mount" command takes the "bind" argument:

mount --bind /source/dir /dest/dir

this essentially creates a shortcut (similar to a symlink created with "ln"), however rather than a "link" the shortcut can be viewed more as a "gateway" and is hence stronger than a symlink

It's useful in situation where operations in a symlink target throw errors referencing the original location (e.g. some compilation pipelines, or SNAP packages). In this case, replace the symlink with a bind mount