Wednesday, August 1, 2012

zpool tạo group disk

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

AVAILABLE DISK SELECTIONS:
       0. c0t203400A0B84700CEd31
          /pci@1c,600000/SUNW,emlxs@1/fp@0,0/ssd@w203400a0b84700ce,1f
       1. c1t203500A0B84700CEd31
          /pci@1d,700000/SUNW,emlxs@1/fp@0,0/ssd@w203500a0b84700ce,1f
       2. c3t0d0
          /pci@1f,700000/scsi@2/sd@0,0
       3. c3t1d0
          /pci@1f,700000/scsi@2/sd@1,0
       4. c3t2d0
          /pci@1f,700000/scsi@2/sd@2,0
       5. c3t3d0
          /pci@1f,700000/scsi@2/sd@3,0
       6. c5t600A0B8000330D0A0000054748BF696Bd0
          /scsi_vhci/ssd@g600a0b8000330d0a0000054748bf696b
       7. c5t600A0B80004700CE0000057348BF6846d0
          /scsi_vhci/ssd@g600a0b80004700ce0000057348bf6846
       8. c5t600A0B80004700CE0000057748BF6AD0d0
          /scsi_vhci/ssd@g600a0b80004700ce0000057748bf6ad0
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;
NAME  PROPERTY       VALUE       SOURCE
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.
config:

        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.
   see: http://www.sun.com/msg/ZFS-8000-6X
config:

        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: