Look ma' no disks! ZFS Testing On A Budget

21 Nov '05 - 01:40 by benr

Feeling left out of the ZFS excitement because you don't have a fibre channel disk array sitting at home or don't have spare disks in your box? Fear not! The ZFS team has thought of you. ZFS has the ability to use files as virtual devices! Instead of using a real disk, you can instead create files of 128MB or larger and use them just like a disk. This allows for debugging, testing, and experiementation with complex pool setups without having to require emmense resources.

Lets walk through the process:


root@chloe ~$ mkdir /vdev
root@chloe ~$ mkfile 128m /vdev/disk1
root@chloe ~$ mkfile 128m /vdev/disk2
root@chloe ~$ mkfile 128m /vdev/disk3

root@chloe ~$ mkfile 128m /vdev/disk4
root@chloe ~$ mkfile 128m /vdev/disk5

root@chloe ~$ zpool status
no pools available
root@chloe ~$ zpool create oasis raidz /vdev/disk1 /vdev/disk2 /vdev/disk3
root@chloe ~$ zpool status
  pool: oasis
 state: ONLINE
 scrub: none requested
config:

        NAME             STATE     READ WRITE CKSUM
        oasis            ONLINE       0     0     0
          raidz          ONLINE       0     0     0
            /vdev/disk1  ONLINE       0     0     0
            /vdev/disk2  ONLINE       0     0     0
            /vdev/disk3  ONLINE       0     0     0
root@chloe ~$ df -h /oasis

Filesystem             size   used  avail capacity  Mounted on
oasis                  354M    16K   354M     1%    /oasis
root@chloe ~$ zpool create mirrormirror mirror /vdev/disk4 /vdev/disk5
root@chloe ~$ zpool status
  pool: mirrormirror
 state: ONLINE
 scrub: none requested
config:

        NAME             STATE     READ WRITE CKSUM
        mirrormirror     ONLINE       0     0     0
          mirror         ONLINE       0     0     0
            /vdev/disk4  ONLINE       0     0     0
            /vdev/disk5  ONLINE       0     0     0

  pool: oasis
 state: ONLINE
 scrub: none requested
config:

        NAME             STATE     READ WRITE CKSUM
        oasis            ONLINE       0     0     0
          raidz          ONLINE       0     0     0
            /vdev/disk1  ONLINE       0     0     0
            /vdev/disk2  ONLINE       0     0     0
            /vdev/disk3  ONLINE       0     0     0

Obviously this is gonna be slow. You've got ZFS on top of UFS, so, don't expect it to be speedy. But the point here isn't performance, its about being able to experiment, play, and learn with ZFS configurations that otherwise be impracticle if not impossible.

One know about importing or exporting pools: in order to import the pool you must pass a long an extra parameter to zpool import pointing to the directory in which the vdev files exist:


root@chloe ~$ zpool export oasis
root@chloe ~$ zpool status oasis
cannot open 'oasis': no such pool

root@chloe ~$ zpool import -d /vdev oasis
root@chloe ~$ zpool status oasis
  pool: oasis
 state: ONLINE
 scrub: none requested
config:

        NAME             STATE     READ WRITE CKSUM
        oasis            ONLINE       0     0     0
          raidz          ONLINE       0     0     0
            /vdev/disk1  ONLINE       0     0     0
            /vdev/disk2  ONLINE       0     0     0
            /vdev/disk3  ONLINE       0     0     0

Jeff and crew: Thanks for adding this! My wife's ears and our power bill thank you! ZFS rules!


- - C O M M E N T S - -

Hope you come back soon!!

vivan (URL) - 12 June '06 - 23:59

Your site is amaizing. Can I share some resources with you?

yolonda (Email) (URL) - 13 June '06 - 01:29

Hello! Very interesting and professional site.

reed (Email) (URL) - 13 June '06 - 17:24

Follow your dreams, you can reach your goals.

nydia (Email) (URL) - 14 June '06 - 02:46

Follow your dreams, you can reach your goals.

Alexx (Email) (URL) - 14 June '06 - 04:07

Personal information





Remember your information?
Comment

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.


^M