Skip to content

find.flexfs

find.flexfs provides fast filesystem search by querying the metadata server directly, bypassing the FUSE layer. It supports filters on inode attributes, timestamps, size, cost, permissions, and file type.

Terminal window
find.flexfs [flags] [path...]

If no path is specified, the current directory is used. Can operate from within a flexFS mount or connect directly via --metaAddr and --volume.

FlagTypeDefaultDescription
--fieldsstring slicepathOutput fields (comma-separated). Use all for all fields.
--headerboolfalseInclude header row in output
--limituint640Maximum number of results (0 = unlimited)
--noDecodeboolfalsePrint base32-encoded paths
--outputFile, -ostringOutput file path. With multiple search paths, all results go to this one file, with a single header row.

Results are written to standard output (or the --outputFile file); error messages are written to standard error. This means you can safely pipe results into other commands without error text mixing into the data.

Available fields: path, ino, mode, type, perm, blocks, size, size_bin, cost, nlink, uid, gid, ctime, mtime, atime, btime, xattrs.

The cost field is an estimated monthly storage cost in US dollars ($/month). See the analyze.flexfs cost field documentation for how it is calculated.

The xattrs field emits an inode’s extended attributes as a JSON object. See Xattrs field below.

FlagTypeDefaultDescription
--metaAddrstringMetadata server address (must pair with --volume)
--mountPathstringClient mount path. Only needed in direct mode when the search path passes through symbolic links whose targets are absolute paths (e.g. /mnt/flexfs/data); when run from inside a mount, this is detected automatically.
--volumestringVolume UUID or name (must pair with --metaAddr)

Search paths may pass through symbolic links. Links that stay within the volume are followed automatically, including a link as the final path component — find.flexfs /mnt/flexfs/current/logs works even when current is a link to a release directory. A link whose target points outside the volume cannot be searched and returns an error that names the link.

FlagTypeDefaultDescription
--emptyboolfalseFilter for empty files or directories
--giduint320Filter by group ID
--inouint640Filter by inode number
--namestringFilter by dentry name (supports glob patterns)
--permstring0Required permission bits (octal, with or without a leading 0755 and 0755 mean the same thing; max 07777). Matches when (mode & permMask) == perm.
--permMaskstring0777Bits of the file mode to test (octal, with or without a leading 0; max 07777). The default tests owner/group/other. Set to 7777 to also test setuid/setgid/sticky.
--sparseboolfalseFilter for sparse files
--typestringFilter by inode type: b, c, d, f, l, p, s
--uiduint320Filter by user ID
FlagTypeDefaultDescription
--maxBlocksuint640Maximum blocks filter
--maxCostfloat640Maximum estimated monthly cost filter ($/month)
--maxNlinkuint320Maximum hard link count filter
--maxSizeuint640Maximum byte size filter
--maxSizeBinuint320Maximum size bin filter (0-74)
--minBlocksuint640Minimum blocks filter
--minCostfloat640Minimum estimated monthly cost filter ($/month)
--minNlinkuint320Minimum hard link count filter
--minSizeuint640Minimum byte size filter
--minSizeBinuint320Minimum size bin filter (0-74)

Timestamp values are in seconds since epoch (Unix time).

FlagTypeDefaultDescription
--maxAtimeuint640Maximum access time
--maxBtimeuint640Maximum birth time
--maxCtimeuint640Maximum change time
--maxMtimeuint640Maximum modification time
--minAtimeuint640Minimum access time
--minBtimeuint640Minimum birth time
--minCtimeuint640Minimum change time
--minMtimeuint640Minimum modification time
FlagTypeDefaultDescription
--maxDepthuint320Maximum query depth (0 = unlimited)
--minDepthuint320Minimum query depth
FlagTypeDefaultDescription
--noMetaSSLboolfalseDisable SSL for metadata server connections

Find all files larger than 1 GiB:

Terminal window
find.flexfs --minSize 1073741824 --type f /mnt/flexfs

Find files by name pattern with full metadata:

Terminal window
find.flexfs --name "*.bam" --fields all --header /mnt/flexfs/data

Find empty directories (candidates for cleanup):

Terminal window
find.flexfs --type d --empty /mnt/flexfs

Find all symlinks under a path:

Terminal window
find.flexfs --type l --fields path,size /mnt/flexfs/data

Find the most expensive files (costing more than $1/month):

Terminal window
find.flexfs --minCost 1 --type f --fields path,size,cost --header /mnt/flexfs

Find cold files (not accessed in over 6 months, size bin 6+) that are still large:

Terminal window
find.flexfs --minSizeBin 6 --minSize 1073741824 --type f \
--fields path,size,size_bin,cost --header /mnt/flexfs

Find files not accessed since January 1 2025 (stale data candidates):

Terminal window
# 2025-01-01T00:00:00Z = 1735689600
find.flexfs --maxAtime 1735689600 --type f /mnt/flexfs

Find files modified in a specific window (e.g. during an incident):

Terminal window
# 2025-03-15 00:00:00Z = 1741996800, 2025-03-16 00:00:00Z = 1742083200
find.flexfs --minMtime 1741996800 --maxMtime 1742083200 --type f \
--fields path,size,mtime --header /mnt/flexfs

Find files created in the last 7 days:

Terminal window
# Use $(date -d '7 days ago' +%s) on Linux or $(date -v-7d +%s) on macOS
find.flexfs --minBtime $(date -v-7d +%s) --type f /mnt/flexfs

Find files with exact permissions rwxrwxrwx:

Terminal window
find.flexfs --perm 777 --type f --fields path,perm /mnt/flexfs

Find world-writable files (other-write bit set):

Terminal window
find.flexfs --perm 2 --permMask 2 --type f --fields path,perm /mnt/flexfs

Find files with the setuid bit set:

Terminal window
find.flexfs --perm 4000 --permMask 4000 --type f --fields path,perm /mnt/flexfs

Find all files owned by a specific user:

Terminal window
find.flexfs --uid 1001 --type f --fields path,size,uid /mnt/flexfs

Find sparse files (logical size exceeds allocated blocks):

Terminal window
find.flexfs --sparse --type f --fields path,size,blocks /mnt/flexfs

Export a full file inventory to TSV:

Terminal window
find.flexfs --fields all --header --type f \
--outputFile /tmp/inventory.tsv /mnt/flexfs

Query a volume directly without a local mount:

Terminal window
find.flexfs --metaAddr meta.example.com:443 --volume my-vol --type d /

Output is tab-separated. The columns correspond to the --fields list. When --header is set, the first line contains field names.

The xattrs field emits all of an inode’s extended attributes as a single JSON object, occupying one tab-separated column:

{"user.department":"cmVzZWFyY2g=","user.project":"Z2Vub21pY3M="}
  • Keys are attribute names, including the namespace prefix, exactly as stored. Names settable with setfattr live in the user., trusted., and security. namespaces; system. and flexfs. also appear, holding attributes flexFS maintains on your behalf (see below).
  • Values are base64-encoded (standard alphabet, with padding). Extended attribute values are arbitrary binary data, so they are never emitted raw. Decode with base64 -d; in the example above the values are the strings research and genomics.
  • Keys are sorted lexicographically, so the object is byte-for-byte stable across runs for a given inode.
  • An inode with no extended attributes emits {}, not an empty column.
  • The object is always one line and always tab-free: base64 values cannot contain a tab or newline, and JSON escapes both characters if an attribute name contains them. An xattrs column therefore never breaks the tab-separated row structure.
  • There are no filter flags for extended attributes. xattrs is an output field only — filter the results downstream (see the examples below).

Everything stored on the inode appears, including attributes flexFS maintains itself. Beyond whatever your applications set under user., expect to see:

AttributeWritten byContents
system.posix_acl_accessACLs (--acl)Packed POSIX ACL structure for the inode’s access ACL
system.posix_acl_defaultACLs (--acl)Packed POSIX ACL structure inherited by new children of a directory
security.capabilitysetcapFile capability set. Stripped automatically on write, so it may disappear between runs.
flexfs.iflagschattr4-byte little-endian inode flag word backing the immutable and append-only inode flags. Present even on volumes mounted without --xAttr, and removed entirely once every flag is cleared.

Setting and reading extended attributes through a mount requires --xAttr, but that option gates the FUSE layer only. find.flexfs queries the metadata server, so it reports stored attributes regardless of how any mount is currently configured — including attributes written earlier on a volume now mounted without --xAttr.

find.flexfs queries the metadata server directly and reads the stored form of each attribute. On a volume using metadata encryption, encryption and decryption happen only in the mount client, so attribute names and values reach find.flexfs as ciphertext:

{"5LJ0aBv...=":"n4Kc2Rv1Zt8..."}

The name is base64 of the AES-256-GCM ciphertext of the name; the value is base64 of the AES-256-GCM ciphertext of the value. Neither is recoverable from find.flexfs output. Reading extended attributes in plaintext on an encrypted volume requires going through a mount — getfattr on the mounted path. Note that --noDecode is unrelated: it governs base32 path encoding only and has no effect on the xattrs column.

List every file that carries any extended attribute:

Terminal window
find.flexfs --type f --fields path,xattrs /mnt/flexfs | awk -F'\t' '$2 != "{}"'

Report a specific attribute in plaintext, one file per line:

Terminal window
find.flexfs --type f --fields path,xattrs /mnt/flexfs \
| jq -Rr 'split("\t") | (.[1] | fromjson)["user.project"] as $v
| select($v != null) | .[0] + "\t" + ($v | @base64d)'

Find files carrying a POSIX ACL:

Terminal window
find.flexfs --type f --fields path,perm,xattrs /mnt/flexfs \
| grep 'system.posix_acl_access'