mfsmetasearch(8)

πŸ“¦
version 4.59.2 Β· 3 versions
, in arch rolling, nixos 26.05, nixpkgs unstable, ubuntu stonking

✨ 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 -e option, it matches stuff against the expression you handed it
  • if you use the -c option, 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 pass C, 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.mfs file

πŸ”₯ 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; for blockdev and chardev only)
  • minor β€” minor id (value: numeric; for blockdev and chardev only)
  • 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
  1. 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

  1. 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)

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

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

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

  1. 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 (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