Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

don-brady
Copy link
Contributor

@don-brady don-brady commented Dec 3, 2024

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:

┌────────────┐
│  D2     43 │
│     6020da │
└────────────┘

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
FL-RAIDZ2

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

  1. Only supports RAIDZ. A follow-on pull request can add support for dRAID.
  2. The check for the last row is not always correct and so the edge connector, like '├', can sometimes show final connector '└' by mistake.
  3. Only supports one top-level RAIDZ

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

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]>
@amotin amotin added the Status: Revision Needed Changes are required for the PR to be accepted label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Revision Needed Changes are required for the PR to be accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants