Skip to content

Repository files navigation

truenas-sd-tools

This project provides tools to enhance using SD Cards on TrueNAS systems.

It can automatically perform a backup of any SD Card inserted into a known SD Card slot on your TrueNAS. The backups are store into a known location and named as follows.

<BACKUP_LOCATION>/<SD_CARD_LABEL>/sdcard_backup_<SD_CARD_LABEL>_<DATE_TIME>.img

Optionally it can control the AOOSTAR Monitoring Screen, present on the AOOSTER WTR MAX.

The tool aoostar-rs is included to show status updates on the AOOSTER WTR Max display.

Also, if you want to turn off the Monitoring Screen on Startup, see instructions below.

NOTE: This software might work on other server-based installations, but has not been tested. So use at your own risk.

Installation

From the TrueNAS Shell, perform the following...

  1. Download the docker-compose.yaml file
curl -o compose.yaml https://raw.githubusercontent.com/scruffy359/truenas-sd-tools/refs/heads/main/docker-compose.yaml
  1. Create a directory where you want backups to be stored.
mkdir -p <backup-directory>

For example:

mkdir -p /mnt/Data/backups-sd
  1. Edit the compose.yaml and change environment variables for your deployment.
Variable Description
DISPLAY_STATUS If your hardware supports the AOOSTAR Status Display, set this to aoostar-rs.
SD_LOGICAL_DEV_NAME The logical PCI device names which points to your SD Card device.
TZ Installation timezone.
  1. Edit the volumes and change <your-backup-directory> to the path you create earlier.

  2. Install via Docker Compose

sudo docker compose up -d

Building

The docker image must be built to run on multiple platforms in order for asterctl and aster-sysinfo CLI tools to execute correctly on ARM64 and AMD64 systems.

The build script pulls the latest aoostar-rs code for building and inclusion in the docker image.

sh ./build/build.sh

Testing

You can manually test the image locally.

docker run -it --privileged --rm truenas-sd-tools

TrueNAS support

The Docker instances must be executed with --privileged in order for devices to be visible/accessible within the Container.

Installation

From the TrueNAS Shell, perform the following steps...

  1. Create a location for storing your SD Card backups.
sudo mkdir -p /mnt/Data/backups-sd
  1. Pull the image from the Docker Hub repository.
sudo docker pull scruffy359/truenas-sd-tools

Manually running commands

Turn off Monitoring Screen

sudo docker run -it --privileged --rm scruffy359/truenas-sd-tools ./aooster-rs/asterctl --off

Running SD Card backup interactively

sudo docker run -it --privileged --rm -v /dev/disk/by-path:/dev/disk/by-path:ro
-v <backup-location>:/mnt/backups scruffy359/truenas-sd-tools

Setup turning off display at startup

  1. Log in to the TrueNAS web interface.

  2. Navigate to System > Advanced Settings > Init/Shutdown Scripts and click the ADD button.

  3. Configure the following options:

    1. Description: Enter a brief description for the task. (e.g. Turn off Screen Display)
    2. Type: Select 'Command'.
    3. Command: type of "off" docker command from above.
    4. When: Choose 'Post Init'
    5. Enabled: Ensure this checkbox is selected to activate the task.
    6. Timeout: Optionally, set a timeout in seconds for how long the command or script can run before it is automatically stopped.
  4. Click Save.

About

SD Card tools for TrueNAS

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages