ZBD(8)

zbd(8) β€” bestie, we're managing zoned block devices today πŸ’…

okay so this is zbd, from the System Manager's Manual, and she is that girl. let's get into it.


✨ NAME ✨

zbd β€” manage zoned block devices πŸ¦‹


✨ SYNOPSIS ✨

zbd command [options] device

✨ DESCRIPTION ✨

so zbd is the tool you use to mess with the zones of a zoned block device. and what even is a zoned block device, you ask? it's a block device that supports the SCSI Zoned Block Commands (ZBC), the ATA Zoned-device ATA Commands (ZAC), or the NVMe Zoned NameSpace commands (ZNS). iconic trio fr fr πŸ‘‘

the zones you wanna operate on get picked using the offset and length options. easy.

the device argument has to be the pathname of the target zoned block device. no guessing, bestie, give her the real path 🌸


✨ COMMANDS ✨

lowkey the default vibe: every command starts at the zone at device offset 0 and operates on all the zones. if you want to change that range, the common options -ofst and -len are right there waiting for you πŸ’–


🌈 report

zbd report is the one that grabs and shows you the device zone information. main character energy honestly.

by default she reports all zones from the start of the device up to the last zone of the device. you can change that behavior with options β€” move the starting zone, or change the size of the report. your call, queen ✨

🌸 Report output

  • Zone β€” Zone number
  • type β€” Type of the zone
  • ofst β€” Zone start offset in Bytes
  • len β€” Zone length in Bytes
  • cap β€” Zone usable capacity in Bytes
  • wp β€” Zone write pointer position in Bytes
  • cond β€” Zone condition
  • non_seq β€” Non-sequential write resources active
  • reset β€” Reset write pointer recommended

πŸŽ€ Zone types

  • cnv β€” Conventional
  • swr β€” Sequential write required
  • swp β€” Sequential write preferred
  • ??? β€” Unknown (should not be reported)

πŸ¦‹ Zone conditions

  • nw β€” Not write pointer
  • em β€” Empty
  • fu β€” Full
  • oe β€” Explicitly opened
  • oi β€” Implicitly opened
  • cl β€” Closed
  • ol β€” Offline
  • ro β€” Read only
  • ?? β€” Reserved conditions (should not be reported)
bestie if you ever see ??? or ?? show up, something is deeply not giving. those are literally not supposed to be reported πŸ’€

🌈 reset

zbd reset resets the write pointer of one or more zones. that's it, that's the whole job πŸ’…


🌈 open

zbd open explicitly opens one or more zones. go off πŸ‘‘


🌈 close

zbd close closes one or more zones. closed for business, periodt πŸŽ€


🌈 finish

zbd finish finishes one or more zones β€” meaning it transitions them to full. she's done, she's booked, she's full πŸ”₯


🌈 dump

save the zone information and the zone data of a zoned device to files. so cute of her.

  • files go by default into the current working directory πŸ“
  • wanna put them somewhere else? use the option -d
  • file names are prefixed by default using the device base name
  • device zone info lands in <devname>_zone_info.dump
  • device zone data lands in <devname>_zone_data.dump
  • wanna change that prefix? use the option -f

dump will save the data of all conventional zones and the written data of all sequential zones in the operation range. and yes, -ofst and -len can be used to limit the size of that operation range 🌸

ngl this part matters: the zone information file always saves zone information for all zones of the device, no matter what operation range you specified. and that file can be handed to the report command in place of a device name to inspect its content. iykyk πŸ’œ


🌈 restore

sets a zoned block device's zone status and zone data according to the zone information and zone data saved in files generated by the dump command. the resulting state of the target device will be identical to that of the device used to generate the dump files. literally a glow-up in reverse ✨

some rules, bestie, listen up:

  • restore will only operate on the zone range that was used with the dump command
  • the target zoned block device must be compatible with the zoned block device used as the source for the dump operation
  • "compatible" means the target device must have the same capacity and the same zone configuration (zone type, zone size, and zone capacity) as the source device. no substitutions πŸ™ˆ

you can change the path and the name prefix of the dump files used for restoring with the options -d and -f πŸŽ€


✨ OPTIONS ✨

πŸ’– Options that work with every command

  • -v β€” Verbose mode (for debug).
  • -i β€” Display device information before executing the command.
  • -ofst offset β€” Start offset in Bytes of the first zone to operate on.
  • -len length β€” Length in Bytes of the range of zones to operate on.
  • -h, --help β€” Display help text and exit.

πŸ’– Options that are ONLY for zbd report

  • -csv β€” Output zone information using the comma-separated (csv) format.
  • -n β€” Display the number of zones that are to be reported.
  • -c β€” Display the total capacity of all reported zones. when you use it together with the -n and -csv options, the number of zones is output first.
  • -ro filter β€” Specify reporting option to filter the zone report. filter can be one of the following:
    • em β€” Empty zones
    • oi β€” Implicitly opened zones
    • oe β€” Explicitly opened zones
    • cl β€” Closed zones
    • fu β€” Full zones
    • ro β€” Read only zones
    • ol β€” Offline zones
    • nw β€” Conventional zones
    • ns β€” Non_seq write resource zones
    • rw β€” Reset write pointer recommended zones

✨ AUTHOR ✨

Damien Le Moal <damien.lemoal@wdc.com> β€” thank you king 🫢


✨ SEE ALSO ✨

blkzone(8) β€” go read her too, she's the sister fr fr πŸ’œ


✨ AVAILABILITY ✨

the zbd command is part of the libzbd library, available from https://github.com/westerndigitalcorporation/libzbd 🌈


okay and one last thing before you go β€” this whole page is signed off as ZBD(8), the System Manager's Manual page for zbd. that's the little stamp at the very bottom, like a signature in lip gloss πŸ’…βœ¨ bye bestie, go zone something πŸ¦‹