ZFS on Ubuntu 20.04 LTS
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)
Bundles that include this book
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.
See full terms
Do Well. Do Good.
Authors have earned$11,597,977writing, 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
Top Books
C++20 - The Complete Guide
Nicolai M. JosuttisAll new language and library features of C++20 (for those who know previous C++ versions).
The book presents all new language and library features of C++20. Learn how this impacts day-to-day programming, to benefit in practice, to combine new features, and to avoid all new traps.
Buy early, pay less, free updates.
Other books:
Jetpack Compose internals
Jorge CastilloJetpack Compose is the future of Android UI. Master how it works internally and become a more efficient developer with it. You'll also find it valuable if you are not an Android dev. This book provides all the details to understand how the Compose compiler & runtime work, and how to create a client library using them.
Ansible for DevOps
Jeff GeerlingAnsible is a simple, but powerful, server and configuration management tool. Learn to use Ansible effectively, whether you manage one server—or thousands.
SignalR on .NET 6 - the Complete Guide
Fiodar SazanavetsLearn everything there is to learn about SignalR and how to integrate it with the latest .NET 6 and C# 10 features. Learn how to connect any type of client to SignalR, including plain WebSocket client. Learn how to build interactive applications that can communicate with each other in real time without making excessive calls.
R Programming for Data Science
Roger D. PengThis book brings the fundamentals of R programming to you, using the same material developed as part of the industry-leading Johns Hopkins Data Science Specialization. The skills taught in this book will lay the foundation for you to begin your journey learning data science. Printed copies of this book are available through Lulu.
Functional event-driven architecture: Powered by Scala 3
Gabriel VolpeExplore the event-driven architecture (EDA) in a purely functional way, mainly powered by Fs2 streams in Scala 3!
Leverage your functional programming skills by designing and writing stateless microservices that scale, powered by stateful message brokers.
The easiest way to learn design patterns
Fiodar SazanavetsLearn design patterns in the easiest way possible. You will no longer have to brute-force your way through each one of them while trying to figure out how it works. The book provides a unique methodology that will make your understanding of design patterns stick. It can also be used as a reference book where you can find design patterns in seconds.
Cronache di Domain-Driven Design
Francesco Strazzullo, Matteo Baglini, Gianluca Padovani, Emanuele DelBono, Marco Consolaro, Alessandro Colla, Uberto Barbini, Alberto Acerbis, Julie Camosseto, DDD Open, and Alberto BrandoliniCronache di Domain-Driven Design: un libro corale in italiano fatto di storie indipendenti tra loro, che sono il risultato dell’applicazione di Domain-Driven Design su progetti reali.
OpenIntro Statistics
David Diez, Christopher Barr, Mine Cetinkaya-Rundel, and OpenIntroA complete foundation for Statistics, also serving as a foundation for Data Science.
Leanpub revenue supports OpenIntro (US-based nonprofit) so we can provide free desk copies to teachers interested in using OpenIntro Statistics in the classroom and expand the project to support free textbooks in other subjects.
More resources: openintro.org.
CCIE Service Provider Version 4 Written and Lab Exam Comprehensive Guide
Nicholas RussoThe service provider landscape has changed rapidly over the past several years. Networking vendors are continuing to propose new standards, techniques, and procedures for overcoming new challenges while concurrently reducing costs and delivering new services. Cisco has recently updated the CCIE Service Provider track to reflect these changes; this book represents the author's personal journey in achieving that certification.
Top Bundles
- #1
Software Architecture for Developers: Volumes 1 & 2 - Technical leadership and communication
2 Books
"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before... - #2
Practical FP in Scala + Functional event-driven architecture
2 Books
Practical FP in Scala (A hands-on approach) & Functional event-driven architecture, aka FEDA, (Powered by Scala 3), together as a bundle! The content of PFP in Scala is a requirement to understand FEDA so why not take advantage of this bundle!? - #3
All the Books of The Medical Futurist
6 Books
We put together the most popular books from The Medical Futurist to provide a clear picture about the major trends shaping the future of medicine and healthcare. Digital health technologies, artificial intelligence, the future of 20 medical specialties, big pharma, data privacy, digital health investments and how technology giants such as Amazon... - #4
CCIE Service Provider Ultimate Study Bundle
2 Books
Piotr Jablonski, Lukasz Bromirski, and Nick Russo have joined forces to deliver the only CCIE Service Provider training resource you'll ever need. This bundle contains a detailed and challenging collection of workbook labs, plus an extensively detailed technical reference guide. All of us have earned the CCIE Service Provider certification... - #6
Pattern-Oriented Memory Forensics and Malware Detection
2 Books
This training bundle for security engineers and researchers, malware and memory forensics analysts includes two accelerated training courses for Windows memory dump analysis using WinDbg. It is also useful for technical support and escalation engineers who analyze memory dumps from complex software environments and need to check for possible... - #7
Modern C++ Collection
3 Books
Get All about Modern C++C++ Standard Library, including C++20Concurrency with Modern C++, including C++20C++20Each book has about 200 complete code examples. Updates are included. When I update one of the books, you immediately get the updated bundle. You can expect significant updates to each new C++ standard (C++23, C++26, .. ) and also... - #9
Retromat eBook Bundle for Agile Retrospectives
2 Books
If you facilitate retrospectives this bundle is for you: "Plans for Retrospectives" helps beginners learn the lay of the land with tried-and-true plans. Once you know your way around, "Run great agile retrospectives" contains all 135+ activities in Retromat for you to mix and match.