Skip to content
Bots!
Bots!
  • About
    • Myself
    • আমার দোয়া
  • Bookmarks
    • Bookmarks
    • My OCI Bookmarks
    • Useful Proxmox Commands & Links
    • Learning Nano
    • Useful Sites
    • Useful Virtualbox Command
    • Useful MySQL Command
    • Useful Linux Command
    • BTT-CAS
  • Resources
    • Webinar on Cloud Adoption for Project Managers
  • Photos
  • Videos
  • Downloads
Bots!

Install ZFS on Ubuntu

Rumi, May 17, 2023

Installing ZFS Filesystem on Ubuntu

We will be using the command line Terminal application for the installation of the ZFS filesystem. To launch the command line Terminal, use the Ctrl+Alt+T keyboard shortcut. Now to install the ZFS filesystem on Ubuntu, issue the following command in Terminal:

$ sudo apt install zfsutils-linux

When prompted for the password, provide the sudo password.

After running the above command, the system might ask for confirmation that if you want to continue the installation or not. Press y to continue; after that, the package will be installed on your system. To verify ZFS file system installation, issue the following command in Terminal:

$ which zfs

You will see the output similar to the following:

Creating the ZFS storage pool

After the installation is completed, we will now create a storage pool for our drives. Here are the steps to do so:

1. First, find out the names of the drives for the pool. Use the following command in Terminal to do so:

$ sudo fdisk –l

You will see the drives listed in the output. Note down the drive names that you want to pool. From the above output, we can see that there are two drives /dev/sdb and /dev/sdc are listed. We will create the storage pool using these two drives.

There are two types of storage pools: Striped and mirror. In the striped pool, data is stored in the striped across all devices. While in a mirrored pool, the copy of the data is stored across devices that make them fault-tolerant.

To create the striped pool, use the following syntax:

$ sudo zpool create <pool_name> <drive1> <drive2>

To create the mirror pool, use the following syntax:

$ sudo zpool  create <pool_name> mirror <drive1> <drive2>

If any error occurs, try forcing the command using the -f option after the zpool create command.

In the following example, we will create the striped pool named “test” using the /dev/sdb and /dev/sdc.

$ sudo zpool create test /dev/sdb /dev/sdc

To find out where the pool has been mounted, use the following command in Terminal:

$ df –h

From the above command, we can see that the pool has been mounted at the /test. You can also change the mount point for the pool using the following syntax:

$ sudo zfs set mountpoint=<path> <pool_name>

For example, to set export/zfs as the new mount point, the command would be:

$ sudo zfs set mountpoint=/export/zfs test

Then use the following command to verify if the mount point has changed:

$ df –h | grep test

You can also create the directories under the storage pool. For example, to create a directory named files under the storage pool, the command would be:

$ sudo zfs create test/files

To view all the ZFS storage pools on the system, you can use the following command in Terminal:

$ zpool list

It lists all the pools along with their size, space usage, health, and some other information. To view all the configurations and status of each device in the ZFS storage pool, use the following command in Terminal:

$ zfs status

If you experience some issues related to drives in the pool, you can use the events option. Issue the following command in Terminal to view events associated with a specific pool:

$ sudo zpool events pool_name –v

Removing the ZFS storage pool

If you no longer need the pool, you can remove it. However, note that removing the pool will also remove the files contained within it. Use the following command syntax to remove the storage pool:

$ sudo zpool destroy pool_name

In this article, you have learned how to install the ZFS file system on Ubuntu 20.04 LTS (Focal Fossa). You have also learned how to create a storage pool in the ZFS file system and remove it when you no longer need it.

Src: https://linuxhint.com/installing_zfs_ubuntu/

Administrations Collected Articles Configurations (Linux) UbuntuZFS

Post navigation

Previous post
Next post

Leave a Reply Cancel reply

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

Myself…

Hi, I am Hasan T. Emdad Rumi, an IT Project Manager & Consultant, Virtualization & Cloud Savvyfrom Dhaka, Bangladesh. I have prior experience in managing numerous local and international projects in the area of Telco VAS & NMC, National Data Center & PKI Naitonal Root and CA Infrastructure. Also engaged with several Offshore Software Development Team.

Worked with Orascom Telecom-Banglalink, Network Elites as VAS partner, BTRC, BTT (Turkey) , Mango Teleservices Limited and Access to Informaiton (A2I-UNDP)

Currently working at Oracle Corporation as Principal Technology Solution and Cloud Architect.

You can reach me [h.t.emdad at gmail.com] and I will be delighted to exchange my views.

Tags

Apache Bind Cacti CentOS CentOS 6 CentOS 7 Debain Debian Debian 10 Debian 11 Debian 12 DKIM Docker endian icinga iptables Jitsi LAMP Letsencrypt Linux Munin MySQL Nagios Nextcloud NFS nginx pfsense php Postfix powerdns Proxmox RDP squid SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin XCP-NG zimbra

Topics

Recent Posts

  • Install Jitsi on Ubuntu 22.04 / 22.10 April 30, 2025
  • Key Lessons in life April 26, 2025
  • Create Proxmox Backup Server (PBS) on Debian 12 April 19, 2025
  • Add Physical Drive in Proxmox VM Guest April 19, 2025
  • Mount a drive permanently with fstab in Linux April 16, 2025
  • Proxmox 1:1 NAT routing March 30, 2025
  • Installation steps of WSL – Windows Subsystem for Linux March 8, 2025
  • Enabling Nested Virtualization In Proxmox March 8, 2025
  • How to Modify/Change console/SSH login banner for Proxmox Virtual Environment (Proxmox VE / PVE) March 3, 2025
  • Install Proxmox Backup Server on Debian 12 February 12, 2025

Archives

Top Posts & Pages

  • Install Jitsi on Ubuntu 22.04 / 22.10
©2025 Bots! | WordPress Theme by SuperbThemes