-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zdb raidz file layout #16835
base: master
Are you sure you want to change the base?
zdb raidz file layout #16835
Conversation
Adding the --file-layout (-f) option to zdb(8) to display the raidz file 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. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Signed-off-by: Don Brady <[email protected]>
I just tested this by printing out different objects. Seems to work fine:
The scripted mode columns don't align with the values, but I don't know if that matters since it's scripted mode:
Some of the edge cases have ASCII art a little off, but again, I don't think it matters: Empty or small file:
Printing out the "ZFS Master node" for a dataset:
|
@@ -4208,7 +4508,7 @@ dump_objset(objset_t *os) | |||
|
|||
zdb_nicenum(refdbytes, numbuf, sizeof (numbuf)); | |||
|
|||
if (verbosity >= 4) { | |||
if (verbosity >= 4 || dump_opt['d']) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to add in your commit message that -d
also prints this header now.
.It Fl f , -file-layout | ||
Display the file layout of an object for the disks of a raidz vdev. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to mention -H
here, like:
Display the file layout of an object for the disks of a raidz vdev.
You can optionally pass -H to print the file layout in scripted mode for easy parsing.
Motivation and Context
It would be nice to be able to visualize how the RAIDZ disk columns for a given file are laid out on disk. For example, one might ponder if the parity is being evenly distributed or are the same disks being used for parity?
Description
This change introduces the --file-layout (-f) option to zdb(8) to display the raidz file layout for a given file. The change leverages the
vdev_raidz_map_alloc()
function to find the map of how the block data is laid out across the child disks.A typical column entry looks like:
Which here represents the logical data column 2 that is 43 sectors high starting at sector 0x6020da. The parity is displayed in inverse text if output is to a terminal (see example below).
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
An example
How Has This Been Tested?
Tested with various flavors of raidz and disk counts.
Tested with ZTS
cli_root/zdb
suite of tests.Known Issues/Limitations
RAIDZ
. A follow-on pull request can add support fordRAID
.'├'
, can sometimes show final connector'└'
by mistake.Types of changes
Checklist:
Signed-off-by
.