DEBUGVMFS6(8)

πŸ“¦
version 0.2.1 Β· 4 versions
, in ubuntu noble, ubuntu questing

πŸ’– DEBUGVMFS6 β€” VMFS file system debugger πŸ’–

okay bestie, so this is debugvmfs6, and it lives in the vmfs-tools family, and it is literally your all-access pass into VMFS6 file systems. we're talking peek at everything, dig into data, the whole vibe. πŸ¦‹


✨ SYNOPSIS ✨

debugvmfs6 VOLUME... COMMAND [ OPTIONS ]
debugvmfs6 -b BITMAP show [ VARIABLE ]

like, that's the whole energy right there. volumes first, then tell it what to do. πŸ’…


🌸 DESCRIPTION 🌸

so debugvmfs6 lets you display various informations about VMFS6 file systems, and also access data within the file systems. it's giving detective mode but make it filesystem. πŸ”βœ¨

the VOLUME you wanna open can be either a block device or an image file. and listen β€” when the VMFS spreads across several extents, all extents must be given. not some. ALL. no cap. πŸ™…β™€οΈ

⚠️ heads up bestie: most commands are still likely to change in future versions. so don't get too attached to the exact syntax, iykyk. πŸ’€

and when you pass the -b option, a BITMAP file may be opened directly from the host file system. in that mode, only the show command is supported, and the variables available are only a subset. that's it. that's the whole mode. πŸŽ€


🧚 SPECIFYING FILES 🧚

some commands take a filespec as an argument, and a filespec can take either of these two forms, periodt:

  • a path name, relative to the root of the filesystem if it starts with /, or relative to the current working directory otherwise (interactive mode only).
  • an inode number, enclosed between angle brackets, e.g. <4>, <0x1400004>

so like, <4> is a whole vibe. angle brackets are iconic. πŸ‘‘


πŸ’… COMMANDS πŸ’…

cat filespec [ ... ]

outputs the content of the given files from the VMFS. like cat but it's in the filesystem. slay. 🐱

ls [ -l ] filespec

lists files contained at the given location within the VMFS.

with -l, gives some more information, much like the output from ls(1) when given the -l option. long mode stays undefeated. ✨

truncate filespec length

truncate the file to the specified length. R/W support must be enabled. πŸ”₯

chmod filespec mode

change file permissions to the given mode. permission glow-up fr fr. πŸ’…

df

outputs information about file system size. the classic. πŸ“

get_file_block filespec position

get file block corresponding to position in the specified file.

check_vol_bitmaps

checks volume bitmaps consistency. it's the vibe check for your bitmaps. βœ…

show_heartbeats

outputs active heartbeats on the file system. πŸ’“ (yes they're literally called heartbeats, obsessed)

read_block block_id [ ... ]

outputs content within the specified block_id in binary.

get_block_status block_id

get status (allocated or free) of the specified block_id.

alloc_block_fixed block_id

allocate the specified block_id. R/W support must be enabled.

alloc_block block_type

allocate a block of the specified type. R/W support must be enabled.

allowed block types are: 1 (File Block), 2 (Sub-Block), 3 (Pointer Block) and 4 (File Descriptor / Inode). memorize those, bestie. 🧠✨

free_block block_id

free the specified block_id. R/W support must be enabled.

🚨 Warning: can cause damage since no heartbeat is used at this time and a block used by a file can be freed. this one is not playing around. be careful. like actually. πŸ’€

show

display value(s) of the given variable. see the VARIABLES section for more details. when no variable is given, it lists the top-level properties.

shell

starts an interactive session. all of the above commands can be executed from within the interactive session. main character energy, but for a shell. πŸ‘‘

the current working directory can be changed with the cd command, followed by a filespec.

the following output redirections are supported within the shell:

  • cmd > output β€” puts the output of cmd in the output file.
  • cmd >> output β€” appends the output of cmd to the output file.
  • cmd | external command β€” sends the output of cmd to the input of external command. the external command itself can contain output redirection.

examples, because we love a demo:

  • read_block 0x00000681 | less
  • cat /.fdc.sf | hexdump -C
  • cat /.fdc.sf | hexdump -C > /tmp/fdc.hex
  • cat /.fdc.sf | hexdump -C | less

piping is the moment. 🫢


🌈 VARIABLES 🌈

variables in debugvmfs6 represent structures on the filesystem. the currently supported top-level variables are the following:

  • vol_version
  • version
  • label
  • mode
  • uuid
  • ctime
  • block_size
  • subblock_size
  • fdc_header_size
  • fdc_bitmap_count
  • fbb
  • fdc
  • pbc
  • sbc
  • fs
  • lvm
  • blkid[blk]
  • dirent["path"]
  • inode["filespec"]

the vol_version, version, label, mode, uuid, ctime, block_size, subblock_size, fdc_header_size, and fdc_bitmap_count properties are low-level information about the filesystem. the lore. πŸ“œ

the fbb, fdc, pbc and sbc variables are bitmaps. running them through the show command will display all the bitmaps header fields. each of these fields can also be displayed individually:

  • bitmap.items_per_bitmap_entry
  • bitmap.bmp_entries_per_area
  • bitmap.hdr_size
  • bitmap.data_size
  • bitmap.area_size
  • bitmap.area_count
  • bitmap.total_items
  • bitmap.used_items
  • bitmap.free_items
  • bitmap.entry[n]

e.g. to display the data size of the fdc bitmap, type show fdc.data_size. easy. ✨

each bitmap.entry[n] (where 0 ≀ n < bitmap.bmp_entries_per_area * bitmap.area_count) contains information about each entry in the bitmap. the available fields are:

  • bitmap.entry[n].id
  • bitmap.entry[n].total
  • bitmap.entry[n].free
  • bitmap.entry[n].ffree
  • bitmap.entry[n].mdh
  • bitmap.entry[n].item[m]

the bitmap.entry[n].mdh is a metadata header. see further below for more details about metadata headers. (spoiler: it's in the mdh list, bestie, we'll get there 🧚)

each bitmap.entry[n].item[m] (where 0 ≀ m < bitmap.items_per_bitmap_entry) contains information about a given item in the given entry. the available fields are:

  • bitmap.entry[n].item[m].used
  • bitmap.entry[n].item[m].dump

the pbc bitmap has an additional field:

  • pbc.entry[n].item[m].blocks

the lvm variable contains low-level information about the physical and logical volumes. the available fields are:

  • lvm.uuid
  • lvm.size
  • lvm.blocks
  • lvm.num_extents
  • lvm.extent[n]

each lvm.extent[n] (where 0 ≀ n < lvm.num_extents) contains low-level information about the physical volumes. the available fields are:

  • lvm.extent[n].device
  • lvm.extent[n].uuid
  • lvm.extent[n].lun
  • lvm.extent[n].version
  • lvm.extent[n].name
  • lvm.extent[n].size
  • lvm.extent[n].num_segments
  • lvm.extent[n].first_segment
  • lvm.extent[n].last_segment

each blkid[blk] (where blk is a block id) contains information on the given block id. the available fields are:

  • blkid[blk].item
  • blkid[blk].flags

each dirent[path] (where path is a path relative to the current directory in the shell or / outside the shell) contains information on the directory entry corresponding to the given path. the available fields are:

  • dirent["path"].type
  • dirent["path"].block_id
  • dirent["path"].record_id
  • dirent["path"].name

each inode[filespec] contains information on the inode corresponding to the given filespec. the available fields are:

  • inode["filespec"].id
  • inode["filespec"].id2
  • inode["filespec"].nlink
  • inode["filespec"].type
  • inode["filespec"].flags
  • inode["filespec"].size
  • inode["filespec"].blk_size
  • inode["filespec"].blk_count
  • inode["filespec"].uid
  • inode["filespec"].gid
  • inode["filespec"].mode
  • inode["filespec"].zla
  • inode["filespec"].tbz
  • inode["filespec"].cow
  • inode["filespec"].atime
  • inode["filespec"].mtime
  • inode["filespec"].ctime
  • inode["filespec"].rdm_id
  • inode["filespec"].mdh
  • inode["filespec"].blocks

metadata headers are being used in several places, such as bitmap.entry[n].mdh and inode["filespec"].mdh. they mostly contain information about clustered accesses to metadata on the filesystem. the available fields are:

  • mdh.magic
  • mdh.pos
  • mdh.hb_pos
  • mdh.hb_lock
  • mdh.hb_uuid
  • mdh.hb_seq
  • mdh.obj_seq
  • mdh.mtime

variable values can also be used in expressions using square brackets to use the variable value as an index. for example:

  • blkid[inode["filespec"].id]

enclosing a variable name with parentheses will use that variable value as a variable name. for example:

  • (blkid[blk].item).status

when invoked with the -b option, the top-level variables are those normally under bitmap:

  • items_per_bitmap_entry
  • bmp_entries_per_area
  • hdr_size
  • data_size
  • area_size
  • area_count
  • total_items
  • used_items
  • free_items
  • entry[n]

the sub-variables for each entry are also available. πŸ’–


πŸŽ€ AUTHORS πŸŽ€

the absolute legends who made this:

  • Christophe Fillot <cf@utc.fr>[1]
  • Mike Hommey <mh@glandium.org>[2]
  • Weafon Tsao <weafon.tsao@accelstor.com>[3]
  • Thomas Ward <teward@ubuntu.com>[4]

πŸ‘‘ SEE ALSO πŸ‘‘


πŸ“Ž NOTES πŸ“Ž

  1. cf@utc.fr mailto:cf@utc.fr
  2. mh@glandium.org mailto:mh@glandium.org
  3. weafon.tsao@accelstor.com mailto:weafon.tsao@accelstor.com
  4. teward@ubuntu.com mailto:teward@ubuntu.com

and that's a wrap bestie!! πŸ’–βœ¨ this page is from vmfs-tools, version 0.0.0-patched, dated 04/01/2024. go forth and debug your filesystems, you absolute icon. πŸ¦‹πŸŒΈπŸ’… periodt.

πŸ“¦ where this page comes from