MFSTOOLS(1)

NAME
mfstools - perform MooseFS-specific operations

SYNOPSIS
mfsgetgoal [-r] [-n|-h|-H] OBJECT...

mfsrgetgoal [-n|-h|-H] OBJECT...

mfssetgoal [-r] [-n|-h|-H] Name OBJECT...

mfssetquota [-r] [-n|-h|-H] [+|-]N TODO(alek)...

mfsrepquota [-r] [-n|-h|-H] [+|-]N TODO(alek)...

mfsrsetgoal [-n|-h|-H] [+|-]N OBJECT...

mfsgettrashtime [-r] [-n|-h|-H] OBJECT...

mfsrgettrashtime [-n|-h|-H] OBJECT...

mfssettrashtime [-r] [-n|-h|-H] [+|-]SECONDS OBJECT...

mfsrsettrashtime [-n|-h|-H] [+|-]SECONDS OBJECT...

mfsgeteattr [-r] [-n|-h|-H] OBJECT...

mfsseteattr [-r] [-n|-h|-H] -f ATTRNAME [-f ATTRNAME ...] OBJECT...

mfsdeleattr [-r] [-n|-h|-H] -f ATTRNAME [-f ATTRNAME ...] OBJECT...

mfscheckfile FILE...

mfsfileinfo FILE...

mfsdirinfo [-n|-h|-H] OBJECT...

mfsfilerepair [-n|-h|-H] FILE...

mfsappendchunks SNAPSHOT_FILE OBJECT...

mfsmakesnapshot [-o] SOURCE... DESTINATION

DESCRIPTION
mfsgetgoal and mfssetgoal operate on object's goal value. mfsgetgoal prints current goal value of given object(s). -r option enables recursive mode, which works as usual for every given file, but for every given directory additionally prints current goal value of all contained objects (files and directories). mfssetgoal changes current goal value of given object(s). -r option enables recursive mode. These tools can be used on any file, directory or deleted (trash) file.

mfsrgetgoal and mfsrsetgoal are deprecated aliases for mfsgetgoal -r and mfssetgoal -r respectively.

mfsgettrashtime and mfssettrashtime operate on object's trashtime value, i.e. the number of seconds the file is preserved in special trash directory before it's finally removed from filesystem. Trashtime must be non-negative integer value. mfsgettrashtime prints current trashtime value of given object(s). -r option enables recursive mode, which works as usual for every given file, but for every given directory additionally prints current trashtime value of all contained objects (files and directories). mfssettrashtime changes current trashtime value of given object(s). If new value is specified in +N form, trashtime value is increased to N for objects with lower trashtime value and unchanged for the rest. Similarly, if new value is specified as -N, trashtime value is decreased to N for objects with higher trashtime value and unchanged for the rest. -r option enables recursive mode. These tools can be used on any file, directory or deleted (trash) file.

mfsrgettrashtime and mfsrsettrashtime are deprecated aliases for mfsgettrashtime -r and mfssettrashtime -r respectively.

mfsgeteattr, mfsseteattr and mfsdeleattr tools are used to get, set or delete some extra attributes. Attributes are described below.

mfscheckfile checks and prints number of chunks and number of chunk copies belonging to specified file(s). It can be used on any file, included deleted (trash).

mfsfileinfo prints location (chunkserver host and port) of each chunk copy belonging to specified file(s). It can be used on any file, included deleted (trash).

mfsdirinfo is extended, MooseFS-specific equivalent of du -s command. It prints summary for each specified object (single file or directory tree).

mfsfilerepair deals with broken files (those which cause I/O errors on read operations) to make them partially readable. In case of missing chunk it fills missing parts of file with zeros; in case of chunk version mismatch it sets chunk version known to mfsmaster to highest one found on chunkservers. Note: because in the second case content mismatch can occur in chunks with the same version, it's advised to make a copy (not a snapshot!) and delete original file after "repairing".

mfsappendchunks (equivalent of mfssnapshot from MooseFS 1.5) appends a lazy copy of specified file(s) to specified snapshot file ("lazy" means that creation of new chunks is delayed to the moment one copy is modified). If multiple files are given, they are merged into one target file in the way that each file begins at chunk (64MB) boundary; padding space is left empty.

mfsmakesnapshots makes a "real" snapshot (lazy copy, like in case of mfsappendchunks) of some object(s) or subtree (similarly to cp -r command). It's atomic with respect to each SOURCE argument separately. If DESTINATION points to already existing file, error will be reported unless -o (overwrite) option is given. Note: if SOURCE is a directory, it's copied as a whole; but if it's followed by trailing slash, only directory content is copied.

GENERAL OPTIONS
Most of mfstools use -n, -h and -H options to select format of printed numbers. -n causes to print exact numbers, -h uses binary prefixes (Ki, Mi, Gi as 2^10, 2^20 etc.) while -H uses SI prefixes (k, M, G as 10^3, 10^6 etc.). The same can be achieved by setting MFSHRFORMAT environment variable to: 0 (exact numbers), 1 or h (binary prefixes), 2 or H (SI prefixes), 3 or h+ (exact numbers and binary prefixes), 4 or H+ (exact numbers and SI prefixes). The default is to print just exact numbers.

EXTRA ATTRIBUTES
noowner This flag means, that particular object belongs to current user (uid and gid are equal to uid and gid values of accessing process). Only root (uid=0) sees the real uid and gid.

noattrcache This flag means, that standard file attributes such as uid, gid, mode, length and so on won't be stored in kernel cache. In MooseFS 1.5 this was the only behaviour, and mfsmount always prevented attributes from being stored in kernel cache, but in MooseFS 1.6 attributes can be cached, so in very rare ocassions it could be useful to turn it off.

noentrycache This flag is similar to above. It prevents directory entries from being cached in kernel.

INHERITANCE
When new object is created in MooseFS, attributes such as goal, trashtime and extra attributes are inherited from parent directory. So if you set i.e. "noowner" attribute and goal to 3 in a directory then every new object created in this directory will have goal set to 3 and "noowner" flag set. A newly created object inherits always the current set of its parent's attributes. Changing a directory attribute does not affect its already created children. To change an attribute for a directory and all of its children use "-r" option.

NOTES
mfstools require MooseFS (mfsmaster and mfsmount) >= 1.6.0 to work on read-only filesystem.

REPORTING BUGS
Report bugs to <contact@lizardfs.org>.

COPYRIGHT
Copyright 2008-2009 Gemius SA, 2013 Skytechnology sp. z o.o.. LizardFS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3. LizardFS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with LizardFS If not, see <http://www.gnu.org/licenses/>.

SEE ALSO
mfsmount(8), moosefs(7)