FreeNASでDrobo風なNASを作る
Droboとは
Droboについてはitmediaの記事に紹介されています。
個人ユーザーこそ使ってみよう──RAIDより簡単なストレージアレイ「Drobo」の実力検証(前編) (1/3)
便利そうなディスク装置ですが、特に以下の点が個人的に魅力です。
とっても便利そうなDroboですが、ちょっと値が張ります(価格コムで4万円切るくらい)。
なんとか安く似たようなものが作れないものか。
ググったところ、Glen’s Weblog の ZFS & FreeNAS – A poor (and very geeky) man’s Drobo setup!
というエントリで、FreeNASでDrobo風なNASを作る方法が紹介されているのを見つけました。
FreeNASで実現できること
具体的には以下のことが実現できます。
つまり、簡単操作という点以外は個人的にDroboでいいなあと思っているところが全部できています。
ちょっと元ネタブログで紹介されている方法が難しかったので、まとめてみました。
簡単な原理
作り方の紹介の前に、原理を簡単に紹介します。
普通にFreeNASでRAIDを組むだけではDroboっぽくはなりません。
以下の面倒な作業が必要です。
作り方
ここで紹介する方法は私を始め誰も動作保証してくれません。あくまで自己責任でお願いします。
なにか問題があっても、私は責任をおえませんし、助言する義務もおいません。
1.FreeNASが使える環境を準備する
4本ディスクが入るPCにFreeNAS最新版(現在0.7.2)をインストールしてください。
USBメモリにインストールするとディスクを無駄にしません。
私は4G USBメモリにフルインストールしてHP ProLiant MicroServerで使用しています。
以後ログなどはHP ProLiant MicroServerrのものです。
ちなみにHP ProLiant MicroServerは税込35,700円です。
なんとかDroboよりは安くなっています。
FreeNASがインストールできたら、SSHでログインできるようにしておいてください。
作業は殆どコマンドラインで行ないます。
2. 使用するディスクのデバイス名と容量を調べる
rootユーザでdmesgコマンドとgptコマンドを使って各ディスクのデバイス名と容量(セクタ数)を調べます。
以下の赤字のところです。
freenas:~# dmesg | grep "^ad"
ad4: 1907729MB at ata2-master SATA300
ad6: 152627MB at ata3-master SATA300
ad8: 476940MB at ata4-master SATA300
ad10: 152627MB at ata5-master SATA150
freenas:~# gpt -v show ad4 > /dev/null
gpt show: ad4: mediasize=2000398934016; sectorsize=512; blocks=3907029168
freenas:~# gpt -v show ad6 > /dev/null
gpt show: ad6: mediasize=160041885696; sectorsize=512; blocks=312581808
freenas:~# gpt -v show ad8 > /dev/null
gpt show: ad8: mediasize=500107862016; sectorsize=512; blocks=976773168
freenas:~# gpt -v show ad10 > /dev/null
gpt show: ad10: mediasize=160041885696; sectorsize=512; blocks=312581808
3. Googleドキュメントで仮想ディスク作成スクリプトを作る
Drobo風にNASを作るために、パーティションサイズの計算が必要なのですが
計算しやすくするためにGoogle spreadsheetで表を作りました。
以下URLから参照してください。
https://spreadsheets.google.com/ccc?key=0AufEgCg-Sy76dDh4ZkRIQ2JVT3FzMzNVdnlsVURzMEE&hl=ja&authkey=CPSmrNUI
参照はできますが編集はできませんので「ファイル」メニューから「コピーを作成」して自分のgoogleアカウントにコピーしてください。
コピーしたドキュメントの緑色のセルに先程確認した情報を入力します。
こんな感じですね

このあと、ソルバーを使ってパーティションの容量配分を計算します。「ツール」メニューから「ソルバー」を選択して、下記のように入力します。

ソルバーボタンをクリックすると、Total: というセルの数字が変わるはずです。この数字が、実際に構築される仮想ディスクの容量になります。表の下に仮想ディスク作成スクリプトが作成されます。
4. 作成スクリプトを実行する
あとは生成されたスクリプトをコピペするだけです。
作成後にdf -hできちんと作成されているか確認してください。
私の環境ではこんな感じでした。容量としては 2T, 160G, 500G, 160G の4本で500Gくらいです。
あとは /mnt/tank をsambaなりNFSなりで共有すればDrobo風NASサーバの完成です。
領域拡張
ディスクを大容量のものに入れ替えて仮想ディスクの容量を増やします。
これがまた面倒なので、詳細はまた後日書きますが、私の環境でのログを貼り付けておきます。
作業前のdf -hの結果が583G で作業後には913Gになっています。
電源OFFして160Gのディスク(ad10)を1Tに交換して起動したところから。
Droboについてはitmediaの記事に紹介されています。
個人ユーザーこそ使ってみよう──RAIDより簡単なストレージアレイ「Drobo」の実力検証(前編) (1/3)
便利そうなディスク装置ですが、特に以下の点が個人的に魅力です。
- 異なる容量のディスクを集約して、ひとつの仮想ディスクを作る
- ファイルを保持したまま仮想ディスクの容量を増やせる(小容量ディスクを大容量のものに挿し換える)
- ディスク増設が簡単(挿し替えるだけ)
とっても便利そうなDroboですが、ちょっと値が張ります(価格コムで4万円切るくらい)。
なんとか安く似たようなものが作れないものか。
ググったところ、Glen’s Weblog の ZFS & FreeNAS – A poor (and very geeky) man’s Drobo setup!
というエントリで、FreeNASでDrobo風なNASを作る方法が紹介されているのを見つけました。
FreeNASで実現できること
具体的には以下のことが実現できます。
- 異なる容量のHDDを集約して、ひとつの仮想ディスクを作る
- を保持したまま仮想ディスクの容量を増やせる(小容量HDDを大容量のものに挿し換える)
つまり、簡単操作という点以外は個人的にDroboでいいなあと思っているところが全部できています。
ちょっと元ネタブログで紹介されている方法が難しかったので、まとめてみました。
簡単な原理
作り方の紹介の前に、原理を簡単に紹介します。
- なぜ異なる容量のディスクを組み合わせられるか?
- 物理ディスクを複数のサイズのパーティションに切って、同一サイズのパーティション同士でRAID5を作るからです。
作られたRAIDを連結して単一ディスク領域にしています。
もちろん、大容量のディスクには未使用領域が残りますが、そこは諦めてください。
そのあたりの事情はDroboも同様のはずです。 - なぜ容量拡張できるの?
- FreeNASが採用しているZFSが容量拡張に対応しているから。
普通にFreeNASでRAIDを組むだけではDroboっぽくはなりません。
以下の面倒な作業が必要です。
作り方
ここで紹介する方法は私を始め誰も動作保証してくれません。あくまで自己責任でお願いします。
なにか問題があっても、私は責任をおえませんし、助言する義務もおいません。
1.FreeNASが使える環境を準備する
4本ディスクが入るPCにFreeNAS最新版(現在0.7.2)をインストールしてください。
USBメモリにインストールするとディスクを無駄にしません。
私は4G USBメモリにフルインストールしてHP ProLiant MicroServerで使用しています。
以後ログなどはHP ProLiant MicroServerrのものです。
ちなみにHP ProLiant MicroServerは税込35,700円です。
なんとかDroboよりは安くなっています。
FreeNASがインストールできたら、SSHでログインできるようにしておいてください。
作業は殆どコマンドラインで行ないます。
2. 使用するディスクのデバイス名と容量を調べる
rootユーザでdmesgコマンドとgptコマンドを使って各ディスクのデバイス名と容量(セクタ数)を調べます。
以下の赤字のところです。
freenas:~# dmesg | grep "^ad"
ad4: 1907729MB
ad6: 152627MB
ad8: 476940MB
ad10: 152627MB
freenas:~# gpt -v show ad4 > /dev/null
gpt show: ad4: mediasize=2000398934016; sectorsize=512; blocks=3907029168
freenas:~# gpt -v show ad6 > /dev/null
gpt show: ad6: mediasize=160041885696; sectorsize=512; blocks=312581808
freenas:~# gpt -v show ad8 > /dev/null
gpt show: ad8: mediasize=500107862016; sectorsize=512; blocks=976773168
freenas:~# gpt -v show ad10 > /dev/null
gpt show: ad10: mediasize=160041885696; sectorsize=512; blocks=312581808
3. Googleドキュメントで仮想ディスク作成スクリプトを作る
Drobo風にNASを作るために、パーティションサイズの計算が必要なのですが
計算しやすくするためにGoogle spreadsheetで表を作りました。
以下URLから参照してください。
https://spreadsheets.google.com/ccc?key=0AufEgCg-Sy76dDh4ZkRIQ2JVT3FzMzNVdnlsVURzMEE&hl=ja&authkey=CPSmrNUI
参照はできますが編集はできませんので「ファイル」メニューから「コピーを作成」して自分のgoogleアカウントにコピーしてください。
コピーしたドキュメントの緑色のセルに先程確認した情報を入力します。
こんな感じですね

このあと、ソルバーを使ってパーティションの容量配分を計算します。「ツール」メニューから「ソルバー」を選択して、下記のように入力します。

ソルバーボタンをクリックすると、Total: というセルの数字が変わるはずです。この数字が、実際に構築される仮想ディスクの容量になります。表の下に仮想ディスク作成スクリプトが作成されます。
4. 作成スクリプトを実行する
あとは生成されたスクリプトをコピペするだけです。
作成後にdf -hできちんと作成されているか確認してください。
私の環境ではこんな感じでした。容量としては 2T, 160G, 500G, 160G の4本で500Gくらいです。
freenas:~# df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/da0s1a 3.6G 247M 3.0G 7% /
devfs 1.0K 1.0K 0B 100% /dev
procfs 4.0K 4.0K 0B 100% /proc
freenas:~# dmesg | grep "^ad"
ad4: 1907729MBat ata2-master SATA300
ad6: 152627MBat ata3-master SATA300
ad8: 476940MBat ata4-master SATA300
ad10: 152627MBat ata5-master SATA150
freenas:~#
freenas:~# gpt -v show ad4 > /dev/null
gpt show: ad4: mediasize=2000398934016; sectorsize=512; blocks=3907029168
freenas:~# gpt -v show ad6 > /dev/null
gpt show: ad6: mediasize=160041885696; sectorsize=512; blocks=312581808
freenas:~# gpt -v show ad8 > /dev/null
gpt show: ad8: mediasize=500107862016; sectorsize=512; blocks=976773168
freenas:~# gpt -v show ad10 > /dev/null
gpt show: ad10: mediasize=160041885696; sectorsize=512; blocks=312581808
freenas:~# gpt destroy ad4 ; gpt create -f ad4
freenas:~# gpt destroy ad6 ; gpt create -f ad6
freenas:~# gpt destroy ad8 ; gpt create -f ad8
freenas:~# gpt destroy ad10 ; gpt create -f ad10
freenas:~#
freenas:~# gpt add -i 1 -s 131072 ad4
freenas:~# gpt add -i 1 -s 131072 ad6
freenas:~# gpt add -i 1 -s 131072 ad8
freenas:~# gpt add -i 1 -s 131072 ad10
freenas:~# gpt add -i 2 -s 312188525 ad4
freenas:~# gpt add -i 2 -s 312188525 ad6
freenas:~# gpt add -i 2 -s 312188525 ad8
freenas:~# gpt add -i 3 -s 131072 ad4
freenas:~# gpt add -i 3 -s 131072 ad6
freenas:~# gpt add -i 3 -s 131072 ad10
freenas:~# gpt add -i 4 -s 312188525 ad4
freenas:~# gpt add -i 4 -s 312188525 ad8
freenas:~# gpt add -i 4 -s 312188525 ad10
freenas:~# gpt add -i 5 -s 131072 ad6
freenas:~# gpt add -i 5 -s 131072 ad8
freenas:~# gpt add -i 5 -s 131072 ad10
freenas:~# zpool create -f -m /mnt/tank tank raidz1 /dev/ad4p1 /dev/ad6p1 /dev/ad8p1 /dev/ad10p1
freenas:~# zpool add -f tank raidz1 /dev/ad4p2 /dev/ad6p2 /dev/ad8p2
freenas:~# zpool add -f tank raidz1 /dev/ad4p3 /dev/ad6p3 /dev/ad10p3
freenas:~# zpool add -f tank raidz1 /dev/ad4p4 /dev/ad8p4 /dev/ad10p4
freenas:~# zpool add -f tank raidz1 /dev/ad6p5 /dev/ad8p5 /dev/ad10p5
freenas:~#
freenas:~# df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/da0s1a 3.6G 247M 3.0G 7% /
devfs 1.0K 1.0K 0B 100% /dev
procfs 4.0K 4.0K 0B 100% /proc
tank 583G 0B 583G 0% /mnt/tank
freenas:~#
freenas:~# zpool status
pool: tank
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p1 ONLINE 0 0 0
ad6p1 ONLINE 0 0 0
ad8p1 ONLINE 0 0 0
ad10p1 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p2 ONLINE 0 0 0
ad6p2 ONLINE 0 0 0
ad8p2 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p3 ONLINE 0 0 0
ad6p3 ONLINE 0 0 0
ad10p3 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p4 ONLINE 0 0 0
ad8p4 ONLINE 0 0 0
ad10p4 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad6p5 ONLINE 0 0 0
ad8p5 ONLINE 0 0 0
ad10p5 ONLINE 0 0 0
errors: No known data errors
あとは /mnt/tank をsambaなりNFSなりで共有すればDrobo風NASサーバの完成です。
領域拡張
ディスクを大容量のものに入れ替えて仮想ディスクの容量を増やします。
これがまた面倒なので、詳細はまた後日書きますが、私の環境でのログを貼り付けておきます。
作業前のdf -hの結果が583G で作業後には913Gになっています。
電源OFFして160Gのディスク(ad10)を1Tに交換して起動したところから。
freenas:~# dmesg | grep "^ad"
ad4: 1907729MBat ata2-master SATA300
ad6: 152627MBat ata3-master SATA300
ad8: 476940MBat ata4-master SATA300
ad10: 953869MBat ata5-master SATA300
freenas:~#
freenas:~# zpool status
pool: tank
state: DEGRADED
status: One or more devices could not be used because the label is missing or
invalid. Sufficient replicas exist for the pool to continue
functioning in a degraded state.
action: Replace the device using 'zpool replace'.
see: http://www.sun.com/msg/ZFS-8000-4J
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
ad4p1 ONLINE 0 0 0
ad6p1 ONLINE 0 0 0
ad8p1 ONLINE 0 0 0
ad10p1 FAULTED 0 0 0 corrupted data
raidz1 ONLINE 0 0 0
ad4p2 ONLINE 0 0 0
ad6p2 ONLINE 0 0 0
ad8p2 ONLINE 0 0 0
raidz1 DEGRADED 0 0 0
ad4p3 ONLINE 0 0 0
ad6p3 ONLINE 0 0 0
ad10p3 FAULTED 0 0 0 corrupted data
raidz1 DEGRADED 0 0 0
ad4p4 ONLINE 0 0 0
ad8p4 ONLINE 0 0 0
ad10p4 FAULTED 0 0 0 corrupted data
raidz1 DEGRADED 0 0 0
ad6p5 ONLINE 0 0 0
ad8p5 ONLINE 0 0 0
ad10p5 FAULTED 0 0 0 corrupted data
errors: No known data errors
freenas:~#
freenas:~#
freenas:~# gpart show ad4
=> 34 3907029101 ad4 GPT (1.8T)
34 131072 1 freebsd-ufs (64M)
131106 312188525 2 freebsd-ufs (149G)
312319631 131072 3 freebsd-ufs (64M)
312450703 312188525 4 freebsd-ufs (149G)
624639228 3282389907 - free - (1.5T)
freenas:~# df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/da0s1a 3.6G 247M 3.0G 7% /
devfs 1.0K 1.0K 0B 100% /dev
procfs 4.0K 4.0K 0B 100% /proc
tank 583G 0B 583G 0% /mnt/tank
freenas:~#
freenas:~# gpt -v show ad10
gpt show: ad10: mediasize=1000204886016; sectorsize=512; blocks=1953525168
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 131072 1 GPT part - FreeBSD UFS/UFS2
131106 131072 3 GPT part - FreeBSD UFS/UFS2
262178 664322432 4 GPT part - FreeBSD UFS/UFS2
664584610 131072 5 GPT part - FreeBSD UFS/UFS2
664715682 1288809453
1953525135 32 Sec GPT table
1953525167 1 Sec GPT header
freenas:~#
freenas:~#
freenas:~# gpart add -b 664715682 -s 131072 -t freebsd-ufs -i 11 ad4
ad4p11 added
freenas:~# gpart show ad4 | tail -2
664846754 3242182381 - free - (1.5T)
freenas:~# gpart add -b 664846754 -s 312188525 -t freebsd-ufs -i 12 ad4
ad4p12 added
freenas:~# gpart show ad4 | tail -2
977035279 2929993856 - free - (1.4T)
freenas:~# gpart add -b 977035279 -s 131072 -t freebsd-ufs -i 13 ad4
ad4p13 added
freenas:~# gpart show ad4 | tail -2
977166351 2929862784 - free - (1.4T)
freenas:~# gpart add -b 977166351 -s 664322432 -t freebsd-ufs -i 14 ad4
ad4p14 added
freenas:~# gpart show ad4 | tail -2
1641488783 2265540352 - free - (1.1T)
freenas:~# gpart add -b 1641488783 -s 131072 -t freebsd-ufs -i 15 ad4
ad4p15 added
freenas:~#
freenas:~# zpool status
pool: tank
state: DEGRADED
status: One or more devices could not be used because the label is missing or
invalid. Sufficient replicas exist for the pool to continue
functioning in a degraded state.
action: Replace the device using 'zpool replace'.
see: http://www.sun.com/msg/ZFS-8000-4J
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
ad4p1 ONLINE 0 0 0
ad6p1 ONLINE 0 0 0
ad8p1 ONLINE 0 0 0
ad10p1 FAULTED 0 0 0 corrupted data
raidz1 ONLINE 0 0 0
ad4p2 ONLINE 0 0 0
ad6p2 ONLINE 0 0 0
ad8p2 ONLINE 0 0 0
raidz1 DEGRADED 0 0 0
ad4p3 ONLINE 0 0 0
ad6p3 ONLINE 0 0 0
ad10p3 FAULTED 0 0 0 corrupted data
raidz1 DEGRADED 0 0 0
ad4p4 ONLINE 0 0 0
ad8p4 ONLINE 0 0 0
ad10p4 FAULTED 0 0 0 corrupted data
raidz1 DEGRADED 0 0 0
ad6p5 ONLINE 0 0 0
ad8p5 ONLINE 0 0 0
ad10p5 FAULTED 0 0 0 corrupted data
errors: No known data errors
freenas:~# zpool replace -f tank ad10p1 ad4p11
freenas:~# zpool replace -f tank ad10p3 ad4p13
freenas:~# zpool replace -f tank ad10p4 ad4p14
freenas:~# zpool replace -f tank ad10p5 ad4p15
freenas:~#
freenas:~# zpool status
pool: tank
state: ONLINE
scrub: scrub completed after 0h0m with 0 errors on Mon Nov 8 00:36:45 2010
config:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p1 ONLINE 0 0 0
ad6p1 ONLINE 0 0 0
ad8p1 ONLINE 0 0 0
ad4p11 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p2 ONLINE 0 0 0
ad6p2 ONLINE 0 0 0
ad8p2 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p3 ONLINE 0 0 0
ad6p3 ONLINE 0 0 0
ad4p13 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p4 ONLINE 0 0 0
ad8p4 ONLINE 0 0 0
ad4p14 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad6p5 ONLINE 0 0 0
ad8p5 ONLINE 0 0 0
ad4p15 ONLINE 0 0 0
errors: No known data errors
freenas:~#
freenas:~# zpool export tank
freenas:~# gpt destroy ad10
freenas:~# gpt create -f ad10
freenas:~# gpt add -i 1 -s 131072 ad10
freenas:~# gpt add -i 3 -s 131072 ad10
freenas:~# gpt add -i 4 -s 664322432 ad10
freenas:~# gpt add -i 5 -s 131072 ad10
freenas:~# zpool import tank
cannot import 'tank': more than one matching pool
import by numeric ID instead
freenas:~# zpool import
pool: tank
id: 9270976627868517511
state: UNAVAIL
status: One or more devices contains corrupted data.
action: The pool cannot be imported due to damaged devices or data.
see: http://www.sun.com/msg/ZFS-8000-5E
config:
tank UNAVAIL insufficient replicas
raidz1 ONLINE
ad4p1 ONLINE
ad6p1 ONLINE
ad8p1 ONLINE
ad10p1 ONLINE
raidz1 ONLINE
ad4p3 ONLINE
ad6p3 ONLINE
ad10p3 ONLINE
raidz1 UNAVAIL corrupted data
ad4p4 ONLINE
ad8p4 ONLINE
ad10p4 ONLINE
raidz1 ONLINE
ad6p5 ONLINE
ad8p5 ONLINE
ad10p5 ONLINE
pool: tank
id: 2323966863493414263
state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:
tank ONLINE
raidz1 ONLINE
ad4p1 ONLINE
ad6p1 ONLINE
ad8p1 ONLINE
ad4p11 ONLINE
raidz1 ONLINE
ad4p2 ONLINE
ad6p2 ONLINE
ad8p2 ONLINE
raidz1 ONLINE
ad4p3 ONLINE
ad6p3 ONLINE
ad4p13 ONLINE
raidz1 ONLINE
ad4p4 ONLINE
ad8p4 ONLINE
ad4p14 ONLINE
raidz1 ONLINE
ad6p5 ONLINE
ad8p5 ONLINE
ad4p15 ONLINE
freenas:~# gpt destroy ad10
freenas:~# zpool import tank
freenas:~# zpool status
pool: tank
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p1 ONLINE 0 0 0
ad6p1 ONLINE 0 0 0
ad8p1 ONLINE 0 0 0
ad4p11 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p2 ONLINE 0 0 0
ad6p2 ONLINE 0 0 0
ad8p2 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p3 ONLINE 0 0 0
ad6p3 ONLINE 0 0 0
ad4p13 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p4 ONLINE 0 0 0
ad8p4 ONLINE 0 0 0
ad4p14 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad6p5 ONLINE 0 0 0
ad8p5 ONLINE 0 0 0
ad4p15 ONLINE 0 0 0
errors: No known data errors
freenas:~# gpt create -f ad10
freenas:~# gpt add -i 1 -s 131072 ad10
freenas:~# gpt add -i 3 -s 131072 ad10
freenas:~# gpt add -i 4 -s 664322432 ad10
freenas:~# gpt add -i 5 -s 131072 ad10
freenas:~# zpool replace -f tank ad4p11 ad10p1
freenas:~# zpool replace -f tank ad4p13 ad10p3
freenas:~# zpool replace -f tank ad4p14 ad10p4
freenas:~# zpool replace -f tank ad4p15 ad10p5
freenas:~#
freenas:~# zpool export tank
freenas:~# gpt destroy ad8
freenas:~# zpool import tank
freenas:~# zpool status
pool: tank
state: DEGRADED
status: One or more devices could not be opened. Sufficient replicas exist for
the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
see: http://www.sun.com/msg/ZFS-8000-2Q
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
ad4p1 ONLINE 0 0 0
ad6p1 ONLINE 0 0 0
1434089966366771512 UNAVAIL 0 0 0 was /dev/ad8p1
ad10p1 ONLINE 0 0 0
raidz1 DEGRADED 0 0 0
ad4p2 ONLINE 0 0 0
ad6p2 ONLINE 0 0 0
7672230464381230151 UNAVAIL 0 0 0 was /dev/ad8p2
raidz1 ONLINE 0 0 0
ad4p3 ONLINE 0 0 0
ad6p3 ONLINE 0 0 0
ad10p3 ONLINE 0 0 0
raidz1 DEGRADED 0 0 0
ad4p4 ONLINE 0 0 0
15824696584317871971 REMOVED 0 0 0 was /dev/ad8p4
ad10p4 ONLINE 0 0 0
raidz1 DEGRADED 0 0 0
ad6p5 ONLINE 0 0 0
1662115052024520418 REMOVED 0 0 0 was /dev/ad8p5
ad10p5 ONLINE 0 0 0
errors: No known data errors
freenas:~#
freenas:~# zpool replace -f tank ad8p1 ad4p11
freenas:~# zpool replace -f tank ad8p2 ad4p12
freenas:~# zpool replace -f tank ad8p4 ad4p14
freenas:~# zpool replace -f tank ad8p5 ad4p15
freenas:~# zpool status
pool: tank
state: ONLINE
scrub: resilver completed after 0h0m with 0 errors on Mon Nov 8 00:47:39 2010
config:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p1 ONLINE 0 0 0
ad6p1 ONLINE 0 0 0
ad4p11 ONLINE 0 0 0
ad10p1 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p2 ONLINE 0 0 0
ad6p2 ONLINE 0 0 0
ad4p12 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p3 ONLINE 0 0 0
ad6p3 ONLINE 0 0 0
ad10p3 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p4 ONLINE 0 0 0
ad4p14 ONLINE 0 0 0
ad10p4 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad6p5 ONLINE 0 0 0 512 resilvered
ad4p15 ONLINE 0 0 0 512 resilvered
ad10p5 ONLINE 0 0 0
errors: No known data errors
freenas:~# gpt add -i 1 -s 131072 ad8
gpt add: ad8: error: no primary GPT header; run create or recover
ad8p1 added
freenas:~# gpt create -f ad8
freenas:~# gpt add -i 1 -s 131072 ad8
freenas:~# gpt add -i 2 -s 312188525 ad8
freenas:~# gpt add -i 4 -s 664322432 ad8
freenas:~# gpt add -i 5 -s 131072 ad8
freenas:~#
freenas:~# zpool replace -f tank ad4p11 ad8p1
freenas:~# zpool replace -f tank ad4p12 ad8p2
freenas:~# zpool replace -f tank ad4p14 ad8p4
freenas:~# zpool replace -f tank ad4p15 ad8p5
freenas:~# zpool status
pool: tank
state: ONLINE
scrub: resilver completed after 0h0m with 0 errors on Mon Nov 8 00:50:01 2010
config:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p1 ONLINE 0 0 0
ad6p1 ONLINE 0 0 0
ad8p1 ONLINE 0 0 0
ad10p1 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p2 ONLINE 0 0 0
ad6p2 ONLINE 0 0 0
ad8p2 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p3 ONLINE 0 0 0
ad6p3 ONLINE 0 0 0
ad10p3 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p4 ONLINE 0 0 0
ad8p4 ONLINE 0 0 0
ad10p4 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad6p5 ONLINE 0 0 0 14.5K resilvered
ad8p5 ONLINE 0 0 0 14.5K resilvered
ad10p5 ONLINE 0 0 0 14K resilvered
errors: No known data errors
freenas:~# zpool export tank
freenas:~# gpt destroy ad6
freenas:~# gpt create -f ad6
freenas:~# zpool import tank
freenas:~# zpool status
pool: tank
state: DEGRADED
status: One or more devices could not be opened. Sufficient replicas exist for
the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
see: http://www.sun.com/msg/ZFS-8000-2Q
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
ad4p1 ONLINE 0 0 0
15100179404678663866 REMOVED 0 0 0 was /dev/ad6p1
ad8p1 ONLINE 0 0 0
ad10p1 ONLINE 0 0 0
raidz1 DEGRADED 0 0 0
ad4p2 ONLINE 0 0 0
12038723168089769348 UNAVAIL 0 0 0 was /dev/ad6p2
ad8p2 ONLINE 0 0 0
raidz1 DEGRADED 0 0 0
ad4p3 ONLINE 0 0 0
7159896418724073791 UNAVAIL 0 0 0 was /dev/ad6p3
ad10p3 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p4 ONLINE 0 0 0
ad8p4 ONLINE 0 0 0
ad10p4 ONLINE 0 0 0
raidz1 DEGRADED 0 0 0
13947581831733968000 REMOVED 0 0 0 was /dev/ad6p5
ad8p5 ONLINE 0 0 0
ad10p5 ONLINE 0 0 0
errors: No known data errors
freenas:~#
freenas:~# zpool replace -f tank ad6p1 ad4p11
freenas:~# zpool replace -f tank ad6p2 ad4p12
freenas:~# zpool replace -f tank ad6p3 ad4p13
freenas:~# zpool replace -f tank ad6p5 ad4p15
freenas:~# zpool status
pool: tank
state: ONLINE
scrub: resilver completed after 0h0m with 0 errors on Mon Nov 8 00:52:57 2010
config:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p1 ONLINE 0 0 0
ad4p11 ONLINE 0 0 0
ad8p1 ONLINE 0 0 0
ad10p1 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p2 ONLINE 0 0 0
ad4p12 ONLINE 0 0 0
ad8p2 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p3 ONLINE 0 0 0
ad4p13 ONLINE 0 0 0
ad10p3 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p4 ONLINE 0 0 0
ad8p4 ONLINE 0 0 0
ad10p4 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p15 ONLINE 0 0 0 2K resilvered
ad8p5 ONLINE 0 0 0 2.50K resilvered
ad10p5 ONLINE 0 0 0 2K resilvered
errors: No known data errors
freenas:~# gpt add -i 1 -s 131072 ad6
freenas:~# gpt add -i 2 -s 312188525 ad6
freenas:~# gpt add -i 3 -s 131072 ad6
freenas:~# gpt add -i 5 -s 131072 ad6
freenas:~# zpool replace -f tank ad4p11 ad6p1
freenas:~# zpool replace -f tank ad4p12 ad6p2
freenas:~# zpool replace -f tank ad4p13 ad6p3
freenas:~# zpool replace -f tank ad4p15 ad6p5
freenas:~#
freenas:~# zpool status
pool: tank
state: ONLINE
scrub: resilver completed after 0h0m with 0 errors on Mon Nov 8 00:54:42 2010
config:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p1 ONLINE 0 0 0
ad6p1 ONLINE 0 0 0
ad8p1 ONLINE 0 0 0
ad10p1 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p2 ONLINE 0 0 0
ad6p2 ONLINE 0 0 0
ad8p2 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p3 ONLINE 0 0 0
ad6p3 ONLINE 0 0 0
ad10p3 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p4 ONLINE 0 0 0
ad8p4 ONLINE 0 0 0
ad10p4 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad6p5 ONLINE 0 0 0 39K resilvered
ad8p5 ONLINE 0 0 0 39K resilvered
ad10p5 ONLINE 0 0 0 38.5K resilvered
errors: No known data errors
freenas:~#
freenas:~# zpool export tank
freenas:~# gpt destroy ad4
freenas:~# gpt create -f ad4
freenas:~# zpool import tank
freenas:~# zpool status
pool: tank
state: DEGRADED
status: One or more devices could not be opened. Sufficient replicas exist for
the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
see: http://www.sun.com/msg/ZFS-8000-2Q
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
10825006633158704898 REMOVED 0 0 0 was /dev/ad4p1
ad6p1 ONLINE 0 0 0
ad8p1 ONLINE 0 0 0
ad10p1 ONLINE 0 0 0
raidz1 DEGRADED 0 0 0
16325851114971065300 REMOVED 0 0 0 was /dev/ad4p2
ad6p2 ONLINE 0 0 0
ad8p2 ONLINE 0 0 0
raidz1 DEGRADED 0 0 0
4071833555875781794 UNAVAIL 0 0 0 was /dev/ad4p3
ad6p3 ONLINE 0 0 0
ad10p3 ONLINE 0 0 0
raidz1 DEGRADED 0 0 0
772440535543473728 UNAVAIL 0 0 0 was /dev/ad4p4
ad8p4 ONLINE 0 0 0
ad10p4 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad6p5 ONLINE 0 0 0
ad8p5 ONLINE 0 0 0
ad10p5 ONLINE 0 0 0
errors: No known data errors
freenas:~# gpart show ad10
=> 34 1953525101 ad10 GPT (932G)
34 131072 1 freebsd-ufs (64M)
131106 131072 3 freebsd-ufs (64M)
262178 664322432 4 freebsd-ufs (317G)
664584610 131072 5 freebsd-ufs (64M)
664715682 1288809453 - free - (615G)
freenas:~# gpart add -b 664715682 -s 131072 -t freebsd-ufs -i 11 ad10
ad10p11 added
freenas:~# gpart show ad10 | tail -2
664846754 1288678381 - free - (614G)
freenas:~# gpart add -b 664846754 -s 131072 -t freebsd-ufs -i 12 ad10
ad10p12 added
freenas:~# gpart show ad10 | tail -2
664977826 1288547309 - free - (614G)
freenas:~# gpart delete -i 2 ad10
gpart: index '2': No such file or directory
freenas:~# gpart delete -i 12 ad10
ad10p12 deleted
freenas:~# gpart add -b 664846754 -s 312188525 -t freebsd-ufs -i 12 ad10
ad10p12 added
freenas:~# gpart show ad10 | tail -2
977035279 976489856 - free - (466G)
freenas:~# gpart add -b 977035279 -s 131072 -t freebsd-ufs -i 13 ad10
ad10p13 added
freenas:~# gpart show ad10 | tail -2
977166351 976358784 - free - (466G)
freenas:~# gpart add -b 977166351 -s 664322432 -t freebsd-ufs -i 14 ad10
ad10p14 added
freenas:~# gpart show ad10 | tail -2
1641488783 312036352 - free - (149G)
freenas:~# gpart add -b 1641488783 -s 131072 -t freebsd-ufs -i 15 ad10
ad10p15 added
freenas:~#
freenas:~# zpool status
pool: tank
state: DEGRADED
status: One or more devices could not be opened. Sufficient replicas exist for
the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
see: http://www.sun.com/msg/ZFS-8000-2Q
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
10825006633158704898 REMOVED 0 0 0 was /dev/ad4p1
ad6p1 ONLINE 0 0 0
ad8p1 ONLINE 0 0 0
ad10p1 ONLINE 0 0 0
raidz1 DEGRADED 0 0 0
16325851114971065300 REMOVED 0 0 0 was /dev/ad4p2
ad6p2 ONLINE 0 0 0
ad8p2 ONLINE 0 0 0
raidz1 DEGRADED 0 0 0
4071833555875781794 UNAVAIL 0 0 0 was /dev/ad4p3
ad6p3 ONLINE 0 0 0
ad10p3 ONLINE 0 0 0
raidz1 DEGRADED 0 0 0
772440535543473728 UNAVAIL 0 0 0 was /dev/ad4p4
ad8p4 ONLINE 0 0 0
ad10p4 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad6p5 ONLINE 0 0 0
ad8p5 ONLINE 0 0 0
ad10p5 ONLINE 0 0 0
errors: No known data errors
freenas:~# zpool replace -f tank ad4p1 ad10p11
freenas:~# zpool replace -f tank ad4p2 ad10p12
freenas:~# zpool replace -f tank ad4p3 ad10p13
freenas:~# zpool replace -f tank ad4p4 ad10p14
freenas:~#
freenas:~# zpool status
pool: tank
state: ONLINE
scrub: resilver completed after 0h0m with 0 errors on Mon Nov 8 01:01:29 2010
config:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad10p11 ONLINE 0 0 0
ad6p1 ONLINE 0 0 0
ad8p1 ONLINE 0 0 0
ad10p1 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad10p12 ONLINE 0 0 0
ad6p2 ONLINE 0 0 0
ad8p2 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad10p13 ONLINE 0 0 0
ad6p3 ONLINE 0 0 0
ad10p3 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad10p14 ONLINE 0 0 0 1K resilvered
ad8p4 ONLINE 0 0 0 1.50K resilvered
ad10p4 ONLINE 0 0 0 1.50K resilvered
raidz1 ONLINE 0 0 0
ad6p5 ONLINE 0 0 0
ad8p5 ONLINE 0 0 0
ad10p5 ONLINE 0 0 0
errors: No known data errors
freenas:~#
freenas:~# gpt add -i 1 -s 131072 ad4
freenas:~# gpt add -i 2 -s 312188525 ad4
freenas:~# gpt add -i 3 -s 131072 ad4
freenas:~# gpt add -i 4 -s 664322432 ad4
freenas:~# zpool replace -f tank ad10p11 ad4p1
freenas:~# zpool replace -f tank ad10p12 ad4p2
freenas:~# zpool replace -f tank ad10p13 ad4p3
freenas:~# zpool replace -f tank ad10p14 ad4p4
freenas:~# zpool status
pool: tank
state: ONLINE
scrub: resilver completed after 0h0m with 0 errors on Mon Nov 8 01:02:55 2010
config:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p1 ONLINE 0 0 0
ad6p1 ONLINE 0 0 0
ad8p1 ONLINE 0 0 0
ad10p1 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p2 ONLINE 0 0 0
ad6p2 ONLINE 0 0 0
ad8p2 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p3 ONLINE 0 0 0
ad6p3 ONLINE 0 0 0
ad10p3 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4p4 ONLINE 0 0 0 17.5K resilvered
ad8p4 ONLINE 0 0 0 18K resilvered
ad10p4 ONLINE 0 0 0 18K resilvered
raidz1 ONLINE 0 0 0
ad6p5 ONLINE 0 0 0
ad8p5 ONLINE 0 0 0
ad10p5 ONLINE 0 0 0
errors: No known data errors
freenas:~#
freenas:~# df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/da0s1a 3.6G 247M 3.0G 7% /
devfs 1.0K 1.0K 0B 100% /dev
procfs 4.0K 4.0K 0B 100% /proc
tank 913G 128K 913G 0% /mnt/tank
スポンサーサイト