Messing around with ZFS pool on SmartOS

I recently started experimenting with smartOS from Joyent, you know, the Solaris based virtualisation OS. Being a long time Windows user I'm easily impressed by the various features offered by other *UX like OS'es, and this time it is the hotplug disks and the zpool command that have my interest. In windows it is always a pain to expand disk capacity on a live installation, so behold my amazement when I discovered how simple it is done under ZFS  ....

So lets start by taking inventory

[root@00-0c-29-92-3b-ab ~]# zpool list
NAME    SIZE  ALLOC   FREE  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
zones  15.9G   842M  15.1G     15.6E     5%  1.00x  ONLINE  -

As you can see, we have a 15.9G ZFS pool named 'zones'

[root@00-0c-29-92-3b-ab ~]# zpool status
  pool: zones
 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        zones       ONLINE       0     0     0
          c0d1      ONLINE       0     0     0

And the ZFS pool 'zones' consists of only one disk 'c0d1'. The next thing to do is to plug in a few more disks, however until my new Blade serveres have been provisioned I'm unfortunately stuck with my VMware, so it is not possible to simulate hotplug without restarting the VM. Anyway I created a 5G (c0d0) disk on the PCI bus and a 7G (c2t1d0) disk on SCSI bus, and rebooted the entire thing in order to run the format command.

[root@00-0c-29-92-3b-ab ~]# format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       0. c0d0 <Unknown-Unknown-0001 cyl 2557 alt 2 hd 128 sec 32>
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
       1. c1d1 <VMware V-0000000000000000-0001-16.00GB>
          /pci@0,0/pci-ide@7,1/ide@1/cmdk@1,0
       2. c2t1d0 <VMware,-VMwareVirtualS-1.0 cyl 3582 alt 2 hd 128 sec 32>
          /pci@0,0/pci15ad,1976@10/sd@1,0

As you can see from above we now have three disks on the system, so lets add c0d0 to the pool

[root@00-0c-29-92-3b-ab ~]# zpool add zones c0d0
[root@00-0c-29-92-3b-ab ~]# zpool status

  pool: zones
 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        zones       ONLINE       0     0     0
          c1d1      ONLINE       0     0     0
          c0d0      ONLINE       0     0     0

[root@00-0c-29-92-3b-ab ~]# zpool list
NAME    SIZE  ALLOC   FREE  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
zones  20.8G   842M  20.0G     11.6E     3%  1.00x  ONLINE  -

We now have 20.8G in the pool, success! what if we try to add a partition? using the format command I created three partitions on c2t1d0

Total disk size is 3584 cylinders
             Cylinder size is 4096 (512 byte) blocks

                                               Cylinders
      Partition   Status    Type          Start   End   Length    %
      =========   ======    ============  =====   ===   ======   ===
          1                 Solaris2          1   716     716     20
          2                 Ext Win95       717  1432     716     20
          3                 Solaris2       1433  2865    1433     40

 

Lets add partition 1 to the pool

[root@00-0c-29-92-3b-ab ~]# zpool add zones c2t1d0p1
[root@00-0c-29-92-3b-ab ~]# zpool status

  pool: zones
 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        zones       ONLINE       0     0     0
          c1d1      ONLINE       0     0     0
          c0d0      ONLINE       0     0     0
          c2t1d0p1  ONLINE       0     0     0

[root@00-0c-29-92-3b-ab ~]# zpool list
NAME    SIZE  ALLOC   FREE  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
zones  22.2G   842M  21.4G     11.6E     3%  1.00x  ONLINE  -

And success again, we have added partition 1 (20% og 7G) to the pool and now command over 22.2G

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Month List

RecentPosts