Building ZFS Mirrored File System Example

I’ve writted something about the Zeta file system before… It’s like some sort of an intro to the filesystem.

This post will be the first of series of post in configuring ZFS on a test machine, a Sun-Fire-V240 running Solaris 10.

# uname -a
SunOS sedm3205 5.10 Generic_137111-04 sun4u sparc SUNW,Sun-Fire-V240

Anyhow, first topic will be how to create/build, test, destroy and recreate a mirrored ZFS disk (or file based). Most of the ZFS commands we’ll be using are:

  • zpool
  • zcreate

That’s it!

Creating the ZFS Mirror

We’ll create two kinds of mirrored partition, one is file based and the other was is physical 175GB disk.

Here’s for the file based… first create two 150M files:

# mkfile 150m /home/elizar/disk1 ; mkfile 150m /home/elizar/disk2

Once that’s done, go ahead and create the Mirrored volume:

# zpool create file-mirror mirror /home/elizar/disk1 /home/elizar/disk2

After that command you’ll now have a new mirrored disk/partition mounted on the root called file-mirror

# zpool status file-mirror
pool: file-mirror
state: ONLINE
scrub: resilver completed with 0 errors on Tue Sep 16 17:04:13 2008
config:

NAME                                    STATE     READ WRITE CKSUM
file-mirror                             ONLINE       0     0     0
mirror                                ONLINE       0     0     0
/export/home/x120008/zfs-lab/disk2  ONLINE       0     0     0
/export/home/x120008/zfs-lab/disk1  ONLINE       0     0     0

errors: No known data errors
We’ll try and break the mirror the next time!

http://flux.org.uk/howto/solaris/zfs_tutorial_01

Leave a Reply

Your email address will not be published. Required fields are marked *