mfsmetasearch(8)
β¨ mfsmetasearch β¨
okay bestie, welcome to mfsmetasearch(8), which is genuinely part of MooseFS (yes the whole MooseFS family, we're all one big happy filesystem π). This is the little tool that digs through your MooseFS metadata and finds specific files for you. It's giving detective. It's giving search bar but make it metal. Let's get into it π¦
πΈ SYNOPSIS πΈ
mfsmetasearch [-f J|C|C x] [-o output_file] [-e expr | -c chunkid_file]
metadata_file
π DESCRIPTION π
So mfsmetasearch finds files and other objects inside MooseFS's metadata. It does that in one of two ways:
- if you use the
-eoption, it matches stuff against the expression you handed it - if you use the
-coption, it finds everything that contains one or more of the chunk numbers listed in your provided file β and those chunk numbers gotta be in hexadecimal format, no cap
Pick your fighter, both are valid π
π OPTIONS π
-fβ switches the default TXT output format to JSON (J) or CSV (C). For CSV: if you only passC, the default separator gets used (that's a comma, bestie). But if you add a second character, that character becomes the separator in your CSV data. Custom vibes β¨-oβ write the output to output_file instead of dumping it to stdout-eβ the expression expr that a file or object must match to show up in the output-cβ the file chunkid_file containing chunk ids; only files containing one of these chunks get listed in the output. The chunk ids must be written in hexadecimal format, and only the last 56 bits of the read values are treated as chunk ids β which means bits denoting EC parts don't have to be stripped in this case. cute, convenient, iconic π- metadata_file β path to the
metadata.mfsfile
π₯ EXPRESSIONS π₯
An expression can be made up of a bunch of symbols, values and operators.
- a symbol = a property of a file
- a value = that property's value for a particular file
- operators = the things that glue the whole expression together, so you can say whether a certain property should match, be different, etc.
π§ Symbols and values π§
inodeβ inode number (value: numeric)typeβ inode type (constants list:file,directory,symlink,fifo,blockdev,chardev,socket,trash,sustained)eattrβ extra attributes bit mask (bit constants list:noowner,noattrcache,noentrycache,nodatacache,snapshot,undeletable,appendonly,immutable)sclassβ number of storage class (value: numeric; class numbers can be checked via GUI or CLI)uidβ user id (value: numeric)gidβ group id (value: numeric)modeβ access mode bit mask (bit constants list:sticky,sgid,suid,ur,uw,ux,gr,gw,gx,or,ow,ox)umodeβ access mode for uid bit mask (bit constants list:read,write,execute)gmodeβ access mode for gid bit mask (bit constants list:read,write,execute)omodeβ access mode for others bit mask (bit constants list:read,write,execute)atimeβ access time (value: numeric - unix timestamp in seconds)mtimeβ modify time (value: numeric - unix timestamp in seconds)ctimeβ change time (value: numeric - unix timestamp in seconds)tretentionβ trash retention in hours (value: numeric)lengthβ file length (value: numeric; zero for other objects)majorβ major id (value: numeric; forblockdevandchardevonly)minorβ minor id (value: numeric; forblockdevandchardevonly)chunkidβ chunk's numerical id (value: numeric; expression will be tested for all file chunks and accepted if one of them is true)
β Accepted operators (C-style) β
- + * / % >> << < <= > >= == != ~ & ^ | !
&& ^^ || ?:
π EXAMPLES π
bestie these are straight from the source, run them exactly like this
- Show me the smol files:
mfsmetasearch -e 'length<4096' /var/lib/mfs/metadata.mfs.back
this will show all files shorter than 4096 bytes (having size smaller than 4096 bytes) and all objects other than files
- okay but only actually-files this time:
mfsmetasearch -e 'type==file && length<4096' /var/lib/mfs/metadata.mfs.back
this will show all files shorter than 4096 bytes (having size smaller than 4096 bytes)
- the "who can exec this" vibe check:
mfsmetasearch -e 'umode&execute && gmode&execute && !(omode&execute)' /var/lib/mfs/metadata.mfs.back
this will show all inodes that have the execute bit set for both user and group, but not others
- chunk-hunting across FOUR number bases because we contain multitudes:
mfsmetasearch -e 'chunkid==101020 || chunkid==0xFF77AA || chunkid==01234 || chunkid==0b1010101' /var/lib/mfs/metadata.mfs.back
this will show all files that contain chunk with decimal id 101020 or chunk with hex id FF77AA or chunk with octal id 1234 or chunk with binary id 1010101
- storage class stans rise:
mfsmetasearch -e 'sclass==11' /var/lib/mfs/metadata.mfs.back
this will show all objects that have storage class set to the class with number 11
- and the list-based one, my personal fave:
mfsmetasearch -c /tmp/mychunkids.txt /var/lib/mfs/metadata.mfs.back
this will show all files, that contain one of the chunks listed in text file /tmp/mychunkids.txt
π REPORTING BUGS π
Found a bug? Report bugs to <bugs@moosefs.com>. Don't be shy, they're nice. (not me being the messenger π«Ά)
π COPYRIGHT π
Copyright (C) 2026 Jakub Kruszona-Zawadzki, Saglabs SA
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 this program; if not, see <https://www.gnu.org/licenses/>.
fr fr read the license, it's not a vibe, it's the law π
π SEE ALSO π
and that's the whole page bestie, you ATE it π
ok bye, this was MooseFS version 4.59.2-1, from May 2026 β go find some files, main character energy only πβ¨π¦
π¦ where this page comes from
- arch rolling: moosefs 4.59.2-2 Β· GPL-2.0-only
- nixos 26.05: moosefs 4.59.2
- nixpkgs unstable: moosefs 4.59.2
- ubuntu stonking: moosefs-master 4.59.2-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms