CEPH-DENCODER(8)

πŸ’– CEPH-DENCODER β€” bestie edition πŸ’–

okay so this is the manual page for ceph-dencoder (section 8 of the Ceph manual, iykyk), and I'm about to make it make sense for you. grab a snack. πŸ“

✨ NAME ✨

ceph-dencoder β€” the ceph encoder/decoder utility, and yes she is that girl πŸ’…

✨ SYNOPSIS ✨

ceph-dencoder [commands...]

✨ DESCRIPTION ✨

so ceph-dencoder is this little utility that encodes, decodes, and dumps ceph data structures. it's a debugging girlie and also a testing girlie β€” specifically she tests inter-version compatibility. main character energy fr fr. πŸ‘‘

the way it works is so simple it's actually iconic: ceph-dencoder takes a plain list of commands and does them in order. that's it. that's the whole vibe.

✨ COMMANDS ✨

here's the whole roster, no skips, no cuts, we're doing all of them πŸ’–

  • version β€” prints the version string for the ceph-dencoder binary. just a lil hello, who she is.
  • import <file> β€” reads a binary blob of encoded data out of the file you name. it gets parked in an in-memory buffer (her little purse πŸ‘œ).
  • export <file> β€” writes whatever's currently in the in-memory buffer out to the file you name.
  • list_types β€” lists all the data types this particular build of ceph-dencoder knows about.
  • type <name> β€” picks the type you named, and everything you encode or decode after this uses it.
  • skip <bytes> β€” seeks <bytes> into the imported file before reading the data structure. use this when your object has a preamble/header sitting in front of the actual object of interest. she's just skipping past the intro, respectfully. πŸ™ˆ
  • decode β€” decodes the contents of the in-memory buffer into an instance of the type you previously selected. if something goes wrong, she reports the error. no hiding it.
  • encode β€” encodes the in-memory instance of the previously selected type into the in-memory buffer. the reverse girlie.
  • dump_json β€” prints a JSON-formatted description of the in-memory object. pretty print, slay.
  • count_tests β€” prints how many built-in test instances of the previously selected type ceph-dencoder is able to generate.
  • select_test <n> β€” selects the built-in test instance you named and makes it the in-memory instance of the type.
  • get_features β€” prints the decimal value of the feature set supported by this version of ceph-dencoder. every single bit represents a feature, and these line up with the CEPH_FEATURE_* defines over in src/include/ceph_features.h.
  • set_features <f> β€” sets the feature bits that get provided to encode to <f>. this is the time-travel option: it lets you encode objects so that old versions of the software can still understand them (for those types that support it).

✨ EXAMPLE ✨

okay so say you wanna peek at an attribute on an object that ceph-osd stored. you can do exactly this:

$ cd /mnt/osd.12/current/2.b_head
$ attr -l foo_bar_head_EFE6384B
Attribute "ceph.snapset" has a 31 byte value for foo_bar_head_EFE6384B
Attribute "ceph._" has a 195 byte value for foo_bar_head_EFE6384B
$ attr foo_bar_head_EFE6384B -g ceph._ -q > /tmp/a
$ ceph-dencoder type object_info_t import /tmp/a decode dump_json
{ "oid": { "oid": "foo",
      "key": "bar",
      "snapid": -2,
      "hash": 4024842315,
      "max": 0},
  "locator": { "pool": 2,
      "preferred": -1,
      "key": "bar"},
  "category": "",
  "version": "9'1",
  "prior_version": "0'0",
  "last_reqid": "client.4116.0:1",
  "size": 1681,
  "mtime": "2012-02-21 08:58:23.666639",
  "lost": 0,
  "wrlock_by": "unknown.0.0:0",
  "snaps": [],
  "truncate_seq": 0,
  "truncate_size": 0,
  "watchers": {}}

and alternatively β€” plot twist πŸ¦‹ β€” maybe you wanna dump an internal CephFS metadata object instead. that looks like this:

$ rados -p metadata get mds_snaptable mds_snaptable.bin
$ ceph-dencoder type SnapServer skip 8 import mds_snaptable.bin decode dump_json
{ "snapserver": { "last_snap": 1,
   "pending_noop": [],
   "snaps": [],
   "need_to_purge": {},
   "pending_create": [],
   "pending_destroy": []}}

see how skip 8 is doing all the heavy lifting there? that's the preamble/header thing we talked about. periodt. πŸ’…


✨ AVAILABILITY ✨

ceph-dencoder is part of Ceph, a massively scalable, open-source, distributed storage system. if you want more, the Ceph documentation lives at <https://docs.ceph.com> and she has so much more to say. πŸ’œ

✨ SEE ALSO ✨

  • ceph <>(8)

2010-2014, Inktank Storage, Inc. and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).


mwah πŸ’– that's the whole page. this build is from the dev source, dated Oct 06, 2026, and it's the CEPH-DENCODER(8) page of the Ceph manual β€” go forth and decode, bestie. πŸŽ€βœ¨

πŸ“¦ where this page comes from