ShaoLin Microsystems  
The Enterprise Linux Solutions Expert
Corporate Products Services Support Partners
Download  Contact Us
 

A.3. Union Network File System Reference

Unionnfs have the same union behavior like Unionfs, it does not require a fake block device to mount. You can simple give none as the block device. It also has the .unionfs file control of directories. But Unionnfs is designed to merge two NFS directories with special control.

A.3.1. Mount time options

master=[dir]

The master file system dir.

slave=[dir]

The slave file system dir.

cow=[yes|no]

This is called the Copy-on-write flag. When enabled, modifying files on slave directory will make a copy of the file to master directory and the changes will be made to master directory. The file in slave is 'protected' by Copy-on-write feature. This is enabled by default for Unionnfs mount and disabled by default for unionfs mount.

nocheckdev

This option is used by Unionnfs mount on two NFS mounted directories. When nocheckdev is specified, Unionnfs will not perform cross device checking. However, you must make sure that the two NFS mounted directories must come from the same partition from the same server.

Example A-4. Example Unionnfs Mount


 mount -t unionnfs -o master=/import/master,slave=/import/slave,cow=yes,nocheckdev none /unionnfs

/import/master/a
/import/master/b
/import/master/c
+
/import/slave/a
/import/slave/d
/import/slave/e

Unionfs -> /unionnfs/a
/unionnfs/b
/unionnfs/c
/unionnfs/d
/unionnfs/e

Demonstration of copy-on-write .

Example A-5. Unionnfs copy-on-write

$ cat /unionnfs/e
Hello World!
$ echo abc >> /unionnfs/e
$ cat /unionnfs/e
Hello World!
abc
$ cat /import/slave/e
Hello World!
$ cat /import/master/e
Hello World!
abc
$
Changing the file in slave will result copy to master, leave the slave file untouched.