简体   繁体   English

Unix / Linux符号链接是否支持回退?

[英]Does Unix/Linux symbolic link support fallback?

I set up an nfs/autofs-ldap system connecting 5-6 Ubuntu boxes. 我设置了一个nfs / autofs-ldap系统,连接5-6个Ubuntu盒子。 All my computers export their drives for storage large files, and are auto-mounted at 我所有的计算机都导出其驱动器以存储大文件,并在以下位置自动挂载

/drives/machine1/drive1
/drives/machine1/drive2
...

Inside the user's home directory, I ask users to set up symbolic links to point to one of the dedicated drives for storing large files. 在用户的主目录中,我要求用户设置符号链接以指向用于存储大文件的专用驱动器之一。 For example for user1: 例如,user1:

cd /homes/user1/
ln -s /drives/machine1/drive1/users/user1/workdir .

when a user logs in any one of my boxes, he/she can use ~/workdir to work on data. 当用户登录我的任何一个框时,他/她都可以使用〜/ workdir来处理数据。

However, when the network is down, and a user happens to use machine1 as his desktop, I wonder if the link ~/workdir can have a fallback link, such as /local_mount/machine1/drive1, which is the original path in the fstab and /etc/exports? 但是,当网络中断并且用户恰巧将machine1用作桌面时,我想知道链接〜/ workdir是否可以具有回退链接,例如/ local_mount / machine1 / drive1,这是fstab中的原始路径。和/ etc / exports?

if a fallback link is supported, one can still be able to access all his files without recreating the links. 如果支持后备链接,则仍然可以访问他的所有文件而无需重新创建链接。

does Unix/Linux symbolic link support this feature? Unix / Linux符号链接是否支持此功能? any hack to make this possible? 任何破解使这成为可能?

You can setup a symbolic link at the unmounted /drives/machine1/drive1/users/user1/workdir location [aka recursive link] to point to /local_mount/machine1/drive1 . 您可以在未安装的/drives/machine1/drive1/users/user1/workdir位置(也称为递归链接)设置符号链接,以指向/local_mount/machine1/drive1

The [only?] problem: 唯一的问题:

  • You'll have to have the same /drives/machine1/drive1/users/* structure under the unmounted file system. 在卸载的文件系统下,您必须具有相同的/ drives / machine1 / drive1 / users / *结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM