Find it

Tuesday, July 14, 2009

ZFS - most frequently used commands.

ZFS - most frequently used commands - below are the commands that we use on daily basis for ZFS filesystem Administration.

# Some reminders on command syntax
root@server:# zpool create oradb-1 c0d0s0
root@server:# zpool create oradb-1 mirror c0d0s3 c1d0s0
root@server:# zfs create oradb-1/oracle-10g
root@server:# zfs set mountpoint=/u01/oracle-10g oradb-1/oracle-10g
root@server:# zfs create oradb-1/home
root@server:# zfs set mountpoint=/export/home oradb-1/home
root@server:# zfs create oradb-1/home/oracle
root@server:# zfs set compression=on oradb-1/home
root@server:# zfs set quota=1g oradb-1/home/oracle
root@server:# zfs set reservation=2g oradb-1/home/oracle
root@server:# zfs set sharenfs=rw oradb-1/home

# to set the filesystem block size to 16k
root@server:# zfs set recordsize=16k oradb-1/home

zpool list, zpool status, zfs list are also useful command in case of FS monitoring.

I have lots of things to add to this however as and when I will get hands on I will modify or add to my blog.



  1. Question on setting the filesystem block size to 8k.

    If the suggested block size for Oracle data files (specifically) is 8k, why in your 'zfs set recordsize' command are you specifying 32k? In the man pages of zfs, it states that for the value of recordsize "The size specified must be a power of two greater than or equal to 512 and less than or equal to 128 Kbytes."

    Wouldn't that mean that the setting should be set to a value of 'recordsize=64' or is my math wrong? I will admit, I stink at math...

    Thanks in advance...

  2. Follow up to my previous question on recordsize.

    Can you please explain how and why you came to a recordsize value of '32k' as opposed to simply using the value of '8k'?

    i.e., use 'recordsize=8k' instead of 'recordsize=32k'

    Thanks again!

  3. Hi Anonymous user,

    If you're using any database and which is going to sit on ZFS filesystem then the ZFS recordsize setting is depends on what is your Oracle DB block size. It is recommended that you set the ZFS recordsize value as same as what Oracle DB blocksize has. If the Oracle block size is 16K then ZFS recordsize should set to 16K for better performance.

    Note: Do this before any datafile creation

    For more details please take a look at -