Unassigned Devices - Managing Disk Drives and Remote Shares Outside of The Unraid Array (2024)

Unassigned Devices Plugin

Unassigned Devices (UD) includes a lot of functionality and has become a bit complex. Please read the first and second post. You will find answers to most of your questions.

Note: You will need to install the Unassigned Devices Plus(UD+) plugin to enable HFS+ and APFS (Apple file formats) and exFAT (flash larger than 64MB) disk mounting, and to enable 'Destructive Mode' for formatting of someUD supported disk formats.

UD and UD+ areavailable in Community Applications (CA).

  • Hover your mouse overany active area on the UD page and a tool tip will show you what clicking that area does.
  • UD supports all Unraid native disk formats. You will need to install the 'Unassigned Devices Plus' plugin to mount HFS+, APFS and exFAT file formats.
  • UD has a destructive mode that allows deleting disk partitions and formatting disks. If Destructive Mode is not turned on in the UD Settings, you WILL NOT be able to format a disk. Go the the Settings page and scroll to the bottom to see the UD settings. To format a disk:
    • Destructive Mode must be enabled. You will need to install the 'Unassigned Devices Plus' plugin to enable Destructive Mode. UD Plus will install the 'parted' package needed for formatting and deleting partitions.
    • Disk must have all partitions removed. Unmount the disk, click on the '+' icon next to the serial number, and click on all red-X to delete partitions. You can also click on the red-X next to the disk serial number to delete all partitions.
    • A precelared disk will have a partition without a file system and will show a grayed 'Mount' button. You can assign this disk directly to the array and Unraid will see the disk as 'pre-cleared' and will not clear it again. If you want to format the disk for use in UD, you need to first click on the red-X on the preclear status line to remove the preclear stats and then remove all partitions by clicking on the red-X icon next to the serial number and then you'll be able to format the disk.
  • There are different operations in various active areas (especially the disk serial number) based on whether or not the disk drive is mounted. If the disk is not mounted, click on the '+' icon by the serial number, click on the partition name, you will get a pop-up dialog to change the mount pointname. This will now become the mount point and the share name when the disk is shared.

  • In order to share any UD device, sharing needs to be enabled in the UD Settings and the switch turned on to share the particular device.

  • SSD disks formatted with xfs, btrfs, or ext4 will be mounted with 'discard' if the "Mount SSDs with 'discard' option?" is set to "Yes". This includes encrypted disks. Reiserfs does not support discard. This enables TRIM on SSD devices. If you have the trim plugin installed, it is recommended to not mount SSD disks with discard.

  • Disks formattedXFS or BTRFS will be partitioned compatible with the arraydisks and can be installed in the array without a re-format. SSD devicesare now partitioned with a 1MiB offsetas of Unraid 6.9 Beta 25 and cannot be installed as a cache or pool device on earlier versions.

  • Because of security issues with samba, the mounting of remote SMB shares with CIFS has become more complicated. The default protocol is now SMB3 and not SMB1; the default security is nowntlmv2 and not ntlm. UD will try to mount SMB shares with SMB3, then SMB2, and then SMB1 to try to get the mount to use the most secure protocol it supports and the ntlmv2 protocol. If you have an older server that only supports SMB v1, you need to update thatserver so it will support SMB v2 or v3. SMB v1 is being phased out and will probably eventually be removed from samba. You will not be able to mount a remote SMB share using SMBv1 if NetBIOS is disabled in Unraid. It is recommended to disable NetBIOS on Unraid servers.

Note: UD disks add to the total disks allowed by the Unraid license you have purchased except for a Pro license. Seeherefor details.

Unassigned Devices allows you to mount and share disk drives that are not managed as part of the array. Some users are mounting a drive specifically for Dockers and/or VMs rather than having them on a cache or array drive. You can also mount a UNC share on another system (SMB or NFS) and have it show in the Unraidshares when browsing the Unraidshares with Windows. This is called Remote ShareMount. The UNC path is mounted locally and shared as a \\Tower share that can be accessed by SMB or NFS.

Access to Unassigned Devices shares defaults to Public with everyone having read/write access. User access can be enabled in the Unassigned Devices Settings. Access can be enabled by user for read/write, read only, or no access to Unassigned Devices shares.


Installing the plugin

You can install the plugin from the Community Applications (Apps tab);

Remote Mounted Shares

You can remote mount SMB and NFS shares. SMB shares are accessed through\\Tower\share. There are several special cases of remote mounting SMB shares.

  • Windows. You have to provide user login credentials to be able to show the shares with the 'Load Shares' button. Even if the shares are not password protected, Windows insists on login credentials.
  • Domains. You can remote mount shares on a domain by specifying a domain.

It is preferred to use the server name and not the IP address. Let UD search for the servers and then make a selection, then load shares and make a selection. This is much less error prone than manually entering the information. Unless you use a static IP address on the server, it can change making the remote mount fail.

Note: With NetBIOS disabled on a remote server or computer on your LAN, UD may only be able to look up the server and show its IP address because the name cannot be resolved. It is recommended that you type in the name of your other server or computer instead of using the IP address. UD will make an adjustment so the name can be resolved when mounting the remote share. UD also keeps the IP current if it is changed by a DHCP server.

When a USB device is plugged in or mounted an event is initiated to run a user defined script. This is useful for backing up files from the server initiated by plugging in the USB device or copying pictures from a camera to the array. Scripts are created unique for each device. You can also setup one script to run whenever any device is plugged in or mounted.

Mount Points and Shares

There seems to bea lot of confusion over a mount point vs. a share. The mount point is where the device is mounted locally on Unraid. A share makes the mount point available in Windows at '\\Tower' as a browseable folder.

When disk devicesand ISOMounts are mounted, they are mounted at /mnt/disks/. They are not a part of the Unraidarray and are not mounted at /mnt/disk/ which is for Unraiddisk drives. As an example, you have a device named 'MyDisk'. When it is mounted, it is accessed locally at /mnt/disks/MyDisk. If you want to use 'MyDisk' in a Docker Container or VM, you would refer to it by '/mnt/disks/MyDisk'. It is not automatically shared at '\\Tower\MyDisk' unless you enable sharing the device.

To share 'MyDrisk', you would turn on the 'Share' switch for the drive and 'MyDisk' would be shared at '\\Tower\MyDisk'. The share 'MyDisk' is not accessed at /mnt/user/MyDisk' because it is not an Unraiduser share.

When remote sharesare mounted, they are mounted at /mnt/remotes/. They are not a part of the Unraidarray and are not mounted at /mnt/disk/ which is for Unraiddisk drives. As an example, you have a sharenamed 'MyShare'. When it is mounted, it is accessed locally at /mnt/remotes/MyShare. If you want to use 'MyShare' in a Docker Container or VM, you would refer to it by '/mnt/remotes/MyShare'. It is not automatically shared at '\\Tower\MyDisk' unless you enable sharing the device.

To share 'MyShare', you would turn on the 'Share' switch for the remote shareand 'MyShare' would be shared at '\\Tower\MyShare'. The share 'MyShareis not accessed at /mnt/user/MyShare' because it is not an Unraiduser share.

If you are using the legacy mapping of remote shares at /mnt/disks/ for your Docker Containers or VMs, and it is not practical to remap them in your Docker Containers or VMs, you can set a legacy mapping option in UD Settings that will put symlinks in/mnt/disks/ to the remote shares in mnt/remotes/. When you map to the /mnt/disks/MySharebe sure to have a trailing '/' on the mapping so the symlink will be treated as a directory and not a file.

Mount points and shares are two separate things.

Partitions and Formatting

If you turn on the destructive mode in the Unassigned Devices Settings, you will be able to delete partitions and format disks. It is defaulted off as a safety measure.

Scripts

Here is an example script that will back up a Pictures share to a USB drive when plugged in. The USB drive is unmounted once the script completes so you just plug in the drive, wait for it to be completed, and then unplug the drive. The beeps in the script will make speaker sounds if you have a speaker to let you know when the drive is plugged in, when the backup has started, and when the backup has finished and the drive unmounted. The nice thing about this script is that all you have to do is plugin the drive and wait for it to finish. You will also be notified when it is done if you have turned on Unraidnotifications. Set the drive to auto mount. Set the script to run in the background.

If you mount and unmount the drive from the Unassigned Devices gui, the drive will mount and unmount but the script will not run because it has detected the 'OWNER' as 'user' and will skip the backup.

#!/bin/bashPATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin## Available variables:# ACTION - if mounting, ADD; if unmounting, UNMOUNT; if unmounted, REMOVE; if error, ERROR_MOUNT, ERROR_UNMOUNT# DEVICE - partition device, e.g. /dev/sda1# UD_DEVICE - unassigned devX designation# SERIAL - disk serial number# LABEL - partition label# LUKS - if the device is encrypted, this is the partition device, e.g. /dev/sda1# FSTYPE - partition filesystem# MOUNTPOINT - where the partition is mounted# OWNER - "udev" if executed by UDEV, otherwise "user"# PROG_NAME - program name of this script# LOGFILE - log file for this scriptcase $ACTION in 'ADD' ) # # Beep that the device is plugged in. # beep -l 200 -f 600 -n -l 200 -f 800 sleep 2 if mountpoint -q $MOUNTPOINT; then if [ $OWNER = "udev" ] then beep -l 100 -f 2000 -n -l 150 -f 3000 beep -l 100 -f 2000 -n -l 150 -f 3000 logger Started -t$PROG_NAME echo "Started: `date`" > $LOGFILE logger Pictures share -t$PROG_NAME rsync -a -v /mnt/user/Pictures $MOUNTPOINT/ 2>&1 >> $LOGFILE logger Syncing -t$PROG_NAME sync -f $MOUNTPOINT beep -l 100 -f 2000 -n -l 150 -f 3000 beep -l 100 -f 2000 -n -l 150 -f 3000 beep -r 5 -l 100 -f 2000 logger Unmounting PicturesBackup -t$PROG_NAME /usr/local/sbin/rc.unassigned umount $DEVICE echo "Completed: `date`" >> $LOGFILE logger Pictures Backup drive can be removed -t$PROG_NAME /usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Server Backup" -d "Pictures Backup completed" -i "normal" fi else logger Pictures Backup Drive Not Mounted -t$PROG_NAME fi ;; 'REMOVE' ) # # Beep that the device is unmounted. # beep -l 200 -f 800 -n -l 200 -f 600 ;; 'ERROR_MOUNT' )/usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Server Backup" -d "Could not mount Pictures Backup" -i "normal" ;; 'ERROR_UNMOUNT' )/usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Server Backup" -d "Could not unmount Pictures Backup" -i "normal" ;;esac

Here is a nice UD script for importing photos from a camera/memory card into the array:Photo Script Thanks to ljm42.

Cron Task

A better way of running cron scripts is the 'User Scripts' plugin. You can set up a script to run at a particular time to perform disk operations. It is best to leave the device mounted so the script can access the drive.

This is a simple way to set up a cron task to run a script to copy files to a backup. This method is a little cumbersome, but does work well. You will need to set up your drive to auto mount and it has to be left mounted. You can use the default script or the following one if you want beeps when the drive is mounted and unmounted. Set the drive to auto mount. he drive has to stay mounted for the script to work. Set the script to run in the background.

#!/bin/bashPATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin## Available variables:# ACTION - if mounting, ADD; if unmounting, UNMOUNT; if unmounted, REMOVE; if error, ERROR_MOUNT, ERROR_UNMOUNT# DEVICE - partition device, e.g. /dev/sda1# UD_DEVICE - unassigned devX designation# SERIAL - disk serial number# LABEL - partition label# LUKS - if the device is encrypted, this is the partition device, e.g. /dev/sda1# FSTYPE - partition filesystem# MOUNTPOINT - where the partition is mounted# OWNER - "udev" if executed by UDEV, otherwise "user"# PROG_NAME - program name of this script# LOGFILE - log file for this scriptcase $ACTION in 'ADD' ) # # Beep that the device is plugged in. # beep -l 200 -f 600 -n -l 200 -f 800 ;; 'REMOVE' ) # # Beep that the device is unmounted. # beep -l 200 -f 800 -n -l 200 -f 600 ;;esac

Now set up a cron file in the /flash/config/plugins/dynamix/ directory. Name the file 'custom.cron' (or a name of your own choosing.cron) with the following contents. This will set up a cron task to run at 4:30 AM every day. It runs a script in the /boot/custom/ directory called

DailyBackup.

# Custom cron scripts:30 4 * * * /boot/custom/DailyBackup &> /dev/null

Sample Daily Backup script

#!/bin/bash## Perform daily backup.#MOUNTPOINT=/mnt/disks/DailyBackupPROG_NAME=DailyBackuplogger Started -t$PROG_NAMEif mountpoint -q $MOUNTPOINT; then logger Pictures share -t$PROG_NAME rsync -a -v /mnt/user/Pictures $MOUNTPOINT/ 2>&1 logger Completed -t$PROG_NAME /usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Server Backup" -d "Daily Backup completed" -i "normal"else logger Daily Backup Drive Not Mounted -t$PROG_NAMEfi

After you have copied your cron file to the dynamix directory you will have to load the cron file manually one time to get it started. Unraidwill manage the cron file after that and insert it into the crontab for you.

Use the following command to load the cron file the first time.

/usr/local/sbin/update_cron

Encrypted Dsks

  • You can format a xfs or btrfs encrypted disk with UD that is compatible with the array. The disk is created with the array password/passphrase. You must have at least one encrypted disk in the array. Unraid 6.8 and greater only.
  • You can format an encrypted disk for use outside the array without having an encrypted array. The disk password is entered when the disk is formatted. You need to set the disk password in UD settings so the disk will mount. Unraid 6.8 and greater only.
  • A disk encrypted with a different password than the arraycan be mounted with a disk password set in the UD settings. A different password can be set for each disk.

Pooling Disks

You can create multiple pools with UD, with some limitations, detailshere. Starting with Unraid 6.9, there is a 'Pool' feature that should be used for pooling disks.

Click on the 'Help' button on the main menu bar of Unraidto get some additional help. If you hover your mouse over an active area on the gui, you will see tool tips that will help you understand the operation of the active area.

Verify you have the latest version installed and check the syslog for information if you are having any issues. Many questions can be answered by reading this post and checking the syslog.

Root Share

You can create a root share in UD and collect all your shares in /mnt/user/ into one named root share. The root share is then accessible at /Tower/rootshare. There are some advantages and disadvantages to this approach:

  • You control the root share permissions in UD Security settings.
  • You may increase your risk of a malware attack by having all your shares accessible on one root share. Use secure passowrds!

Addon Mount Folder

UD adds the folder '/mnt/addons' where you can mount anything you need mounted. A protected mount is added to '/mnt/addons' so a misconfigured app cannot fill the rootfs and crash the system. FCP will ignore this mount folder so you won't see any warnings.

If you mount something at '/mnt/addons' before UD is installed, you will see a reboot message over the banner. If this is the case, you need to delay your mount until after UD installs.

Mount Button Indicators

Disks

In order to point out to users normal operation and situations that may prevent UD from operating on a disk device properly, the 'Mount' button will show some greyed out text that indicates status on the disk. If the text shows with the not symbol, the disk is in an error conndition.

  • 'MOUNT' or 'UNMOUNT' - when the 'Mount' button shows either of these grayed out, the 'Disable Mount Button' switch is on. This situation lets UD do auto mount and unmount, but operator actions are not permitted. Theere are occasions when these indicators are grayed out because of disk drive issues.
  • 'PASSED' - This indicates the 'Passed Through' switch is set. This is used to tell UD that a VM or Docker Container is using the disk and for UD to not manage the disk in any way.
  • 'PRECLEAR' - The UD Preclear or binhexPreclear Docker is preclearing the disk.
  • 'POOL' - This is used to indicate that a disk is part of a BTRFS pool.
  • 'PARTITION' - This will show when a disk is detected that has a file system but no partition. UD cannot mount a disk in this situation. If it is a disk introduced to UD that you want to use in UD, you can clear the disk and reformat it for use with UD.
  • 'ARRAY' - This indicates that a disk has not been detected by Unraid as an Unassigned Device and UD thinks the disk is a part of the array. This generally happens when an array disk drops from the array.
  • 'UDEV' - UD has detected that the disk format reported by udev does not match the format as reported by lsblk. This can sometimes be rectified by clicking on the double arrows on the UD UI to refresh the udev data in UD.
  • 'REBOOT' - This shows when UD has detected a disk was probably removed before being unmounted and thenre-installed. The bestway to clear this up is to reboot. If this happens because of several disks having the same mount point, unmount the diskwith this mount point and change mount points on all disks to be unique.

Remote Shares

  • 'MOUNT' or 'UNMOUNT' - when the 'Mount' button shows either of these grayed out, the remote sever is off-line. When these indicators are grayed out on an ISO mount, the iso file is not available.
Unassigned Devices - Managing Disk Drives and Remote Shares Outside of The Unraid Array (2024)
Top Articles
Latest Posts
Article information

Author: Clemencia Bogisich Ret

Last Updated:

Views: 6035

Rating: 5 / 5 (60 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Clemencia Bogisich Ret

Birthday: 2001-07-17

Address: Suite 794 53887 Geri Spring, West Cristentown, KY 54855

Phone: +5934435460663

Job: Central Hospitality Director

Hobby: Yoga, Electronics, Rafting, Lockpicking, Inline skating, Puzzles, scrapbook

Introduction: My name is Clemencia Bogisich Ret, I am a super, outstanding, graceful, friendly, vast, comfortable, agreeable person who loves writing and wants to share my knowledge and understanding with you.