Skip to content

Instantly share code, notes, and snippets.

View tonyhutter's full-sized avatar

Tony Hutter tonyhutter

  • LLNL
  • Livermore, CA USA
View GitHub Profile
@tonyhutter
tonyhutter / new-zpool-status.json
Last active May 30, 2024 21:37
new-zpool-status.json
{
"pools": [
{
"name": "pool1",
"vdevs": [
{
"name": "file1",
"pool": "pool1",
"class": "normal",
"redundancy": "raidz",
@tonyhutter
tonyhutter / zpool-status.json
Created May 28, 2024 22:54
zpool-status.json
{
"pools": [
{
"pool_name": "pool1",
"vdevs": [
{
"name": "file1",
"pool": "pool1",
"disk_type": "file",
"group_type": "raidz",
@tonyhutter
tonyhutter / special_block_stats_fedora_38
Created April 10, 2024 20:33
special_block_stats_fedora_38
Fedora 38 root directory contents ('/') copied to zfs pool with one special device, all default pool settings, /home and /dev excluded:
$ zdb -PLbbbs tank
Blocks LSIZE PSIZE ASIZE avg comp %Total Type
- - - - - - - unallocated
2 32768 4608 13824 6912 7.11 0.00 object directory
2 1024 512 1536 768 2.00 0.00 object array
1 16384 1024 3072 3072 16.00 0.00 packed nvlist
- - - - - - - packed nvlist size
@tonyhutter
tonyhutter / test_backup_with_draid.sh
Created April 9, 2024 22:00
test backup to pool with draid
#!/bin/bash
truncate -s 500M /tmp/file{0..105} /tmp/file-special
for i in '-o feature@allow_backup_to_pool=disabled' '-o feature@allow_backup_to_pool=enabled' ; do
echo "--- ARGS: $i : before ---"
sudo ./zpool create -f $i tank draid2:11d:106c:2s-0 /tmp/file{0..105} special /tmp/file-special
sudo ./zfs set compression=off tank
./zpool sync
./zpool get allocated tank
#!/bin/bash
#
# Run this script multiple times in parallel inside your pool's mount
# to reproduce https://github.com/openzfs/zfs/issues/15526. Like:
#
# ./reproducer.sh & ./reproducer.sh & ./reproducer.sh & /reproducer.sh & wait
#
if [ $(cat /sys/module/zfs/parameters/zfs_bclone_enabled) != "1" ] ; then
echo "please set /sys/module/zfs/parameters/zfs_bclone_enabled = 1"
@tonyhutter
tonyhutter / zfs_bclone_disable_zts.patch
Created November 15, 2023 23:30
zfs_bclone_disable_zts
diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib
index 844caa17d..d5d7bb6c8 100644
--- a/tests/zfs-tests/include/libtest.shlib
+++ b/tests/zfs-tests/include/libtest.shlib
@@ -3334,6 +3334,21 @@ function set_tunable_impl
esac
}
+function save_tunable
+{
@tonyhutter
tonyhutter / blk-mq_benmarks.md
Last active April 12, 2022 00:36
blk-mq_benmarks.md
BLK-MQ O_DIRECT POOL Direction volblocksize MB/s or IOPS Blk-mq gain/loss multiple (greater than 1 is gain, less than 1 is loss)
0 No 5x3 mirror write 1MB 416
1 No 5x3 mirror write 1MB 474 1.14
0 No draid1:8d write 1MB 881
1 No draid1:8d write 1MB 998 1.13
0 No raidz2:6d write 1MB 231
1 No raidz2:6d write 1MB 257 1.11
0 No SingleDisk write 1MB 147
@tonyhutter
tonyhutter / benchmark-zvols.sh
Created October 21, 2021 00:10
benchmark-zvols.sh
#!/bin/bash
#
# Use 10% of the pool free space to make multiple zvols, one zvol per CPU.
# Then write 5GB to each zvol in parallel, one writer per CPU.
# This test writes with non-O_DIRECT and O_DIRECT.
#
# Usage:
# ./benchmarks-zvols.sh POOL
TESTPOOL=$1
@tonyhutter
tonyhutter / test_ec2.patch
Created May 3, 2021 18:31
Partial work on test case for 5041
diff --git a/master/buildbot/test/unit/worker/test_ec2.py b/master/buildbot/test/unit/worker/test_ec2.py
index 3342671ed..0d91f8481 100644
--- a/master/buildbot/test/unit/worker/test_ec2.py
+++ b/master/buildbot/test/unit/worker/test_ec2.py
@@ -17,6 +17,7 @@
import os
from twisted.trial import unittest
+from twisted.python import log
@tonyhutter
tonyhutter / partial_moto_fixes.patch
Created May 3, 2021 18:27
partially completed moto changes for describe_spot_price_history
diff -ru ./lib/python3.6/site-packages/moto.orig/ec2/models.py ./lib/python3.6/site-packages/moto/ec2/models.py
--- ./lib/python3.6/site-packages/moto.orig/ec2/models.py 2021-01-12 22:15:05.958727781 +0000
+++ ./lib/python3.6/site-packages/moto/ec2/models.py 2021-05-03 18:23:48.524026897 +0000
@@ -4041,6 +4041,7 @@
class SpotInstanceRequest(BotoSpotRequest, TaggedEC2Resource):
+ test_request_state = ""
def __init__(
self,