Linux command
zdb 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Display pool configuration
sudo zdb -C [pool]
Display detailed vdev information
sudo zdb -l [/dev/disk]
Dump pool metadata
sudo zdb -d [pool]
Display object set contents
sudo zdb -dd [pool/dataset]
Check pool integrity without modifying
sudo zdb -c [pool]
Display block statistics
sudo zdb -b [pool]
说明
zdb is the ZFS debugger, used to display detailed internal information about ZFS pools, datasets, and vdevs. It's primarily a diagnostic and debugging tool for ZFS administrators and developers. The tool can examine pool structure, display block allocation maps, verify data checksums, and dump raw ZFS metadata. It operates read-only and doesn't modify pool data. Common uses include diagnosing pool corruption, examining vdev labels after disk failures, and understanding ZFS internals.
参数
- -b
- Display block allocation statistics
- -c
- Verify pool integrity (checksum all data)
- -C
- Display pool configuration from cachefile
- -d
- Dump metadata from specified dataset
- -D
- Display deduplication statistics
- -e
- Operate on exported pool (specify devices with -p)
- -l
- Read and display vdev label contents
- -L
- Disable leak tracking
- -m
- Display metaslab information
- -p _path_
- Path to vdev (use with -e)
- -R
- Read and display raw data
- -s
- Display space map histograms
- -v
- Verbose output
FAQ
What is the zdb command used for?
zdb is the ZFS debugger, used to display detailed internal information about ZFS pools, datasets, and vdevs. It's primarily a diagnostic and debugging tool for ZFS administrators and developers. The tool can examine pool structure, display block allocation maps, verify data checksums, and dump raw ZFS metadata. It operates read-only and doesn't modify pool data. Common uses include diagnosing pool corruption, examining vdev labels after disk failures, and understanding ZFS internals.
How do I run a basic zdb example?
Run `sudo zdb -C [pool]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -b do in zdb?
Display block allocation statistics