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.
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