ZFS zpool Expansion…

Having moved my entire RAIDZ2 cluster to a bigger drives quite a while ago, I never had the need to expand the entire volume size (yet). But since I was to embark on creating a new RAIDZ3 for some other reason, I decided to first expand the part1s across all six disks (where by RAIDZ2 was sitting astride):

Export the zpool:

  • zfs export <POOL NAME>

Backup the GPT tables:

mkdir -p /root/gpt-backup

for d in /dev/sd[a-f]; do
    sgdisk --backup="/root/gpt-backup/$(basename "$d").gpt" "$d"
done

Then resize part1 across all 6 disks, based on your expanded ending sector:

for d in /dev/sd[a-f]; do
    sgdisk --delete=1 "$d"
    sgdisk --new=1:2048:20835092399 "$d"
    sgdisk --typecode=1:BF01 "$d"
    sgdisk --change-name=1:<POOL NAME> "$d"
done

Don’t worry: sgdisk re-creating the partition 1 information with the same starting sector and later ending sector simply means your data is still there, but the partition is expanded.

You can now check the “new” boundaries:

  • sfdisk -l /dev/sd[a-f]

And you can also check that the ZFS labels still exist:

for d in /dev/sd[a-f]1; do
    echo "===== $d ====="
    zdb -l "$d" | grep -E 'name:|pool_guid:|top_guid:|guid:|txg:'
done

You can then proceed to re-import the pool, either with a blanket command below, or using specific IDs:

  • zpool import -d /dev/disk/by-id <POOL NAME>

Then check:

  • zpool status -P <POOL NAME>

 

Ensure the pool is set to auto-expand:

  • zpool set autoexpand=on <POOL NAME>

And then explicitly  set each member vdev to expand:

for d in /dev/sd[a-f]1; do
    zpool online -e <POOL NAME> "$d"
done

And this where all the trouble started…

No matter how many times I did that last two commands, or even exported and reimported, ZFS refused to expand the individual vdevs, despite the “extra space” being acknowledged (by the EXDPANDSZ parameter showing as such)…

# zpool list <POOL>
NAME      SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
<POOL>   32.5T  30.7T  1.85T        -     25.2T    18%    94%  1.00x    ONLINE  -
# zpool list -v <POOL>
NAME                                                  SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
<POOL>                                               32.5T  30.7T  1.85T        -     25.2T    18%    94%  1.00x    ONLINE  -
  raidz2-0                                           32.5T  30.7T  1.85T        -     25.2T    18%  94.3%      -    ONLINE
    ata-<redacted>-part1                             9.70T      -      -        -         -      -      -      -    ONLINE
    ata-<redacted>-part1                             9.70T      -      -        -         -      -      -      -    ONLINE
    ata-<redacted>-part1                             9.70T      -      -        -         -      -      -      -    ONLINE
    ata-<redacted>-part1                             9.70T      -      -        -         -      -      -      -    ONLINE
    ata-<redacted>-part1                             9.70T      -      -        -         -      -      -      -    ONLINE
    ata-<redacted>-part1                             9.70T      -      -        -         -      -      -      -    ONLINE
logs                                                     -      -      -        -         -      -      -      -         -
  nvme-<redacted>-part5                                 4G   536K  3.97G        -         -     0%  0.01%      -    ONLINE

Continue reading →

ZFS Importing /dev/disk/by-id…

I had the dubious pleasure of having to (re-)import a ZFS pool by disk ID… i.e. zpool import -d /dev/disk/by-id <POOL NAME>, unfortunately, on my system, everything appeared as WWNs, like “wwn-0x5111c500c8708981-part1” – instead of my expected “ata-<MODEL>-<BUILD>_<HDD SERIAL>-part1” where I could easily determine which disk a specific zpool/zvol was on.

So the fix, given I know I had all my SATA drives’ “part1” as part of my zpool, and that my log was on my NVMe drive, the following commands imported the individual vdevs according to my desired tags/handles:

devices=()

for dev in /dev/disk/by-id/ata-*-part1; do
    devices+=(-d "$dev")
done

# Include the NVMe SLOG explicitly
devices+=(-d /dev/disk/by-id/nvme-<MODEL>_<BUILD>_<SERIAL>-part5)

Doing a last check:

  • printf '%s\n' "${devices[@]}"

Then check the import:

  • zpool import "${devices[@]}"

And finally, assuming all is good, import!

  • zpool import "${devices[@]}" <POOL NAME>

Lastly, verify the vdev paths:

  • zpool status -P <POOL NAME>

ZFS Partition IDs…

While doing some maintenance, I ran: sudo sfdisk -l /dev/sd[a-z] in attempt to list all partitions on my 6x 16TB of spinning rust i.e. /dev/sd*, which produced:

Disk /dev/sda: 14.55 TiB, 16000900661248 bytes, 31251759104 sectors
Disk model: <redacted>
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: <redacted>

Device     Start         End     Sectors  Size Type
/dev/sda1   2048 11721043967 11721041920  5.5T Linux filesystem


Disk /dev/sdb: 14.55 TiB, 16000900661248 bytes, 31251759104 sectors
Disk model: <redacted>
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: <redacted>

Device     Start         End     Sectors  Size Type
/dev/sdb1   2048 11721043967 11721041920  5.5T Linux filesystem


Disk /dev/sdc: 14.55 TiB, 16000900661248 bytes, 31251759104 sectors
Disk model: <redacted>
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: <redacted>

Device     Start         End     Sectors  Size Type
/dev/sdc1   2048 11721043967 11721041920  5.5T Linux filesystem


Disk /dev/sdd: 14.55 TiB, 16000900661248 bytes, 31251759104 sectors
Disk model: <redacted>
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: <redacted>

Device     Start         End     Sectors  Size Type
/dev/sdd1   2048 11721043967 11721041920  5.5T Linux filesystem


Disk /dev/sde: 14.55 TiB, 16000900661248 bytes, 31251759104 sectors
Disk model: <redacted>
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: <redacted>

Device     Start         End     Sectors  Size Type
/dev/sde1   2048 11721043967 11721041920  5.5T Linux filesystem


Disk /dev/sdf: 14.55 TiB, 16000900661248 bytes, 31251759104 sectors
Disk model: <redacted>
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: <redacted>

Device     Start         End     Sectors  Size Type
/dev/sdf1   2048 11721043967 11721041920  5.5T Solaris /usr & Apple ZFS

 

That was odd, considering all these partitions are ZFS type (i.e. blue highlights are correct, red highlights are incorrect).

Continue reading →

Move, Outlook!

Ever had Microsoft Outlook, together with Exchange, have brain farts and couldn’t move emails? Do the following:

  • (optional) empty “Deleted Items” folder
  • delete the “unmovable” items – Outlook moves it to “Deleted Items” folder

WARNING: ensure you do not use the SHIFT+DELETE keys combination – it will permanently delete those emails (do not pass “Deleted Items” folder, do not collect $200… 😆 )

  • navigate to the “Deleted Items” folder, select everything you intended to move and move to intended destination

QEMU libvirt VM Migration/Backup…

Attempting to backup a VM was a mess – the Windows 11 activation was broken upon copying, so I got AI to help me code a migration script…

After a huge amount of my own time (largely because I am a cheap-ass and was attempting to do things locally on a Qwen 3.8 27B on an AMD 395+ Strix Halo w/128gB RAM), a huge amount of repetitions across free Google AI Mode (sucks) and free ChatGPT (good enough), I finally got a working script…

It took about a month, an hour or so on and off whenever I had “spare” time, with some 32 iterations before I had a script that didn’t have script errors and I was sure the logic and technicals were sound (yes, I ran through the code manually). Then another 4 iterations to address run-time issues and figure out what broke Windows 11 activation…

Have fun!

Auto Toggling Touchpad

I get irritated whenever my touchpad accidentally triggers when I am typing on the laptop keyboard, shifting focus and ending up typing on some other window or screen. The straw that broke the camel’s back was when the focus shifted from a password entry to a chat window and I ended up sending (part of) my password to someone…

With the help of Google’s AI mode and later ChatGPT (yes, I needed both to get things to finally work), I whipped up a solution based on AutoHotkey.

Total time:

  • design, redesign, code, testing + retesting: ~2 hours
  • Repo ReadMe.md documentation: 0.5 hours

Hopefully this helps someone.

Oppo Find N6

It is bad enough that Google tracks all my apps installed, etc. through the Play Store – granted there is some level of (misplaced) trust and the ability to have some central updating platform, but having a useless level of interference (and delay to add) from Oppo through their “HeyTap” crap simply crossed the line.

Refer here to clear the malware, adware and privacy stripping apps.

Forcing the Reddit App Down Your Throat…

So, browsing Reddit on your mobile, usually from Google search results, is now an exercise in frustration – Reddit will freeze your screen and force you to jump to their app.

I do not like using the app. If I can use a normal browser to navigate, there is no valid technical reason I must use your app.

So, Fennec browser, complete with uBlock Origin, to the rescue (because Chrome just sucks)!

Add the following to the “My filters”:

! Remove Reddit mobile app wall popup
www.reddit.com##.rpl-bottom-sheet
www.reddit.com##+js(remove-class, rpl-scroll-lock, body, stay)
www.reddit.com##+js(remove-class, scroll-is-blocked, body, stay)
www.reddit.com##+js(prevent-addEventListener, touchmove)

Problem fixed.

I HATE Apple

This post was in draft for a looooong time (since June 2024) – mainly procrastination and this starting out more of a “self-help” listing of “required software” turning into a self-indulgent rant… Now finally published because I just had another Mac vs. Windows argument recently…

So, I finally filled in the remaining ~60% of the post originally drafted with headlines only (e.g. “Multiple Monitor Support”, “File System Rabbit Droppings”, “Clamshell Mode”, “Power Management Control”, “Fingerprint Touch Sensor and “PD Power Supplies”) and even added current-day info (with lotsa “saved”/shared Google AI links, ‘coz pages disappear and summaries are better)… Hopefully this helps any users transitioning to Mac, despite some points probably being out of date…

WARNING: In a departure from usual posts having a more professional tone, this post is (unapologetically) laden with expletives, swearing and (apologetically) sexist terms, exposing my absolute anger and frustration on being forced to use, and defend my arguments against, poorly thought out/narrow-minded engineering. If you have sensitive eyes/ears/thinking, please ask Google AI to summarise this post for you instead. 😳  Note that is a “live” link – you will probably get different responses from different browser sessions because, you know, AI.

My experience with Apple has been nothing if short of atrocious, starting with a iPhone 6s forced upon me, so many years back, till 2021 through 2025 where I did not have a choice of Windows or OSX for a work laptop, having a Intel-based MacBook Pro 13 2020 being forced upon me, followed by a MacBook Pro 2022 w/2x USB4/TB3 ports.

I’m going to start with the bad first – draw up a strong, big drink – this is going to be a loooooooong one…

I SWEAR the next time an IT engineer tries to argue Apple’s USABILITY points with me, I’ll drive the bloody MBP through his friggin skull.

Continue reading →

Windows Volume Mount Points, Junctions and Windows 11 Firewall…

I was wondering why a simple firewall rule allowing inbound connections to some executable just would not work.

Extensive troubleshooting, excepting disabling the firewall (works), attempting relaxing any other conditions, like removing port restrictions (doesn’t work), source IP/subnet restrictions (doesn’t work), and a whole bunch of other stuff just simply did not work.

Finally frustrated, I just tried removing the targeted/allowed executable – port, source IP/subnet and other bits in place… WORKS.

WTF?

Continue reading →