mfstools(1)

NAME
mfstools - perform MooseFS-specific operations

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

mfsrgetgoal [-n|-h|-H|-k|-m|-g] OBJECT...

mfssetgoal [-r] [-n|-h|-H|-k|-m|-g] [+|-]N OBJECT...

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

mfsgettrashtime [-r] [-n|-h|-H|-k|-m|-g] OBJECT...

mfsrgettrashtime [-n|-h|-H|-k|-m|-g] OBJECT...

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

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

mfsgeteattr [-r] [-n|-h|-H|-k|-m|-g] OBJECT...

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

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

mfscheckfile FILE...

mfsfileinfo FILE...

mfsdirinfo [-n|-h|-H|-k|-m|-g] [-i|-d|-f|-c|-l|-s|-r] OBJECT...

mfsfilerepair [-n|-h|-H|-k|-m|-g] FILE...

mfsappendchunks SNAPSHOT_FILE OBJECT...

mfsmakesnapshot [-o] SOURCE... DESTINATION

mfsgetquota [-n|-h|-H|-k|-m|-g] DIRECTORY...

mfssetquota [-n|-h|-H|-k|-m|-g] [-i|-I inodes] [-l|-L length] [-s|-S size] [-r|-R realsize] DIRECTORY...

mfsdelquota [-a|-A|-i|-I|-l|-L|-s|-S|-r|-R] [-n|-h|-H|-k|-m|-g] -f DIRECTORY...

mfsfilepaths OBJECT|INODE...

DESCRIPTION
mfsgetgoal and mfssetgoal operate on object's goal value, i.e. the number of copies in which all file data are stored. It means that file should survive failure of one less chunkservers than its goal value. Goal must be set between 1 and 9 (note that 1 is strongly unadvised). 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). If new value is specified in +N form, goal value is increased to N for objects with lower goal value and unchanged for the rest. Similarly, if new value is specified as -N, goal value is decreased to N for objects with higher goal value and unchanged for the rest. -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). If you only want to see one parameter, then add one of show options (see SHOW OPTIONS).

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.

mfsmakesnapshot 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.

mfsgetquota, mfssetquota and mfsdelquota tools are used to check, define and delete quotas. Quota is set on a directory. It can be set in one of 4 ways: for number of inodes inside the directory (total sum of the subtree's inodes) with -i, -I options, for sum of (logical) file lengths with -l, -L options, for sum of chunk sizes (not considering goals) with -s, -S options and for physical hdd space (more or less chunk sizes multiplied by goal of each chunk) with -r, -R options. Small letters set soft quota, capital letters set hard quota. -a and -A options in mfsdelquota mean all kinds of quota. Quota behaviour is described below.

mfsfilepaths tool can be used to find all occurences (hard links) of given file in filesystem. Also can be used to find file by number of i-node. In case of searching by i-node tool has to be run in mfs mounted directory.

GENERAL OPTIONS
Most of mfstools use -n, -h, -H, -k, -m and -g 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.). -k, -m and -g show plain numbers respectivaly in kibis (binary kilo - 1024), mebis (binary mega - 1024^2) and gibis (binary giga - 1024^3). 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.

SHOW OPTIONS

-i  show number of inodes

-d  show number of directories

-f  show number of files

-c  show number of chunks

-l  show length

-s  show size

-r  show realsize

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.

QUOTAS
Quota is always set on a directory. Hard quota cannot be exceeded anytime. Soft quota can be exceeded for a period of time (7 days). Once a quota is exceeded in a directory, user must go below the quota during the next 7 days. If not, the soft quota for this particular directory starts to behave like a hard quota. The 7 days period is global and cannot currently be modified.

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.

REPORTING BUGS
Report bugs to <bugs@moosefs.com>.

COPYRIGHT
Copyright (C) 2015 Jakub Kruszona-Zawadzki, Core Technology Sp. z o.o. This file is part of MooseFS. MooseFS 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 2 (only). MooseFS 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 MooseFS; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or visit http://www.gnu.org/licenses/gpl-2.0.html

SEE ALSO
mfsmount(8), moosefs(7)