一度使い出したらその便利さに抜け出せなくZFS。ZFSの提供するさまざまな機能を使わなくても基本的な使い方だけでも便利なものですが、
- Do zdb for ZFS rescue
ZFSは壊れにくいファイルシステムだと言われてはいますが、
何らかの原因で壊れることもあります。スクラブで直らない場合にはzdb(1M)で直すのが順当な修正方法となります。 ただし、
zdb(1M)のマニュアルを見るとわかりますが、 使い方が載っていません。 「zdb -h」 を実行すると指定できるオプションとその意味の要約がでますので、 これを利用します。 % zdb -h Usage: zdb [-CumdibcsDvhL] poolname [object...] zdb [-div] dataset [object...] zdb -m [-L] poolname [vdev [metaslab...]] zdb -R poolname vdev:offset:size[:flags] zdb -S poolname zdb -l [-u] device zdb -C Dataset name must include at least one separator character '/' or '@' If dataset name is specified, only that dataset is dumped If object numbers are specified, only those objects are dumped Options to control amount of output: -u uberblock -d dataset(s) -i intent logs -C config (or cachefile if alone) -h pool history -b block statistics -m metaslabs -c checksum all metadata (twice for all data) blocks -s report stats on zdb's I/
O -D dedup statistics -S simulate dedup to measure effect -v verbose (applies to all others) -l dump label contents -L disable leak tracking (do not load spacemaps) -R read and display block from a device Below options are intended for use with other options (except -l): -A ignore assertions (-A), enable panic recovery (-AA) or both (-AAA) -F attempt automatic rewind within safe range of transaction groups -U <cachefile_ path> -- use alternate cachefile -X attempt extreme rewind (does not work with dataset) -e pool is exported/ destroyed/ has altroot/ not in a cachefile -p <path> -- use one or more with -e to specify path to vdev dir -P print numbers parsable -t <txg> -- highest txg to use when searching for uberblocks Specify an option more than once (e. g. -bb) to make only that option verbose Default is to dump everything non-verbosely % zdbを使うには、
まずプールをexportして外す必要があります。外したプールに対して 「zdbn オプション プール」 として修正を実施します。なにもオプションを指定しないと分析だけを実施してくれるので、 そのプールがパニックを引き起こすものかどうかをチェックできます。 実証実験をしていないので確かなことはわかりませんが、
前回のような問題が発生したようなケースは 「zdb -AAA プール」 で修正が可能なようです。