A.2. 聯合文件系統參考

Unionfs 適合與 NFS daemon nfsd 一併使用。它利用一個 fake block device /dev/unionfs[0-255],當中包括一些主號碼231及由0至255的次號碼。 Unionfs有以下的行為模式:

範例 A-1. Unionfs Mount


	mount -t unionfs -o master=/master,slave=/slave /dev/unionfs1 /unionfs

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

Unionfs ->	/unionfs/a
			/unionfs/b
			/unionfs/c
			/unionfs/d
			/unionfs/e	
這是聯合登上,在這例子中,'a'出現在/master及/slave中,而unionfs會在/master中採取,如果在master及slave中有相同名稱的子目錄,那子目錄中的內容也會隨之合併。 CLASS="section" >

A.2.1. 掛載時間選項(Mount time options)

master=[dir]

The master file system dir.

slave=[dir]

The slave file system dir.

注意:Master及slave必須在同一分區中(從同一設備),否則,unionfs 將會登上失敗。

A.2.2. The .unionfs file

聯合文件系統)unionfs)控制系統目錄中的運行時間。而 .unionfs文件必須存於主檔中,並已讀入目錄查找的記憶中。除非目錄緩存下降,否則它不會自我更新。它包含了以下部份及意義:

[Options]

The [Options]是控制此目錄的選項,您可以指定 no_slave 選項使其目錄不會與 slave 子目錄合併。例如,

範例 A-2. .unionfs options


[Options]
no_slave
我們只支援一個選項。

[Exclude]

您亦可以指定一組文件名稱,排除它們與 slave 子目錄合併的,每一個 entry 都以最後一個字作區別。

範例 A-3. .unionfs exclude


[Exclude]
name1
name2
name3
no_slave 生效 [Exclude] 變得沒意義。