5/5/11

How to Add a Drive to a ZFS Pool

Solaris' ZFS file system takes a different approach to storage management than most other file systems. Whereas Windows divides disks into C, D, and E drives, and Linux allows you to mount disks directly to the file system, Solaris mounts an abstract "pool." A disk can have multiple pools and a pool may reside on any number of disks, either as mirrors maintained for backup purposes or to span all their disk space. After the initial configuration, this all takes place transparently: Nonadministrative users may never even know whether their system has one, two, or a dozen disks.
    • 1

      Open the terminal by clicking the terminal icon on the desktop.

    • 2

      Type the following to add the new drive to the pool as extra space:

      zpool add poolname c9t0d0p0

      Replace the poolname with the name of your pool and the device name (c9 etc.) with the device name of the disk you would like to add. Type the following:

      zpool list

      You should now see that your pool has grown considerably. If you did this with two 80-GB hard drives, you would now see that the pool has a total disk space of 160 GB. Alternatively, you can try to use the second drive as a mirror of the first.

    • 3

      Type the following to add the new drive to the pool as a mirror:

      zpool attach poolname c9t0d0p0

      Again, replace the device name and poolnames with relevant names for your system. The device will be added as a mirror of the existing device. The total capacity of the pool will not go up, but you can run "zpool status" to see that the two devices are now mirror images of each other. Any data written to one will be written to the other, and as a bonus, any data read from the pool will be read from both alternately, effectively doubling the drive bandwidth.

  • No comments: