Browse Source

reverse source and destination mount points to match fstab requirements. closes #13

pull/36/head
Antonio SJ Musumeci 11 years ago
parent
commit
45a2e09fbe
  1. 27
      README.md
  2. 11
      src/option_parser.cpp

27
README.md

@ -33,7 +33,7 @@ Filesystem calls are broken up into 4 functional categories: search, action, cre
#### statvfs #### #### statvfs ####
Since we aren't trying to stripe data across drives or move them should ENOSPC be return on a write the free space of the mountpoint is just that of the source mount with the most free space at the moment.
It normalizes the source drives based on the fragment size and sums the number of adjusted blocks and inodes. This means you will see the combined space of all sources. Total, used, and free. The sources however are dedupped based on the drive so multiple points on the same drive will not result in double counting it's space.
**NOTE:** create is really a search for existence and then create. The 'search' policy applies to the first part. If the [dirname](http://linux.die.net/man/3/dirname) of the full path is not found to exist [ENOENT](http://linux.die.net/man/3/errno) is returned. **NOTE:** create is really a search for existence and then create. The 'search' policy applies to the first part. If the [dirname](http://linux.die.net/man/3/dirname) of the full path is not found to exist [ENOENT](http://linux.die.net/man/3/errno) is returned.
@ -41,15 +41,36 @@ Usage
===== =====
``` ```
$ mergerfs -o create=epmfs,search=ff,action=ff <mountpoint> <dir0>:<dir1>:<dir2>
$ mergerfs -o create=epmfs,search=ff,action=ff <srcpoints> <mountpoint>
``` ```
###options###
| Option | Default | | Option | Default |
|--------|--------| |--------|--------|
| search | ff | | search | ff |
| action | ff | | action | ff |
| create | epmfs | | create | epmfs |
###srcpoints###
The source points argument is a colon (':') delimited list of paths. To make it simplier to include multiple source points without having to modify your [fstab](http://linux.die.net/man/5/fstab) we also support [globbing](http://linux.die.net/man/7/glob).
```
$ mergerfs /mnt/disk*:/mnt/cdrom /media/drives
```
The above line will use all points in /mnt prefixed with *disk* and the directory *cdrom*.
In /etc/fstab it'd look like the following:
```
# <file system> <mount point> <type> <options> <dump> <pass>
/mnt/disk*:/mnt/cdrom /media/drives fuse.mergerfs allow_other 0 0
```
**NOTE:** the globbing is done at mount time. If a new directory is added matching the glob after the fact it will not be included.
Building Building
======== ========
@ -60,7 +81,7 @@ Building
``` ```
[trapexit:~/dev/mergerfs] $ make help [trapexit:~/dev/mergerfs] $ make help
usage: make usage: make
make WITHOUT_XATTR=1 - to build program without xattrs functionality
make XATTR_AVAILABLE=0 - to build program without xattrs functionality (auto discovered otherwise)
``` ```
Runtime Settings Runtime Settings

11
src/option_parser.cpp

@ -134,15 +134,10 @@ option_processor(void *data,
break; break;
case FUSE_OPT_KEY_NONOPT: case FUSE_OPT_KEY_NONOPT:
if(config.destmount.empty())
{
rv = 1;
config.destmount = arg;
}
else
{
if(config.srcmounts.empty())
process_srcmounts(arg,config); process_srcmounts(arg,config);
}
else
rv = (config.destmount = arg,1);
break; break;
default: default:

Loading…
Cancel
Save