0

Is there any solution if I need to mount the directory e.g. /Test pointing to /Opt/Test

Thanks Sumit

user170039
  • 21
  • 2
  • 1
    You've provided no OS/release details; but you can have a partition (*even remote share*) mounted more than once... eg. I like my network shares mounted off / to reduce my typing, but *snap* packages cannot access them, thus I also have another copy available in `/mnt` so my browser(s) can access them (`firefox` & `chromium` are *snap* packages on my Ubuntu product). – guiverc Nov 04 '22 at 12:29
  • 1
    There are *bind mounts*, but do you may find that a symbolic link is more appropriate - see for example [What is the difference between ln -s and mount --bind?](https://askubuntu.com/questions/557733/what-is-the-difference-between-ln-s-and-mount-bind) – steeldriver Nov 04 '22 at 12:37
  • would a symbolic link do? `ln -s /Test /Opt/Test` – Wayne Vosberg Nov 04 '22 at 12:42

1 Answers1

0

Yes, for sure there is!

Easiest option: remove "Test" and replace it by a symbolic link with the same name that links to "/Opt/Test". For practical purposes, such symbolic link behaves and acts as if it were a true directory.

More thorough option: if you have special requirements where a link does not cut it, then you can mount --bind the directory "Test" to "/Opt/Test".

vanadium
  • 82,909
  • 6
  • 116
  • 186