Fun with ZFS Part 2 (zfs filesystem)

0

Well welcome back, this is part 2 of my ZFS tutorial series last time we talked about zpool basics, In This article i will talk about the basics of the zfs file system.  Lets begin with a basic explanation of the zfs filesystem . A ZFS file system is built on top of a storage pool. File systems can be dynamically created and destroyed without requiring you to allocate or format any underlying disk space. Because file systems are so lightweight and because they are the central point of administration in ZFS, you are likely to create many of them. Lets begin with some of the basics of zfs.

Creating a zfs filesystem:

# zfs create nixpool/pyscript

Creating a zfs filesystem but this time configuring the zfs filesystem to use a specific mountpoint:

# zfs create -o mountpoint=/pyscript nixpool/pyscript 

Destroying a zfs filesystem:

# zfs destroy nixpool/pyscript

Destroying a zfs filesystem along with any descendents

# zfs destroy -r nixpool/pyscript 

Renaming a zfs filesystem

# zfs rename nixpool/pyscript  nixpool/blah

listing basic zfs information

# zfs list 

 

 

Getting property information on a zfs filesystem:

# zfs get all nixpool/zones | more
NAME                    PROPERTY         VALUE                         SOURCE
nixpool/zones       type                  filesystem                                 –
nixpool/zones       used                     21K                                           –
nixpool/zones available                  63.2G                                       –
nixpool/zones referenced              21K                                            –
nixpool/zones compressratio        1.00x                                       –
nixpool/zones       mounted                yes                                         –
nixpool/zones        quota                      none                                  default
nixpool/zones     reservation                  none                                  default

Setting a properties in zfs:

# zfs set compression=on  nixpool/zones 

Setting up legacy mountpoints some people feel the need to do this which is odd in my book but oh well to each its own this defeats the purpose of using zfs  b/c by setting legacy mountpoint you are relying on the /etc/vfstab file  🙂

Mounting zfs file systems: Note the following command mounts all zfs file systems

Unmounting the ZFS filesystem

Sharing Filesystems (NFS) using ZFS: I thought this was so cool when i first learned of this command # zfs set

NAME                           PROPERTY        VALUE     SOURCE
nixpool/pyscript       quota                           10G                 local

 

Well this will conclude Fun with ZFS Part2. In part 3 i will do through the advanced usage of both zfs and zpool administration as well as some good troubleshooting tips for zfs. But in the meantime if you and to know and learn more about the zfs filesystem please do a man zfs  on your flavor of unix and read the manual :).

Share.

About Author

Leave A Reply

Welcome, guest maybe you should register or login