Basic ZFS example

I just couldn’t wait any longer, and decided to try something with ZFS. And what do you know? I’ve found a very useful advice from Ben Rockwood, which allows us use regular files created with mkfile as virtual disks for ZFS. VERY useful, especially when you really want to play with such a great technology and maybe try various configurations, but there are no spare physical disks for such experiments.

I will, of course, read and understand all the inner workings of ZFS later, but the first impression of it is this – too easy to be true! ūüôā

Here’s what I did:

solaris# mkdir /export/vdev
solaris# mkfile 128m /export/vdev/d1
solaris# mkfile 128m /export/vdev/d2
solaris# zpool create try /export/vdev/d1 /export/vdev/d2
solaris# zpool status
pool: try
state: ONLINE
scrub: none requested
config:
NAME               STATE     READ WRITE CKSUM
try                ONLINE       0     0     0
/export/vdev/d1  ONLINE       0     0     0
/export/vdev/d2  ONLINE       0     0     0
solaris# zpool list
NAME                    SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT
try                     246M   32,5K    246M     0%  ONLINE     -

After this the newly made filesystem automatically became available (it’s a partial output of df -k):

Filesystem            kbytes    used   avail capacity  Mounted on
try                   235520    3722  231771     2%    /try

Enough for the moment! Now the next challenge will be freeing up one of the two physical disks I’ve got in my Netra t1, so that I could bring it under ZFS control.

Comments

  1. Great thing. Very simple and very smart. Thanks for your post.

Speak Your Mind

*