Add the --file-layout (-f) option to zdb(8)

Displays the physical raidz block layout for a given file.
This leverages the internal vdev_raidz_map_alloc() function to find
the map of how the block data is laid out across the child disks.

The column entry for each row looks like:
+------------+
|  D2     43 |
|     6020da |
+------------+
representing here the logical data column 2 that is 43 sectors high
starting at sector 0x6020da.

With -H, the output is a list of disks, LBAs, and block counts,
given in 512 byte block values.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: sean.fagan@klarasystems.com
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Don Brady <don.brady@klarasystems.com>
Co-authored-by: Sean Fagan <sean.fagan@klarasystems.com>
Closes #18264
This commit is contained in:
Sean Eric Fagan
2026-03-12 21:41:23 +00:00
committed by GitHub
parent 2b930f63f8
commit f109c7bb98
3 changed files with 366 additions and 19 deletions
+7
View File
@@ -282,6 +282,13 @@ Also dump the contents of the deduplication tables describing unique blocks.
Decode and display block from an embedded block pointer specified by the
.Ar word
arguments.
.It Fl f , -file-layout
Display the file layout of an object for the disks of a raidz vdev.
With
.Fl H ,
the output is in scripted mode for easy parsing, with all values
being presented as 512 byte blocks.
Only a single top-level raidz vdev is supported.
.It Fl h , -history
Display pool history similar to
.Nm zpool Cm history ,