Q&A How to solve zpool i/o error and can not import zpool

Q&A How to solve zpool i/o error
這一篇給自己做個紀念 希望也幫助一些人

自從裝OpenSolaris 當NAS也兩年了

這期間發生過一件糗事
就是機殼裡面的電源分接線 品質不良
而我沒有發現到
導致其中一個zpool 毀損
其實他並不是實體硬碟壞掉
而是zfs 的zpool出了一些問題
各種原因都有
而我的是因為斷斷續續離線 導致兩顆spare上線參與raidz重建
慘案就此發生

zpool FAULTED corrupted data or i/o error

總之就是不能完整連線
由於找不到解決方式
原廠文件又只會告訴你 當出現這種情形的時候 請重建跟還原

但人有失手的時候
這裡面有一些些生活的照片沒丟到另外一台去備份

而且他是在我出國回來的當天晚上才發現
很好 想救都沒得救

心一橫 就把這組zpool 拆下來丟著
這期間上線過幾次 找了無數的網頁 通通是求救的帖
甚至有人教zpool import -fF -R zpool
諸如此類 但都不能解決這種非硬碟壞死的狀況

終於在前天晚上讓我找到答案 千百個網頁中唯一一個說對 且真的能解決的方式
我把這兩天的奮鬥過程簡化成一個可以用的版本留下來大家
也希望國外的朋友能搜尋到這一篇
所以我用破爛的英文來寫!
(對,我這幾顆硬碟丟在桌上將近兩年)
( yes.....I left these disks on my desk almost two years)

0. "cant not be imported" must not be caused by dead disks (it`s different)

1.first install a whole new solaris with another harddisk, opensolaris or solaris 11 express will be ok
2.turn off, and attach all your disks (the damaged zpool)
3.mark your disk by order, it`s very important
sata on MB will be sata0 sata1 sata2 sata3 sata4 sata5, normally 6 ports, unless you use SAS HBA
if you use sata0 port to boot solaris...then mark on disks sata1 with 01, sata2 with 02..........
4.boot

5.open a terminal, type zpool import -f -R damagedzpool,
then you will see the status of damagedzpool like this command "zpool status -v", even we can not import

6.if you have 5 disks in raidz1,choose the disk marked 01 to be removed, I suggest turn off your PC first
because I don`t know if your SATA can be hotplug or not

7.boot, type "zpool import -f damagedzpool"

8.if it works, then it`s done, congratulations, if not try to deattach another disk 02,
but please attach "disk 01" back
one by one, be patient

9.that`s all

hope this will help you

ps:because my situation is 4 disks in raidz1 with 2 spare
so I must know which one to deattach, so I need to type "zpool import -f -R damagedzpool"
I tried two days, finally got the right one to deattach
when I saw the r/w led twinkling for a long time, I was very very happy....









所以你這個案例的故障點在那?

是硬體上的不穩定,造成pool存放檔案的metadata錯誤,最終引起pool的毀損?
thi wrote:
所以你這個案...(恕刪)



是三轉五的問題
還是HBA卡的問題
或是主機版
又或者是電源分接線太爛造成的
我自己不清楚,抓不出來
所以全拆過重來就沒事

國外也好多案例
看過幾個是電源中斷造成的

我這兩天拿z68和i5-2400裝
又發生抓不到
最後確定是電源分接線太爛
有時間的話,我看自己夾線都比零售貨來的好
真相永遠只有一個!

補述一下這個用法
不過我沒有測試過這個辦法
就是將壞掉的pool import成唯讀模式

# zpool import -o readonly=on tpool
For more information about importing a pool read-only, see Importing a Pool in Read-Only Mode.

You can import a pool with a missing log device by using the zpool import -m command. For more information, see Importing a Pool With a Missing Log Device.

If the pool cannot be recovered by the pool recovery method described above, you must restore the pool and all its data from a backup copy. The mechanism you use varies widely depending on the pool configuration and backup strategy. First, save the configuration as displayed by the zpool status command so that you can recreate it after the pool is destroyed. Then, use the zpool destroy -f command to destroy the pool. Also, keep a file describing the layout of the datasets and the various locally set properties somewhere safe, as this information will become inaccessible if the pool is ever rendered inaccessible. With the pool configuration and dataset layout, you can reconstruct your complete configuration after destroying the pool. The data can then be populated by using whatever backup or restoration strategy you use.
真相永遠只有一個!
文章分享
評分
複製連結