Saturday, July 25, 2009

Creating a simple ZFS pool and ZFS file system

ZFS was introduced in Solaris 10 06/06 (update2). No special license or software is required to use it. ZFS provides both "volume management" and a "file system" so it can be used in place of VXVM/VXFS and SVM/UFS

ZFS file systems are contained inside ZFS pools.
So… if you want to create a ZFS file system you first need to create a ZFS pool.

A ZFS pool is usually built top of one or more block devices (disk slices, memory sticks, etc), but for test or demonstration purposes a ZFS pool can be created on top of one or more regular files.

The minimum size of a block device or file is 64MB.

I encourage you to try the following three commands in the global zone of an unused Solaris 10 server… or if you are running Solaris 10 on a desktop or laptop you can try it there.

Create a 64MB temp file
# mkfile 64M /tmp/file1

Create a ZFS pool called "ttt" on top of the temp file.
# zpool create ttt /tmp/file1

Every new pool by default contains a mounted file system; the mount point is the same as pool name. To see this run:

# df -k /ttt

Note:

a) mkfs is not needed for ZFS file systems.
b) mount points do not need to be re-created with "mkdir".
c) ZFS file systems do not require entries in /etc/vfstab.
d) available space is smaller than the underlying storage… this is due to overhead. Overhead for very small file systems is high.
e) the device name reported by "df -k" is simply the pool name; it does not start with "/dev".
f) ZFS file systems start out completely empty; they do not contain "lost+found" directories.

Now just in case you created your ZFS pool and ZFS file system on a production server (which I won't endorse), here is how you clean up your tracks:

# zpool destroy ttt
# rm /tmp/file1

Readers who read this page, also read:




Bookmark and Share My Zimbio http://www.wikio.com

0 comments: