ZFS on Ubuntu 20.04 LTS
$5.00
Minimum price
$15.00
Suggested price

ZFS on Ubuntu 20.04 LTS

Working with ZFS 0.7 and 0.8.3 on Ubuntu Linux

About the Book

It covers installing it on Ubuntu 20.04 LTS, and operating and troubleshooting it with different hardware:

  • SAS SSD
  • Typical SATA onboard controller and LSI SAS IO HBA controller.
  • SATA3 SSD
  • SATA3 HDD
  • 2.5" and 3.5"

It explains advantages and disadvantages of each choice, and expected speed.

It covers troubleshooting at Linux level, Kernel, and with ZFS pools.

Offers advanced tricks and tips from my experience leading ZFS projects.

During covid you can buy the title at a reduced price now ($5).

Feel free to register with your email, and get any future updates for free, and to provide me feedback on what you would like to be added to the book.

About the Author

Carles Mateo
Carles Mateo

I’m Carles Mateo, since January 2020 working as Operations Engineer for Blizzard Entertainment in Cork, Ireland.

Previously worked as Cloud Architect and SDM for Sanmina, in Ireland and United States, where I created and I did lead a Python and C project for a Storage Manager for our 4U Cold Storage Servers 1PB and 2U SSD and 1U NVMe with NICs up to 2x100Gbps, which will restore redundancy in the RAID when a drive dies, very quickly, using ZFS and DRAID.

I also worked for Volkswagen IT, Winterthur Insurance (Axa), or BBVA Tickets and several CSP, Start ups, Online travel agencies, eCommerce…. in hands on positions leading teams and coding myself, in Software Development, SRE and Operations roles.

You can find information about me in my blog.

https://blog.carlesmateo.com/bio

Table of Contents

  • Dedication.............................................................................................................................................5
  • Introduction..........................................................................................................................................6
  • Key aspects of ZFS...............................................................................................................................7
  • Hardware choices.................................................................................................................................9
  • Choosing the Server.........................................................................................................................9
  • Practical case: a ZFS Server, AMD Based................................................................................10
  • Practical case: a ZFS Server, Intel Based..................................................................................12
  • Choosing SAS or SATA, SSD or Spinning, 2.5” or 3.5” drives....................................................14
  • Drives die..................................................................................................................................16
  • The value of your Data..............................................................................................................17
  • Testing the infrastructure...........................................................................................................17
  • Assembling the UPS......................................................................................................................17
  • Adding an internal hot swap drives case.......................................................................................20
  • Icy Dock MB326SP-B SATA Rack (1U) Black disk array - disk arrays (HDD, SSD, Serial
  • ATA III, Serial Attached SCSI, SATA, Rack (1U), Black, HDD, Power)................................20
  • Planning your Architecture.................................................................................................................22
  • Erasure Coding, RAID, redundancy..............................................................................................22
  • SAS Controller or SATA Controller..............................................................................................22
  • Useful Linux Operations on Drives....................................................................................................22
  • Seeing your drives in Linux...........................................................................................................22
  • Seeing your drives by Id...........................................................................................................22
  • lsblk...........................................................................................................................................23
  • Don’t relay in device names, use ids.........................................................................................24
  • See the partitions.......................................................................................................................26
  • Know the sequential read speed of a drive................................................................................26
  • Wipe a drive..............................................................................................................................28
  • Using ZFS Software...........................................................................................................................29
  • Installing ZFS................................................................................................................................29
  • ZFS Commands..................................................................................................................................30
  • Man zfs..........................................................................................................................................30
  • zfs gell all.......................................................................................................................................31
  • zfs set.............................................................................................................................................31
  • zfs create -V (Create Volume)........................................................................................................31
  • Create a partition.......................................................................................................................32
  • Format the partitioned Volume..................................................................................................34
  • Mount the Volume.....................................................................................................................34
  • About the speed of the ZVOL...................................................................................................34
  • Zpool Commands...............................................................................................................................35
  • zpool create raidz1 (first part)........................................................................................................35
  • zpool list.........................................................................................................................................37
  • zfs list.............................................................................................................................................37
  • zpool destroy..................................................................................................................................37
  • zpool create raidz1 (second part)...................................................................................................38
  • Creating a pool with drives of different size and nature...........................................................39
  • Errors on the drives...................................................................................................................40
  • zpool status -v................................................................................................................................41
  • Creating a pool with 2 mirror vdevs from different type, but compatible.....................................42
  • Attempting to create a pool with drives in use for another pool...............................................42
  • 2 / 140Creating a pool when a drive is falsely detected by in use in another pool..............................42
  • Enabling compression in a pool................................................................................................43
  • zpool status....................................................................................................................................44
  • zpool iostat.....................................................................................................................................45
  • zpool create mirror (second part)...................................................................................................45
  • Creating a simple mirror...........................................................................................................45
  • Creating 6 drives mirroring the same information....................................................................45
  • Dealing with errors in the mirroring.........................................................................................46
  • zpool detach...................................................................................................................................47
  • Zpool scrub....................................................................................................................................48
  • Stop ongoing Scrub...................................................................................................................49
  • Watch the status of the pool during Scrub................................................................................49
  • Growing (expanding) the pool once the drives are bigger.............................................................51
  • Zpool online..............................................................................................................................51
  • Zpool replace.................................................................................................................................52
  • Zpool replace using a spare drive..............................................................................................52
  • Zpool replace removing the drive and inserting a new one......................................................55
  • Speed Resilvering / Replacing a drive......................................................................................58
  • Throttling..................................................................................................................................59
  • zpool clear......................................................................................................................................60
  • If you physically pull one drive.....................................................................................................61
  • Troubleshooting the IO errors........................................................................................................65
  • Removing the mirror causing errors..............................................................................................67
  • Creating a pool using partitions.....................................................................................................71
  • Using fdisk to create partitions.................................................................................................72
  • Cloning the partition table.........................................................................................................75
  • Creating the pool with the second partition..............................................................................76
  • zpool export...................................................................................................................................77
  • zpool import...................................................................................................................................77
  • The mistery is solved................................................................................................................81
  • Compatible enclosures..............................................................................................................82
  • Verifying the drives and cables by creating a new pool................................................................83
  • Destroy the pools......................................................................................................................83
  • Creating the pool.......................................................................................................................84
  • zpool status, in deep.......................................................................................................................87
  • Adding a Hot Spare........................................................................................................................88
  • The Zed Service.............................................................................................................................89
  • Creating a Pool for home, all the steps...............................................................................................93
  • Sharing the Dataset via NFS..........................................................................................................99
  • Advanced tricks................................................................................................................................100
  • Using ZVOLs for providing Block Device Storage to Virtual Machines....................................100
  • Improving iSCSI performance for Block Devices (ZVOL Volumes)..........................................100
  • Adding a RAMDISK as SLOG ZIL to ZFS................................................................................100
  • Creating a VM for compiling ZFS sources with RHEL6.10.......................................................104
  • This trick describes how to compile and install ZFS 7.x for RHEL6..........................................104
  • Steps to compile the code:...........................................................................................................104
  • Make sure the ZFS file exists under zfs/contrib/initramfs/scripts/local-top/..........................104
  • Inside root source folder, execute the following commands...................................................106
  • Execute Auto generate script:......................................................................................................106
  • Execute configuration script:.......................................................................................................106
  • Please note we use this specific configuration for bettter results and you may not need it:........106
  • Create rpms:.................................................................................................................................106
  • Remove all test rpms. Those will generate conflicts, and as they are for running the tests, can be
  • removed from the final release....................................................................................................106
  • Install all created rpms on the desired RHEL6.10 Server.......................................................106
  • Verify that zfs is been installed:...................................................................................................106
  • This command will display zfs help............................................................................................106
  • Optional: Adding a custom version name for your compiled ZFS version.............................106
  • Another interesting trick I instructed my Team to do is to add a version number to zfs, with a
  • parameter -v or –version..............................................................................................................106
  • In my code is line 7926, then add:...............................................................................................107
  • You can check the Kernel Module info by using modinfo zfs, but I found it handy to allow to just
  • do:................................................................................................................................................107
  • Creating a compressed filesystem with Linux and ZFS..............................................................108
  • Benchmark the speed of a pool....................................................................................................111
  • Generate the Random file........................................................................................................111
  • Read the Random file..............................................................................................................111
  • Creating a partition bigger than 2TiB..........................................................................................111
  • ZFS is unable to use a disk..........................................................................................................113
  • Filling a half Petabyte pool as fast as possible............................................................................113
  • Creating a Sparse file that you can partition or create a loopback on it......................................116
  • Troubleshooting upgrading and loading a ZFS module in RHEL7.4..........................................117
  • Create a small partition on the drives for tests.............................................................................119
  • Get the list of drives in the system..........................................................................................119
  • Do the loop with for DRIVE in $DRIVES or manually........................................................119
  • Forcing a Kernel Panic in CentOS or RHEL...............................................................................120
  • Simulating a SAS physical pull out of a drive.............................................................................120
  • To delete a disk (Linux stop seeing it until next reboot/power cycle)....................................120
  • Set a disk offline......................................................................................................................120
  • Online the disk........................................................................................................................120
  • Scan all hosts, rescan..............................................................................................................121
  • Disabling the port in the expander..........................................................................................121
  • Kill one drive, indicating the wwn...............................................................................................121
  • Extend existing Single ZFS disk with a mirror without losing the Data on the existing HDD...122
  • Seeing which drives are available for ZFS on a zoning on a multi-IOC, multi-motherboard,
  • system like NDS-4600.................................................................................................................125
  • Troubleshooting................................................................................................................................127
  • Bibliography and Resources.............................................................................................................140
  • Introducing ZFS on Linux...........................................................................................................140
  • ZFS on Linux...............................................................................................................................140
  • Zfs-discuss...................................................................................................................................140

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Do Well. Do Good.

Authors have earned$10,623,269writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF, EPUB and/or MOBI files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub