debugfs.ocfs2(8)
β¨ debugfs.ocfs2 β¨
okay bestie, so this is the manual page for debugfs.ocfs2(8), aka your new favorite OCFS2 file system debugger π β section 8 of the manual, for all you sysadmin girlies out there. it's an interactive file system debugger, and honestly? it ate. let's get into it.
πΈ NAME πΈ
debugfs.ocfs2 β the OCFS2 file system debugger. yes that's the whole name, she's simple and she knows it π
π¦ SYNOPSIS π¦
debugfs.ocfs2 [-f cmdfile] [-R command] [-s backup] [-nwV?] [device]
debugfs.ocfs2 -l [tracebit ... [allow|off|deny]] ...
debugfs.ocfs2 -d, --decode lockname
debugfs.ocfs2 -e, --encode lock_type block_num [generation | parent]
π DESCRIPTION π
so debugfs.ocfs2 is an interactive file system debugger, and her whole job is displaying the on-disk OCFS2 filesystem structures on the device you hand her. that's it, that's the vibe. she looks at the disk so you don't have to π«Ά
β¨ OPTIONS β¨
-d,--decode locknameβ shows you all the info that's encoded up in thelockname. little decoder ring energy π-e,--encode lock_type block_num [generation | parent]β the reverse, bestie. hands you back thelocknameyou get from encoding the arguments you gave it β¨-f,--file cmdfileβ runs all the debugfs commands sitting insidecmdfile. batch mode, no back-and-forth π-i,--imageβ tells her thatdeviceis actually an o2image file made by the o2image tool. not a real live volume, just a lil snapshot situation π-l [tracebit ... [allow|off|deny]] ...β controls OCFS2 filesystem tracing by turning trace bits on and off. dodebugfs.ocfs2 -lwith nothing else to get the full list of every trace bit. pick your faves π-n,--nopromptβ hides the prompt. shy girl behavior, respect π-R,--request commandβ runs exactly one debugfs command and dips. one and done, periodt π-s,--superblock backup-numberβ somkfs.ocfs2makes up to 6 backup copies of the superblock, at offsets1G,4G,16G,64G,256Gand1T, depending on how big the volume is. use this option to say which backup,1thru6, she should use to open the volume π-w,--writeβ opens the filesystem in RW mode. by default she opens it in RO mode, so yeah, this is the "yes I really mean it" button π₯-V,--versionβ displays the version and exits. quick lil flex π-?,--helpβ displays help and exits π«Ά
π SPECIFYING FILES π
lots of debugfs.ocfs2 commands want a filespec as an argument, which is how you point at an inode (as opposed to a pathname) in the filesystem that debugfs.ocfs2 currently has open. you've got two forms to choose from, bestie:
- inode number or lockname wrapped in angle brackets, like
<32>π― - a pathname. and here's where it gets spicy:
- if the pathname starts with a forward slash (
/), she reads it relative to the root of the filesystem currently opened bydebugfs.ocfs2π³ - if it doesn't start with a slash, she reads it relative to the current working directory as maintained by
debugfs.ocfs2β which you can change with thecdcommand π - and if the pathname starts with a double forward slash (
//), she reads it relative to the root of the system directory of the filesystem opened bydebugfs.ocfs2β¨
- if the pathname starts with a forward slash (
π LOCKNAMES π
locknames are these specially formatted strings the file system uses to uniquely identify objects in the filesystem. most locknames OCFS2 uses are generated from the inode number and its generation number, and you can decode them with the decode command β or just use them directly in place of an inode number in any command that wants a filespec. and like inode numbers, locknames need to be wrapped in angle brackets, e.g. <M000000000000000040c40c044069cf>. use the encode command to generate all the possible locknames for an object. iykyk π
π COMMANDS π
here's the full list of commands debugfs.ocfs2 supports. yes, all of them. we don't skip π
bmap filespec logical_blockβ displays the physical block number that corresponds to the logical block numberlogical_blockin the inodefilespecπΊοΈcat filespecβ dumps the contents of inodefilespecto stdout π±cd filespecβ changes the current working directory tofilespecπchroot filespecβ makes the root directory become the directoryfilespecπ³closeβ closes the currently opened filesystem πͺcontrold dumpβ displays information obtained fromocfs2_controldπcurdevβ shows the currently open device πdecode <lockname>β displays the inode number encoded in thelocknameπdirblocks <filespec>β displays the directory blocks associated with the givenfilespecπ§±dlm_locks [-f <file>] [-l] [<lockname(s)>]...β displays the status of all lock resources in the o2dlm domain that the file system is a member of. this command expects the debugfs filesystem to be mounted asmount -t debugfs debugfs /sys/kernel/debug. uselockname(s)to limit the output to those given lock resources,-lto include the contents of the lock value block, and-f <file>to point at a saved copy of/sys/kernel/debug/o2dlm/<DOMAIN>/locking_stateπdump [-p] filespec outfileβ dumps the contents of the inodefilespecinto the output fileoutfile. if-pis given, she sets the owner, group, timestamps and permissions info onoutfileto match those offilespecβ matching set, adorable πdx_dump filespecβ displays the indexed directory information for the given directory πdx_leaf <block#>β displays the contents of the given indexed directory leaf block πdx_root <block#>β displays the contents of the given indexed directory root block π±dx_space filespecβ displays the directory free space list ποΈencode filespecβ displays the lockname for thefilespecβ¨extent <block#>β displays the contents of the extent structure atblock#π§©findpath [<lockname>|<inode#>]β displays the pathname for the inode specified bylocknameorinode#. heads up tho: this command does not display all the hard-linked paths for the inode, so don't come for her π«£frag filespecβ displays the inode's ratio of number of extents to clusters πfs_locks [-f <file>] [-l] [-B] [<lockname(s)>]...β displays the status of all locks known by the file system. this command expects the debugfs filesystem to be mounted asmount -t debugfs debugfs /sys/kernel/debug. uselockname(s)to limit the output to those given lock resources,-Bto limit the output to only the busy locks,-lto include the contents of the lock value block, and-f <file>to point at a saved copy of/sys/kernel/debug/ocfs2/<UUID>/locking_stateπgd_free_bits [-s]β displays the contiguous free bits of group descriptor blocks which are managed by//global_bitmap.-srecords contiguous free bits in the group descriptor block. and important: the[-s]option requires thedebugfs.ocfs2option-wβ οΈgroup <block#>β displays the contents of the group descriptor atblock#π―grpextents <block#>β displays free extents in the chain group βοΈhbβ displays the contents of the heartbeat system file πhelp,?β prints the list of commands understood bydebugfs.ocfs2πicheck block# ...β displays the inodes that use the one or more blocks specified on the command line. and if the inode is a regular file, she also displays the corresponding logical block offset πlcd directoryβ changes the current working directory of thedebugfs.ocfs2process to thedirectoryon the native filesystem (lcd = local cd, we love a shortcut) πlocate [<lockname>|<inode#>] ...β displays all the pathnames for the inode(s) specified bylocknames orinode#s πΊοΈlogdump [-T] slot#β displays the contents of the journal for slotslot#. use-Tto limit the output to just the summary of the inodes in the journal πls [-l] filespecβ prints the listing of the files in the directoryfilespec. the-lflag lists files in the long format πnet_stats [-f <file>] [interval [count]]β displays the net statistics. this command expects the debugfs filesystem to be mounted at/sys/kernel/debug. theintervalis in seconds. use the-fparameter to point at a saved copy of/sys/kernel/debug/o2net/statsπncheck [<lockname>|<inode#>] ...β seelocateπopen deviceβ opens the filesystem ondeviceπͺquit,qβ quitsdebugfs.ocfs2. bye bestie πrdump [-v] filespec outdirβ recursively dumps the directoryfilespecand all its contents (including regular files, symbolic links and other directories) intooutdir, which should be an existing directory on the native filesystem π²refcount [-e] filespecβ displays the refcount block, and optionally its tree, of the specified inode π³slotmapβ displays the contents of the slotmap system file πΊοΈstat [-t|-T] filespecβ displays the contents of the inode structure for thefilespec. the-t("traverse") option selects traversal of the inode's metadata β the extent tree, chain list, or other extra metadata will be dumped, and this is the default. the-Toption turns off traversal, which reduces the I/O required when you only need basic inode information π§stat_sysdirβ displays the contents of all objects in the system directory π¦stats [-h] [-s backup-number]β displays the contents of the superblock. use-sto display a specific backup superblock. use-hto hide the inode π©xattr [-v] <filespec>β displays extended attributes associated with the givenfilespecπ·οΈ
π«Ά ACKNOWLEDGEMENT π«Ά
this tool has been modelled after debugfs, a debugging tool for ext2. paying homage, as she should π
π SEE ALSO π
fsck.ocfs2(8) fsck.ocfs2.checks(8) mkfs.ocfs2(8) mount.ocfs2(8) mounted.ocfs2(8) o2cluster(8) o2image(8) o2info(1) ocfs2(7) tunefs.ocfs2(8)
π AUTHOR π
Oracle Corporation
β COPYRIGHT β
Copyright Β© 2004, 2012 Oracle. All rights reserved.
and that's the whole page, bestie π she's Version 1.8.9, dated January 2012, and honestly? iconic for her era. no cap, go debug something π β¨π¦
π¦ where this page comes from
- fedora 44: ocfs2-tools 1.8.9-2.fc44 Β· GPL-2.0-only
- fedora 44: ocfs2-tools 1.8.9-2.fc44 Β· GPL-2.0-only
- ubuntu resolute: ocfs2-tools 1.8.9-1 Β· GPL-2.0-or-later
- ubuntu stonking: ocfs2-tools 1.8.9-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms