debugfs.ocfs2(8)

πŸ“¦
version 1.8.9 Β· 3 versions
, in fedora 44, ubuntu resolute, ubuntu stonking

✨ 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 the lockname. little decoder ring energy πŸ”
  • -e, --encode lock_type block_num [generation | parent] β€” the reverse, bestie. hands you back the lockname you get from encoding the arguments you gave it ✨
  • -f, --file cmdfile β€” runs all the debugfs commands sitting inside cmdfile. batch mode, no back-and-forth πŸ’…
  • -i, --image β€” tells her that device is 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. do debugfs.ocfs2 -l with 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 β€” so mkfs.ocfs2 makes up to 6 backup copies of the superblock, at offsets 1G, 4G, 16G, 64G, 256G and 1T, depending on how big the volume is. use this option to say which backup, 1 thru 6, 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:

  1. inode number or lockname wrapped in angle brackets, like <32> 🎯
  2. 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 by debugfs.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 the cd command πŸ“
    • 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 by debugfs.ocfs2 ✨

πŸ” 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 number logical_block in the inode filespec πŸ—ΊοΈ
  • cat filespec β€” dumps the contents of inode filespec to stdout 🐱
  • cd filespec β€” changes the current working directory to filespec πŸ“
  • chroot filespec β€” makes the root directory become the directory filespec 🌳
  • close β€” closes the currently opened filesystem πŸšͺ
  • controld dump β€” displays information obtained from ocfs2_controld πŸ“‹
  • curdev β€” shows the currently open device πŸ‘€
  • decode <lockname> β€” displays the inode number encoded in the lockname πŸ”
  • dirblocks <filespec> β€” displays the directory blocks associated with the given filespec 🧱
  • 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 as mount -t debugfs debugfs /sys/kernel/debug. use lockname(s) to limit the output to those given lock resources, -l to 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 inode filespec into the output file outfile. if -p is given, she sets the owner, group, timestamps and permissions info on outfile to match those of filespec β€” 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 the filespec ✨
  • extent <block#> β€” displays the contents of the extent structure at block# 🧩
  • findpath [<lockname>|<inode#>] β€” displays the pathname for the inode specified by lockname or inode#. 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 as mount -t debugfs debugfs /sys/kernel/debug. use lockname(s) to limit the output to those given lock resources, -B to limit the output to only the busy locks, -l to 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. -s records contiguous free bits in the group descriptor block. and important: the [-s] option requires the debugfs.ocfs2 option -w ⚠️
  • group <block#> β€” displays the contents of the group descriptor at block# πŸ‘―
  • 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 by debugfs.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 the debugfs.ocfs2 process to the directory on the native filesystem (lcd = local cd, we love a shortcut) πŸ“‚
  • locate [<lockname>|<inode#>] ... β€” displays all the pathnames for the inode(s) specified by locknames or inode#s πŸ—ΊοΈ
  • logdump [-T] slot# β€” displays the contents of the journal for slot slot#. use -T to limit the output to just the summary of the inodes in the journal πŸ““
  • ls [-l] filespec β€” prints the listing of the files in the directory filespec. the -l flag 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. the interval is in seconds. use the -f parameter to point at a saved copy of /sys/kernel/debug/o2net/stats 🌐
  • ncheck [<lockname>|<inode#>] ... β€” see locate πŸ‘€
  • open device β€” opens the filesystem on device πŸšͺ
  • quit, q β€” quits debugfs.ocfs2. bye bestie πŸ‘‹
  • rdump [-v] filespec outdir β€” recursively dumps the directory filespec and all its contents (including regular files, symbolic links and other directories) into outdir, 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 the filespec. 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 -T option 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 -s to display a specific backup superblock. use -h to hide the inode 🎩
  • xattr [-v] <filespec> β€” displays extended attributes associated with the given filespec 🏷️

🫢 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 Β© 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