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


Recommended Posts

19 minutes ago, jpimlott said:

If i turn AD off i can access the shares via ip.   Windows 2003 can access them normally. The  shared from your plugin show up as well.

If i switch it back to AD the all the computers can access the shares but no shares from the plugin.

 

 

The Active Directory setting is not being considered by UD as SMB being enabled.  I'll issue an update later that should enable sharing with Active Directory sharing and you can see if it works.

  • Upvote 2
Link to comment

I ran into a bunch of issues getting several Unraid docker images working with my Freenas storage.

 

So I just wanted to make a quick post to document all the things I ended up doing to solve this problem. Note that alot of this may be common sense or documented in various post.

 

My setup:

Freenas (FreeNAS-11.1-U6)

  • Used as main storage
  • Unraid will access certain folders/dataset via smb or nfs.

Unraid (Version: 6.6.5)

  • Running various docker images. I was using SABnzbd and Sonarr.

Sonarr (2.0.0.5252)

  • Running on Unraid
  • Will grab download files from SABnzbd and copy it over smb/nfs to my Freenas storage that holds my media.

SABnzbd (2.3.5 [76c7a6c])

  • Running on Unraid
  • Will download files requested by Sonarr and store it on Unraid storage

I was also using "Unassigned Devices" plugin to allow my Docker images on Unraid to see my Freenas shares.

 

1. I didn't read carefully but as the "Unassigned Devices" plugin states when you add a share make sure the Docker image has that share path to RW/slave or RO/slave.

 

2. To avoid permission issues any software/docker/jail that is accessing your files should use a common uid and gid when accessing files. 

So ultimately my issue was permission related which is 99% of the case. Based on Freenas tutorials I have typically used 816 (uid) and 1001 (gid). In various docker images typically there is a property that ask you to specify the image's uid and gid.

 

3. Create a user and group account with the uid and gid in Freenas. This is important since you need to specify the user account when using NFS or SAMBA on freenas. Set a password for the user account.

 

4. Pay attention to the Guest Account set by default in Freenas SMB->Setting. If you create a Samba share that allows Guest Access and you use Guest Access (don't specify a username or password) then your share will be mounted with an unexpected uid and pid.

 

5. When mounting the samba share via "Unassigned Devices" its "easier" to just use the above user account you created in freenas.

 

6. When doing NFS set the Mapall User and Mapall Group to the username and group you created in step 3.

 

7. If your using NFS make sure the files in your share has ACL removed. To do this log into the console in Freenas and go to the folder your sharing via nfs and run "find <share folder> | setfacl -b".

 

Number 7 issue was especially weird. Basically what I found out was copying files to my nfs directory would fail the first time. However, it would create a blank file in the nfs directory with the name of the folder I copied. Repeating the copy command again would end up being successful. After some Googling I found this had to do with my Freenas files having Windows permissions (ACL) so I needed to remove that flag from all my files that I want to to run off of nfs.

 

Ultimately I was happy with Samba but when using Sonarr and importing all my media while trying to download missing files the Sonarr docker image and the Unraid GUI would hang. Issuing the shutdown command even failed and I was only able to do a hard reset to recover. The log showed that Unraid ended up losing access to the samba share which I think caused everything to hang. So I decided to switch to NFS to avoid this problem.

 

Link to comment

Hi - just checking it's still the best way to spin down an unassigned device is with the CLI command hdparm -y /dev/sdx ?

 

Long story short, I've got four drives unformatted and end of life that are only in there for now for airflow - I don't currently have dummy drives for my Supermicro case, so filling the gaps with old drives.  There's no point in them being spun up, so I'm running the above on all four manually at boot.

 

Alternatively, could the -Y option be better to turn the drive off altogether?

 

Or is there now a better way?

Link to comment

I love this plugin, is there a way to automatically unmount the drive if the USB drive is disconnected without unmounting?

  

I sometimes forget to unmount the device if i'm in a rush and my PCs are turned off to get into the webGUI.  

  

however once unplugged the device stays mounted and when plugged back in increments the sdf1 value to the next letter and I have two identical devices mounted.

 

Anyway to unmount automatically after a USB device is unplugged when mounted?

Link to comment
23 minutes ago, 5footbanana said:

I love this plugin, is there a way to automatically unmount the drive if the USB drive is disconnected without unmounting?

  

I sometimes forget to unmount the device if i'm in a rush and my PCs are turned off to get into the webGUI.  

  

however once unplugged the device stays mounted and when plugged back in increments the sdf1 value to the next letter and I have two identical devices mounted.

 

Anyway to unmount automatically after a USB device is unplugged when mounted?

How are you using the USB drive? Plug it in, do some action, then remove it?

Link to comment
9 minutes ago, dlandon said:

How are you using the USB drive? Plug it in, do some action, then remove it?

Yes.

Basically plug it in, auto mount, run script to rsync the drive to my array, unplug it when it's done or later on when I remember.

I do sometimes share it over my network but not too often.  

  

It's mainly when unplugging, if I remember to unmount the drive I have no issues and it frees up the sde1 designation.  If I forget or if I am rushing and don't have chance to unmount.  I don't unplug til i'm pretty certain it would have written all data.  

It's just annoying having the drive still mounted even though i've removed it.

Link to comment
4 hours ago, 5footbanana said:

Yes.

Basically plug it in, auto mount, run script to rsync the drive to my array, unplug it when it's done or later on when I remember.

I do sometimes share it over my network but not too often.  

  

It's mainly when unplugging, if I remember to unmount the drive I have no issues and it frees up the sde1 designation.  If I forget or if I am rushing and don't have chance to unmount.  I don't unplug til i'm pretty certain it would have written all data.  

It's just annoying having the drive still mounted even though i've removed it.

Unmount it at the end of your script.

 

EDIT: The first post shows how to do this in the example script.

Edited by dlandon
Link to comment

I'm getting the following error:

 

Dec 9 10:34:45 Jefflix nginx: 2018/12/09 10:34:45 [error] 10760#10760: *3860986 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.1.13, server: , request: "POST /plugins/unassigned.devices/UnassignedDevices.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock", host: "jefflix", referrer: "http://jefflix/Main"

I believe this is due to me rebooting my second unraid server which this server has an smb share mapped to. 

 

Right now unassigned devices is just showing an endless refreshing dialog and smb shares won't load at all. It's just on the brink of locking the whole server up.

 

Is there something I can reload to fix this error?

Link to comment

Unraid 6.6.6

 

I have been having issues with an NSF mount that seems to unmount/stop responding in the middle of the night. At first I thought it was SMB being weird so I switched over to NFS, but I am still having the same issue. This drive is mounted with no special scripting. The drive holds a music library that is then mapped to a plex container. At somepoint, normally in the middle of the night, but it has happened a couple of times during the day and even during active use of the drive, music ceases to be playable. The gui for unassigned devices shows a zero byte counter and I have to unmount and attempt to remount it a couple of times before it mounts successfully again. I don't really get any "useful" logs around the time that I believe the issue happens on either side. The NFS share is on a vm on another host "locally" - logically anyway. Its being accessed over IPsec tunnel that shares other resources. I have confirmed that the tunnel is constantly up and doesn't go down during the time of the issue. 

Here are some of the logs I get in unraid when its already broken:

 

Dec 13 03:11:18 stylophora kernel: nfs: server 192.168.130.4 not responding, still trying
Dec 13 03:11:18 stylophora kernel: nfs: server 192.168.130.4 not responding, still trying
Dec 13 03:11:18 stylophora kernel: nfs: server 192.168.130.4 not responding, still trying
Dec 13 03:11:18 stylophora kernel: nfs: server 192.168.130.4 OK
Dec 13 03:11:19 stylophora kernel: nfs: server 192.168.130.4 OK
Dec 13 03:11:21 stylophora kernel: nfs: server 192.168.130.4 OK

This happens over and over until I fix it.

This is me fixing it hours later when I find that its broken - with a couple of failed attempts:

 

Dec 13 08:08:01 stylophora unassigned.devices: Removing Remote SMB share '192.168.130.4://mnt/music/library'...
Dec 13 08:08:01 stylophora unassigned.devices: Unmounting Remote SMB Share '192.168.130.4://mnt/music/library'...
Dec 13 08:08:01 stylophora unassigned.devices: Unmounting '192.168.130.4://mnt/music/library'...
Dec 13 08:08:01 stylophora unassigned.devices: Unmount cmd: /bin/umount '192.168.130.4://mnt/music/library' 2>&1
Dec 13 08:08:03 stylophora unassigned.devices: Unmount of '192.168.130.4://mnt/music/library' failed. Error message:  umount.nfs: /mnt/disks/cruton-music: device is busy 
Dec 13 08:08:29 stylophora unassigned.devices: Since there aren't open files, will force unmount.
Dec 13 08:08:29 stylophora unassigned.devices: Unmounting '192.168.130.4://mnt/music/library'...
Dec 13 08:08:29 stylophora unassigned.devices: Unmount cmd: /bin/umount -f -l '192.168.130.4://mnt/music/library' 2>&1
Dec 13 08:08:29 stylophora unassigned.devices: Successfully unmounted '192.168.130.4://mnt/music/library'
Dec 13 08:08:29 stylophora unassigned.devices: Removing SMB share file '/etc/samba/unassigned-shares/cruton-music.conf'
Dec 13 08:08:29 stylophora unassigned.devices: Removing SMB share definitions from '/boot/config/smb-extra.conf'
Dec 13 08:08:29 stylophora unassigned.devices: Reloading Samba configuration..
Dec 13 08:08:29 stylophora unassigned.devices: Successfully removed SMB share 'cruton-music'.
Dec 13 08:08:29 stylophora unassigned.devices: Share '192.168.130.4://mnt/music/library' unmount successfull.
Dec 13 08:09:05 stylophora rpcbind[12310]: connect from 127.0.0.1 to getport/addr(status)
Dec 13 08:09:25 stylophora unassigned.devices: Mount SMB/NFS command: mount -t nfs -o defaults '192.168.130.4://mnt/music/library' '/mnt/disks/cruton-music'
Dec 13 08:09:25 stylophora unassigned.devices: Mount of '192.168.130.4://mnt/music/library' failed. Error message: 
Dec 13 08:09:31 stylophora emhttpd: req (2): csrf_token=****************&title=System+Log&cmd=%2FwebGui%2Fscripts%2Ftail_log&arg1=syslog
Dec 13 08:09:31 stylophora emhttpd: cmd: /usr/local/emhttp/plugins/dynamix/scripts/tail_log syslog
Dec 13 08:10:28 stylophora rpcbind[15718]: connect from 127.0.0.1 to getport/addr(status)
Dec 13 08:10:28 stylophora unassigned.devices: Mount SMB/NFS command: mount -t nfs -o defaults '192.168.130.4://mnt/music/library' '/mnt/disks/cruton-music'
Dec 13 08:10:28 stylophora unassigned.devices: Successfully mounted '192.168.130.4://mnt/music/library' on '/mnt/disks/cruton-music'.
Dec 13 08:10:28 stylophora unassigned.devices: Defining share 'cruton-music' with file '/etc/samba/unassigned-shares/cruton-music.conf'
Dec 13 08:10:28 stylophora unassigned.devices: Adding share 'cruton-music' to '/boot/config/smb-extra.conf'
Dec 13 08:10:28 stylophora unassigned.devices: Reloading Samba configuration...
Dec 13 08:10:28 stylophora unassigned.devices: Directory '/mnt/disks/cruton-music' shared successfully.

On the share side, I don't see any useful logs other than me remounting it.

Edited by manofcolombia
Link to comment
2 hours ago, pro9c3 said:

is there any way to adjust the warning/critical temperature for unassigned devices? My SSD's can operate up to 70C and i'm getting too many warnings at 45C.

Not currently, but you can set all the other disks individually to lower values and set the global settings to the higher values.

Link to comment
On 12/14/2018 at 6:11 PM, johnnie.black said:

Not currently, but you can set all the other disks individually to lower values and set the global settings to the higher values.

Thanks! Good workaround.  I'll get to it eventually... but with 24 disks in my array I prefer to be a little lazy lol

Link to comment
  • 2 weeks later...
On 12/9/2018 at 9:36 PM, Squid said:

Close the browser and then re-open.  Any operation that takes longer than 120 seconds will effectively cause the tab to stop responding.  IE: You can let UD sit there for an hour and it will never recover.

(Squid, your profile pics and quips crack me up! haha)

 

So I have the same issue as munit85 described, the UD's go missing after rebooting the server they were attached to.

The spinning circle of death appears...

UD_Gone_Missing.thumb.png.128b6a2f523c503dfef0881f2ccb403d.png

I have to reboot to get them back...

 

Any thoughts on how to get them back without having to reboot?

 

Thanks and Merry Christmas!

 

 

 

  • Like 1
Link to comment
  • trurl pinned this topic

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.