Syslog to NTFS Kingston Card Reader Unassigned Device


Recommended Posts

I have a special use case which may apply to few unRAID users, but I will document it here in case it is useful to others.

 

I want to write my syslog to a location other than those officially supported by the syslog server.  Although I am using a card reader, this should work with any Unassigned Devices location.

 

Caveat:  Officially, unRAID does not support card readers as boot flash devices.  Don't tell Limetech, but I and others have been doing this for years 😁. In fact, here is a forum discussion of card readers that have unique GUIDs and work with unRAID.   This solution involves using an available card slot in the card reader and a flash card as an unassigned device.  Theoretically, this will work with any card reader with an empty slot and not just the particular Kingston card reader I am using.

 

By default, the Syslog must be written to an existing share on unRAID with the option to mirror it to the boot flash drive if you need to do some troubleshooting. Alternatively, you can write it to a remote syslog server.  It is not recommended to have the syslog mirrored to the boot flash drive constantly as that could result in a lot of writes to the flash drive and you don't want unnecessary wear and tear on your boot flash.

 

If your server will not boot, writing to a share won't do you much good as you will not be able to access the syslog.

 

With some tweaking of the config files, you can get the syslog mirrored to an unassigned device.  This has already been documented.

 

What I want to accomplish:  Use the unused Micro SD card slot in my Kingston MobileLite G2 card reader as a location to which to write the syslog.  The SD card slot is currently used as the flash drive from which unRAID boots.  If I can do this, I never need to mirror the syslog to the boot flash drive.  NOTE: this card reader is no longer available (perhaps on eBay) but it has a unique GUID and is USB 2.0 which is preferred for unRAID.  I also have the MobileLite G3 USB 3.0 version in another server and it works great.  Other versions of this card reader do not have a unique GUID.

 

Keep in mind, this flash drive will count against the drive total in your unRAID license as it will be an Unassigned Device that is attached at the time the array starts.  It counts even if the Micro SD slot is empty!  Might as well use it for something.

 

I have been using the Kingston reader as my boot flash drive for 10 years.  It's great as the GUID is associated with the reader, and I can swap flash cards to my heart's content to test different unRAID configurations and troubleshoot. If the flash card fails, I just copy a backup onto a new flash card with no need to license a new flash drive.  The Micro SD slot has always been unused and has showed up as an unassigned device.

 

Steps to make this work:

  1.  Format a Micro SD card as an NTFS partition (I gave the card the label "SYSLOG").  You could do FAT32 like with the boot drive as well.  I had a spare 32GB Micro SD card and I chose to format it as NTFS as this is supported by Unassigned devices and makes it directly readable in Windows as is FAT32.  If the server won't boot, I can just remove the card from the reader and view the syslog in Windows or post it to the forums for help.  Of course, you could also do this with the boot flash drive if you mirrored the syslog there, but I want to avoid that.
  2. Put the card in the reader and mount it as an Unassigned Device in unRAID.  As seen below, the boot flash is in the SD slot and I now have the SYSLOG card in the Micro SD slot. Yes, the flash drive is public (not recommended) while I did this.image.png.6e5b89a240d90a475a8c79fd5b82f770.png
  3. Edit the Unassigned Device (UD) settings to enable automount and sharing:image.png.6e7ca8e6166705ad1d731f7553e60fe8.png
  4. Modify the syslog config files on the boot flash drive to point to the UD location:
    • Change the server_folder line in /boot/config/rsyslog.cfg to point to the UD location:
      • server_folder="/mnt/disks/SYSLOG/"
    • In rsyslog.conf, change the $template remote variable to point to the UD location:
      • $template remote,"/mnt/disks/SYSLOG//syslog-%FROMHOST-IP%.log"
  5. If you want to preserve your existing syslog info, copy syslog-[ip address of server].log from the current location to the UD location.
  6. Disable and then Enable the syslog server to restart it and force it to read the new config.  The local syslog folder should now show <custom>image.thumb.png.c4804241ae554cc5aa136558d2b7058d.png
  7. If you want to test that syslog is now writing to the new location, log out of the GUI and log back in.  This should be recorded in the syslog in the UD location.

 

UPDATE: To make all of the above work properly, I found it necessary to run a user script that restarts the syslog server after the array starts on a server reboot.   This script contains the following:

#!/bin/bash
/etc/rc.d/rc.rsyslogd restart

 

Setting it up to run on array start makes it all automatic so you can set it and forget it.

 

Celebrate your success in writing the syslog to a removable and replaceable UD location that does not hammer your boot flash drive and does not use an unRAID share.

Edited by Hoopster
  • Like 2
  • Thanks 2
  • Upvote 2
Link to comment

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.