Sunday, January 13, 2013

Understanding ZFS (Zpools)

Good Morning everyone hope everyone is enjoying the weekend, This is a quick tutorial on the zfs filesystem mainly focusing on zpools. But before jumping into command and how things work let me give you a little background on the zfs filesystem, ZFS which stands for Zetabyte File System is a 128bit filesystem that is also a volume manager rolled up in on. In reality this is the Sun Volume manager on steroids. With the Sun Volume Manager the admin had to use soft partitioning in order to expand disk space on the ufs filesystem, this is not so with the zfs filesystem. By simply adding a disk to the disk pool automatically adds disk space to the volume this is such a cool filesystem. Over time developers have ported zfs over to linux and freebsd which in my most humble opinion is the best OS(bsd) :). Well enough of this chatter let me show some of the cools stuff that zfs has to offer beginning with zpools. Zpools are the heart of the zfs filesystem , without zpools there is no zfs period, in order to use zfs you  will have to create a zpool by typing in the following command.

# zpool create (which in my case is nixpool :) )  

#zpool create nixpool c1t0d0s0


List all zpools 

# zpool status -xv 
all pools are healthy

Creating a mirrored zpool 

#zpool create nixpool mirror c0d0 c1d0

Creating a mirrored zpool with a hot spare#Note: These devices are not actively used in the pool, but when an active device fails, it is automatically replaced by a hot spare zfs rocks :).

#zpool create pool mirror c0d0 c1d0 spare c2d0 c3d0

Create a zpool with log devices. log devices come in handy sometimes for example databases often require their transactions to be a on a stable storage devices when returning from a system call. Multiple log devices can also be specified and they can be mirrored. 


# zpool create nixpool c0d0 c1d0 log c2d0 

Another cool thing about zpools is that their properties can be modified. you can get a list of zpool properties by running their following command:

# zpool get all testpool

Adding a Mirror to a Zfs Storage Pool Note: The following command addss two mirrored disks  to the 
pool nixpool, assuming the pool is already made up of two-way mirrors.

# zpool add nixpool mirror c1t0d0 c1t1d0


Destroying a zpool Note: the following command destroys the pool nixpool and any datasets contained within. 


# zpool destroy -f nixpool 

well this will conclude  the zpool tutorial, if you desire to know more about the zpool command. Please go through and read the man pages on your local unix system  

man zpool :).




No comments:

Post a Comment

Cracking Kerberos Service Tickets (TGS) Using Kerberoasting

As of late I've been spending a lot of time researching and learning different techniques when it comes to attacking Active Directory En...