aufs.in.5 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684
  1. .\".so aufs.tmac
  2. .
  3. .eo
  4. .de TQ
  5. .br
  6. .ns
  7. .TP \$1
  8. ..
  9. .de Bu
  10. .IP \(bu 4
  11. ..
  12. .ec
  13. .\" end of macro definitions
  14. .
  15. .\" ----------------------------------------------------------------------
  16. .TH aufs 5 \*[AUFS_VERSION] Linux "Linux Aufs User's Manual"
  17. .SH NAME
  18. aufs \- advanced multi layered unification filesystem. version \*[AUFS_VERSION]
  19. .\" ----------------------------------------------------------------------
  20. .SH DESCRIPTION
  21. Aufs is a stackable unification filesystem such as Unionfs, which unifies
  22. several directories and provides a merged single directory.
  23. In the early days, aufs was entirely re-designed and re-implemented
  24. Unionfs Version 1.x series. After
  25. many original ideas, approaches and improvements, it
  26. becomes totally different from Unionfs while keeping the basic features.
  27. See Unionfs Version 1.x series for the basic features.
  28. Recently, Unionfs Version 2.x series begin taking some of same
  29. approaches to aufs's.
  30. .\" ----------------------------------------------------------------------
  31. .SH MOUNT OPTIONS
  32. At mount-time, the order of interpreting options is,
  33. .RS
  34. .Bu
  35. simple flags, except xino/noxino and udba=inotify
  36. .Bu
  37. branches
  38. .Bu
  39. xino/noxino
  40. .Bu
  41. udba=inotify
  42. .RE
  43. At remount-time,
  44. the options are interpreted in the given order,
  45. e.g. left to right.
  46. .RS
  47. .Bu
  48. create or remove
  49. whiteout-base(\*[AUFS_WH_BASE]) and
  50. whplink-dir(\*[AUFS_WH_PLINKDIR]) if necessary
  51. .RE
  52. .
  53. .TP
  54. .B br:BRANCH[:BRANCH ...] (dirs=BRANCH[:BRANCH ...])
  55. Adds new branches.
  56. (cf. Branch Syntax).
  57. Aufs rejects the branch which is an ancestor or a descendant of another
  58. branch. It is called overlapped. When the branch is loopback-mounted
  59. directory, aufs also checks the source fs-image file of loopback
  60. device. If the source file is a descendant of another branch, it will
  61. be rejected too.
  62. After mounting aufs or adding a branch, if you move a branch under
  63. another branch and make it descendant of another branch, aufs will not
  64. work correctly.
  65. .
  66. .TP
  67. .B [ add | ins ]:index:BRANCH
  68. Adds a new branch.
  69. The index begins with 0.
  70. Aufs creates
  71. whiteout-base(\*[AUFS_WH_BASE]) and
  72. whplink-dir(\*[AUFS_WH_PLINKDIR]) if necessary.
  73. If there is the same named file on the lower branch (larger index),
  74. aufs will hide the lower file.
  75. You can only see the highest file.
  76. You will be confused if the added branch has whiteouts (including
  77. diropq), they may or may not hide the lower entries.
  78. .\" It is recommended to make sure that the added branch has no whiteout.
  79. Even if a process have once mapped a file by mmap(2) with MAP_SHARED
  80. and the same named file exists on the lower branch,
  81. the process still refers the file on the lower(hidden)
  82. branch after adding the branch.
  83. If you want to update the contents of a process address space after
  84. adding, you need to restart your process or open/mmap the file again.
  85. .\" Usually, such files are executables or shared libraries.
  86. (cf. Branch Syntax).
  87. .
  88. .TP
  89. .B del:dir
  90. Removes a branch.
  91. Aufs does not remove
  92. whiteout-base(\*[AUFS_WH_BASE]) and
  93. whplink-dir(\*[AUFS_WH_PLINKDIR]) automatically.
  94. For example, when you add a RO branch which was unified as RW, you
  95. will see whiteout-base or whplink-dir on the added RO branch.
  96. If a process is referencing the file/directory on the deleting branch
  97. (by open, mmap, current working directory, etc.), aufs will return an
  98. error EBUSY.
  99. .
  100. .TP
  101. .B mod:BRANCH
  102. Modifies the permission flags of the branch.
  103. Aufs creates or removes
  104. whiteout-base(\*[AUFS_WH_BASE]) and/or
  105. whplink-dir(\*[AUFS_WH_PLINKDIR]) if necessary.
  106. If the branch permission is been changing `rw' to `ro', and a process
  107. is mapping a file by mmap(2)
  108. .\" with MAP_SHARED
  109. on the branch, the process may or may not
  110. be able to modify its mapped memory region after modifying branch
  111. permission flags.
  112. Additioanlly when you enable CONFIG_IMA (in linux-2.6.30 and later), IMA
  113. may produce some wrong messages. But this is equivalent when the
  114. filesystem is changed `ro' in emergency.
  115. (cf. Branch Syntax).
  116. .
  117. .TP
  118. .B append:BRANCH
  119. equivalent to `add:(last index + 1):BRANCH'.
  120. (cf. Branch Syntax).
  121. .
  122. .TP
  123. .B prepend:BRANCH
  124. equivalent to `add:0:BRANCH.'
  125. (cf. Branch Syntax).
  126. .
  127. .TP
  128. .B xino=filename
  129. Use external inode number bitmap and translation table.
  130. When CONFIG_AUFS_EXPORT is enabled, external inode generation table too.
  131. It is set to
  132. <FirstWritableBranch>/\*[AUFS_XINO_FNAME] by default, or
  133. \*[AUFS_XINO_DEFPATH].
  134. Comma character in filename is not allowed.
  135. The files are created per an aufs and per a branch filesystem, and
  136. unlinked. So you
  137. cannot find this file, but it exists and is read/written frequently by
  138. aufs.
  139. (cf. External Inode Number Bitmap, Translation Table and Generation Table).
  140. If you enable CONFIG_SYSFS, the path of xino files are not shown in
  141. /proc/mounts (and /etc/mtab), instead it is shown in
  142. <sysfs>/fs/aufs/si_<id>/xi_path.
  143. Otherwise, it is shown in /proc/mounts unless it is not the default
  144. path.
  145. .
  146. .TP
  147. .B noxino
  148. Stop using external inode number bitmap and translation table.
  149. If you use this option,
  150. Some applications will not work correctly.
  151. .\" And pseudo link feature will not work after the inode cache is
  152. .\" shrunk.
  153. (cf. External Inode Number Bitmap, Translation Table and Generation Table).
  154. .
  155. .TP
  156. .B trunc_xib
  157. Truncate the external inode number bitmap file. The truncation is done
  158. automatically when you delete a branch unless you do not specify
  159. `notrunc_xib' option.
  160. (cf. External Inode Number Bitmap, Translation Table and Generation Table).
  161. .
  162. .TP
  163. .B notrunc_xib
  164. Stop truncating the external inode number bitmap file when you delete
  165. a branch.
  166. (cf. External Inode Number Bitmap, Translation Table and Generation Table).
  167. .
  168. .TP
  169. .B create_policy | create=CREATE_POLICY
  170. .TQ
  171. .B copyup_policy | copyup | cpup=COPYUP_POLICY
  172. Policies to select one among multiple writable branches. The default
  173. values are `create=tdp' and `cpup=tdp'.
  174. link(2) and rename(2) systemcalls have an exception. In aufs, they
  175. try keeping their operations in the branch where the source exists.
  176. (cf. Policies to Select One among Multiple Writable Branches).
  177. .
  178. .TP
  179. .B verbose | v
  180. Print some information.
  181. Currently, it is only busy file (or inode) at deleting a branch.
  182. .
  183. .TP
  184. .B noverbose | quiet | q | silent
  185. Disable `verbose' option.
  186. This is default value.
  187. .
  188. .TP
  189. .B sum
  190. df(1)/statfs(2) returns the total number of blocks and inodes of
  191. all branches.
  192. Note that there are cases that systemcalls may return ENOSPC, even if
  193. df(1)/statfs(2) shows that aufs has some free space/inode.
  194. .
  195. .TP
  196. .B nosum
  197. Disable `sum' option.
  198. This is default value.
  199. .
  200. .TP
  201. .B dirwh=N
  202. Watermark to remove a dir actually at rmdir(2) and rename(2).
  203. If the target dir which is being removed or renamed (destination dir)
  204. has a huge number of whiteouts, i.e. the dir is empty logically but
  205. physically, the cost to remove/rename the single
  206. dir may be very high.
  207. It is
  208. required to unlink all of whiteouts internally before issuing
  209. rmdir/rename to the branch.
  210. To reduce the cost of single systemcall,
  211. aufs renames the target dir to a whiteout-ed temporary name and
  212. invokes a pre-created
  213. kernel thread to remove whiteout-ed children and the target dir.
  214. The rmdir/rename systemcall returns just after kicking the thread.
  215. When the number of whiteout-ed children is less than the value of
  216. dirwh, aufs remove them in a single systemcall instead of passing
  217. another thread.
  218. This value is ignored when the branch is NFS.
  219. The default value is \*[AUFS_DIRWH_DEF].
  220. .\" .
  221. .\" .TP
  222. .\" .B rdcache=N
  223. .
  224. .TP
  225. .B rdblk=N
  226. Specifies a size of internal VDIR block which is allocated at a time in
  227. byte.
  228. The VDIR block will be allocated several times when necessary. If your
  229. directory has millions of files, you may want to expand this size.
  230. The default value is defined as \*[AUFS_RDBLK_DEF].
  231. The size has to be lager than NAME_MAX (usually 255) and kmalloc\-able
  232. (the maximum limit depends on your system. at least 128KB is available
  233. for every system).
  234. Whenever you can reset the value to default by specifying rdblk=def.
  235. (cf. Virtual or Vertical Directory Block).
  236. .
  237. .TP
  238. .B rdhash=N
  239. Specifies a size of internal VDIR hash table which is used to compare
  240. the file names under the same named directory on multiple branches.
  241. The VDIR hash table will be allocated in readdir(3)/getdents(2),
  242. rmdir(2) and rename(2) for the existing target directory. If your
  243. directory has millions of files, you may want to expand this size.
  244. The default value is defined as \*[AUFS_RDHASH_DEF].
  245. The size has to be lager than zero, and it will be multiplied by 4 or 8
  246. (for 32\-bit and 64\-bit respectively, currently). The result must be
  247. kmalloc\-able
  248. (the maximum limit depends on your system. at least 128KB is available
  249. for every system).
  250. Whenever you can reset the value to default by specifying rdhash=def.
  251. (cf. Virtual or Vertical Directory Block).
  252. .
  253. .TP
  254. .B plink
  255. .TQ
  256. .B noplink
  257. Specifies to use `pseudo link' feature or not.
  258. The default is `plink' which means use this feature.
  259. (cf. Pseudo Link)
  260. .
  261. .TP
  262. .B clean_plink
  263. Removes all pseudo-links in memory.
  264. In order to make pseudo-link permanent, use
  265. `auplink' utility just before one of these operations,
  266. unmounting aufs,
  267. using `ro' or `noplink' mount option,
  268. deleting a branch from aufs,
  269. adding a branch into aufs,
  270. or changing your writable branch as readonly.
  271. If you installed both of /sbin/mount.aufs and /sbin/umount.aufs, and your
  272. mount(8) and umount(8) support them,
  273. `auplink' utility will be executed automatically and flush pseudo-links.
  274. (cf. Pseudo Link)
  275. .
  276. .TP
  277. .B udba=none | reval | inotify
  278. Specifies the level of UDBA (User's Direct Branch Access) test.
  279. (cf. User's Direct Branch Access and Inotify Limitation).
  280. .
  281. .TP
  282. .B diropq=whiteouted | w | always | a
  283. Specifies whether mkdir(2) and rename(2) dir case make the created directory
  284. `opaque' or not.
  285. In other words, to create `\*[AUFS_WH_DIROPQ]' under the created or renamed
  286. directory, or not to create.
  287. When you specify diropq=w or diropq=whiteouted, aufs will not create
  288. it if the
  289. directory was not whiteouted or opaqued. If the directory was whiteouted
  290. or opaqued, the created or renamed directory will be opaque.
  291. When you specify diropq=a or diropq==always, aufs will always create
  292. it regardless
  293. the directory was whiteouted/opaqued or not.
  294. The default value is diropq=w, it means not to create when it is unnecessary.
  295. If you define CONFIG_AUFS_COMPAT at aufs compiling time, the default will be
  296. diropq=a.
  297. You need to consider this option if you are planning to add a branch later
  298. since `diropq' affects the same named directory on the added branch.
  299. .
  300. .TP
  301. .B warn_perm
  302. .TQ
  303. .B nowarn_perm
  304. Adding a branch, aufs will issue a warning about uid/gid/permission of
  305. the adding branch directory,
  306. when they differ from the existing branch's. This difference may or
  307. may not impose a security risk.
  308. If you are sure that there is no problem and want to stop the warning,
  309. use `nowarn_perm' option.
  310. The default is `warn_perm' (cf. DIAGNOSTICS).
  311. .
  312. .TP
  313. .B shwh
  314. .TQ
  315. .B noshwh
  316. By default (noshwh), aufs doesn't show the whiteouts and
  317. they just hide the same named entries in the lower branches. The
  318. whiteout itself also never be appeared.
  319. If you enable CONFIG_AUFS_SHWH and specify `shwh' option, aufs
  320. will show you the name of whiteouts
  321. with keeping its feature to hide the lowers.
  322. Honestly speaking, I am rather confused with this `visible whiteouts.'
  323. But a user who originally requested this feature wrote a nice how-to
  324. document about this feature. See Tips file in the aufs CVS tree.
  325. .\" ----------------------------------------------------------------------
  326. .SH Module Parameters
  327. .TP
  328. .B nwkq=N
  329. The number of kernel thread named \*[AUFS_WKQ_NAME].
  330. Those threads stay in the system while the aufs module is loaded,
  331. and handle the special I/O requests from aufs.
  332. The default value is \*[AUFS_NWKQ_DEF].
  333. The special I/O requests from aufs include a part of copy-up, lookup,
  334. directory handling, pseudo-link, xino file operations and the
  335. delegated access to branches.
  336. For example, Unix filesystems allow you to rmdir(2) which has no write
  337. permission bit, if its parent directory has write permission bit. In aufs, the
  338. removing directory may or may not have whiteout or `dir opaque' mark as its
  339. child. And aufs needs to unlink(2) them before rmdir(2).
  340. Therefore aufs delegates the actual unlink(2) and rmdir(2) to another kernel
  341. thread which has been created already and has a superuser privilege.
  342. If you enable CONFIG_SYSFS, you can check this value through
  343. <sysfs>/module/aufs/parameters/nwkq.
  344. .
  345. .TP
  346. .B brs=1 | 0
  347. Specifies to use the branch path data file under sysfs or not.
  348. If the number of your branches is large or their path is long
  349. and you meet the limitation of mount(8) ro /etc/mtab, you need to
  350. enable CONFIG_SYSFS and set aufs module parameter brs=1.
  351. When this parameter is set as 1, aufs does not show `br:' (or dirs=)
  352. mount option through /proc/mounts (and /etc/mtab). So you can
  353. keep yourself from the page limitation of
  354. mount(8) or /etc/mtab.
  355. Aufs shows branch paths through <sysfs>/fs/aufs/si_XXX/brNNN.
  356. Actually the file under sysfs has also a size limitation, but I don't
  357. think it is harmful.
  358. There is one more side effect in setting 1 to this parameter.
  359. If you rename your branch, the branch path written in /etc/mtab will be
  360. obsoleted and the future remount will meet some error due to the
  361. unmatched parameters (Remember that mount(8) may take the options from
  362. /etc/mtab and pass them to the systemcall).
  363. If you set 1, /etc/mtab will not hold the branch path and you will not
  364. meet such trouble. On the other hand, the entries for the
  365. branch path under sysfs are generated dynamically. So it must not be obsoleted.
  366. But I don't think users want to rename branches so often.
  367. If CONFIG_SYSFS is disable, this parameter is always set to 0.
  368. .
  369. .TP
  370. .B sysrq=key
  371. Specifies MagicSysRq key for debugging aufs.
  372. You need to enable both of CONFIG_MAGIC_SYSRQ and CONFIG_AUFS_DEBUG.
  373. Currently this is for developers only.
  374. The default is `a'.
  375. .
  376. .TP
  377. .B debug= 0 | 1
  378. Specifies disable(0) or enable(1) debug print in aufs.
  379. This parameter can be changed dynamically.
  380. You need to enable CONFIG_AUFS_DEBUG.
  381. Currently this is for developers only.
  382. The default is `0' (disable).
  383. .\" ----------------------------------------------------------------------
  384. .SH Entries under Sysfs and Debugfs
  385. See linux/Documentation/ABI/*/{sys,debug}fs-aufs.
  386. .\" ----------------------------------------------------------------------
  387. .SH Branch Syntax
  388. .TP
  389. .B dir_path[ =permission [ + attribute ] ]
  390. .TQ
  391. .B permission := rw | ro | rr
  392. .TQ
  393. .B attribute := wh | nolwh
  394. dir_path is a directory path.
  395. The keyword after `dir_path=' is a
  396. permission flags for that branch.
  397. Comma, colon and the permission flags string (including `=')in the path
  398. are not allowed.
  399. Any filesystem can be a branch, But some are not accepted such like
  400. sysfs, procfs and unionfs.
  401. If you specify such filesystems as an aufs branch, aufs will return an error
  402. saying it is unsupported.
  403. Cramfs in linux stable release has strange inodes and it makes aufs
  404. confused. For example,
  405. .nf
  406. $ mkdir -p w/d1 w/d2
  407. $ > w/z1
  408. $ > w/z2
  409. $ mkcramfs w cramfs
  410. $ sudo mount -t cramfs -o ro,loop cramfs /mnt
  411. $ find /mnt -ls
  412. 76 1 drwxr-xr-x 1 jro 232 64 Jan 1 1970 /mnt
  413. 1 1 drwxr-xr-x 1 jro 232 0 Jan 1 1970 /mnt/d1
  414. 1 1 drwxr-xr-x 1 jro 232 0 Jan 1 1970 /mnt/d2
  415. 1 1 -rw-r--r-- 1 jro 232 0 Jan 1 1970 /mnt/z1
  416. 1 1 -rw-r--r-- 1 jro 232 0 Jan 1 1970 /mnt/z2
  417. .fi
  418. All these two directories and two files have the same inode with one
  419. as their link count. Aufs cannot handle such inode correctly.
  420. Currently, aufs involves a tiny workaround for such inodes. But some
  421. applications may not work correctly since aufs inode number for such
  422. inode will change silently.
  423. If you do not have any empty files, empty directories or special files,
  424. inodes on cramfs will be all fine.
  425. A branch should not be shared as the writable branch between multiple
  426. aufs. A readonly branch can be shared.
  427. The maximum number of branches is configurable at compile time (127 by
  428. default).
  429. When an unknown permission or attribute is given, aufs sets ro to that
  430. branch silently.
  431. .SS Permission
  432. .
  433. .TP
  434. .B rw
  435. Readable and writable branch. Set as default for the first branch.
  436. If the branch filesystem is mounted as readonly, you cannot set it `rw.'
  437. .\" A filesystem which does not support link(2) and i_op\->setattr(), for
  438. .\" example FAT, will not be used as the writable branch.
  439. .
  440. .TP
  441. .B ro
  442. Readonly branch and it has no whiteouts on it.
  443. Set as default for all branches except the first one. Aufs never issue
  444. both of write operation and lookup operation for whiteout to this branch.
  445. .
  446. .TP
  447. .B rr
  448. Real readonly branch, special case of `ro', for natively readonly
  449. branch. Assuming the branch is natively readonly, aufs can optimize
  450. some internal operation. For example, if you specify `udba=inotify'
  451. option, aufs does not set inotify for the things on rr branch.
  452. Set by default for a branch whose fs-type is either `iso9660',
  453. `cramfs' or `romfs' (and `squashfs' for linux\-2.6.29 and later).
  454. When your branch exists on slower device and you have some
  455. capacity on your hdd, you may want to try ulobdev tool in ULOOP sample.
  456. It can cache the contents of the real devices on another faster device,
  457. so you will be able to get the better access performance.
  458. The ulobdev tool is for a generic block device, and the ulohttp is for a
  459. filesystem image on http server.
  460. If you want to spin down your hdd to save the
  461. battery life or something, then you may want to use ulobdev to save the
  462. access to the hdd, too.
  463. See $AufsCVS/sample/uloop in detail.
  464. .SS Attribute
  465. .
  466. .TP
  467. .B wh
  468. Readonly branch and it has/might have whiteouts on it.
  469. Aufs never issue write operation to this branch, but lookup for whiteout.
  470. Use this as `<branch_dir>=ro+wh'.
  471. .
  472. .TP
  473. .B nolwh
  474. Usually, aufs creates a whiteout as a hardlink on a writable
  475. branch. This attributes prohibits aufs to create the hardlinked
  476. whiteout, including the source file of all hardlinked whiteout
  477. (\*[AUFS_WH_BASE].)
  478. If you do not like a hardlink, or your writable branch does not support
  479. link(2), then use this attribute.
  480. But I am afraid a filesystem which does not support link(2) natively
  481. will fail in other place such as copy-up.
  482. Use this as `<branch_dir>=rw+nolwh'.
  483. Also you may want to try `noplink' mount option, while it is not recommended.
  484. .\" .SS FUSE as a branch
  485. .\" A FUSE branch needs special attention.
  486. .\" The struct fuse_operations has a statfs operation. It is OK, but the
  487. .\" parameter is struct statvfs* instead of struct statfs*. So almost
  488. .\" all user\-space implementation will call statvfs(3)/fstatvfs(3) instead of
  489. .\" statfs(2)/fstatfs(2).
  490. .\" In glibc, [f]statvfs(3) issues [f]statfs(2), open(2)/read(2) for
  491. .\" /proc/mounts,
  492. .\" and stat(2) for the mountpoint. With this situation, a FUSE branch will
  493. .\" cause a deadlock in creating something in aufs. Here is a sample
  494. .\" scenario,
  495. .\" .\" .RS
  496. .\" .\" .IN -10
  497. .\" .Bu
  498. .\" create/modify a file just under the aufs root dir.
  499. .\" .Bu
  500. .\" aufs acquires a write\-lock for the parent directory, ie. the root dir.
  501. .\" .Bu
  502. .\" A library function or fuse internal may call statfs for a fuse branch.
  503. .\" The create=mfs mode in aufs will surely call statfs for each writable
  504. .\" branches.
  505. .\" .Bu
  506. .\" FUSE in kernel\-space converts and redirects the statfs request to the
  507. .\" user\-space.
  508. .\" .Bu
  509. .\" the user\-space statfs handler will call [f]statvfs(3).
  510. .\" .Bu
  511. .\" the [f]statvfs(3) in glibc will access /proc/mounts and issue
  512. .\" stat(2) for the mountpoint. But those require a read\-lock for the aufs
  513. .\" root directory.
  514. .\" .Bu
  515. .\" Then a deadlock occurs.
  516. .\" .\" .RE 1
  517. .\" .\" .IN
  518. .\"
  519. .\" In order to avoid this deadlock, I would suggest not to call
  520. .\" [f]statvfs(3) from fuse. Here is a sample code to do this.
  521. .\" .nf
  522. .\" struct statvfs stvfs;
  523. .\"
  524. .\" main()
  525. .\" {
  526. .\" statvfs(..., &stvfs)
  527. .\" or
  528. .\" fstatvfs(..., &stvfs)
  529. .\" stvfs.f_fsid = 0
  530. .\" }
  531. .\"
  532. .\" statfs_handler(const char *path, struct statvfs *arg)
  533. .\" {
  534. .\" struct statfs stfs
  535. .\"
  536. .\" memcpy(arg, &stvfs, sizeof(stvfs))
  537. .\"
  538. .\" statfs(..., &stfs)
  539. .\" or
  540. .\" fstatfs(..., &stfs)
  541. .\"
  542. .\" arg->f_bfree = stfs.f_bfree
  543. .\" arg->f_bavail = stfs.f_bavail
  544. .\" arg->f_ffree = stfs.f_ffree
  545. .\" arg->f_favail = /* any value */
  546. .\" }
  547. .\" .fi
  548. .\" ----------------------------------------------------------------------
  549. .SH External Inode Number Bitmap, Translation Table and Generation Table (xino)
  550. Aufs uses one external bitmap file and one external inode number
  551. translation table files per an aufs and per a branch
  552. filesystem by default.
  553. Additionally when CONFIG_AUFS_EXPORT is enabled, one external inode
  554. generation table is added.
  555. The bitmap (and the generation table) is for recycling aufs inode number
  556. and the others
  557. are a table for converting an inode number on a branch to
  558. an aufs inode number. The default path
  559. is `first writable branch'/\*[AUFS_XINO_FNAME].
  560. If there is no writable branch, the
  561. default path
  562. will be \*[AUFS_XINO_DEFPATH].
  563. .\" A user who executes mount(8) needs the privilege to create xino
  564. .\" file.
  565. If you enable CONFIG_SYSFS, the path of xino files are not shown in
  566. /proc/mounts (and /etc/mtab), instead it is shown in
  567. <sysfs>/fs/aufs/si_<id>/xi_path.
  568. Otherwise, it is shown in /proc/mounts unless it is not the default
  569. path.
  570. Those files are always opened and read/write by aufs frequently.
  571. If your writable branch is on flash memory device, it is recommended
  572. to put xino files on other than flash memory by specifying `xino='
  573. mount option.
  574. The
  575. maximum file size of the bitmap is, basically, the amount of the
  576. number of all the files on all branches divided by 8 (the number of
  577. bits in a byte).
  578. For example, on a 4KB page size system, if you have 32,768 (or
  579. 2,599,968) files in aufs world,
  580. then the maximum file size of the bitmap is 4KB (or 320KB).
  581. The
  582. maximum file size of the table will
  583. be `max inode number on the branch x size of an inode number'.
  584. For example in 32bit environment,
  585. .nf
  586. $ df -i /branch_fs
  587. /dev/hda14 2599968 203127 2396841 8% /branch_fs
  588. .fi
  589. and /branch_fs is an branch of the aufs. When the inode number is
  590. assigned contiguously (without `hole'), the maximum xino file size for
  591. /branch_fs will be 2,599,968 x 4 bytes = about 10 MB. But it might not be
  592. allocated all of disk blocks.
  593. When the inode number is assigned discontinuously, the maximum size of
  594. xino file will be the largest inode number on a branch x 4 bytes.
  595. Additionally, the file size is limited to LLONG_MAX or the s_maxbytes
  596. in filesystem's superblock (s_maxbytes may be smaller than
  597. LLONG_MAX). So the
  598. support-able largest inode number on a branch is less than
  599. 2305843009213693950 (LLONG_MAX/4\-1).
  600. This is the current limitation of aufs.
  601. On 64bit environment, this limitation becomes more strict and the
  602. supported largest inode number is less than LLONG_MAX/8\-1.
  603. The xino files are always hidden, i.e. removed. So you cannot
  604. do `ls \-l xino_file'.
  605. If you enable CONFIG_DEBUG_FS, you can check these information through
  606. <debugfs>/aufs/<si_id>/{xib,xi[0-9]*,xigen}. xib is for the bitmap file,
  607. xi0 ix for the first branch, and xi1 is for the next. xigen is for the
  608. generation table.
  609. xib and xigen are in the format of,
  610. .nf
  611. <blocks>x<block size> <file size>
  612. .fi
  613. Note that a filesystem usually has a
  614. feature called pre-allocation, which means a number of
  615. blocks are allocated automatically, and then deallocated
  616. silently when the filesystem thinks they are unnecessary.
  617. You do not have to be surprised the sudden changes of the number of
  618. blocks, when your filesystem which xino files are placed supports the
  619. pre-allocation feature.
  620. The rests are hidden xino file information in the format of,
  621. .nf
  622. <file count>, <blocks>x<block size> <file size>
  623. .fi
  624. If the file count is larger than 1, it means some of your branches are
  625. on the same filesystem and the xino file is shared by them.
  626. Note that the file size may not be equal to the actual consuming blocks
  627. since xino file is a sparse file, i.e. a hole in a file which does not
  628. consume any disk blocks.
  629. Once you unmount aufs, the xino files for that aufs are totally gone.
  630. It means that the inode number is not permanent across umount or
  631. shutdown.
  632. The xino files should be created on the filesystem except NFS.
  633. If your first writable branch is NFS, you will need to specify xino
  634. file path other than NFS.
  635. Also if you are going to remove the branch where xino files exist or
  636. change the branch permission to readonly, you need to use xino option
  637. before del/mod the branch.
  638. The bitmap file can be truncated.
  639. For example, if you delete a branch which has huge number of files,
  640. many inode numbers will be recycled and the bitmap will be truncated
  641. to smaller size. Aufs does this automatically when a branch is
  642. deleted.
  643. You can truncate it anytime you like if you specify `trunc_xib' mount
  644. option. But when the accessed inode number was not deleted, nothing
  645. will be truncated.
  646. If you do not want to truncate it (it may be slow) when you delete a
  647. branch, specify `notrunc_xib' after `del' mount option.
  648. If you do not want to use xino, use noxino mount option. Use this
  649. option with care, since the inode number may be changed silently and
  650. unexpectedly anytime.
  651. For example,
  652. rmdir failure, recursive chmod/chown/etc to a large and deep directory
  653. or anything else.
  654. And some applications will not work correctly.
  655. .\" When the inode number has been changed, your system
  656. .\" can be crazy.
  657. If you want to change the xino default path, use xino mount option.
  658. After you add branches, the persistence of inode number may not be
  659. guaranteed.
  660. At remount time, cached but unused inodes are discarded.
  661. And the newly appeared inode may have different inode number at the
  662. next access time. The inodes in use have the persistent inode number.
  663. When aufs assigned an inode number to a file, and if you create the
  664. same named file on the upper branch directly, then the next time you
  665. access the file, aufs may assign another inode number to the file even
  666. if you use xino option.
  667. Some applications may treat the file whose inode number has been
  668. changed as totally different file.
  669. .\" ----------------------------------------------------------------------
  670. .SH Pseudo Link (hardlink over branches)
  671. Aufs supports `pseudo link' which is a logical hard-link over
  672. branches (cf. ln(1) and link(2)).
  673. In other words, a copied-up file by link(2) and a copied-up file which was
  674. hard-linked on a readonly branch filesystem.
  675. When you have files named fileA and fileB which are
  676. hardlinked on a readonly branch, if you write something into fileA,
  677. aufs copies-up fileA to a writable branch, and write(2) the originally
  678. requested thing to the copied-up fileA. On the writable branch,
  679. fileA is not hardlinked.
  680. But aufs remembers it was hardlinked, and handles fileB as if it existed
  681. on the writable branch, by referencing fileA's inode on the writable
  682. branch as fileB's inode.
  683. Once you unmount aufs, the plink info for that aufs kept in memory are totally
  684. gone.
  685. It means that the pseudo-link is not permanent.
  686. If you want to make plink permanent, try `auplink' utility just before
  687. one of these operations,
  688. unmounting your aufs,
  689. using `ro' or `noplink' mount option,
  690. deleting a branch from aufs,
  691. adding a branch into aufs,
  692. or changing your writable branch to readonly.
  693. This utility will reproduces all real hardlinks on a writable branch by linking
  694. them, and removes pseudo-link info in memory and temporary link on the
  695. writable branch.
  696. Since this utility access your branches directly, you cannot hide them by
  697. `mount \-\-bind /tmp /branch' or something.
  698. If you are willing to rebuild your aufs with the same branches later, you
  699. should use auplink utility before you umount your aufs.
  700. If you installed both of /sbin/mount.aufs and /sbin/umount.aufs, and your
  701. mount(8) and umount(8) support them,
  702. `auplink' utility will be executed automatically and flush pseudo-links.
  703. .nf
  704. # auplink /your/aufs/root flush
  705. # umount /your/aufs/root
  706. or
  707. # auplink /your/aufs/root flush
  708. # mount -o remount,mod:/your/writable/branch=ro /your/aufs/root
  709. or
  710. # auplink /your/aufs/root flush
  711. # mount -o remount,noplink /your/aufs/root
  712. or
  713. # auplink /your/aufs/root flush
  714. # mount -o remount,del:/your/aufs/branch /your/aufs/root
  715. or
  716. # auplink /your/aufs/root flush
  717. # mount -o remount,append:/your/aufs/branch /your/aufs/root
  718. .fi
  719. The plinks are kept both in memory and on disk. When they consumes too much
  720. resources on your system, you can use the `auplink' utility at anytime and
  721. throw away the unnecessary pseudo-links in safe.
  722. Additionally, the `auplink' utility is very useful for some security reasons.
  723. For example, when you have a directory whose permission flags
  724. are 0700, and a file who is 0644 under the 0700 directory. Usually,
  725. all files under the 0700 directory are private and no one else can see
  726. the file. But when the directory is 0711 and someone else knows the 0644
  727. filename, he can read the file.
  728. Basically, aufs pseudo-link feature creates a temporary link under the
  729. directory whose owner is root and the permission flags are 0700.
  730. But when the writable branch is NFS, aufs sets 0711 to the directory.
  731. When the 0644 file is pseudo-linked, the temporary link, of course the
  732. contents of the file is totally equivalent, will be created under the
  733. 0711 directory. The filename will be generated by its inode number.
  734. While it is hard to know the generated filename, someone else may try peeping
  735. the temporary pseudo-linked file by his software tool which may try the name
  736. from one to MAX_INT or something.
  737. In this case, the 0644 file will be read unexpectedly.
  738. I am afraid that leaving the temporary pseudo-links can be a security hole.
  739. It makes sense to execute `auplink /your/aufs/root flush'
  740. periodically, when your writable branch is NFS.
  741. When your writable branch is not NFS, or all users are careful enough to set 0600
  742. to their private files, you do not have to worry about this issue.
  743. If you do not want this feature, use `noplink' mount option.
  744. .SS The behaviours of plink and noplink
  745. This sample shows that the `f_src_linked2' with `noplink' option cannot follow
  746. the link.
  747. .nf
  748. none on /dev/shm/u type aufs (rw,xino=/dev/shm/rw/.aufs.xino,br:/dev/shm/rw=rw:/dev/shm/ro=ro)
  749. $ ls -li ../r?/f_src_linked* ./f_src_linked* ./copied
  750. ls: ./copied: No such file or directory
  751. 15 -rw-r--r-- 2 jro jro 2 Dec 22 11:03 ../ro/f_src_linked
  752. 15 -rw-r--r-- 2 jro jro 2 Dec 22 11:03 ../ro/f_src_linked2
  753. 22 -rw-r--r-- 2 jro jro 2 Dec 22 11:03 ./f_src_linked
  754. 22 -rw-r--r-- 2 jro jro 2 Dec 22 11:03 ./f_src_linked2
  755. $ echo abc >> f_src_linked
  756. $ cp f_src_linked copied
  757. $ ls -li ../r?/f_src_linked* ./f_src_linked* ./copied
  758. 15 -rw-r--r-- 2 jro jro 2 Dec 22 11:03 ../ro/f_src_linked
  759. 15 -rw-r--r-- 2 jro jro 2 Dec 22 11:03 ../ro/f_src_linked2
  760. 36 -rw-r--r-- 2 jro jro 6 Dec 22 11:03 ../rw/f_src_linked
  761. 53 -rw-r--r-- 1 jro jro 6 Dec 22 11:03 ./copied
  762. 22 -rw-r--r-- 2 jro jro 6 Dec 22 11:03 ./f_src_linked
  763. 22 -rw-r--r-- 2 jro jro 6 Dec 22 11:03 ./f_src_linked2
  764. $ cmp copied f_src_linked2
  765. $
  766. none on /dev/shm/u type aufs (rw,xino=/dev/shm/rw/.aufs.xino,noplink,br:/dev/shm/rw=rw:/dev/shm/ro=ro)
  767. $ ls -li ../r?/f_src_linked* ./f_src_linked* ./copied
  768. ls: ./copied: No such file or directory
  769. 17 -rw-r--r-- 2 jro jro 2 Dec 22 11:03 ../ro/f_src_linked
  770. 17 -rw-r--r-- 2 jro jro 2 Dec 22 11:03 ../ro/f_src_linked2
  771. 23 -rw-r--r-- 2 jro jro 2 Dec 22 11:03 ./f_src_linked
  772. 23 -rw-r--r-- 2 jro jro 2 Dec 22 11:03 ./f_src_linked2
  773. $ echo abc >> f_src_linked
  774. $ cp f_src_linked copied
  775. $ ls -li ../r?/f_src_linked* ./f_src_linked* ./copied
  776. 17 -rw-r--r-- 2 jro jro 2 Dec 22 11:03 ../ro/f_src_linked
  777. 17 -rw-r--r-- 2 jro jro 2 Dec 22 11:03 ../ro/f_src_linked2
  778. 36 -rw-r--r-- 1 jro jro 6 Dec 22 11:03 ../rw/f_src_linked
  779. 53 -rw-r--r-- 1 jro jro 6 Dec 22 11:03 ./copied
  780. 23 -rw-r--r-- 2 jro jro 6 Dec 22 11:03 ./f_src_linked
  781. 23 -rw-r--r-- 2 jro jro 6 Dec 22 11:03 ./f_src_linked2
  782. $ cmp copied f_src_linked2
  783. cmp: EOF on f_src_linked2
  784. $
  785. .fi
  786. .\"
  787. .\" If you add/del a branch, or link/unlink the pseudo-linked
  788. .\" file on a branch
  789. .\" directly, aufs cannot keep the correct link count, but the status of
  790. .\" `pseudo-linked.'
  791. .\" Those files may or may not keep the file data after you unlink the
  792. .\" file on the branch directly, especially the case of your branch is
  793. .\" NFS.
  794. If you add a branch which has fileA or fileB, aufs does not follow the
  795. pseudo link. The file on the added branch has no relation to the same
  796. named file(s) on the lower branch(es).
  797. If you use noxino mount option, pseudo link will not work after the
  798. kernel shrinks the inode cache.
  799. This feature will not work for squashfs before version 3.2 since its
  800. inode is tricky.
  801. When the inode is hardlinked, squashfs inodes has the same inode
  802. number and correct link count, but the inode memory object is
  803. different. Squashfs inodes (before v3.2) are generated for each, even
  804. they are hardlinked.
  805. .\" ----------------------------------------------------------------------
  806. .SH User's Direct Branch Access (UDBA)
  807. UDBA means a modification to a branch filesystem manually or directly,
  808. e.g. bypassing aufs.
  809. While aufs is designed and implemented to be safe after UDBA,
  810. it can make yourself and your aufs confused. And some information like
  811. aufs inode will be incorrect.
  812. For example, if you rename a file on a branch directly, the file on
  813. aufs may
  814. or may not be accessible through both of old and new name.
  815. Because aufs caches various information about the files on
  816. branches. And the cache still remains after UDBA.
  817. Aufs has a mount option named `udba' which specifies the test level at
  818. access time whether UDBA was happened or not.
  819. .
  820. .TP
  821. .B udba=none
  822. Aufs trusts the dentry and the inode cache on the system, and never
  823. test about UDBA. With this option, aufs runs fastest, but it may show
  824. you incorrect data.
  825. Additionally, if you often modify a branch
  826. directly, aufs will not be able to trace the changes of inodes on the
  827. branch. It can be a cause of wrong behaviour, deadlock or anything else.
  828. It is recommended to use this option only when you are sure that
  829. nobody access a file on a branch.
  830. It might be difficult for you to achieve real `no UDBA' world when you
  831. cannot stop your users doing `find / \-ls' or something.
  832. If you really want to forbid all of your users to UDBA, here is a trick
  833. for it.
  834. With this trick, users cannot see the
  835. branches directly and aufs runs with no problem, except `auplink' utility.
  836. But if you are not familiar with aufs, this trick may make
  837. yourself confused.
  838. .nf
  839. # d=/tmp/.aufs.hide
  840. # mkdir $d
  841. # for i in $branches_you_want_to_hide
  842. > do
  843. > mount -n --bind $d $i
  844. > done
  845. .fi
  846. When you unmount the aufs, delete/modify the branch by remount, or you
  847. want to show the hidden branches again, unmount the bound
  848. /tmp/.aufs.hide.
  849. .nf
  850. # umount -n $branches_you_want_to_unbound
  851. .fi
  852. If you use FUSE filesystem as an aufs branch which supports hardlink,
  853. you should not set this option, since FUSE makes inode objects for
  854. each hardlinks (at least in linux\-2.6.23). When your FUSE filesystem
  855. maintains them at link/unlinking, it is equivalent
  856. to `direct branch access' for aufs.
  857. .
  858. .TP
  859. .B udba=reval
  860. Aufs tests only the existence of the file which existed. If
  861. the existed file was removed on the branch directly, aufs
  862. discard the cache about the file and
  863. re-lookup it. So the data will be updated.
  864. This test is at minimum level to keep the performance and ensure the
  865. existence of a file.
  866. This is default and aufs runs still fast.
  867. This rule leads to some unexpected situation, but I hope it is
  868. harmless. Those are totally depends upon cache. Here are just a few
  869. examples.
  870. .
  871. .RS
  872. .Bu
  873. If the file is cached as negative or
  874. not-existed, aufs does not test it. And the file is still handled as
  875. negative after a user created the file on a branch directly. If the
  876. file is not cached, aufs will lookup normally and find the file.
  877. .
  878. .Bu
  879. When the file is cached as positive or existed, and a user created the
  880. same named file directly on the upper branch. Aufs detects the cached
  881. inode of the file is still existing and will show you the old (cached)
  882. file which is on the lower branch.
  883. .
  884. .Bu
  885. When the file is cached as positive or existed, and a user renamed the
  886. file by rename(2) directly. Aufs detects the inode of the file is
  887. still existing. You may or may not see both of the old and new files.
  888. Todo: If aufs also tests the name, we can detect this case.
  889. .RE
  890. If your outer modification (UDBA) is rare and you can ignore the
  891. temporary and minor differences between virtual aufs world and real
  892. branch filesystem, then try this mount option.
  893. .
  894. .TP
  895. .B udba=inotify
  896. Aufs sets `inotify' to all the accessed directories on its branches
  897. and receives the event about the dir and its children. It consumes
  898. resources, cpu and memory. And I am afraid that the performance will be
  899. hurt, but it is most strict test level.
  900. There are some limitations of linux inotify, see also Inotify
  901. Limitation.
  902. So it is recommended to leave udba default option usually, and set it
  903. to inotify by remount when you need it.
  904. When a user accesses the file which was notified UDBA before, the cached data
  905. about the file will be discarded and aufs re-lookup it. So the data will
  906. be updated.
  907. When an error condition occurs between UDBA and aufs operation, aufs
  908. will return an error, including EIO.
  909. To use this option, you need to enable CONFIG_INOTIFY and
  910. CONFIG_AUFS_UDBA_INOTIFY.
  911. To rename/rmdir a directory on a branch directory may reveal the same named
  912. directory on the lower branch. Aufs tries re-lookuping the renamed
  913. directory and the revealed directory and assigning different inode
  914. number to them. But the inode number including their children can be a
  915. problem. The inode numbers will be changed silently, and
  916. aufs may produce a warning. If you rename a directory repeatedly and
  917. reveal/hide the lower directory, then aufs may confuse their inode
  918. numbers too. It depends upon the system cache.
  919. When you make a directory in aufs and mount other filesystem on it,
  920. the directory in aufs cannot be removed expectedly because it is a
  921. mount point. But the same named directory on the writable branch can
  922. be removed, if someone wants. It is just an empty directory, instead
  923. of a mount point.
  924. Aufs cannot stop such direct rmdir, but produces a warning about it.
  925. If the pseudo-linked file is hardlinked or unlinked on the branch
  926. directly, its inode link count in aufs may be incorrect. It is
  927. recommended to flush the pseudo-links by auplink script.
  928. .\" ----------------------------------------------------------------------
  929. .SH Linux Inotify Limitation
  930. Unfortunately, current inotify (linux\-2.6.18) has some limitations,
  931. and aufs must derive it.
  932. .SS IN_ATTRIB, updating atime
  933. When a file/dir on a branch is accessed directly, the inode atime (access
  934. time, cf. stat(2)) may or may not be updated. In some cases, inotify
  935. does not fire this event. So the aufs inode atime may remain old.
  936. .SS IN_ATTRIB, updating nlink
  937. When the link count of a file on a branch is incremented by link(2)
  938. directly,
  939. inotify fires IN_CREATE to the parent
  940. directory, but IN_ATTRIB to the file. So the aufs inode nlink may
  941. remain old.
  942. .SS IN_DELETE, removing file on NFS
  943. When a file on a NFS branch is deleted directly, inotify may or may
  944. not fire
  945. IN_DELETE event. It depends upon the status of dentry
  946. (DCACHE_NFSFS_RENAMED flag).
  947. In this case, the file on aufs seems still exists. Aufs and any user can see
  948. the file.
  949. .SS IN_IGNORED, deleted rename target
  950. When a file/dir on a branch is unlinked by rename(2) directly, inotify
  951. fires IN_IGNORED which means the inode is deleted. Actually, in some
  952. cases, the inode survives. For example, the rename target is linked or
  953. opened. In this case, inotify watch set by aufs is removed by VFS and
  954. inotify.
  955. And aufs cannot receive the events anymore. So aufs may show you
  956. incorrect data about the file/dir.
  957. .\" ----------------------------------------------------------------------
  958. .SH Virtual or Vertical Directory Block (VDIR)
  959. In order to provide the merged view of file listing, aufs builds
  960. internal directory block on memory. For readdir, aufs performs readdir()
  961. internally for each dir on branches, merges their entries with
  962. eliminating the whiteout\-ed ones, and sets it to the opened file (dir)
  963. object. So the file object has its entry list until it is closed. The
  964. entry list will be updated when the file position is zero (by
  965. rewinddir(3)) and becomes obsoleted.
  966. Some people may call it can be a security hole or invite DoS attack
  967. since the opened and once readdir\-ed dir (file object) holds its entry
  968. list and becomes a pressure for system memory. But I would say it is similar
  969. to files under /proc or /sys. The virtual files in them also holds a
  970. memory page (generally) while they are opened. When an idea to reduce
  971. memory for them is introduced, it will be applied to aufs too.
  972. The dynamically allocated memory block for the name of entries has a
  973. unit of \*[AUFS_RDBLK_DEF] bytes by default.
  974. During building dir blocks, aufs creates hash list (hashed and divided by
  975. \*[AUFS_RDHASH_DEF] by default) and judging whether
  976. the entry is whiteouted by its upper branch or already listed.
  977. These values are suitable for normal environments. But you may have
  978. millions of files or very long filenames under a single directory. For
  979. such cases, you may need to customize these values by specifying rdblk=
  980. and rdhash= aufs mount options.
  981. For instance, there are 97 files under my /bin, and the total name
  982. length is 597 bytes.
  983. .nf
  984. $ \\ls -1 /bin | wc
  985. 97 97 597
  986. .fi
  987. Strictly speaking, 97 end\-of\-line codes are
  988. included. But it is OK since aufs VDIR also stores the name length in 1
  989. byte. In this case, you do not need to customize the default values. 597 bytes
  990. filenames will be stored in 2 VDIR memory blocks (597 <
  991. \*[AUFS_RDBLK_DEF] x 2).
  992. And 97 filenames are distributed among \*[AUFS_RDHASH_DEF] lists, so one
  993. list will point 4 names in average. To judge the names is whiteouted or
  994. not, the number of comparison will be 4. 2 memory allocations
  995. and 4 comparison costs low (even if the directory is opened for a long
  996. time). So you do not need to customize.
  997. If your directory has millions of files, the you will need to specify
  998. rdblk= and rdhash=.
  999. .nf
  1000. $ ls -U /mnt/rotating-rust | wc -l
  1001. 1382438
  1002. .fi
  1003. In this case, assuming the average length of filenames is 6, in order to
  1004. get better time performance I would
  1005. recommend to set $((128*1024)) or $((64*1024)) for rdblk, and
  1006. $((8*1024)) or $((4*1024)) for rdhash.
  1007. You can change these values of the active aufs mount by "mount -o
  1008. remount".
  1009. This customization is not for
  1010. reducing the memory space, but for reducing time for the number of memory
  1011. allocation and the name comparison. The larger value is faster, in
  1012. general. Of course, you will need system memory. This is a generic
  1013. "time\-vs\-space" problem.
  1014. .\" ----------------------------------------------------------------------
  1015. .SH Copy On Write, or aufs internal copyup and copydown
  1016. Every stackable filesystem which implements copy\-on\-write supports the
  1017. copyup feature. The feature is to copy a file/dir from the lower branch
  1018. to the upper internally. When you have one readonly branch and one
  1019. upper writable branch, and you append a string to a file which exists on
  1020. the readonly branch, then aufs will copy the file from the readonly
  1021. branch to the writable branch with its directory hierarchy. It means one
  1022. write(2) involves several logical/internal mkdir(2), creat(2), read(2),
  1023. write(2) and close(2) systemcalls
  1024. before the actual expected write(2) is performed. Sometimes it may take
  1025. a long time, particularly when the file is very large.
  1026. If CONFIG_AUFS_DEBUG is enabled, aufs produces a message saying `copying
  1027. a large file.'
  1028. You may see the message when you change the xino file path or
  1029. truncate the xino/xib files. Sometimes those files can be large and may
  1030. take a long time to handle them.
  1031. .\" ----------------------------------------------------------------------
  1032. .SH Policies to Select One among Multiple Writable Branches
  1033. Aufs has some policies to select one among multiple writable branches
  1034. when you are going to write/modify something. There are two kinds of
  1035. policies, one is for newly create something and the other is for
  1036. internal copy-up.
  1037. You can select them by specifying mount option `create=CREATE_POLICY'
  1038. or `cpup=COPYUP_POLICY.'
  1039. These policies have no meaning when you have only one writable
  1040. branch. If there is some meaning, it must hurt the performance.
  1041. .SS Exceptions for Policies
  1042. In every cases below, even if the policy says that the branch where a
  1043. new file should be created is /rw2, the file will be created on /rw1.
  1044. .
  1045. .Bu
  1046. If there is a readonly branch with `wh' attribute above the
  1047. policy-selected branch and the parent dir is marked as opaque,
  1048. or the target (creating) file is whiteouted on the ro+wh branch, then
  1049. the policy will be ignored and the target file will be created on the
  1050. nearest upper writable branch than the ro+wh branch.
  1051. .RS
  1052. .nf
  1053. /aufs = /rw1 + /ro+wh/diropq + /rw2
  1054. /aufs = /rw1 + /ro+wh/wh.tgt + /rw2
  1055. .fi
  1056. .RE
  1057. .
  1058. .Bu
  1059. If there is a writable branch above the policy-selected branch and the
  1060. parent dir is marked as opaque or the target file is whiteouted on the
  1061. branch, then the policy will be ignored and the target file will be
  1062. created on the highest one among the upper writable branches who has
  1063. diropq or whiteout. In case of whiteout, aufs removes it as usual.
  1064. .RS
  1065. .nf
  1066. /aufs = /rw1/diropq + /rw2
  1067. /aufs = /rw1/wh.tgt + /rw2
  1068. .fi
  1069. .RE
  1070. .
  1071. .Bu
  1072. link(2) and rename(2) systemcalls are exceptions in every policy.
  1073. They try selecting the branch where the source exists as possible since
  1074. copyup a large file will take long time. If it can't be, ie. the
  1075. branch where the source exists is readonly, then they will follow the
  1076. copyup policy.
  1077. .
  1078. .Bu
  1079. There is an exception for rename(2) when the target exists.
  1080. If the rename target exists, aufs compares the index of the branches
  1081. where the source and the target are existing and selects the higher
  1082. one. If the selected branch is readonly, then aufs follows the copyup
  1083. policy.
  1084. .SS Policies for Creating
  1085. .
  1086. .TP
  1087. .B create=tdp | top\-down\-parent
  1088. Selects the highest writable branch where the parent dir exists. If
  1089. the parent dir does not exist on a writable branch, then the internal
  1090. copyup will happen. The policy for this copyup is always `bottom-up.'
  1091. This is the default policy.
  1092. .
  1093. .TP
  1094. .B create=rr | round\-robin
  1095. Selects a writable branch in round robin. When you have two writable
  1096. branches and creates 10 new files, 5 files will be created for each
  1097. branch.
  1098. mkdir(2) systemcall is an exception. When you create 10 new directories,
  1099. all are created on the same branch.
  1100. .
  1101. .TP
  1102. .B create=mfs[:second] | most\-free\-space[:second]
  1103. Selects a writable branch which has most free space. In order to keep
  1104. the performance, you can specify the duration (`second') which makes
  1105. aufs hold the index of last selected writable branch until the
  1106. specified seconds expires. The first time you create something in aufs
  1107. after the specified seconds expired, aufs checks the amount of free
  1108. space of all writable branches by internal statfs call
  1109. and the held branch index will be updated.
  1110. The default value is \*[AUFS_MFS_SECOND_DEF] seconds.
  1111. .
  1112. .TP
  1113. .B create=mfsrr:low[:second]
  1114. Selects a writable branch in most-free-space mode first, and then
  1115. round-robin mode. If the selected branch has less free space than the
  1116. specified value `low' in bytes, then aufs re-tries in round-robin mode.
  1117. .\" `G', `M' and `K' (case insensitive) can be followed after `low.' Or
  1118. Try an arithmetic expansion of shell which is defined by POSIX.
  1119. For example, $((10 * 1024 * 1024)) for 10M.
  1120. You can also specify the duration (`second') which is equivalent to
  1121. the `mfs' mode.
  1122. .
  1123. .TP
  1124. .B create=pmfs[:second]
  1125. Selects a writable branch where the parent dir exists, such as tdp
  1126. mode. When the parent dir exists on multiple writable branches, aufs
  1127. selects the one which has most free space, such as mfs mode.
  1128. .SS Policies for Copy-Up
  1129. .
  1130. .TP
  1131. .B cpup=tdp | top\-down\-parent
  1132. Equivalent to the same named policy for create.
  1133. This is the default policy.
  1134. .
  1135. .TP
  1136. .B cpup=bup | bottom\-up\-parent
  1137. Selects the writable branch where the parent dir exists and the branch
  1138. is nearest upper one from the copyup-source.
  1139. .
  1140. .TP
  1141. .B cpup=bu | bottom\-up
  1142. Selects the nearest upper writable branch from the copyup-source,
  1143. regardless the existence of the parent dir.
  1144. .\" ----------------------------------------------------------------------
  1145. .SH Exporting Aufs via NFS
  1146. Aufs is supporting NFS-exporting.
  1147. Since aufs has no actual block device, you need to add NFS `fsid' option at
  1148. exporting. Refer to the manual of NFS about the detail of this option.
  1149. There are some limitations or requirements.
  1150. .RS
  1151. .Bu
  1152. The branch filesystem must support NFS-exporting.
  1153. .Bu
  1154. NFSv2 is not supported. When you mount the exported aufs from your NFS
  1155. client, you will need to some NFS options like v3 or nfsvers=3,
  1156. especially if it is nfsroot.
  1157. .Bu
  1158. If the size of the NFS file handle on your branch filesystem is large,
  1159. aufs will
  1160. not be able to handle it. The maximum size of NFSv3 file
  1161. handle for a filesystem is 64 bytes. Aufs uses 24 bytes for 32bit
  1162. system, plus 12 bytes for 64bit system. The rest is a room for a file
  1163. handle of a branch filesystem.
  1164. .Bu
  1165. The External Inode Number Bitmap, Translation Table and Generation Table
  1166. (xino) is
  1167. required since NFS file
  1168. handle is based upon inode number. The mount option `xino' is enabled
  1169. by default.
  1170. The external inode generation table and its debugfs entry
  1171. (<debugfs>/aufs/si_*/xigen) is created when CONFIG_AUFS_EXPORT is
  1172. enabled even if you don't export aufs actually.
  1173. The size of the external inode generation table grows only, never be
  1174. truncated. You might need to pay attention to the free space of the
  1175. filesystem where xino files are placed. By default, it is the first
  1176. writable branch.
  1177. .Bu
  1178. The branch filesystems must be accessible, which means `not hidden.'
  1179. It means you need to `mount \-\-move' when you use initramfs and
  1180. switch_root(8), or chroot(8).
  1181. .RE
  1182. .\" ----------------------------------------------------------------------
  1183. .SH Dentry and Inode Caches
  1184. If you want to clear caches on your system, there are several tricks
  1185. for that. If your system ram is low,
  1186. try `find /large/dir \-ls > /dev/null'.
  1187. It will read many inodes and dentries and cache them. Then old caches will be
  1188. discarded.
  1189. But when you have large ram or you do not have such large
  1190. directory, it is not effective.
  1191. If you want to discard cache within a certain filesystem,
  1192. try `mount \-o remount /your/mntpnt'. Some filesystem may return an error of
  1193. EINVAL or something, but VFS discards the unused dentry/inode caches on the
  1194. specified filesystem.
  1195. .\" ----------------------------------------------------------------------
  1196. .SH Compatible/Incompatible with Unionfs Version 1.x Series
  1197. If you compile aufs with \-DCONFIG_AUFS_COMPAT, dirs= option and =nfsro
  1198. branch permission flag are available. They are interpreted as
  1199. br: option and =ro flags respectively.
  1200. `debug', `delete', `imap' options are ignored silently. When you
  1201. compile aufs without \-DCONFIG_AUFS_COMPAT, these three options are
  1202. also ignored, but a warning message is issued.
  1203. Ignoring `delete' option, and to keep filesystem consistency, aufs tries
  1204. writing something to only one branch in a single systemcall. It means
  1205. aufs may copyup even if the copyup-src branch is specified as writable.
  1206. For example, you have two writable branches and a large regular file
  1207. on the lower writable branch. When you issue rename(2) to the file on aufs,
  1208. aufs may copyup it to the upper writable branch.
  1209. If this behaviour is not what you want, then you should rename(2) it
  1210. on the lower branch directly.
  1211. And there is a simple shell
  1212. script `unionctl' under sample subdirectory, which is compatible with
  1213. unionctl(8) in
  1214. Unionfs Version 1.x series, except \-\-query action.
  1215. This script executes mount(8) with `remount' option and uses
  1216. add/del/mod aufs mount options.
  1217. If you are familiar with Unionfs Version 1.x series and want to use unionctl(8), you can
  1218. try this script instead of using mount \-o remount,... directly.
  1219. Aufs does not support ioctl(2) interface.
  1220. This script is highly depending upon mount(8) in
  1221. util\-linux\-2.12p package, and you need to mount /proc to use this script.
  1222. If your mount(8) version differs, you can try modifying this
  1223. script. It is very easy.
  1224. The unionctl script is just for a sample usage of aufs remount
  1225. interface.
  1226. Aufs uses the external inode number bitmap and translation table by
  1227. default.
  1228. The default branch permission for the first branch is `rw', and the
  1229. rest is `ro.'
  1230. The whiteout is for hiding files on lower branches. Also it is applied
  1231. to stop readdir going lower branches.
  1232. The latter case is called `opaque directory.' Any
  1233. whiteout is an empty file, it means whiteout is just an mark.
  1234. In the case of hiding lower files, the name of whiteout is
  1235. `\*[AUFS_WH_PFX]<filename>.'
  1236. And in the case of stopping readdir, the name is
  1237. `\*[AUFS_WH_PFX]\*[AUFS_WH_PFX].opq' or
  1238. `\*[AUFS_WH_PFX]__dir_opaque.' The name depends upon your compile
  1239. configuration
  1240. CONFIG_AUFS_COMPAT.
  1241. .\" All of newly created or renamed directory will be opaque.
  1242. All whiteouts are hardlinked,
  1243. including `<writable branch top dir>/\*[AUFS_WH_BASE].'
  1244. The hardlink on an ordinary (disk based) filesystem does not
  1245. consume inode resource newly. But in linux tmpfs, the number of free
  1246. inodes will be decremented by link(2). It is recommended to specify
  1247. nr_inodes option to your tmpfs if you meet ENOSPC. Use this option
  1248. after checking by `df \-i.'
  1249. When you rmdir or rename-to the dir who has a number of whiteouts,
  1250. aufs rename the dir to the temporary whiteouted-name like
  1251. `\*[AUFS_WH_PFX]<dir>.<random hex>.' Then remove it after actual operation.
  1252. cf. mount option `dirwh.'
  1253. .\" ----------------------------------------------------------------------
  1254. .SH Incompatible with an Ordinary Filesystem
  1255. stat(2) returns the inode info from the first existence inode among
  1256. the branches, except the directory link count.
  1257. Aufs computes the directory link count larger than the exact value usually, in
  1258. order to keep UNIX filesystem semantics, or in order to shut find(1) mouth up.
  1259. The size of a directory may be wrong too, but it has to do no harm.
  1260. The timestamp of a directory will not be updated when a file is
  1261. created or removed under it, and it was done on a lower branch.
  1262. The test for permission bits has two cases. One is for a directory,
  1263. and the other is for a non-directory. In the case of a directory, aufs
  1264. checks the permission bits of all existing directories. It means you
  1265. need the correct privilege for the directories including the lower
  1266. branches.
  1267. The test for a non-directory is more simple. It checks only the
  1268. topmost inode.
  1269. statfs(2) returns the information of the first branch info except
  1270. namelen when `nosum' is specified (the default). The namelen is
  1271. decreased by the whiteout prefix length. And the block size may differ
  1272. from st_blksize which is obtained by stat(2).
  1273. Remember, seekdir(3) and telldir(3) are not defined in POSIX. They may
  1274. not work as you expect. Try rewinddir(3) or re-open the dir.
  1275. The whiteout prefix (\*[AUFS_WH_PFX]) is reserved on all branches. Users should
  1276. not handle the filename begins with this prefix.
  1277. In order to future whiteout, the maximum filename length is limited by
  1278. the longest value \- \*[AUFS_WH_PFX_LEN]. It may be a violation of POSIX.
  1279. If you dislike the difference between the aufs entries in /etc/mtab
  1280. and /proc/mounts, and if you are using mount(8) in util\-linux package,
  1281. then try ./mount.aufs utility. Copy the script to /sbin/mount.aufs.
  1282. This simple utility tries updating
  1283. /etc/mtab. If you do not care about /etc/mtab, you can ignore this
  1284. utility.
  1285. Remember this utility is highly depending upon mount(8) in
  1286. util\-linux\-2.12p package, and you need to mount /proc.
  1287. Since aufs uses its own inode and dentry, your system may cache huge
  1288. number of inodes and dentries. It can be as twice as all of the files
  1289. in your union.
  1290. It means that unmounting or remounting readonly at shutdown time may
  1291. take a long time, since mount(2) in VFS tries freeing all of the cache
  1292. on the target filesystem.
  1293. When you open a directory, aufs will open several directories
  1294. internally.
  1295. It means you may reach the limit of the number of file descriptor.
  1296. And when the lower directory cannot be opened, aufs will close all the
  1297. opened upper directories and return an error.
  1298. The sub-mount under the branch
  1299. of local filesystem
  1300. is ignored.
  1301. For example, if you have mount another filesystem on
  1302. /branch/another/mntpnt, the files under `mntpnt' will be ignored by aufs.
  1303. It is recommended to mount the sub-mount under the mounted aufs.
  1304. For example,
  1305. .nf
  1306. # sudo mount /dev/sdaXX /ro_branch
  1307. # d=another/mntpnt
  1308. # sudo mount /dev/sdbXX /ro_branch/$d
  1309. # mkdir -p /rw_branch/$d
  1310. # sudo mount -t aufs -o br:/rw_branch:/ro_branch none /aufs
  1311. # sudo mount -t aufs -o br:/rw_branch/${d}:/ro_branch/${d} none /aufs/another/$d
  1312. .fi
  1313. There are several characters which are not allowed to use in a branch
  1314. directory path and xino filename. See detail in Branch Syntax and Mount
  1315. Option.
  1316. The file-lock which means fcntl(2) with F_SETLK, F_SETLKW or F_GETLK, flock(2)
  1317. and lockf(3), is applied to virtual aufs file only, not to the file on a
  1318. branch. It means you can break the lock by accessing a branch directly.
  1319. TODO: check `security' to hook locks, as inotify does.
  1320. The I/O to the named pipe or local socket are not handled by aufs, even
  1321. if it exists in aufs. After the reader and the writer established their
  1322. connection if the pipe/socket are copied-up, they keep using the old one
  1323. instead of the copied-up one.
  1324. The fsync(2) and fdatasync(2) systemcalls return 0 which means success, even
  1325. if the given file descriptor is not opened for writing.
  1326. I am afraid this behaviour may violate some standards. Checking the
  1327. behaviour of fsync(2) on ext2, aufs decided to return success.
  1328. If you want to use disk-quota, you should set it up to your writable
  1329. branch since aufs does not have its own block device.
  1330. When your aufs is the root directory of your system, and your system
  1331. tells you some of the filesystem were not unmounted cleanly, try these
  1332. procedure when you shutdown your system.
  1333. .nf
  1334. # mount -no remount,ro /
  1335. # for i in $writable_branches
  1336. # do mount -no remount,ro $i
  1337. # done
  1338. .fi
  1339. If your xino file is on a hard drive, you also need to specify
  1340. `noxino' option or `xino=/your/tmpfs/xino' at remounting root
  1341. directory.
  1342. To rename(2) directory may return EXDEV even if both of src and tgt
  1343. are on the same aufs. When the rename-src dir exists on multiple
  1344. branches and the lower dir has child(ren), aufs has to copyup all his
  1345. children. It can be recursive copyup. Current aufs does not support
  1346. such huge copyup operation at one time in kernel space, instead
  1347. produces a warning and returns EXDEV.
  1348. Generally, mv(1) detects this error and tries mkdir(2) and
  1349. rename(2) or copy/unlink recursively. So the result is harmless.
  1350. If your application which issues rename(2) for a directory does not
  1351. support EXDEV, it will not work on aufs.
  1352. Also this specification is applied to the case when the src directory
  1353. exists on the lower readonly branch and it has child(ren).
  1354. If a sudden accident such like a power failure happens during aufs is
  1355. performing, and regular fsck for branch filesystems is completed after
  1356. the disaster, you need to extra fsck for aufs writable branches. It is
  1357. necessary to check whether the whiteout remains incorrectly or not,
  1358. eg. the real filename and the whiteout for it under the same parent
  1359. directory. If such whiteout remains, aufs cannot handle the file
  1360. correctly.
  1361. To check the consistency from the aufs' point of view, you can use a
  1362. simple shell script called /sbin/auchk. Its purpose is a fsck tool for
  1363. aufs, and it checks the illegal whiteout, the remained
  1364. pseudo-links and the remained aufs-temp files. If they are found, the
  1365. utility reports you and asks whether to delete or not.
  1366. It is recommended to execute /sbin/auchk for every writable branch
  1367. filesystem before mounting aufs if the system experienced crash.
  1368. .\" ----------------------------------------------------------------------
  1369. .SH EXAMPLES
  1370. The mount options are interpreted from left to right at remount-time.
  1371. These examples
  1372. shows how the options are handled. (assuming /sbin/mount.aufs was
  1373. installed)
  1374. .nf
  1375. # mount -v -t aufs br:/day0:/base none /u
  1376. none on /u type aufs (rw,xino=/day0/.aufs.xino,br:/day0=rw:/base=ro)
  1377. # mount -v -o remount,\\
  1378. prepend:/day1,\\
  1379. xino=/day1/xino,\\
  1380. mod:/day0=ro,\\
  1381. del:/day0 \\
  1382. /u
  1383. none on /u type aufs (rw,xino=/day1/xino,br:/day1=rw:/base=ro)
  1384. .fi
  1385. .nf
  1386. # mount -t aufs br:/rw none /u
  1387. # mount -o remount,append:/ro /u
  1388. different uid/gid/permission, /ro
  1389. # mount -o remount,del:/ro /u
  1390. # mount -o remount,nowarn_perm,append:/ro /u
  1391. #
  1392. (there is no warning)
  1393. .fi
  1394. .\" If you want to expand your filesystem size, aufs may help you by
  1395. .\" adding an writable branch. Since aufs supports multiple writable
  1396. .\" branches, the old writable branch can be being writable, if you want.
  1397. .\" In this example, any modifications to the files under /ro branch will
  1398. .\" be copied-up to /new, but modifications to the files under /rw branch
  1399. .\" will not.
  1400. .\" And the next example shows the modifications to the files under /rw branch
  1401. .\" will be copied-up to /new/a.
  1402. .\"
  1403. .\" Todo: test multiple writable branches policy. cpup=nearest, cpup=exist_parent.
  1404. .\"
  1405. .\" .nf
  1406. .\" # mount -v -t aufs br:/rw:/ro none /u
  1407. .\" none on /u type aufs (rw,xino=/rw/.aufs.xino,br:/rw=rw:/ro=ro)
  1408. .\" # mkfs /new
  1409. .\" # mount -v -o remount,add:1:/new=rw /u
  1410. .\" none on /u type aufs (rw,xino=/rw/.aufs.xino,br:/rw=rw:/new=rw:/ro=ro)
  1411. .\" .fi
  1412. .\"
  1413. .\" .nf
  1414. .\" # mount -v -t aufs br:/rw:/ro none /u
  1415. .\" none on /u type aufs (rw,xino=/rw/.aufs.xino,br:/rw=rw:/ro=ro)
  1416. .\" # mkfs /new
  1417. .\" # mkdir /new/a new/b
  1418. .\" # mount -v -o remount,add:1:/new/b=rw,prepend:/new/a,mod:/rw=ro /u
  1419. .\" none on /u type aufs (rw,xino=/rw/.aufs.xino,br:/new/a=rw:/rw=ro:/new/b=rw:/ro=ro)
  1420. .\" .fi
  1421. When you use aufs as root filesystem, it is recommended to consider to
  1422. exclude some directories. For example, /tmp and /var/log are not need
  1423. to stack in many cases. They do not usually need to copyup or to whiteout.
  1424. Also the swapfile on aufs (a regular file, not a block device) is not
  1425. supported.
  1426. In order to exclude the specific dir from aufs, try bind mounting.
  1427. And there is a good sample which is for network booted diskless machines. See
  1428. sample/ in detail.
  1429. .\" ----------------------------------------------------------------------
  1430. .SH DIAGNOSTICS
  1431. When you add a branch to your union, aufs may warn you about the
  1432. privilege or security of the branch, which is the permission bits,
  1433. owner and group of the top directory of the branch.
  1434. For example, when your upper writable branch has a world writable top
  1435. directory,
  1436. a malicious user can create any files on the writable branch directly,
  1437. like copyup and modify manually. I am afraid it can be a security
  1438. issue.
  1439. When you mount or remount your union without \-o ro common mount option
  1440. and without writable branch, aufs will warn you that the first branch
  1441. should be writable.
  1442. .\" It is discouraged to set both of `udba' and `noxino' mount options. In
  1443. .\" this case the inode number under aufs will always be changed and may
  1444. .\" reach the end of inode number which is a maximum of unsigned long. If
  1445. .\" the inode number reaches the end, aufs will return EIO repeatedly.
  1446. When you set udba other than inotify and change something on your
  1447. branch filesystem directly, later aufs may detect some mismatches to
  1448. its cache. If it is a critical mismatch, aufs returns EIO.
  1449. When an error occurs in aufs, aufs prints the kernel message with
  1450. `errno.' The priority of the message (log level) is ERR or WARNING which
  1451. depends upon the message itself.
  1452. You can convert the `errno' into the error message by perror(3),
  1453. strerror(3) or something.
  1454. For example, the `errno' in the message `I/O Error, write failed (\-28)'
  1455. is 28 which means ENOSPC or `No space left on device.'
  1456. When CONFIG_AUFS_BR_RAMFS is enabled, you can specify ramfs as an aufs
  1457. branch. Since ramfs is simple, it does not set the maximum link count
  1458. originally. In aufs, it is very dangerous, particularly for
  1459. whiteouts. Finally aufs sets the maximum link count for ramfs. The
  1460. value is 32000 which is borrowed from ext2.
  1461. .\" .SH Current Limitation
  1462. .
  1463. .\" ----------------------------------------------------------------------
  1464. .\" SYNOPSIS
  1465. .\" briefly describes the command or function's interface. For commands, this
  1466. .\" shows the syntax of the command and its arguments (including options); bold-
  1467. .\" face is used for as-is text and italics are used to indicate replaceable
  1468. .\" arguments. Brackets ([]) surround optional arguments, vertical bars (|) sep-
  1469. .\" arate choices, and ellipses (...) can be repeated. For functions, it shows
  1470. .\" any required data declarations or #include directives, followed by the func-
  1471. .\" tion declaration.
  1472. .
  1473. .\" DESCRIPTION
  1474. .\" gives an explanation of what the command, function, or format does. Discuss
  1475. .\" how it interacts with files and standard input, and what it produces on
  1476. .\" standard output or standard error. Omit internals and implementation
  1477. .\" details unless they're critical for understanding the interface. Describe
  1478. .\" the usual case; for information on options use the OPTIONS section. If
  1479. .\" there is some kind of input grammar or complex set of subcommands, consider
  1480. .\" describing them in a separate USAGE section (and just place an overview in
  1481. .\" the DESCRIPTION section).
  1482. .
  1483. .\" RETURN VALUE
  1484. .\" gives a list of the values the library routine will return to the caller and
  1485. .\" the conditions that cause these values to be returned.
  1486. .
  1487. .\" EXIT STATUS
  1488. .\" lists the possible exit status values or a program and the conditions that
  1489. .\" cause these values to be returned.
  1490. .
  1491. .\" USAGE
  1492. .\" describes the grammar of any sublanguage this implements.
  1493. .
  1494. .\" FILES
  1495. .\" lists the files the program or function uses, such as configuration files,
  1496. .\" startup files, and files the program directly operates on. Give the full
  1497. .\" pathname of these files, and use the installation process to modify the
  1498. .\" directory part to match user preferences. For many programs, the default
  1499. .\" installation location is in /usr/local, so your base manual page should use
  1500. .\" /usr/local as the base.
  1501. .
  1502. .\" ENVIRONMENT
  1503. .\" lists all environment variables that affect your program or function and how
  1504. .\" they affect it.
  1505. .
  1506. .\" SECURITY
  1507. .\" discusses security issues and implications. Warn about configurations or
  1508. .\" environments that should be avoided, commands that may have security impli-
  1509. .\" cations, and so on, especially if they aren't obvious. Discussing security
  1510. .\" in a separate section isn't necessary; if it's easier to understand, place
  1511. .\" security information in the other sections (such as the DESCRIPTION or USAGE
  1512. .\" section). However, please include security information somewhere!
  1513. .
  1514. .\" CONFORMING TO
  1515. .\" describes any standards or conventions this implements.
  1516. .
  1517. .\" NOTES
  1518. .\" provides miscellaneous notes.
  1519. .
  1520. .\" BUGS
  1521. .\" lists limitations, known defects or inconveniences, and other questionable
  1522. .\" activities.
  1523. .SH COPYRIGHT
  1524. Copyright \(co 2005\-2009 Junjiro R. Okajima
  1525. .SH AUTHOR
  1526. Junjiro R. Okajima
  1527. .\" SEE ALSO
  1528. .\" lists related man pages in alphabetical order, possibly followed by other
  1529. .\" related pages or documents. Conventionally this is the last section.