Skip to content

Category: Servers

Unraid – can’t mount shares via NFS

Lately, I’ve had problems mounting shares on a different Unraid server. It seems that sometimes, when doing parity rebuilds or stopping and starting the array multiple times, NFS stops working. The web UI doesn’t let you know this is happening and doesn’t reflect on there.

So… I open up a terminal and enter this command to restart NFS.

 /usr/local/etc/rc.d/rc.nfsd restart
Leave a Comment

Plex + Unraid + AMD GPU Transcoding

While moving/upgrading stuff I temporarily had to use 2 GPUs on my server; however, I want to use the AMD GPU to transcode now that it’s somewhat supported.

Using the Plex template from lscr.io/linuxserver/plex

I added a device variable called

Config 1 – card0 is my AMD GPU

Name: /dev/dri

Value: /dev/dri/card0

Config 2 – /dev/dri/renderD128

Name: whatever, called it “AMD”

Value: /dev/dri/renderD128


I was able to put some load on it by watching Live TV.

Don’t forget to install Radeon-TOP.

Leave a Comment

How to shutdown a second or additional server from one Unraid machine

Found this interesting post that helped me set it up.

https://forums.unraid.net/topic/53944-how-to-shutdown-2-servers-on-1-ups

Yes, if you are using the unraid stock ups software (apcupsd). On the slave server set the cable type to Ether, the ups type to Net, and the device to <master_server_name_or_ip>:3551

Make SURE that the conditions to shutdown are set to keep the master on long enough to allow the slave server to shutdown first.

Personally, I have the master machine set to shut down after 300 seconds on battery, and the slave after 270 seconds. If the power around here is off more than a minute, it’s going to be out a while.

BTW, this also works for VM’s. I have apcupsd set up in all my VM’s to initiate shutdown after 60 seconds of no power, so they have plenty of time to finish up what they are doing and shutdown cleanly before unraid pulls the rug out from under them

Leave a Comment

bash script to clean up directories

#!/bin/bash
# Define the directory to search (you can change this to the desired directory)
DIR="/temp"

# Array of file extensions to delete
EXTENSIONS=("*.txt" "*.srt" "*.nzb" "*.sup" "*.ac3" "*.dts" "*.sample.*" "*.srr")

# Counters for deleted files and directories
deleted_files=0
deleted_directories=0

# Loop through the array and delete the files, counting each deletion
for EXT in "${EXTENSIONS[@]}"; do
    count=$(find "$DIR" -type f -name "$EXT" -print -delete | wc -l)
    deleted_files=$((deleted_files + count))
done

# Find and delete empty directories, counting each deletion
count=$(find "$DIR" -type d -empty -print -delete | wc -l)
deleted_directories=$((deleted_directories + count))

# Output the counts
echo "Deleted $deleted_files files with extensions ${EXTENSIONS[*]}."
echo "Deleted $deleted_directories empty directories."

For the most up-to-date version, follow the links below.

https://snippets.cacher.io/snippet/b554e570d8ffc0431ad9

https://gist.github.com/xavier-hernandez/f4979b4ce174068ce5428a26ae08be32

Leave a Comment

Unraid BTRFS Issues

One of my BTRFS pools, which was RAID 1 corrupted and wouldn’t mount.

I want to say docker updates overloaded the size of the docker file.

I probably did this all wrong, but I got a lot of the data from it, so I provided some commands that might help others in the future.

Make sure to put Unraid into maintenance mode.

Below are just examples since I didn’t record exactly what I did.

To mount the degraded RAID configuration. Choose the primary partition/drive to mount somewhere.

#mount degraded RAID
mount -o degraded /dev/mapper/[partition] /mnt

# to unmount
umount /mnt

To check the filesystem and hopefully fix the filesystem issue.

#shows you the filesystem
btrfs fi show /dev/sdd

#starts the scrub process
btrfs scrub start /mnt

#checks the scrub process status
btrfs scrub status /mnt

You can also use this to monitor the status instead of running the last line above over and over again.

#this will check the status of the scrub every second

watch -n 1 btrfs scrub status /mnt

I was told not to use this since it might screw up the filesystem, but my filesystem was already screwed up 🙂 This checks and tries to repair the filesystem.

btrfs check --repair /dev/sdd
Leave a Comment

Unraid – Unmountable: Volume not encrypted

So I got this error on my Unraid server for a drive, “Unmountable: Volume not encrypted” for a drive I had used on another server. There was nothing on the drive I wanted so I just wanted to overwrite or format it.

Finally found a link to just overwrite the filesystem.

https://unix.stackexchange.com/questions/315063/mount-wrong-fs-type-bad-option-bad-superblock

mkfs.ext4 /dev/sXXX

Leave a Comment

All of my RAM is not showing up in Unraid

So I bought some RAM recently in one of those bins on clearance because it was opened, etc. I installed it with another two sticks I already had. All four sticks are DDR4, of course, but the old ones were 2x8GB 26666, and the new ones are 2×16 GB 3200. Unraid would only show 16GB usable rather than the 48GB. Unraid did notice them, but they were unable to be used.

After some googling which didn’t get me anywhere, I decided to remove all the sticks and just use the new ones in A2 and B2. Well, now Unraid shows 32GB of RAM usable. So next, I put in the other two sticks in A1 and B1. Boom!!! Now it can use all 48GB. I assume it has to do with a mismatch in either speed or capacity.

Motherboard: Asrock B450M Pro4

Leave a Comment

traefik v3 example with uptime-kuma

Here is an example of Traefik, using Uptime-Kuma as an example with a domain for it plus using letsencrypt to secure the domain. We also redirect HTTP to HTTPS.

The Traefik dashboard is not secure, so please implement security or a firewall.

This is just an example.

version: "3"

services:
 uk1:
    image: louislam/uptime-kuma:1
    container_name: uk1
    volumes:
      - ./uk1-data:/app/data
    ports:
      - 3001:3001  # <Host Port>:<Container Port>
    restart: always
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.uk1.tls.certresolver=myresolver"
      - "traefik.http.routers.uk1-http.entrypoints=web"
      - "traefik.http.routers.uk1-http.rule=Host(`your_domain_here`)"
      - "traefik.http.routers.uk1-http.middlewares=uk1-https"
      - "traefik.http.middlewares.uk1-https.redirectscheme.scheme=https"
      - "traefik.http.routers.uk1.entrypoints=websecure"
      - "traefik.http.routers.uk1.rule=Host(`your_domain_here`)"
      - "traefik.http.routers.uk1.tls=true"
    depends_on:
      - traefik
 traefik:
  image: traefik:v3.0
  command:
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.myresolver.acme.httpchallenge=true"
      - "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"
      - "--certificatesresolvers.myresolver.acme.email=your_email_address_here"
      - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
  ports:
    - 80:80
    - 443:443
    - 8080:8080
  volumes:
    - "./letsencrypt:/letsencrypt"
    - /var/run/docker.sock:/var/run/docker.sock

https://gist.github.com/xavier-hernandez/48042d5cdb66a89ac5e92a92ecfeb7b5

Leave a Comment

Install dotnet core on Ubuntu 22.04

These are the steps I used to install dotnet core on Ubuntu 22.04, both the SDK and the runtime.

apt update
apt install -y apt-transport-https
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
apt update
apt install -y dotnet-sdk-7.0
apt update
apt install -y aspnetcore-runtime-7.0

To verify installation run the following commands. If the below doesn’t work try to open a new ssh session or terminal.

dotnet --list-runtimes

Microsoft.AspNetCore.App 7.0.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

dotnet --list-sdks

7.0.102 [/usr/share/dotnet/sdk]
root@srv4311:~# 

If you tried previously to install version 7.0 make sure you remove/purge the old version from the system. Something like below.

apt remove --purge dotnet-sdk-6.0 dotnet-runtime-6.0
apt auto-remove

Also maybe delete the .dotnet folder in your home directory.

Leave a Comment

Unraid Upgrade – EMC KTNSTL3

I recently updated my Unraid to use an EMC KTNSTL3 storage array. I use a lot of small drives which are really cheap.

So far it’s working great. Bought it on eBay.

https://www.ebay.com/itm/284306911248

I’m using SATA drives so you need to buy the Interposers. They turn your SATA into SAS drives so they fit in the caddy.

You’ll need 15 of them otherwise you can use straight SAS drives.

There does appear to be one quirk you need to know. Only one set of the SAS controllers reads SATA drives. I think it’s the bottom one so hook up your mini SAS cables there.

Also, I had some 14TB drives that I just installed and they kept giving me an “unsupported partition layout”. To fix this I just had to reboot the Unraid box. I’m not sure why but it worked after that.

You’ll also need a SAS card as well. I have the LSI 9200-8e. Something like the pic below. You can buy them on eBay too. I like this seller https://www.ebay.com/str/theartofserver .

There was some useful information below however it related to TrueNAS.

Leave a Comment

GoAccess for Nginx Proxy Manager Logs

This docker container should work out of the box with Nginx Proxy Manager to parse proxy logs. The goaccess.conf has been configured to only access proxy logs and archived proxy logs. No fuss, no muss.

The docker image scans and includes files matching the following criteria: proxy-host-*_access.log.gz proxy-host-*_access.log

Currently using GoAccess version: 1.5.5

Unraid container is also available.

https://hub.docker.com/r/xavierh/goaccess-for-nginxproxymanager

Leave a Comment

Setting up Rocket.Chat with Mongo 4.2 via Docker

I could not find a docker-compose.yml example with rocket.chat using 4.2 so I pieced one together.

Also, some tips on these errors.

Error: $MONGO_OPLOG_URL must be set to the ‘local’ database of a Mongo replica set

MongoError: not master and slaveOk=false

Visit my Github repo for more information: https://github.com/xavier-hernandez/rocket.chat/

Leave a Comment

Adding Unraid Mount Share via Tag to FSTAB

Create a share on the VM machine itself in Unraid.

Screenshot of Unraid Share and Unraid Mount tag example.

Let’s assume your mount tag is “test”.

Make sure you create your mount folder within the VM. In our case its “/whatever”. Modify your /etc/fstab file like this to mount the share. Then reboot.

test  /whatever 9p trans=virtio,version=9p2000.L,_netdev,rw 0 0
Leave a Comment

Network stopped working in Ubuntu 18.04

I had a Ubuntu VM that lost its ability to get an IP. I have no idea why but I finally found the issue and it seems that the interface name changed.

Maybe its a bug : https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/1881832

So I found out that the network interface that was trying to do DHCP did not exist. You’ll find this in /etc/netplan/50-cloud-init.yaml . For some reason, it showed that my interface was enp1s0 but it wasn’t, it was enp3s0. So I modified the file and rebooted the server. Everything is fine now.

Leave a Comment

UnRaid Expanding qcow2 drive, Windows 10

To expand your drive size in UnRaid.

  • Go to VMs
  • Click on the name of the VM you want to expand
  • A new bar will appear, disk devices. Click on the capacity.
  • Set a new size and hit enter.
  • Start the machine, log in, etc.
  • Go to administrative tools, computer management, storage, disk management
  • Right click “disk management” and hit refresh
  • You should now see the additional space
  • Expand your disk
  • Done
Leave a Comment