Mount options
=============

When mounting NILFS, the following options are accepted:

cp=blknum                Mount a snapshot whose checkpoint is stored in
                         the segment specified with the block number.
                         A read-only mount option should be given 
                         together; otherwise the mount will fail.
                         This option is preliminary, and will be revised
                         in future releases.

recovery=<sw>            Don't roll back if <sw> matches <off>.

sync=segment       (*)   This will unplug the block layer at the last
                         BIO request in writing each segment.

sync=bio                 This will unplug the block layer for every
                         BIO request to write segments.

sync=<off>               Don't unplug the block layer for writing
                         segments.

barrier=<sw>             Enables/disables write barriers.
                         The option is enabled by default.
                         For Linux kernels before version 2.6.16, the 
                         barrier is only supported by limited drivers.
                         For the device without the barrier support,
                         it will be turned off automatically.

order=relaxed      (*)   Apply relaxed order semantics that corresponds
		         to the ordered data mode of ext3.
			 This option improves synchronous write
			 performance in the case of overwriting.

order=strict             Apply strict in-order semantics that preserves
			 sequence of all file operations including
			 overwriting of data blocks.  That means, no
			 overtaking of events occurs among adjacent
			 snapshots or in a recovered filesystem after
			 a crash.

passive=<sw>             Mount a read/write-mode instance in passive
(experimental)		 mode if <sw> matches <on>.
			 This option disables background write due to
                         a timeout and allows userland tools to set the
			 timestamp of segments.  A copy destination 
			 partition is mounted by this mode when cloning
			 a NILFS partition.

errors=remount-ro        Remount the filesystem read-only on an error.
errors=continue    (*)   Keep going on a filesystem error.
errors=panic             Panic and halt the machine if an error occurs.


Notes:

   (*) == default

   <sw>   := <on> | <off>
   <on>   := on | true
   <off>  := off | false | none


Examples
========

A Read/write mode mount (rw-mount) can be done like ordinary
filesystems.

   # mount -t nilfs /dev/sda3 /mnt

Mount parameters are, of course, describable in /etc/fstab.

Similar to ordinary filesystems, NILFS shares one fs-instance for all
rw-mounts done on a same block device.  Thus, directory trees /foo and
/bar seen after the following mounts, are identical; modifications to
one directory appear on another:

   # mount -t nilfs /dev/sda3 /foo
   # mount -t nilfs /dev/sda3 /bar
   # ls /foo /bar
   /foo:
   
   /bar:
   # touch /foo/baz
   # ls /foo /bar
   /foo:
   baz
   
   /bar:
   baz

We can see past directory trees by mounting snapshots. The snapshot
is mounted as a read-only mount (ro-mount) whose checkpoint is
specified with a block number.  The checkpoint and its block number
can be listed by inspect or listcp.

   # mount -t nilfs /dev/sda3 /home
   ...
   # listcp -l /dev/sda3
    137686    66 Wed Jan  4 14:48:51 MajorCP|LogiBegin|LogiEnd
     ...
    150528  1852 Wed Jan 11 14:54:01 MajorCP|LogiBegin|LogiEnd
     ...
   # mkdir /home-last-week /home-5-minutes-ago
   # mount -t nilfs -r -o cp=137686 /dev/sda3 /home-last-week
   # mount -t nilfs -r -o cp=150528 /dev/sda3 /home-5-minutes-ago

A read-only mount option (i.e. '-r') should be given with the
checkpoint together; otherwise an error will be returned.

We can omit the cp option.  In this case, NILFS mounts the latest
checkpoint.  This feature helps online backup because it can clip
a consistent state and freeze it for long stretches.
   
   # mount
   ...
   /dev/sda3 on /var type nilfs (rw)
   # mount -t nilfs -r /dev/sda3 /mnt
   # tar jcf var-2006-01-18-15h02m47s.tar.gz /mnt


Other options such as barrier are specified as follows:

   # mount -t nilfs -o barrier=on /dev/sda3 /mnt

As for the meaning of each option, please refer to the
descriptions above.


Known problem
=============

 * diff problem

   In some cases, diff tool regards two directories (or files) as
   identical when both their block devices and inode numbers
   equal.

   This is the matter depending on the current NILFS
   specification where a rw-mount and their snapshots are mounted
   on the same block device.
   
   We would like to contend with this problem in the future
   release.

---
mount-options.txt,v 1.11 2006/07/10 12:13:16 ryusuke Exp
