1

I want to create a symlink, foo.txt, needed at system startup, to another file, bar.txt on a different mount point. The mounted partitions are different physical drives as well.

ln -s /baz/bar.txt /foo.txt

EDIT:

So far no problem. The Symlink is created and is valid. The question relates to what will happen when partition at /bar disappears.

/EDIT

My dilemma is this, the partition mounted at /baz may not be present at startup.

My question -> To avoid obvious problems, can I specify a fall back file at the filesystem level that the symlink will resolve to rather than simply breaking? Or am i stuck doing this at the application level?

Using Debian linux on an ext4 (the default for the latest release of Debian) filesystem FWIW.

  • 1
    create a file /baz/bar.txt when the filesystem is not mounted? – yeti Mar 26 '14 at 19:54
  • no. sorry if i was unclear. The file will exist at /baz/bar.txt already. It just may or may not be mounted when I need it. – datUser Mar 26 '14 at 20:00
  • 1
    Make the replacement file /baz/bar.txt while the filesystem is NOT mounted. When /baz gets it's additional filesystem, this file will be below it and when the mounted filesystem has bar.txt, this will seem to replace the other file of below... – yeti Mar 26 '14 at 20:11
  • ...and I think this is not ext4-FS specific, so the /ext4 tag seems misleading... – yeti Mar 26 '14 at 20:13
  • Great this works! I'll pull the ext4 tag. If you make your suggestion an answer i'll accept it. Thanks. – datUser Mar 26 '14 at 20:25
0

Make the replacement file /baz/bar.txt while the filesystem is NOT mounted.

When /baz gets it's additional filesystem, this file will be below it and when the mounted filesystem has bar.txt, this will seem to replace the other file of below...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.