Pages

Thursday, January 6, 2011

How to create ZFS storage pool

ZFS is file system that implemented on solaris 10 6/06 or later release. To use this file system you should create ZFS pool first. ZFS pool can be a single disk (non redundant), mirrored disk, raid 5 or raid 6 disk. Below is tips to create mirrored Zpool (ZFS pool).

  1. See that the are no existing ZFS pool
    bash-3.00# zpool list
    no pools available
  2. List the disk that you want to use as a pool. In this example you will use 2 available disks c3t2d0 and c3t3d0 as a mirrored pool.
    bash-3.00# df -F ufs -h
    Filesystem size used avail capacity Mounted on
    /dev/dsk/c0d0s0 14G 8.9G 5.4G 63% /
    /dev/dsk/c0d0s7 3.3G 3.4M 3.3G 1% /export/home
    /dev/dsk/c0d1s0 9.8G 7.1G 2.6G 74% /u01
    /dev/dsk/c3t0d0s0 4.9G 219M 4.7G 5% /disk01
    /dev/dsk/c3t1d0s0 4.9G 662M 4.2G 14% /disk02
    bash-3.00# format
    Searching for disks...done
    AVAILABLE DISK SELECTIONS:
    0. c0d0 <DEFAULT cyl 2607 alt 2 hd 255 sec 63>
    /pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0
    1. c0d1 <DEFAULT cyl 1302 alt 2 hd 255 sec 63>
    /pci@0,0/pci-ide@1,1/ide@0/cmdk@1,0
    2. c3t0d0 <DEFAULT cyl 2556 alt 2 hd 128 sec 32>
    /pci@0,0/pci8086,2829@d/disk@0,0
    3. c3t1d0 <DEFAULT cyl 2556 alt 2 hd 128 sec 32>
    /pci@0,0/pci8086,2829@d/disk@1,0
    4. c3t2d0 <DEFAULT cyl 1020 alt 2 hd 64 sec 32>
    /pci@0,0/pci8086,2829@d/disk@2,0
    5. c3t3d0 <DEFAULT cyl 1020 alt 2 hd 64 sec 32>
    /pci@0,0/pci8086,2829@d/disk@3,0
    Specify disk (enter its number): ^C
  3. Create the mirrored pool with 2 disks. This pool name is mirrpool.
    bash-3.00# zpool create mirrpool mirror c3t2d0 c3t3d0
    bash-3.00# zpool list
    NAME SIZE USED AVAIL CAP HEALTH ALTROOT
    mirrpool 1008M 94K 1008M 0% ONLINE -
  4. Check condition of the pool
    bash-3.00# zpool status
    pool: mirrpool
    state: ONLINE
    scrub: none requested
    config:
    NAME STATE READ WRITE CKSUM
    mirrpool ONLINE 0 0 0
    mirror ONLINE 0 0 0
    c3t2d0 ONLINE 0 0 0
    c3t3d0 ONLINE 0 0 0
    errors: No known data errors

No comments:

Post a Comment