ZFS on Ubuntu 20.04 LTS
$15.00
Minimum price
$25.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.

Shows how to replace and Resilver (rebuild) the information on a damaged drive.

When you buy the book, you'll get all the updates for free.

You can specify register with your email, and get any future updates email I publish.

Note: The book does not cover installing Ubuntu itself in a ZFS filesystem (this feature was experimental at the moment of writing this book and I considered it too risky)

  • Share this book

  • Categories

    • Computer Hardware
    • Computers and Programming
    • Storage
    • Software
  • Feedback

    Email the Author(s)

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 helped several multinationals:

  • Volkswagen IT (gedas) where I got promoted to head of department of Reusability and Code Components and previously I lead the SEAT's Intranet project, I solved TCP/Ip transmission problems in project PortIc for Barcelona's port (EDI Transfer), I created a project to transfer warranty documents over Web and TCP/IP instead of X.25 expensive lines, and worked for CaixaBank (formerly "la caixa") creating a Documentum solution programing the GUI and DLL's.
  • Winterthur Insurance (Axa) where I was Senior PM and I lead both technically and in functionally, the project to deploy a new Contact Center Software, the e-Commerce web platform and the insurance of health policies (special Data treatment)
  • BBVA Tickets where I was responsible of the platform (Sun Solaris and Oracle)

I worked a lot for CSP (Cloud Service Providers) and ISP, in Linux.

Also I helped many Start ups, e-Commerces, Online travel agencies... as CTO or in hands on positions leading teams and coding myself, in Software Development, SRE and Operation roles.

I was one of the 5 Senior BackEnds that wrote Privalia's new multi-country Website, from the scratch, with inheritance, and I lead a KPI Dashboards for CEO, really learning the internals of all the areas of the company through the data.

The last company I was CTO for, in Barcelona, was sold to airbnb for 45 million euros.

My friends say that everything I touch turns into gold, and my very good friend Jaume (R.I.P.) used to say that I was the most brutal technical guy, solving all the difficult technical issues easily, that he ever met. I've very grateful thoughts and memories for all the people that did speak up how well they considered me, and that were fair Other people tried to take advantage by never telling me how good and helpful I was, so they could pay me less. What they didn't know is that I always had offers paying me double, and I was choosing to help them.

Now I only accept fair agreements. I know my value.

I started programming when I was 5 years old, at 10 I won a contest at Spanish State level, getting a Pc with a green phosphorescent monitor and a floppy drive, and I've lived the times of the BBS, much before Internet.

I've coded many Freeware Software, and Open Source Software, and I created the first system in Europe to sell Tickets for musical events, in 1995, for Tick Tack Ticket. I created this e-Commerce engine, with render template system completely in C, cgi-bin, HTML.

I love Software and Hardware.

I've worked with C, Java, PHP, Python... and my knowledge of PHP Unit Testing really reached its best when I was working for a bank.

I've invented the CSort algorithm.

In my free time I teach some students to get pro in coding. Most of my time now I work with Python 3, Docker Containers and Linux.

You can find information about me in my blog.

https://blog.carlesmateo.com/bio

Bundles that include this book

$65.00
Bought separately
$28.00
Bundle Price

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 60 Day 100% Happiness Guarantee

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

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.

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) and EPUB (for phones, tablets and 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 and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub