FreeBSD Daily Topics
2011年9月20日 ZFS活用シリーズ - scrubで直らない問題の修正(zdb版)
この記事を読むのに必要な時間:およそ 1.5 分
一度使い出したらその便利さに抜け出せなく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 プール」 で修正が可能なようです。
バックナンバー
FreeBSD Daily Topics
- 2011年9月30日 FreeBSD 1.x系とFreeBSD 10.x系ダブルディジット問題について
- 2011年9月29日 FreeBSD 9.0-BETA3登場
- 2011年9月28日 FreeBSD 10.0-CURRENT登場,ベータ版は3の登場間もなく
- 2011年9月27日 ZFS活用シリーズ - より詳しい情報と説明
- 2011年9月22日 ZFS活用シリーズ - scrubで直らない問題の修正(zdb - 修復編)
- 2011年9月21日 ZFS活用シリーズ - scrubで直らない問題の修正(zdb - 状況調査編)
- 2011年9月20日 ZFS活用シリーズ - scrubで直らない問題の修正(zdb版)
- 2011年9月16日 ZFS活用シリーズ - scrubで直らない問題の修正(アドホック版)
- 2011年9月15日 ZFS活用シリーズ - scrubを使う
- 2011年9月14日 Capsicumを知る - 積極的なセキュリティ強化