xfs_spaceman(8)

πŸ’– xfs_spaceman(8) β€” the System Manager's Manual's absolute baddie πŸ’–

okay bestie, sit DOWN, because we're about to talk about xfs_spaceman, and she is that girl. This is a page from the System Manager's Manual, so you already know it's giving official. πŸŽ€


✨ NAME ✨

xfs_spaceman β€” show free space information about an XFS filesystem πŸ’…


🌸 SYNOPSIS 🌸

xfs_spaceman [ -c cmd ] file
xfs_spaceman -V

πŸ¦‹ DESCRIPTION πŸ¦‹

xfs_spaceman reports and controls free space usage in an XFS filesystem. that's it, that's the whole vibe. she tells you what your free space is doing and she can also, like, do things about it. no cap. ✨


πŸŽ€ OPTIONS πŸŽ€

  • -c cmd β€” xfs_spaceman commands can be run interactively (which is the default, no thoughts just vibes) or you can hand them over as arguments on the command line. you can give multiple -c arguments, bestie, go off. the commands run in the exact sequence you gave them, and then the program exits. bye πŸ‘‹

πŸ‘‘ COMMANDS πŸ‘‘

πŸ’œ freesp

freesp [ -dgrs ] [-a agno]... [ -b | -e bsize | -h bsize | -m factor ]

with no arguments, freesp shows a histogram of all the free space extents in the filesystem. iconic behavior honestly. the command takes the following options:

  • -a agno β€” collect free space information from this allocation group. you can specify this option multiple times to collect from multiple groups. (collect them all, pokΓ©mon style 🧚)
  • -b β€” this argument establishes that the histogram bin sizes are successive powers of two. this is the default, and it is mutually exclusive with the -e, -h, and -m options. pick a lane, bestie.
  • -d β€” print debugging information, like the raw free space extent information. it's giving "let me see the receipts" πŸ’€
  • -g β€” print the free space block and extent counts for each AG.
  • -e bsize β€” set all histogram bin sizes to one specific value. mutually exclusive with the -b, -h, and -m options.
  • -h bsize β€” create a histogram bin with a lower bound of this value. the upper bound of this bin will be one less than the lower bound of the next highest histogram bin. you can give this option multiple times to control the exact bin sizes, so precise, so main character. mutually exclusive with the -b, -e, and -m options.
  • -m factor β€” create each histogram bin with a size that is this many times the size of the previous bin created. mutually exclusive with the -b, -e, and -h options.
  • -r β€” query the realtime device for free space information. going straight to the source, love that for her. πŸ”₯
  • -s β€” display a summary of the free space information found.

🌈 makecfg

makecfg [path]

write a configuration file to the given path that can be re-read by mkfs.xfs for a future filesystem format attempt. this file will contain only user-visible features. filesystem geometry information is not written to the configuration file. if you don't give a path, the configuration gets printed on standard output instead. convenient! ✨


πŸ“ info

displays selected geometry information about the filesystem. the opened file must be a mount point of an XFS filesystem β€” no exceptions, she's not doing that for you. the output will have the same format that xfs_info(8) prints when querying a filesystem. matching outfits, cute. πŸŽ€


🫢 health

health [ -a agno] [ -c ] [ -f ] [ -i inum ] [ -n ] [ -q ] [ -r rgno ] [ paths ]

reports the health of the given group of filesystem metadata. let's get a little wellness check going, shall we?

  • -a agno β€” report on the health of the given allocation group.
  • -c β€” scan all inodes in the filesystem and report each file's health status. if the -a option is given, scan only the inodes in that AG. (scoping! we love scoping!)
  • -f β€” report on the health of metadata that affect the entire filesystem.
  • -i inum β€” report on the health of a specific inode.
  • -n β€” when reporting on the health of a file, try to report the full file path, if possible. this option is disabled by default to minimize runtime. (she's just trying to be fast, leave her alone 😭)
  • -q β€” report only unhealthy metadata. no small talk, only problems.
  • -r β€” report on the health of the given realtime group.
  • paths β€” report on the health of the files at the given path.

πŸ’– help

help [ command ]

display a brief description of one or all commands. asking for help is self-care, bestie. 🫢


🌸 prealloc

prealloc [ -u id ] [ -g id ] [ -p id ] [ -m minlen ] [ -s ]

removes speculative preallocation. if you don't give any -u, -g, or -p options, this command acts on all files. the command takes the following options:

  • -u uid β€” clear all speculative preallocations for files with this user id. this option can be given in combination with the -g and -p options.
  • -g gid β€” clear all speculative preallocations for files with this group id. this option can be given in combination with the -u and -p options.
  • -p pid β€” clear all speculative preallocations for files with this project id. this option can be given in combination with the -u and -g options.
  • -m minlen β€” ignore all files smaller than this size. units can be supplied for this argument. (small files stay unbothered ✨)
  • -s β€” wait for removal to complete. patience is a virtue, she said it first.

πŸ‘‘

print

display a list of all open files. simple, direct, slay. πŸ’…


⭐ quit

exit xfs_spaceman. sometimes you just gotta log off, and that's valid. πŸŒ™


πŸ¦‹ trim

trim ( -a agno | -f | offset length ) [ -m minlen ]

instructs the underlying storage device to release all storage that may be backing free space in the filesystem. she's telling the drive "you don't need that, let it go, release it, it's not yours anymore." the command takes the following options: (one of -a, -f, or the offset/length pair is required.)

  • -a agno β€” trim free space extents in the given allocation group. this option is mutually exclusive with the -f option and the offset/length options.
  • -f β€” trim all free space in the filesystem. this option is mutually exclusive with the -a option and the offset/length options.
  • option, length β€” trim all free space within the physical range defined by the offset and length from this filesystem. units can be appended to these arguments. this option is mutually exclusive with the -a and -f options.
  • -m minlen β€” do not trim free space extents shorter than this length. units can be appended to this argument.
⚠️ real talk for one sec: those -a / -f / offset-length options are mutually exclusive, and the offset/length pair is required if you're not using -a or -f. the page says it twice because it means it. don't fight the manpage, bestie. 😀

and that's the whole page, no notes, ate and left no crumbs πŸ‘‘βœ¨

this has been your girl from the System Manager's Manual, and the page signs off as xfs_spaceman(8) β€” version and date vibes straight from that footer, mwah πŸ’–

πŸ“¦ where this page comes from