Skip to content

Instantly share code, notes, and snippets.

@TheBoroer
Last active January 22, 2025 17:58
Making Fusion-IO devices work on TrueNAS SCALE 22.02.1 and up

FusionIO / Fusion-IO devices on TrueNAS SCALE

WARNING: This is unsupported and has potential to mess your system up. Proceed at your own risk.

Initial instructions were for 22.02.1 but also works for later versions with some additional steps. There's notes for each upgrade I've done at the end of the gist.

Note for v22.02.2:

  • there's a bug where it doesnt show fusionio disks at all under Storage > Disks. So I had to downgrade to 22.02.1 and it works fine.

This gist is basically a note-to-self so future me can remember what I did to get this working on my TrueNAS server but I hope it helps someone else out too.

I wanted to use my iodrive duo (2 fusion devices on 1 card) as a mirrored SLOG on an existing raid2z pool.

Links to repos used:

Step 1) Install drivers

Note 1: (probably for v23.10.x and up)

If you get an error like zsh: command not found: make or something related to cc or dkms or dh_testdir missing, you'll need to run the following (as root user or using sudo) commands to install extra stuff then try again:

  • chmod +x /bin/apt*
  • chmod +x /usr/bin/dpkg*
  • apt-get update
  • apt-get install build-essential make dkms debhelper - press y to install when prompted

Note 2: (probably for v24.04.x and up)

If you get the message Package management tools are disabled on TrueNAS appliances. when you try to run sudo apt-get update, you can workaround it by running install-dev-tools then trying the commands from Note 1 again.

Note 3: (probably for v24.10.x and up)

Newer kernel with truenas' custom patches causes make dmks to fail. We'll have to use make dpkg instead.

Instructions

To download & install the VSL3 driver via dkms, run these commands in the shell (ssh or web gui):

  • git clone https://github.com/RemixVSL/iomemory-vsl.git
  • cd iomemory-vsl/
  • for TrueNAS v24.04 and older: make dkms
  • for TrueNAS v24.10 and newer: make dpkg
    • dpkg -i ../iomemory-vsl-$(uname -r)_*_$(dpkg --print-architecture).deb - installs the .deb file we just created

For VSL4:

  • git clone https://github.com/RemixVSL/iomemory-vsl4.git
  • cd iomemory-vsl/
  • for TrueNAS v24.04 and older: make dkms
  • for TrueNAS v24.10 and newer: make dpkg
    • dpkg -i ../iomemory-vsl-$(uname -r)_*_$(dpkg --print-architecture).deb - installs the .deb file we just created

Step 2) Install fio utilities/tools

IMPORTANT NOTE: you might need to unlock dpkg in order to use it for the last command: chmod +x /bin/dpkg*

  • git clone https://github.com/RemixVSL/vsl_downloads.git
  • cd vsl_downloads
  • then look inside the vsl3 (or vsl4) directory for the .deb file.
  • on ubuntu/debian linux version of truenas, install it by running: dpkg -i fio-util_3.2.16.1731-1.0_amd64.deb

Step 3) Reboot

After rebooting, you should now see the fusion cards present when running fio-status -a in the shell. If you need to upgrade firmware on your devices, find the instructions on how to generate the firmware over at vsl_downloads and use the fio-update-iodrive /dev/fctX path/to/firmware/file.fff command.

Step 4) Adding it to the zpool

If you don't see the drives, you need to wipe them with something like sgdisk --zap-all /dev/fioa (CAREFUL, you can easily wipe the wrong drive like this). Sometimes this also works for fio drives and old raid drives: wipefs -af /dev/fio{a,b} (again, be careful).

I can now see the drives in the GUI but when trying to add fioa and fiob drives as log devices to the pool, it would error out after trying to format the drives saying partition of type (zfs) couldn't be found. Weird thing is....the partitions are there (lsblk shows them). After this, the GUI would hang when trying to go to Storage > Disks to see the list of disks. Even after a reboot, nothing worked.

BUT after trying to manually add it to the zpool via the cli: zpool add [pool name] log mirror /dev/fioa /dev/fiob

AND then rebooting the server, it works and nothing hangs anymore! I can see the log drives in the GUI now + Storage > Disks doesn't hang anymore.

What happens after a version upgrade?

I'll share below what my upgrade experience looked like and list any issues or workarounds I needed

Upgrade from 22.02.4 to 22.12.4.2

  • I did the upgrade through the web UI.
  • Repeated steps 1-3 again.
    • Instead of the git clone ... command, run git pull once you're in the iomemory-vsl folder to get latest updates.
  • I had to import the storage pool via the truenas GUI (for some reason running zpool import doesn't make the pool show up in the gui)

Upgrade from 22.02.4 to 23.10.2

  • I did the upgrade through the web UI.
  • Repeated steps 1-3 again.
    • Instead of the git clone ... command, run git pull once you're in the iomemory-vsl or vsl_downloads folder to get latest updates.
  • Ran into issues with make dkms so I've updated the instructions in Step 1 with a workaround (thanks @TechnoidAlpha).
  • After reboot, my existing pool showed up automatically and fio-status -a command shows my fusion drives!

Upgrade from 23.10.2 to 24.04.2.5

  • I did the upgrade through the web UI.
  • Repeated steps 1-3 again.
    • Instead of the git clone ... command, run git pull once you're in the iomemory-vsl or vsl_downloads folder to get latest updates.
    • ran into this message Package management tools are disabled on TrueNAS appliances. when running sudo apt-get update. I've updated the instructions in Step 1 with a workaround (thanks again @TechnoidAlpha).
  • After reboot, my existing pool showed up automatically and fio-status -a command shows my fusion drives!

Upgrade from 24.04.2.5 to 24.10.0.2

  • I did the upgrade through the web UI.
  • Repeated steps 1-3 again.
    • Instead of the git clone ... command, run git pull once you're in the iomemory-vsl or vsl_downloads folder to get latest updates.
    • ran into errors when running make dkms. It was caused by the newer kernel versions. We gotta use make dpkg instead. I've updated the instructions in Step 1 with the workaround.
  • After reboot, my existing pool showed up automatically and fio-status -a command shows my fusion drives!
@wattCash
Copy link

Thanks

@TechnoidAlpha
Copy link

TechnoidAlpha commented Jul 21, 2024

Confirmed to work on TrueNAS SCALE 23.10.2

Hi! Thanks so much for your guide!
Just wanted to provide some info on how I jumped through some hoops to get "dkms" to work. For reference, this is on TrueNAS Scale 23.10.2

Most of what I did wasn't advised but it worked for me.

I used these commands to enable apt via ssh on the root account:

  • su -
  • sudo chmod +x /bin/apt*
  • sudo chmod +x /usr/bin/dpkg
  • sudo apt-get update

I was then able to install dkms as this was not working for me (command not found error)

After that, I was able to follow your guide to install the driver via dkms and also the utils. My drive has been identified with "fio-status -a" however the driver won't load until I reboot as per your guide (currently running a large replication task so I'll have to wait a few days before I can reboot and add my fusion drive as a fast 730gb cache drive for my main pool.

@TechnoidAlpha
Copy link

TechnoidAlpha commented Jul 23, 2024

Confirmed to work on TrueNAS SCALE 24.04.2

I recently updated to TrueNAS SCALE 24.04.2 (the latest version at the time of writing this)
this wiped the driver and utils software but your guide still works fine!

I had to run install-dev-tools to get apt working to install dkms (this is new for scale 24 with how they manage system files)

but after that, I followed the above instructions:

  • su - (so I could do everything as root)
  • chmod +x /bin/dpkg*
  • git clone https://github.com/RemixVSL/iomemory-vsl.git && cd iomemory-vsl/ && make dkms
  • cd ../
  • git clone https://github.com/RemixVSL/vsl_downloads.git && cd vsl_downloads
  • cd vsl3
  • dpkg -i fio-util_3.2.16.1731-1.0_amd64.deb
    I then rebooted and the drive remains in my pool as cache (I added it prior on Scale 23.10.2 using zpool add [pool name] cache /dev/fioa)

I confirmed using lsblk and fio-status -a that the drive was working all okay and it is! I did a few reboots and it all still works fine as expected.
I hope this helps anyone who may be using similar versions of TrueNAS Scale!

@TheBoroer
Copy link
Author

Hey @TechnoidAlpha thanks for the update and I'm glad my guide still works for the newer versions! 🥳

@bpopovych
Copy link

bpopovych commented Oct 22, 2024

Hi! Not working for me for TrueNAS SCALE 24.10-RC.2 unfortunately. I can not compile the driver module itself and don't have a glue where to dig further:

1729615002.547  KFIOC_X_DISK_HAS_OPEN_MUTEX=0
Finished
1729615002.564  Exiting
Preserving configdir due to '-p' option: /var/lib/dkms/iomemory-vsl/6.6.44-79fe888/build/kfio_config
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
make \
    -j24 \
-C /lib/modules/6.6.44-production+truenas/build \
FIO_DRIVER_NAME=iomemory-vsl \
FUSION_DRIVER_DIR=/var/lib/dkms/iomemory-vsl/6.6.44-79fe888/build \
M=/var/lib/dkms/iomemory-vsl/6.6.44-79fe888/build \
EXTRA_CFLAGS+="-I/var/lib/dkms/iomemory-vsl/6.6.44-79fe888/build/include -DBUILDING_MODULE -DLINUX_IO_SCHED -Wall -Werror" \
INSTALL_MOD_DIR=extra/fio \
INSTALL_MOD_PATH= \
KFIO_LIB=kfio/x86_64_cc122_libkfio.o_shipped \
modules
make[1]: Entering directory '/usr/src/linux-headers-6.6.44-production+truenas'
printf '#include "linux/module.h"\nMODULE_LICENSE("GPL");\n' >/var/lib/dkms/iomemory-vsl/6.6.44-79fe888/build/license.c
make[3]: *** [scripts/Makefile.build:243: /var/lib/dkms/iomemory-vsl/6.6.44-79fe888/build/main.o] Killed
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.build:243: /var/lib/dkms/iomemory-vsl/6.6.44-79fe888/build/license.o] Killed
make[2]: *** [/usr/src/linux-headers-6.6.44-production+truenas/Makefile:1924: /var/lib/dkms/iomemory-vsl/6.6.44-79fe888/build] Error 2
make[1]: *** [Makefile:237: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.6.44-production+truenas'
make: *** [Makefile:145: modules] Error 2

Can anyone suggest what else I've to try?

@cgg507
Copy link

cgg507 commented Nov 4, 2024

I just ran into the same issue as @bpopovych . Had to reboot SCALE into version 24.04.2 for a successful compile.

@zinkscott
Copy link

Same issues with 24.10 as @bpopovych. I haven’t found a solution yet.

@TechnoidAlpha
Copy link

Same issues with 24.10 as @bpopovych. I haven’t found a solution yet.

Ditto here, my old "guide" doesn't seem to work on Electric Eel. Not sure what the solution is and im not planning to downgrade back to 24.04.2 or older as I need docker on Truenas 24.10 Electric Eel.

@TheBoroer
Copy link
Author

Hey guys, I'm away on travels atm so can't try to see if I can get 24.10 to work on my setup.
Once I'm back I'll take a stab at getting it to work and will report back 🫡

@tgeske88
Copy link

tgeske88 commented Dec 7, 2024

Hey guys, I'm away on travels atm so can't try to see if I can get 24.10 to work on my setup. Once I'm back I'll take a stab at getting it to work and will report back 🫡

Any luck trying to get this to work? I'm struggling to build the driver without errors and might be time to upgrade to a drive that is supported by manufacturer.

@TheBoroer
Copy link
Author

TheBoroer commented Dec 8, 2024

Hey @tgeske88 @TechnoidAlpha @cgg507 @zinkscott
Sorry for the delay, I totally forgot to give this a try. I'm in the process to upgrade from 22.04 -> 23.10 -> 24.04 ->24.10 and started updating my original instructions as I go.

  • I just upgraded to 23.10 (thanks @TechnoidAlpha for your tips).
  • edit: upgrade to 24.04 went smoothly too (thanks again @TechnoidAlpha)
  • edit: upgrade to 24.10 was a bit rough but I figured it out 🫡

@TheBoroer
Copy link
Author

TheBoroer commented Dec 8, 2024

Confirmed to work on TrueNAS SCALE 24.10.2

Good news yall!

The issue was the newer kernel with truenas' patches seems to cause make dkms to fail so we need to use make dpkg instead.
I've updated the instructions in Step 1 🥳

@zinkscott
Copy link

I'm curious as to what your kernel changes were as I still get errors with make dpkg

make[5]: *** [scripts/Makefile.build:243: /root/iomemory-vsl/driver_source/license.o] Killed
make[4]: *** [/usr/src/linux-headers-6.6.44-production+truenas/Makefile:1924: /root/iomemory-vsl/driver_source] Error 2
make[3]: *** [Makefile:237: __sub-make] Error 2
make[3]: Leaving directory '/usr/src/linux-headers-6.6.44-production+truenas'
make[2]: *** [Makefile:135: modules] Error 2
make[2]: Leaving directory '/root/iomemory-vsl/driver_source'
ERROR:
make[1]: *** [debian/rules:102: build-arch-stamp] Error 1
make[1]: Leaving directory '/root/iomemory-vsl'
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
make: *** [Makefile:16: dpkg] Error 2

{2417A3B6-DD43-450A-B4C2-B021C4B0E50B}

@TheBoroer
Copy link
Author

I didn't have to make any kernel changes to get it to work. I think truenas included some patches in this version that makes dmks fail.

Did you install all the extra stuff from the notes in step1?
Can you post more of the command output? There might be more errors above the snippet you posted

@zinkscott
Copy link

zinkscott commented Dec 8, 2024

Yeah, I did everything in step 1 :(
install-dev-tools && chmod +x /bin/apt* && chmod +x /usr/bin/dpkg* && apt-get update && apt-get install build-essential make dkms debhelper -y && git clone https://github.com/RemixVSL/iomemory-vsl.git && cd iomemory-vsl/ && make dpkg > dpkg.txt < running as root

dpkg.txt:

cd root/usr/src/iomemory-vsl-3.2.16 && \
  		make clean
make[1]: Entering directory '/root/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16'
FIOCC is cc
make \
        -j4 \
	-C /lib/modules/6.6.44-production+truenas/build \
	FIO_DRIVER_NAME=iomemory-vsl \
	FUSION_DRIVER_DIR=/root/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16 \
	M=/root/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16 \
	EXTRA_CFLAGS+="-I/root/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16/include -DBUILDING_MODULE -DLINUX_IO_SCHED -Wall -Werror" \
	KFIO_LIB=kfio/x86_64_cc122_libkfio.o_shipped \
	clean
make[2]: Entering directory '/usr/src/linux-headers-6.6.44-production+truenas'
make[2]: Leaving directory '/usr/src/linux-headers-6.6.44-production+truenas'
rm -rf include/fio/port/linux/kfio_config.h kfio_config
make[1]: Leaving directory '/root/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16'
cd root/usr/src/iomemory-vsl-3.2.16 && \
	make patch_module_version
make[1]: Entering directory '/root/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16'
FIOCC is cc

Adding module version 6.6.44-7357717-3.2.16 to source license.c

make[1]: Leaving directory '/root/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16'
# patch fio_version, fio_short_version in debian/fio_values
cd /root/iomemory-vsl && \
	dpkg-buildpackage -rfakeroot --no-check-builddeps --no-sign
�[1mdpkg-buildpackage: �[0m�[32minfo�[0m: source package iomemory-vsl
�[1mdpkg-buildpackage: �[0m�[32minfo�[0m: source version 3.2.16.1732
�[1mdpkg-buildpackage: �[0m�[32minfo�[0m: source distribution unstable
�[1mdpkg-buildpackage: �[0m�[32minfo�[0m: source changed by Support <support@fusionio.com>
�[1mdpkg-buildpackage: �[0m�[32minfo�[0m: host architecture amd64
make[1]: Entering directory '/root/iomemory-vsl'
dh_testdir
dh_testroot
rm -f build-arch-stamp configure-stamp
# Add here commands to clean up after the build process.
#/usr/bin/make clean
rm -rf \
	"/root/iomemory-vsl/driver_source" \
	"/root/iomemory-vsl/debian/fio" \
	"/root/iomemory-vsl/debian/iomemory-vsl-6.6.44-production+truenas"* \
	"/root/iomemory-vsl/debian/iomemory-vsl-6.6.44-production+truenas"*
sed -r -i -e 's/^Package: iomemory-vsl(-config)?(-[.0-9]+.*)*$/Package: iomemory-vsl\1/;' debian/control
dh_prep
make[1]: Leaving directory '/root/iomemory-vsl'
�[1mdpkg-source: �[0m�[32minfo�[0m: using source format '1.0'
�[1mdpkg-source: �[0m�[32minfo�[0m: building iomemory-vsl in iomemory-vsl_3.2.16.1732.tar.gz
�[1mdpkg-source: �[0m�[32minfo�[0m: building iomemory-vsl in iomemory-vsl_3.2.16.1732.dsc
make[1]: Entering directory '/root/iomemory-vsl'
sed -r -i -e 's/^Package: iomemory-vsl(-config|-di|-initrd)?(-[.0-9]+.*)*$/Package: iomemory-vsl\1-6.6.44-production+truenas/;' debian/control
set -e; \
for file in /root/iomemory-vsl/debian/iomemory-vsl.* /root/iomemory-vsl/debian/iomemory-vsl-di.* /root/iomemory-vsl/debian/iomemory-vsl-initrd.*; do \
	new_file=$(echo $file | sed -r -e -E 's/iomemory-vsl(-config|-di|-initrd)?\./iomemory-vsl\1-6.6.44-production+truenas./;'); \
	cp "$file" "$new_file"; \
done
# Add the kernel version to our UEFI Ubuntu driver injection disk
sed -r -i -e 's/^XB-Kernel-Version:.*/XB-Kernel-Version: 6.6.44-production+truenas/;' debian/control
cp -r /root/iomemory-vsl/debian/iomemory-vsl.postinst "/root/iomemory-vsl/debian/iomemory-vsl-6.6.44-production+truenas.postinst"
echo depmod 6.6.44-production+truenas >> "/root/iomemory-vsl/debian/iomemory-vsl-6.6.44-production+truenas.postinst"
cp -r /root/iomemory-vsl/debian/iomemory-vsl.postrm "/root/iomemory-vsl/debian/iomemory-vsl-6.6.44-production+truenas.postrm"
cp -r /root/iomemory-vsl/debian/iomemory-vsl.prerm "/root/iomemory-vsl/debian/iomemory-vsl-6.6.44-production+truenas.prerm"
echo depmod 6.6.44-production+truenas >> "/root/iomemory-vsl/debian/iomemory-vsl-6.6.44-production+truenas.postrm"
dh_testdir
# Add here commands to configure the package.
touch configure-stamp
# Add here commands to compile the arch part of the package.
rsync -a --delete ./root//usr/src/iomemory-vsl-3.2.16/ driver_source/
if ! /usr/bin/make \
	-C driver_source \
	KERNELVER=6.6.44-production+truenas \
	FIO_DRIVER_NAME=iomemory-vsl \
	 \
	modules; then \
	printf "ERROR:\n"; \
	exit 1; \
fi
make[2]: Entering directory '/root/iomemory-vsl/driver_source'
FIOCC is cc
if [ "122" -gt "74" ];then \
	if [ ! -f "kfio/x86_64_cc122_libkfio.o_shipped" ];then \
		cp kfio/x86_64_cc74_libkfio.o_shipped kfio/x86_64_cc122_libkfio.o_shipped; \
	fi \
fi
./kfio_config.sh -a x86_64 -o include/fio/port/linux/kfio_config.h -k /lib/modules/6.6.44-production+truenas/build -p -d /root/iomemory-vsl/driver_source/kfio_config -l 0 -s /lib/modules/6.6.44-production+truenas/source
Detecting Kernel Flags
Config dir         : /root/iomemory-vsl/driver_source/kfio_config
Output file        : include/fio/port/linux/kfio_config.h
Kernel output dir  : /lib/modules/6.6.44-production+truenas/build
Kernel source dir  : /lib/modules/6.6.44-production+truenas/build
Starting tests:
  1733627562.123  KFIOC_X_HANDLE_SYSRQ_IS_U8...
  1733627562.211  KFIOC_X_BDOPS_OPEN_GENDISK_AND_BLK_MODE_T...
  1733627562.334  KFIOC_X_BDOPS_RELEASE_1_ARG...
  1733627562.460  KFIOC_X_CAPS_PDE_DATA...
  1733627562.550  KFIOC_X_BIO_SPLIT_TO_LIMITS...
  1733627562.650  KFIOC_X_PROC_CREATE_DATA_WANTS_PROC_OPS...
  1733627562.751  KFIOC_X_TASK_HAS_CPUS_MASK...
  1733627562.859  KFIOC_X_BLK_ALLOC_QUEUE_NODE_EXISTS...
  1733627562.972  KFIOC_X_BLK_ALLOC_QUEUE_EXISTS...
  1733627563.079  KFIOC_X_BLK_ALLOC_DISK_EXISTS...
  1733627563.195  KFIOC_X_BLK_ALLOC_DISK_HAS_QUEUE_LIMITS...
  1733627563.951  KFIOC_X_HAS_MAKE_REQUEST_FN...
  1733627564.089  KFIOC_X_GENHD_PART0_IS_A_POINTER...
  1733627564.798  KFIOC_X_BIO_HAS_BI_BDEV...
  1733627564.921  KFIOC_X_SUBMIT_BIO_RETURNS_BLK_QC_T...
  1733627565.043  KFIOC_X_VOID_ADD_DISK...
  1733627565.660  KFIOC_X_DISK_HAS_OPEN_MUTEX...
Started tests, waiting for completions...
  1733627566.809  KFIOC_X_HANDLE_SYSRQ_IS_U8=0
  1733627567.003  KFIOC_X_BDOPS_OPEN_GENDISK_AND_BLK_MODE_T=0
  1733627567.835  KFIOC_X_BDOPS_RELEASE_1_ARG=0
  1733627568.638  KFIOC_X_CAPS_PDE_DATA=0
  1733627569.521  KFIOC_X_BIO_SPLIT_TO_LIMITS=0
  1733627569.678  KFIOC_X_PROC_CREATE_DATA_WANTS_PROC_OPS=0
  1733627569.822  KFIOC_X_TASK_HAS_CPUS_MASK=0
  1733627572.108  KFIOC_X_BLK_ALLOC_QUEUE_NODE_EXISTS=0
  1733627572.919  KFIOC_X_BLK_ALLOC_QUEUE_EXISTS=0
  1733627573.022  KFIOC_X_BLK_ALLOC_DISK_EXISTS=0
  1733627574.346  KFIOC_X_BLK_ALLOC_DISK_HAS_QUEUE_LIMITS=0
  1733627575.719  KFIOC_X_HAS_MAKE_REQUEST_FN=0
  1733627575.766  KFIOC_X_GENHD_PART0_IS_A_POINTER=0
  1733627576.628  KFIOC_X_BIO_HAS_BI_BDEV=0
  1733627577.316  KFIOC_X_SUBMIT_BIO_RETURNS_BLK_QC_T=0
  1733627577.352  KFIOC_X_VOID_ADD_DISK=0
  1733627577.407  KFIOC_X_DISK_HAS_OPEN_MUTEX=0
Finished
1733627577.426  Exiting
Preserving configdir due to '-p' option: /root/iomemory-vsl/driver_source/kfio_config

Adding module version 6.6.44-7357717-driver_source to source license.c

/usr/bin/make \
    -j4 \
-C /lib/modules/6.6.44-production+truenas/build \
FIO_DRIVER_NAME=iomemory-vsl \
FUSION_DRIVER_DIR=/root/iomemory-vsl/driver_source \
M=/root/iomemory-vsl/driver_source \
EXTRA_CFLAGS+="-I/root/iomemory-vsl/driver_source/include -DBUILDING_MODULE -DLINUX_IO_SCHED -Wall -Werror" \
INSTALL_MOD_DIR=extra/fio \
INSTALL_MOD_PATH= \
KFIO_LIB=kfio/x86_64_cc122_libkfio.o_shipped \
modules
make[3]: Entering directory '/usr/src/linux-headers-6.6.44-production+truenas'
make[3]: Leaving directory '/usr/src/linux-headers-6.6.44-production+truenas'
make[2]: Leaving directory '/root/iomemory-vsl/driver_source'
ERROR:
make[1]: Leaving directory '/root/iomemory-vsl'

@TheBoroer
Copy link
Author

TheBoroer commented Dec 8, 2024

hmmm i can't see anything wrong.

Can you try downloading and installing my .deb on your truenas since we're the same version (assuming you're not on an arm-based cpu)?
I've uploaded it here: https://github.com/TheBoroer/iomemory-vsl-debs/tree/main

  • to download it: curl -O https://github.com/TheBoroer/iomemory-vsl-debs/raw/refs/heads/main/iomemory-vsl-6.6.44-production+truenas_3.2.16.1732_amd64.deb
  • then install it via dpgk -i iomemory-vsl-6.6.44-production+truenas_3.2.16.1732_amd64.deb
  • then reboot

@zinkscott
Copy link

zinkscott commented Dec 8, 2024

That fails to install for me :( did a reboot and another try for good measure
I have dual Intel(R) Xeon(R) CPU E5-2680 v2s

I spun up a 24.10 VM and was able to make dpkg and install. Guess there is something broken with my TrueNAS install. But confirmed the steps work!

@zinkscott
Copy link

image

@TheBoroer
Copy link
Author

Thanks for confirming this works on a new 24.10 install!

It's still odd that neither the steps or the .deb i sent above install for you.
What's the error you get when you try to install my .deb?

@misel86
Copy link

misel86 commented Dec 11, 2024

Confirmed, make dpkg works for 24.10

@cgg507
Copy link

cgg507 commented Dec 12, 2024

Thanks for confirming this works on a new 24.10 install!

It's still odd that neither the steps or the .deb i sent above install for you. What's the error you get when you try to install my .deb?

I think I'm on the same boat as @zinkscott . make dpkg refuses to build a .deb file successfully, and I cannot install the provided .deb file.
Also, I do confirm that spawning a fresh 24.10.0.2 installation works like a charm and builds the dpkg without following anything besides the steps you provided on Step1.

However, I'd like to have my current installation working as I have the feeling that down the road this might be useful.

dpkg -i with the .deb file provided by you @TheBoroer fails with the following error:

root@truenas-scale[/opt]# dpkg -i ./iomemory-vsl-6.6.44-production+truenas_3.2.16.1732_amd64.deb
Selecting previously unselected package iomemory-vsl-6.6.44-production+truenas.
(Reading database ... 106980 files and directories currently installed.)
Preparing to unpack .../iomemory-vsl-6.6.44-production+truenas_3.2.16.1732_amd64.deb ...
Unpacking iomemory-vsl-6.6.44-production+truenas (3.2.16.1732) over (3.2.16.1732) ...
Setting up iomemory-vsl-6.6.44-production+truenas (3.2.16.1732) ...
sudo: process 20738 unexpected status 0x57f
dpkg: error processing package iomemory-vsl-6.6.44-production+truenas (--install):
 installed iomemory-vsl-6.6.44-production+truenas package post-installation script subprocess was killed by signal (Killed)
Errors were encountered while processing:
 iomemory-vsl-6.6.44-production+truenas

I've traced the issue down to the dpkg process trying to execute the following control script

"runargv":["/var/lib/dpkg/info/iomemory-vsl-6.6.44-production+truenas.postinst","configure",""]

However, since the control script is missing the shebang, it'd fail miserably. I can replicate the issue as follows:

root@truenas-scale[/var/lib/dpkg/info]# ./iomemory-vsl-6.6.44-production+truenas.postinst
sudo: process 20821 unexpected status 0x57f
zsh: killed     ./iomemory-vsl-6.6.44-production+truenas.postinst

If I manually add the shebang it'd not complain and proceed, however I'm clueless on how to change the control script files inside your provided .deb, and why does it need to be changed, and not on other Scale 24.10.0.2 systems/VMs.

file contents for comparison

root@truenas-scale[/var/lib/dpkg/info]# cat iomemory-vsl-6.6.44-production+truenas.postinst
depmod 6.6.44-production+truenas

Hopefully this also helps finding a clue why make dpkg fails on this system as well.

@zinkscott
Copy link

zinkscott commented Dec 12, 2024

Was able to alter and rebuild and install the .deb with the following:

mkdir temp_deb
cd temp_deb
ar p ../iomemory-vsl-debs/iomemory-vsl-6.6.44-production+truenas_3.2.16.1732_amd64.deb control.tar.xz | tar -xJf -
ar p ../iomemory-vsl-debs/iomemory-vsl-6.6.44-production+truenas_3.2.16.1732_amd64.deb data.tar.xz | tar -xJf -
echo "2.0" > debian-binary
nano postinst
nano postrm
nano prerm
tar -cJf control.tar.xz *
ar -r ../iomemory-vsl-modified.deb debian-binary control.tar.xz data.tar.xz
dpkg -i ../iomemory-vsl-modified.deb
cd ..
rm -rf temp_deb

Need to reboot still.

EDIT: Nanos were adding #!/bin/bash

@zinkscott
Copy link

It works!
{3B3E270D-0765-4832-AA81-CA0DABD73A09}

@cgg507
Copy link

cgg507 commented Dec 13, 2024

The answer has been basically looking at me this whole time. In order to have make dpkg work, and to avoid adding the shebang (#!/bin/bash) manually in the deb packages scripts, you need to be logged in as root, not sudo'ing into root.

I've been trying to make dpkg and install the provided package logging into the system via SSH using my admin account, then sudo su. Even though you adquire root access, certain things seem to misbehave regarding the default shell interpreter (I suspect some environment variables do not get populated using this method) with the issues I've been suffering, and that pushed @zinkscott into manually unpacking and repacking @TheBoroer 's .deb file.

If you SSH into the system using your admin account, then su - root into "root" (requires to set a password for the root account using the UI, beforehand), you get all the environment variables (and God knows what else) but this allows to successfully compile the .deb package and/or directly install the provided .deb file by @TheBoroer

The reason why spinning a new, blank VM from scratch worked out for me, is that out of laziness I did not SSH into that VM, rather used the hypervisor's virtual console to issue all my commands, which logged me directly into root.

Hopefully this helps somebody in case they bump into an issue similar to mine. Thanks for all the support.

admin@truenas-scale[~]$ cat /etc/version
24.10.0.2%                                                                                                    
admin@truenas-scale[~]$ ls /dev/fct*
/dev/fct0  /dev/fct1
admin@truenas-scale[~]$

@zinkscott
Copy link

zinkscott commented Dec 13, 2024

There was a change in 24.10 that removed the ability to sudo su -
https://ixsystems.atlassian.net/browse/NAS-131540
I ran su - and entered my admin password and was able to make module

make dpkg fails, but different:
{FBB605F7-575F-4985-AE0C-18B1C44DDFC2}

@cgg507
Copy link

cgg507 commented Dec 13, 2024

Only thing that calls my attention is that somehow the dpkg-genbuildinfo stage wants to find a file that should be generated if you were running an old kernel version from TrueNAS 22.12.3 I believe. Perhaps delete the whole folder and re-cloning from source will help?

image

This is from a forum entry

image

@cgg507
Copy link

cgg507 commented Dec 13, 2024

You are literally two steps away from a successful compile.

image

Looking into iomemory-vsl_3.2.16.1732_amd64.buildinfo, seems like it contains checksums of all generated files. Perhaps deleting this file and have the make process rebuild it might help, just brainstorming here.

root@truenas-scale[/opt]# cat iomemory-vsl_3.2.16.1732_amd64.buildinfo | grep 6.6.44
Binary: iomemory-vsl-6.6.44-production+truenas iomemory-vsl-config-6.6.44-production+truenas iomemory-vsl-di-6.6.44-production+truenas iomemory-vsl-initrd-6.6.44-production+truenas iomemory-vsl-source
 1edd9e0e3542ad2621f9b592af0de81c 1346268 iomemory-vsl-6.6.44-production+truenas_3.2.16.1732_amd64.deb
 5a48ec6e68c48702b936737353e6a5d8 11988 iomemory-vsl-config-6.6.44-production+truenas_3.2.16.1732_amd64.deb
 3fb7412f4ab5771ddab9f68438e99e88 983468 iomemory-vsl-di-6.6.44-production+truenas_3.2.16.1732_amd64.udeb
 c7534d5a31b0e5f17ebaff707ae46033 9632 iomemory-vsl-initrd-6.6.44-production+truenas_3.2.16.1732_amd64.deb
 35e2c1848c3bd15cf03ba0d3a9a9a48dbe97a317 1346268 iomemory-vsl-6.6.44-production+truenas_3.2.16.1732_amd64.deb
 e1060373e981a808ac3f226cbe496748aae4c2d7 11988 iomemory-vsl-config-6.6.44-production+truenas_3.2.16.1732_amd64.deb
 1bee66dfbcfc1906f4f2393e56b4e68b361ddf88 983468 iomemory-vsl-di-6.6.44-production+truenas_3.2.16.1732_amd64.udeb
 f5a504957cb80e6d9ba935a4ff7e1523cb9caba6 9632 iomemory-vsl-initrd-6.6.44-production+truenas_3.2.16.1732_amd64.deb
 7b3e1d893c6a50b1a2d0a205ad05e06eca1a924246d8b317c687c7f260046573 1346268 iomemory-vsl-6.6.44-production+truenas_3.2.16.1732_amd64.deb
 c44c54d673e82898abad6132ab0a63ac1388f3a16df492d859bb037ad5e0ed36 11988 iomemory-vsl-config-6.6.44-production+truenas_3.2.16.1732_amd64.deb
 11e1e0808ab2c2bc91b9c685764ce5846191cb95d70ecbb828aa2c77f8da7fc5 983468 iomemory-vsl-di-6.6.44-production+truenas_3.2.16.1732_amd64.udeb
 c989639618ef91dc44d18851c3b560329e3b7cea26936d759f7679eaf743ff9b 9632 iomemory-vsl-initrd-6.6.44-production+truenas_3.2.16.1732_amd64.deb
 linux-headers-truenas-debug-amd64 (= 6.6.44-debug+truenas-1),
 linux-headers-truenas-production-amd64 (= 6.6.44-production+truenas-1),
 linux-truenas-production-libc-dev (= 6.6.44-production+truenas-1),

@cgg507
Copy link

cgg507 commented Dec 19, 2024

make dpkg method working in 24.10.1 as well

root@truenas-scale[~]# fio-status -a | grep fct
          fct0: Product Number:F00-001-1T20-CS-0001, SN:1228D2326
fct0    Attached
          fct1: Product Number:F00-001-1T20-CS-0001, SN:1206D3608
fct1    Attached
root@truenas-scale[~]# cat /etc/version
24.10.1
#      

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment