Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install the ZFS file system on Ubuntu19.10

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to install ZFS file system on Ubuntu19.10". In daily operation, I believe many people have doubts about how to install ZFS file system on Ubuntu19.10. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubt of "how to install ZFS file system on Ubuntu19.10". Next, please follow the editor to study!

One of the main new features of Ubuntu 19.10 is ZFS. Now you can easily install ZFS on a Ubuntu system without extra effort.

In general, when you install Linux, you choose the Ext4 file system. However, if you are installing Ubuntu 19.10 freshly, you can see the ZFS option during the startup phase of the installation.

You can choose ZFS when installing Ubuntu 19.10

Let's see why ZFS is important and how to use it on Ubuntu where ZFS is already installed.

What is the difference between ZFS and other file systems?

ZFS is designed to handle mass storage and avoid data corruption. ZFS can handle 256 trillion of ZB data. (this is the Z of ZFS) and it can handle files up to 16 EB.

If you only have a single-disk laptop, you can experience the data protection features of ZFS. The COW feature ensures that the data in use is not overwritten; instead, the new data is written to a new block, and the file system metadata is updated to the new block. ZFS makes it easy to create snapshots of file systems. This snapshot tracks changes to the file system and shares blocks to ensure data space savings.

ZFS allocates a checksum for each file on disk. It will constantly check the status and checksum of the file. If the file is found to be corrupted, it will try to repair the file.

I wrote an article detailing what ZFS is and what features it has. If you are interested, you can read it.

Note: keep in mind that the data protection features of ZFS can lead to performance degradation.

Using ZFS under Ubuntu [for medium and advanced users]

Once you have newly installed Ubuntu with ZFS on your main disk, you can start to experience its features.

Note that all ZFS setup procedures require a command line. I didn't know it had any GUI tools.

Create a ZFS pool

This section is only for systems with multiple disks. If you have only one disk, Ubuntu will automatically create a pool at installation time.

Before you can create a pool, you need to find the id of the disk for the pool. You can query this information with the command lsblk.

Create a base pool for three disks, with the following command:

Sudo zpool create pool-test / dev/sdb / dev/sdc / dev/sdd

Please remember to replace the name you chose by pool-test.

This command will set the "non-redundant RAID-0 pool". This means that if a disk is corrupted or malfunctioned, you will lose data. If you execute the above command, it is recommended to make a regular backup.

You can add another disk to the pool with the following command:

Sudo zpool add pool-name / dev/sdx to view the status of the ZFS pool

You can use this command to query the status of the new pool:

Sudo zpool status pool-test

Zpool statu

Mirror a ZFS pool

To ensure the security of your data, you can create a mirror. Mirroring means that each disk contains the same data. With the mirror setting, you may lose two of the three disks and still have all the information.

To create an image, you can use the following command:

Sudo zpool create pool-test mirror / dev/sdb / dev/sdc / dev/sdd creates a snapshot of ZFS for backup and recovery

Snapshots allow you to create a backup in case a file is deleted or overwritten. For example, let's create a snapshot, delete some directories under the user's home directory, and then restore it.

First, you need to find the snapshot dataset you want. You can do this:

Zfs list

Zfs List

You can see that my home directory is located in rpool/USERDATA/johnblood_uwcjk7.

We create a snapshot called 1910 with the following command:

Sudo zfs snapshot rpool/USERDATA/johnblood_uwcjk7@1019

The snapshot is quickly created. Now you can delete the Downloads and Documents directories.

Now you restore the snapshot with the following command:

Sudo zfs rollback rpool/USERDATA/johnblood_uwcjk7@1019

The duration of the rollback depends on how much information has changed. Now you can view the home directory, and the deleted directory (and its contents) will be restored.

At this point, the study on "how to install the ZFS file system on Ubuntu19.10" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report