В линуксе mount --bind /dev /mnt/dev ЕМНИП

On Sat, Jun 30, 2018 at 1:46 PM, Slawa Olhovchenkov <slw@zxy.spb.ru> wrote:
On Fri, Jun 29, 2018 at 05:59:00PM +0300, Gena Makhomed wrote:

> > Т.е. директории должны быть как бы зеркалами друг друга.
> >
> > Это возможно сделать?
>
> Теоретически - наверное возможно, если написать свой модуль ядра,
> который будет реализовывать эту логику на уровне файловой системы.
>

кажется в лялихе тоже такое было.

MOUNT_UNIONFS(8)        FreeBSD System Manager's Manual       MOUNT_UNIONFS(8)

NAME
     mount_unionfs — mount union file systems

SYNOPSIS
     mount_unionfs [-b] [-o options] directory uniondir

DESCRIPTION
     The mount_unionfs utility attaches directory above uniondir in such a way
     that the contents of both directory trees remain visible.  By default,
     directory becomes the upper layer and uniondir becomes the lower layer.

     The options are as follows:

     -b      Deprecated.  Use -o below instead.

     -o      Options are specified with the -o flag followed by an option.
             The following options are available:

             below   Inverts the default position, so that directory becomes
                     the lower layer and uniondir becomes the upper layer.
                     However, uniondir remains the mount point.

             copymode = traditional | transparent | masquerade
                     Specifies the way to create a file or a directory in the
                     upper layer automatically when needed.  The traditional
                     mode uses the same way as the old unionfs for backward
                     compatibility, and transparent duplicates the file and
                     directory mode bits and the ownership in the lower layer
                     to the created file in the upper layer.  For behavior of
                     the masquerade mode, see MASQUERADE MODE below.

             whiteout = always | whenneeded
                     Specifies whether whiteouts should always be made in the
                     upper layer when removing a file or directory or only
                     when it already exists in the lower layer.

             udir=mode
                     Specifies directory mode bits in octal for masquerade
                     mode.

             ufile=mode
                     Specifies file mode bits in octal for masquerade mode.

             gid=gid
                     Specifies group for masquerade mode.

             uid=uid
                     Specifies user for masquerade mode.

     To enforce file system security, the user mounting a file system must be
     superuser or else have write permission on the mounted-on directory.  In
     addition, the vfs.usermount sysctl(8) variable must be set to 1 to permit
     file system mounting by ordinary users.  However, note that transparent
     and masquerade modes require vfs.usermount to be set to 0 because this
     functionality can only be used by superusers.

     Filenames are looked up in the upper layer and then in the lower layer.
     If a directory is found in the lower layer, and there is no entry in the
     upper layer, then a shadow directory will be created in the upper layer.
     The ownership and the mode bits are set depending on the copymode option.
     In traditional mode, it will be owned by the user who originally did the
     union mount, with mode 0777 (“rwxrwxrwx”) modified by the umask in effect
     at that time.

     If a file exists in the upper layer then there is no way to access a file
     with the same name in the lower layer.  If necessary, a combination of
     loopback and union mounts can be made which will still allow the lower
     files to be accessed by a different pathname.

     Except in the case of a directory, access to an object is granted via the
     normal file system access checks.  For directories, the current user must
     have access to both the upper and lower directories (should they both
     exist).

     Requests to create or modify objects in uniondir are passed to the upper
     layer with the exception of a few special cases.  An attempt to open for
     writing a file which exists in the lower layer causes a copy of the
     entire file to be made to the upper layer, and then for the upper layer
     copy to be opened.  Similarly, an attempt to truncate a lower layer file
     to zero length causes an empty file to be created in the upper layer.
     Any other operation which would ultimately require modification to the
     lower layer fails with EROFS.

     The union file system manipulates the namespace, rather than individual
     file systems.  The union operation applies recursively down the directory
     tree now rooted at uniondir.  Thus any file systems which are mounted
     under uniondir will take part in the union operation.  This differs from
     the union option to mount(8) which only applies the union operation to
     the mount point itself, and then only for lookups.

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru