DEBUGVMFS(8)
π DEBUGVMFS π
okay bestie, buckle up β this is the debugvmfs page from vmfs-tools, section 8 of the manual (the big-girl admin section, yes ma'am). it's a whole debugger for VMFS file systems and it is lowkey iconic. let's get into it π
πΈ NAME πΈ
debugvmfs β the VMFS file system debugger. that's the whole name section, short and stunning, no notes π
π¦ SYNOPSIS π¦
debugvmfs VOLUME... COMMAND [ OPTIONS ]
β¨ DESCRIPTION β¨
so debugvmfs is your little backstage pass: it lets you display all kinds of info about VMFS file systems, and it also lets you get at the data inside them. main character energy fr.
the VOLUME you open can be either a block device</> or an image file</> β either one, she's flexible πββοΈ and when a VMFS is spread across several extents? bestie, you gotta hand over all the extents. every single one. no skipping, no crumbs.
heads up: most of these commands are still likely to change in future versions. so like, don't get too attached, iykyk π«
π SPECIFYING FILES π
some commands want a filespec as an argument, and a filespec can take either of these forms:
- a path name β relative to the root of the filesystem if it starts with
/, or relative to the current working directory otherwise (that second one is interactive mode only). - an inode number, wrapped up in angle brackets, e.g.
'<4>'or'<0x1400004>'β adorable, right? π
π COMMANDS π
every command, all of them, here we go, no crumbs left behind β¨
cat filespec [ ... ]
outputs the content of the given files from the VMFS. basically the cat you know and love, but make it VMFS π±
ls [ -l ] filespec
lists the files sitting at the given location within the VMFS.
with -l it gives you some more info, much like the output from ls(1) when you hand it the -l option. classic.
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. permissions era π
df
outputs information about file system size. the df of it all π
get_file_block filespec position
get the file block corresponding to position in the specified file.
check_vol_bitmaps
checks volume bitmaps consistency. a lil vibe check for your bitmaps π§
show_heartbeats
outputs the active heartbeats on the file system. literally heartbeats π
read_block block_id [ ... ]
outputs the content within the specified block_id in binary.
get_block_status block_id
get the 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.
the allowed block types are: 1 (File Block), 2 (Sub-Block), 3 (Pointer Block) and 4 (File Descriptor / Inode). know them, love them, memorize them π
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. bestie, this one bites. be careful fr fr π
show
display value(s) of the given variable. check the VARIABLES section for the details. when no variable is given, it lists the top-level properties. a little sampler platter π
shell
starts an interactive session. all of the above commands can be executed from within the interactive session β the whole lineup, live and in person π
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 ofcmdin the output file.cmd >> outputβ appends the output ofcmdto the output file.cmd | external commandβ sends the output ofcmdto the input of external command. and the external command itself can contain output redirection. layers, we love layers π§
examples:
read_block 0x00000681 | lesscat /.fdc.sf | hexdump -Ccat /.fdc.sf | hexdump -C > /tmp/fdc.hexcat /.fdc.sf | hexdump -C | less
π VARIABLES π
variables in debugvmfs represent structures on the filesystem. the currently supported top-level variables are the following:
vol_versionversionlabelmodeuuidctimeblock_sizesubblock_sizefdc_header_sizefdc_bitmap_countfbbfdcpbcsbcfslvmblkid[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 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_entrybitmap.bmp_entries_per_areabitmap.hdr_sizebitmap.data_sizebitmap.area_sizebitmap.area_countbitmap.total_itemsbitmap.used_itemsbitmap.free_itemsbitmap.entry[n]
e.g. to display the data size of the fdc bitmap, type show fdc.data_size.
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].idbitmap.entry[n].totalbitmap.entry[n].freebitmap.entry[n].ffreebitmap.entry[n].mdhbitmap.entry[n].item[m]
the bitmap.entry[n].mdh is a metadata header. see further below for more details about metadata headers.
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].usedbitmap.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.uuidlvm.sizelvm.blockslvm.num_extentslvm.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].devicelvm.extent[n].uuidlvm.extent[n].lunlvm.extent[n].versionlvm.extent[n].namelvm.extent[n].sizelvm.extent[n].num_segmentslvm.extent[n].first_segmentlvm.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].itemblkid[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"].typedirent["path"].block_iddirent["path"].record_iddirent["path"].name
each inode[filespec] contains information on the inode corresponding to the given filespec. the available fields are:
inode["filespec"].idinode["filespec"].id2inode["filespec"].nlinkinode["filespec"].typeinode["filespec"].flagsinode["filespec"].sizeinode["filespec"].blk_sizeinode["filespec"].blk_countinode["filespec"].uidinode["filespec"].gidinode["filespec"].modeinode["filespec"].zlainode["filespec"].tbzinode["filespec"].cowinode["filespec"].atimeinode["filespec"].mtimeinode["filespec"].ctimeinode["filespec"].rdm_idinode["filespec"].mdhinode["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.magicmdh.posmdh.hb_posmdh.hb_lockmdh.hb_uuidmdh.hb_seqmdh.obj_seqmdh.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
π AUTHORS π
Christophe Fillot <cf@utc.fr>, Mike Hommey <mh@glandium.org> β legends, honestly π«Ά
π SEE ALSO π
π NOTES π
cf@utc.frβmailto:cf@utc.frmh@glandium.orgβmailto:mh@glandium.org
and that's a wrap, bestie π this whole page is from version 0.2.5-patched, dated 04/01/2024 β go debug something, you absolute icon, and remember: read the warnings before you free_block anything ππβ¨
π¦ where this page comes from
- ubuntu noble: vmfs-tools 0.2.5-1.1build2 Β· GPL-2.0-or-later
- ubuntu questing: vmfs-tools 0.2.5-1.1build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms