Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ZFS SLOG + L2ARC on one device

Featured Replies

Is it somehow possible in Unraid to put ZFS SLOG and L2ARC on the same SSD (Optane P1600x 118GB).

I am using it as just a SLOG rn and it's barely using any space.

I believe this is possible on TrueNas but not sure if possible to do this on Unraid.

My workload involves a lot of Databases so need the SLOG. Adding the SLOG makes almost a 10x difference.

I have also maxed out my RAM for the ARC.

Edited by seamon

Solved by seamon

  • Author
  • Solution

Okay I figured out a dirty way to do this.

Follow this guide to partition your Optane Drive into 2 Partition (I did 10GB for SLOG and 100GB for L2ARC).

SLOG is /dev/nvme0n1p1 and L2ARC is /dev/nvme0n1p2

You can't start the array with SLOG and L2ARC enabled, they have to be added after array is started so I created a User Script that runs at Array Startup.

zfs set compression=lz4 cache #zfs compression gets sets to on instead of lz4, this step is optional

zpool add cache log /dev/nvme0n1p1

zpool add cache cache /dev/nvme0n1p2

At Array Shutdown, the vdevs have to be removed.

zpool import cache #if unraid was improperly shutdown, this script will instead import the zpool, remove and support vdevs and then you have to restart unraid again to make this work.

zpool remove cache /dev/nvme0n1p1

zpool remove cache /dev/nvme0n1p2

Any help in refining this further would be appreciated.

Edited by seamon

  • Community Expert

Unraid is entirely based on "one thing per drive" so you'll likely have to stick with that.

  • Author
43 minutes ago, Kilrah said:

Unraid is entirely based on "one thing per drive" so you'll likely have to stick with that.

But my solution works!

  • Community Expert
11 hours ago, seamon said:

But my solution works!

Yes, but I would not expect Unraid to ever support that configuration via the GUI so you will have to keep your script without a way to 'tidy' up.

  • Author
4 hours ago, itimpi said:

Yes, but I would not expect Unraid to ever support that configuration via the GUI so you will have to keep your script without a way to 'tidy' up.

I feel like that's Unraid in a nutshell with regard to a lot of other things over the years.

12 minutes ago, seamon said:

I feel like that's Unraid in a nutshell with regard to a lot of other things over the years.

Well you've got a niche setup, that calls for a niche solution. ;-)

  • Author

I improved the scripts a little bit more:

On Array Startup

ls /mnt/cache

if [ $? -ne 0 ]

then

echo "ERROR: Unsafe Shutdown detected!"

zpool import cache

sleep 15s

zpool remove cache /dev/nvme0n1p1

zpool remove cache /dev/nvme0n1p2

shutdown -r now

else

echo "All operations normal!"

zfs set compression=lz4 cache

zpool add cache log /dev/nvme0n1p1

zpool add cache cache /dev/nvme0n1p2

fi

On Array shutdown

zpool remove cache /dev/nvme0n1p1

zpool remove cache /dev/nvme0n1p2

Also, note that each time a log device is removed from a zpool, it leaves a hole vdev in its place. This can be viewed with 'zdb -C'. This apparently is normal behavior for ZFS and completely harmless. It's just tracking vdev removals.

Edited by seamon

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.