Wednesday, August 1, 2012

zpool tạo group disk

bash-3.2# echo |format
Searching for disks...done

       0. c0t203400A0B84700CEd31
       1. c1t203500A0B84700CEd31
       2. c3t0d0
       3. c3t1d0
       4. c3t2d0
       5. c3t3d0
       6. c5t600A0B8000330D0A0000054748BF696Bd0
       7. c5t600A0B80004700CE0000057348BF6846d0
       8. c5t600A0B80004700CE0000057748BF6AD0d0
Specify disk (enter its number): Specify disk (enter its number):  

1. Tạo group disk

bash-3.2# zpool create -f u02 c5t600A0B8000330D0A0000054748BF696Bd0 c5t600A0B80004700CE0000057348BF6846d0

bash-3.2# zpool get all u02;
u02   size           1.84T       -
u02   capacity       0%          -
u02   altroot        -           default
u02   health         ONLINE      -
u02   guid           1890458593104236169  default
u02   version        29          default
u02   bootfs         -           default
u02   delegation     on          default
u02   autoreplace    off         default
u02   cachefile      -           default
u02   failmode       wait        default
u02   listsnapshots  on          default
u02   autoexpand     off         default
u02   free           1.84T       -
u02   allocated      252K        -
u02   readonly       off         -

2. Unmount zpool 
bash-3.2# zpool export u02

Khi map volume này vào server mới

Muốn sử dụng lại 2 volume này
bash-3.2# # zpool import
  pool: u02
    id: 1890458593104236169
 state: ONLINE
action: The pool can be imported using its name or numeric identifier.

        u02                                      ONLINE
          c4t600A0B8000330D0A0000054748BF696Bd0  ONLINE
          c4t600A0B80004700CE0000057348BF6846d0  ONLINE

3. mount u02 trước đó vào testzfs

bash-3.2# zpool import u02 testzfs

Chú ý: Trong trường hợp chỉ map lên một volume thì không thể mount lên được

root@TT4-SMS-S # zpool import
  pool: testzfs
    id: 1890458593104236169
 state: UNAVAIL
status: One or more devices are missing from the system.
action: The pool cannot be imported. Attach the missing
        devices and try again.

        testzfs                                  UNAVAIL  missing device
          c4t600A0B8000330D0A0000054748BF696Bd0  ONLINE

        Additional devices are known to be part of this pool, though their
        exact configuration cannot be determined.
root@TT4-SMS-S # zpool import testzfs
cannot import 'testzfs': one or more devices is currently unavailable

No comments: