xfs_bmap(8)
π xfs_bmap(8) π
brought to you by the System Manager's Manual β¨
π NAME π
okay so xfs_bmap is the tool that prints the block mapping for an XFS file πΊοΈ it basically shows you where a file's bytes actually live on disk, bestie π
π¦ SYNOPSIS π¦
xfs_bmap [ -adelpv ] [ -n num_extents ] file
xfs_bmap -V
πΈ DESCRIPTION πΈ
okay so xfs_bmap prints the map of disk blocks that files in an XFS filesystem are using π§ the map lists every extent the file uses, and it also shows the gaps in the file that don't have any blocks behind them. those gaps are called holes π³οΈ each line of the output looks like this:
extent: [startoffset..endoffset]: startblock..endblock
if a region is a hole, the startblock..endblock part gets swapped out for the word hole π also, every file offset and disk block is measured in 512-byte blocks, no matter what block size your filesystem is using. the math is consistent, periodt β¨
π OPTIONS π
-aβ slide in with this and it shows the file's attribute fork instead of the usual data fork π-eβ this one goes after all the delayed allocation extents π§ it doesn't flush dirty pages to disk before it looks at the extent data. if you also use-v, the flags column will tell you which extents still haven't been allocated π-lβ adds a little tag to the end of every line that looks like this:
<nblocks> blocks
nblocks is how long that extent is, counted in 512-byte blocks π heads up though: if you're also using -v, this flag does absolutely nothing π
-n num_extentsβ only shows you at mostnum_extentsextents. if you leave this out, you get every single extent in the file π«Ά-pβ this one hunts down all the unwritten (preallocated) extents that don't have any written data in them π with-v, the flags column marks which extents are preallocated/unwritten β¨-vβ verbose mode, bestie π it tacks some AG specific info onto each line in this format:
agno (startagoffset..endagoffset) nblocks flags
if you type -v a second time, you also get the flags legend π³οΈβπ
-Vβ prints the version number and then bounces π
π§ SEE ALSO π§
xfs_fsr(8), xfs(5) π
and that's the tea, bestie! π this was xfs_bmap(8) from the System Manager's Manual π«Άβ¨
π¦ where this page comes from
- alpine 3.22: xfsprogs-doc 6.14.0-r0 Β· LGPL-2.1-or-later
- alpine 3.23: xfsprogs-doc 6.17.0-r0 Β· LGPL-2.1-or-later
- alpine 3.24: xfsprogs-doc 7.0.1-r0 Β· LGPL-2.1-or-later
- arch rolling: xfsprogs 7.2.0-1
- arch rolling: xfsprogs 7.2.1-1 Β· GPL-2.0-only AND LGPL-2.1-only
- centos-stream 10: xfsprogs 6.16.0-1.el10 Β· GPL-1.0-or-later AND LGPL-2.1-or-later
- centos-stream 9: xfsprogs 6.4.0-9.el9 Β· GPL+ and LGPLv2+
- centos-stream 9: xfsprogs 6.4.0-9.el9 Β· GPL+ and LGPLv2+
- debian bookworm: xfsprogs 6.1.0-1 Β· GPL-2.0-only
- debian trixie: xfsprogs 6.13.0-2+deb13u1 Β· GPL-2.0-only
- fedora 43: xfsprogs 6.15.0-3.fc43 Β· GPL-1.0-or-later AND LGPL-2.1-or-later
- fedora 43: xfsprogs 6.15.0-3.fc43 Β· GPL-1.0-or-later AND LGPL-2.1-or-later
- fedora 44: xfsprogs 6.18.0-2.fc44 Β· GPL-1.0-or-later AND LGPL-2.1-or-later
- fedora 44: xfsprogs 6.18.0-2.fc44 Β· GPL-1.0-or-later AND LGPL-2.1-or-later
- fedora 44: xfsprogs 7.1.1-1.fc44 Β· GPL-1.0-or-later AND LGPL-2.1-or-later
- fedora 44: xfsprogs 7.1.1-1.fc44 Β· GPL-1.0-or-later AND LGPL-2.1-or-later
- nixos 26.05: xfsprogs 6.19.0
- nixpkgs unstable: xfsprogs 7.2.1
- opensuse-leap 16.0: xfsprogs 6.19.0-160000.3.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: xfsprogs 6.19.0-160000.3.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: xfsprogs 6.19.0-160000.3.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: xfsprogs 6.19.0-160000.3.1 Β· GPL-2.0-or-later
- ubuntu jammy: xfsprogs 5.13.0-1ubuntu2 Β· GPL-2.0-only
- ubuntu jammy: xfsprogs 5.13.0-1ubuntu2.1 Β· GPL-2.0-only
- ubuntu noble: xfsprogs 6.6.0-1ubuntu2 Β· GPL-2.0-only
- ubuntu noble: xfsprogs 6.6.0-1ubuntu2.1 Β· GPL-2.0-only
- ubuntu questing: xfsprogs 6.13.0-2ubuntu2 Β· GPL-2.0-only
- ubuntu resolute: xfsprogs 6.18.0-3 Β· GPL-2.0-only
- ubuntu stonking: xfsprogs 6.19.0-1 Β· GPL-2.0-only
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms