solaris zfs补录
solaris zfs补录恢复已摧毁的池:
1.删除一个存储池:
#zpool list
NAME SIZE USED AVAIL CAPHEALTH ALTROOT
zfspool 118G 282K 118G 0%ONLINE -
#zpool destroy zfspool
#zpool list
no pools available
2.恢复存储池:
#zpool import -D
pool: zfspool
id: 12556987331220532754
state: ONLINE (DESTROYED)
action: The pool can be imported using its name or numeric identifier.
config:
zfspool ONLINE
mirror ONLINE
c4t0d0ONLINE
c4t3d0ONLINE
c4t2d0 ONLINE
c0t1d0 ONLINE
spares
c4t4d0
c4t26d0
#zpool list
no pools available
下来使用-Df选项进行恢复:
#zpool list
no pools available
#zpool import -Df zfspool
#zpool list
NAME SIZE USED AVAIL CAPHEALTH ALTROOT
zfspool 118G 290K 118G 0%ONLINE -
#zfs list
NAME USEDAVAILREFERMOUNTPOINT
zfspool 5.00G 112G24.5K/zfspool
zfspool/u01 5.00G 112G 26K/u01
zfspool/u01/zfsvol22.5K 117G22.5K-
zfspool/u02 26K 112G 26K/u02/
zfspool/u03 26.5K 112G26.5K/u03
zfspool/u04 24.5K 112G24.5K/u04
理解存储池中的设备:
#zpool create -f zfspool c4t0d0
#zpool list
NAME SIZE USED AVAIL CAPHEALTH ALTROOT
zfspool 16.8G 88K 16.7G 0%ONLINE -
新创建了一个存储池zfspool,其中只有一块物理磁盘c4t0d0.下面是如何添加设备,扩展zfspool。
添加一个虚拟设备到zfspool:
#zpool add zfspool c4t3d0
#zpool list
NAME SIZE USED AVAIL CAPHEALTH ALTROOT
zfspool 33.5G 91K 33.5G 0%ONLINE -
创建一个双路镜像存储池:
#zpool create -f zfspool2 mirror c4t4d0 c4t26d0
#zpool list
NAME SIZE USED AVAIL CAPHEALTH ALTROOT
zfspool 33.5G 91K 33.5G 0%ONLINE -
zfspool2 16.8G 89K 16.7G 0%ONLINE -
设备的脱机与联机:
#zpool status zfspool2
pool: zfspool2
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
zfspool2 ONLINE 0 0 0
mirror ONLINE 0 0 0
c4t4d0 ONLINE 0 0 0
c4t26d0ONLINE 0 0 0
errors: No known data errors
#zpool offline zfspool2 c4t4d0
Bringing device c4t4d0 offline
现在c4t4d0已offline,如下所示:
#zpool status zfspool2
pool: zfspool2
state: DEGRADED
status: One or more devices has been taken offline by the administrator.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Online the device using 'zpool online' or replace the device with
'zpool replace'.
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
zfspool2 DEGRADED 0 0 0
mirror DEGRADED 0 0 0
c4t4d0 OFFLINE 0 0 0
c4t26d0ONLINE 0 0 0
errors: No known data errors
现在使c4t4d0联机:
#zpool online zfspool2 c4t4d0
Bringing device c4t4d0 online
#zpool status zfspool2
pool: zfspool2
state: ONLINE
scrub: resilver completed with 0 errors on Thu Nov6 10:38:07 2008
config:
NAME STATE READ WRITE CKSUM
zfspool2 ONLINE 0 0 0
mirror ONLINE 0 0 0
c4t4d0 ONLINE 0 0 0
c4t26d0ONLINE 0 0 0
errors: No known data errors
清楚错误:
#zpool offline zfspool2 c4t4d0
Bringing device c4t4d0 offline
下来清除已脱机的设备:
#zpool clear zfspool2 c4t4d0
#zpool status zfspool2
pool: zfspool2
state: DEGRADED
status: One or more devices has been taken offline by the administrator.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Online the device using 'zpool online' or replace the device with
'zpool replace'.
scrub: resilver completed with 0 errors on Thu Nov6 10:38:07 2008
config:
NAME STATE READ WRITE CKSUM
zfspool2 DEGRADED 0 0 0
mirror DEGRADED 0 0 0
c4t4d0 OFFLINE 0 0 0
c4t26d0ONLINE 0 0 0
errors: No known data errors
下来替换已脱机的设备:
#zpool replace zfspool2 c4t4d0 c4t0d0
这意思是说用c4t0d0设备替换已损坏的c4t4d0设备。
#zpool status zfspool2
pool: zfspool2
state: ONLINE
scrub: resilver completed with 0 errors on Thu Nov6 10:43:08 2008
config:
NAME STATE READ WRITE CKSUM
zfspool2 ONLINE 0 0 0
mirror ONLINE 0 0 0
c4t0d0 ONLINE 0 0 0
c4t26d0ONLINE 0 0 0
errors: No known data errors
查看存储池的状态:
#zpool list -o name,size,capacity zfspool2
NAME SIZECAP
zfspool2 16.8G0%
查看存储池的I/O统计信息:
#zpool iostat zfspool2
capacity operations bandwidth
pool usedavail readwrite readwrite
----------------------------------------
zfspool2 163K16.7G 0 0 762.14K
#zpool iostat zfspool2 2
capacity operations bandwidth
pool usedavail readwrite readwrite
----------------------------------------
zfspool2 163K16.7G 0 0 752.12K
zfspool2 163K16.7G 0 0 0 0
zfspool2 163K16.7G 0 0 0 0
zfspool2 163K16.7G 0 0 0 0
zfspool2 163K16.7G 0 0 0 0
zfspool2 163K16.7G 0 0 0 0
^C
#zpool iostat -v zfspool2
capacity operations bandwidth
pool usedavail readwrite readwrite
-----------------------------------------
zfspool2 163K16.7G 0 0 732.07K
mirror 163K16.7G 0 0 732.07K
c4t0d0 - - 0 11.58K13.5K
c4t26d0 - - 0 01.66K8.67K
-----------------------------------------
#zpool status -x
all pools are healthy
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/36549/showart_1362046.html
页:
[1]