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,714,583writing, 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
Recipes for Decoupling
Matthias NobackWrite software that survives
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.
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:
CQRS by Example
Carlos Buenosvinos, Christian Soronellas, and Keyvan Akbary- Leverage your Software Architecture skills by learning everything about CQRS in detail with lots of examples
- Develop faster applications by applying CQRS and fostering Read Models and Projections
- Learn how to apply CQRS into a brownfield project from a pragmatic approach
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.
Maîtriser Apache JMeter
Philippe Mouawad, Bruno Demion (Milamber), and Antonio Gomes RodriguesToute la puissance d'Apache JMeter expliquée par ses commiteurs et utilisateurs experts. De l'intégration continue en passant par le Cloud, vous découvrirez comment intégrer JMeter à vos processus "Agile" et Devops.
If you're looking for the newer english version of this book, go to Master JMeter : From load testing to DevOps
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.
The PowerShell Scripting and Toolmaking Book
Don Jones and Jeff HicksLearn the patterns, practices, and details of PowerShell Scripting and Toolmaking from the industry's two most recognized experts on the subject.
Mastering STM32 - Second Edition
Carmine NovielloWith more than 1200 microcontrollers, STM32 is probably the most complete ARM Cortex-M platform on the market. This book aims to be the most complete guide around introducing the reader to this exciting MCU portfolio from ST Microelectronics and its official CubeHAL and STM32CubeIDE development environment.
Introduction to Data Science
Rafael A IrizarryThe demand for skilled data science practitioners in industry, academia, and government is rapidly growing. This book introduces concepts from probability, statistical inference, linear regression and machine learning and R programming skills. Throughout the book we demonstrate how these can help you tackle real-world data analysis challenges.
Top Bundles
- #1
Software Architecture
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
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... - #4
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... - #6
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...