Skip to content

Updateds zfs pool from OpenZFS release 2.2.0 and ZFSBootMenu can not boot from pool, what now?

As mentioned here, ZFSBootMenu prior version 2.2.1 is not able to boot a zpool once updated.

It took me some time and a few tries to understand that the solution is incredible simple.

Based on the official documentation, all you have to do is to:

  • Boot from a live iso like archzfs.iso
  • Mount your EFI-Partition
  • curl -LJO https://get.zfsbootmenu.org/efi
  • cp zfsbootmenu*.EFI /efi/EFI/ZBM/vmlinuz.EFI
  • Umount your EFI-Partition
  • Reboot

I've updated the archzfs iso build script to automatically create a iso file with the latest ZFSBootMenu pre-shipped.

ssd just lost its partition table

So, I've just done a regular arch linux system update. Of course without kernel updates because of issues/14622.

After rebooting, there was nothing left. I still got an ZFSBootMenu entry somewhere in the efibootmgr but that's it. After using my archzfs usb iso, I went to software/arch-linux-configuration/scripts/zfs/recover and started 01-mount.sh. What I got in return was a no pool available.

I've used them all, parted, gdisk, testdisk and fdisk but they all have told me the same "shiny new ssd you got there". By the way, the ssd is a nvme-one from Samsung. I've fired up the lenovo internal system check tools but all they say is "super fine disk you got there, almost totally new".

What I did at the end was rebuilding my partition table using sgdisk. After that, I've also mkfs.vfat the efi boot partition and recreated the zfsbootmenu as well as the efibootmg entries. Important not, you have to update your /etc/fstab for the boot efi partition after doing that. Nice to know, after creating the zfs partition via sgdisk, I was able to fully import my encrypted zfs pool.

This is a pretty strange error and I hope I don't have to fix this again in the near future. It leaves a strange feeling in your stomach

Lessons learned? sgdisk -b=sgdisk-sda.bin /dev/sda ref

How to use sshfs under windows to mount a filesystem via a BastionHost/JumpHost

Today, I had the "joy" to work on a linux machine and edit a lot of files. The problem is, I had to use a Windows 10 as host OS.
Furthermore, the remote machine was available only via a bastion host/jump host. So it took me some time to make this possible.

I was not able to make sshfs-win working. WinSCP is a fallback option but this would result in edit a file -> save a file -> upload a file. I wanted to avoid the step upload a file.

What comes after this line is a snapshot of my created howto. I hope it will save you some time. It took me a lot to figure it out.

Given is, that you need to mount a filesystem via sshfs.

Following up, I will provide a guide how to do this by using a Windows 10 machine.

Bonus task, we are using a jumphost.

Steps

1.) Ensure you are running wsl2

  • wsl1 does not have a working fuse
  • Open a powershell and run wsl --list --verbose
  • If the VERSION says something bigger 1, you are fine
  • Else
    • Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    • Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
    • Download wsl_update_x64.msi from https://aka.ms/wsl2kernel
    • Install the msi
    • wsl --set-version <string: Distro like Debian> 2
    • Wait
    • wsl --list --verbose should output something like 2 in column VERSION

2.) Ensure you've sshfs installed

  • Open the shell to your wsl linux
  • test -f /usr/bin/sshfs && echo "sshfs already installed" || sudo apt install sshfs -y

3.) Configure your ssh

  • Open the shell to your wsl linux
  • test -d ~/.ssh || mkdir ~/.ssh;
  • Add content like the following in your ~/.ssh/config file
  • sudo bash -c "echo '#enable option' >> /etc/fuse.conf"
  • sudo bash -c "echo 'user_allow_other' >> /etc/fuse.conf"

Example content of the ssh config file

HOST my.main.host-username
  HostName my.main.host
  ProxyJump my.bastion.host-username
  User username
  #optional but recommended
  IdentityFile ~/.ssh/my_private_key

HOST my.bastion.host-username
  HostName my.bastion.host
  User username
  #optional but recommended
  IdentityFile ~/.ssh/my_private_key

4.) Mount and umount the filesystem

  • You can add the following lines to your alias
  • Assumed is, that the path ~/network/host.main.my exists
  • ssh my.main.host-username
  • id -a
  • exit
  • Not down the number for uid and gid
    • Example:
    • For the output uid=1337(artodeto) gid=4711(bazzline) groups=...
    • uid is 1337
    • gid is 4711
  • mount: sshfs -o ProxyJump=my.bastion.host-username,allow_other,uid=<int: number>,gid=<int: number> my.main.host-username:/my/path ~/network/host.main.my

Fix >>failed to setup inotify handler. Please increase inotify limits<< on truenas scale for syncthing

I am using Syncthing on my truenas scale and got the following error after adding more and more directories.

failed to setup inotify handler. Please increase inotify limits, see https://docs.syncthing.net/users/faq.html#inotify-limits

The fix is simple, just login to your truenas scale and click to System Settings -> Advanced -> Sysctl -> Add.

Add Variable fs.inotify.max_user_watches with value 204800 and that's it. Happy syncthing!