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


Recommended Posts

8 hours ago, ksarnelli said:

How do you mount an SMB share that contains a $ character (a hidden share running on Windows)?  When I try to add the share using unassigned devices it fails with the following error in the log: 

 


unassigned.devices: Share '//blah/blah$' contains a '$' character.#011It cannot be added.

 

I tried manually adding it to samba_mount.cfg, but it still doesn't work there either.

 

Adding some keywords because this issue is hard to search for: dollar sign

 

 

EDIT:  I found an old chain about this issue from 2016 where @dlandon incorrectly believed that 'mount -t cifs' does not support hidden windows shares (shares ending with $).  I can fill in some missing details  - the issue you were experiencing is that you were trying to connect to the default admin shares on Windows (C$, D$, admin$, etc) - in order to mount those you either need to disable UAC on the Windows side or change a registry value (add DWORD LocalAccountTokenFilterPolicy=1 to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System).  My point is that hidden shares are certainly supported by the cifs mount command, and in my case I'm not trying to mount one of these 'admin' shares - I'm just trying to mount a regular hidden share which are not affected by that policy.  It would be great if you can add support for this.

 

 

EDIT2: @dlandon - I did some testing with the unassigned devices plugin code and I think the fix is as simple as removing the '$' check and changing line 1195 in include/lib.php from


$samba_mounts = @parse_ini_file($config_file, true);

to


$samba_mounts = @parse_ini_file($config_file, true, INI_SCANNER_RAW);

It would be great if you can test/implement this minor change. Thanks!

I can appreciate your enthusiasm, but it is not as simple as that.  It is not as much a CIFS issue as a php issue.  The '$' is a reserved character in php.  I did some testing with your proposed fixes and there were many issues.  I remember now why I implemented the block of the '$' character.

 

In my testing, the '$' character in the mount point caused the ping of the server for online status to fail, and when I removed the remote share with a '$' in the mount point, all the remote shares I had defined were deleted.

 

The '$' in the mount point is a edge case and not something care to resolve.

 

EDIT: It isn't the mount point that's the issue, it's the share name.

Edited by dlandon
Link to comment
15 minutes ago, dlandon said:

I can appreciate your enthusiasm, but it is not as simple as that.  It is not as much a CIFS issue as a php issue.  The '$' is a reserved character in php.  I did some testing with your proposed fixes and there were many issues.  I remember now why I implemented the block of the '$' character.

 

In my testing, the '$' character in the mount point caused the ping of the server for online status to fail, and when I removed the remote share with a '$' in the mount point, all the remote shares I had defined were deleted.

 

The '$' in the mount point is a edge case and not something I care to resolve.

 

It's obviously your decision since you put in all of the work for the plugin, but I don't really think it's an edge case.  Using a trailing $ is the only way to hide shares on a Windows server, and I've seen hundreds (if not thousands) of uses in the wild.  Usually to reduce the number of visible shares when a server has shares intended for users and others intended for automated processes.

 

When I tested the code change above I was only testing that one particular function (get_samba_mounts), but after looking at more code I'm pretty sure the other issues you encountered were from other uses of the parse_ini_file() function without the INI_SCANNER_RAW parameter.  The default INI_SCANNER_NORMAL tries to parse values and I don't think you want that.  From my tests, parse_ini_file() will return an empty array if a section ends in $ unless you include the INI_SCANNER_RAW - which would probably explain the issues you mentioned.

 

In any case, whatever you decide, thanks for building this plugin.  At some point, if you have a little bit of time can you see if using INI_SCANNER_RAW in every parse_ini_file() call resolves the issues?

Link to comment
9 minutes ago, ksarnelli said:

but I don't really think it's an edge case.

From the UD change log:

2016.04.17

- Fix: Block mounting smb shares with a '$' in the share path name.

It's been that way for a long time.  No one has made an issue of it until now.  It looks to be an edge case to me.

 

Try to find a work around, like securing the share and not hiding it.

Link to comment
16 minutes ago, dlandon said:

From the UD change log:


2016.04.17

- Fix: Block mounting smb shares with a '$' in the share path name.

It's been that way for a long time.  No one has made an issue of it until now.  It looks to be an edge case to me.

 

Try to find a work around, like securing the share and not hiding it.

 

Who said the shares aren't secure?  It's about keeping the share list tidy.  No need to show users shares that aren't for users.

Link to comment
1 hour ago, dlandon said:

From the UD change log:


2016.04.17

- Fix: Block mounting smb shares with a '$' in the share path name.

It's been that way for a long time.  No one has made an issue of it until now.  It looks to be an edge case to me.

 

Try to find a work around, like securing the share and not hiding it.

 

Just for my own sanity, I made the changes I described above, recreated the package archive and deployed it.  Everything works fine.  I'm able to add $ shares, access them, delete them.  The online status remained connected and I was able to delete the $ share without affecting any of my other SMB mounts.  If you want me to send lib.php I will happily send it over (and obviously UnassignedDevices.php needed to be modified to remove the $ check as well).

 

Otherwise I guess my course of action will be to just script these changes every time a new version of unassigned devices is released, but that isn't ideal.

 

EDIT - I just realized this plugin is on github...I'll just submit a PR.😂

EDIT 2 - PR submitted 😀

Edited by ksarnelli
Link to comment

Just for a test I created a hidden share on a Windows 10 computer and successfully mounted it with UD.  The share did not have a '$' in the share name.  Why are you using a '$'?  The C drive will show with a '$' sign, but you shouldn't mount the full C drive anyway for security reasons.

 

Edited by dlandon
Link to comment
2 hours ago, dlandon said:

Just for a test I created a hidden share on a Windows 10 computer and successfully mounted it with UD.  The share did not have a '$' in the share name.  Why are you using a '$'?  The C drive will show with a '$' sign, but you shouldn't mount the full C drive anyway for security reasons.

 

How did you create a hidden share on Windows without a $ sign?  I'm not doing any drive level sharing, just regular user shares.

Link to comment
42 minutes ago, ksarnelli said:

How did you create a hidden share on Windows without a $ sign?  I'm not doing any drive level sharing, just regular user shares.

I don't do any Windows sharing, so I didn't know about the smb share hiding with the '$'.  I've pushed a fix for this issue I think.  I've got to do some testing.

  • Like 1
Link to comment

Enhancement request:

Not a huge deal, but it would be lovely if Unassigned Devices would report not just "luks" as the filesystem for encrypted disks, but also the effective filesystem type (e.g. "luks:xfs" or something to that effect).

 

Thanks for all the work on Unassigned Devices--it's fantastic!

Link to comment

 

On 10/20/2020 at 3:02 PM, kimdu said:

It definitly is, unraid is able to load the share I want to connect to. I chossed the share from the drop down menue.

Both machines are on the same network. And as mentioned, other windows pcs on the same network are able to connect to this smb share without a problem. 

Are there any tests I can do, to get more information from unraid?

23 hours ago, dlandon said:

Delete and recreate the remote shares.


Here's what I tried:

  • reboot unraid server
  • delete remote share and try to recreate

The final solution was simple and a little bit strange:

The vm hosting the share I want to mount uses mullvad vpn cli-client. I thought to activate split-tunneling should be enough, but unfortunately unraid is only connect to the share when the vpn is disconnected. Without vpn everything works fine. I will check whether split-tunneling is editable within the mullvad client to get to work with and without active vpn tunnel. Thank you for your time and keep up the great work!

Link to comment

If you want to hide a particular UD share on Unraid, you can append a '$' to the mount point and it will not show in the UD shares.  It can still be browsed by entering the share name manually.

 

There is a UD setting to hide all UD shares, but this trick allows you to hide individual shares.

Link to comment

Hi, I have an array with files on it , and I want to copy them to a hard drive in the same computer. The HD I want to copy to is showing as an unassigned disk. But krusader will not allow me to create a folder or transfer any files  to it. Note, I tried to use penguin, but it will not load for some reason.

 

 Any idea why this is not working? or how to get it to work?  

 

running Version 6.9.0-beta30 2020-10-05 (vs -beta29)

Is t here an issue with the beta?

 

And auto updates for all dockers and plugins. I have Unassigned disks and unassigned disks plus, both say up to date.

 

Thanks!

Edited by Renew
Link to comment
14 minutes ago, Renew said:

krusader will not allow me

This is almost certainly a problem with the way you have krusader configured and nothing at all to do with Unassigned Devices plugin. I will probably split your post and any responses to its own thread.

 

Post your docker run command for krusader as explained at this very first link in the Docker FAQ:

 

Link to comment

After updating to version 2020.10.24 I can't mount one of my shares.

 

Logs:

Oct 25 07:55:34 R7UNRAID unassigned.devices: Mount SMB share '//192.168.1.1/WD_External' using SMB3 protocol.
Oct 25 07:55:34 R7UNRAID unassigned.devices: Mount SMB command: /sbin/mount -t cifs -o rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777,uid=99,gid=100,vers=3.0,credentials='/tmp/unassigned.devices/credentials_WD_External' '//192.168.1.1/WD_External' '/mnt/disks/KeeneticGiga'
Oct 25 07:55:34 R7UNRAID kernel: CIFS VFS: BAD_NETWORK_NAME: \\192.168.1.1\WD_External
Oct 25 07:55:34 R7UNRAID kernel: CIFS VFS: cifs_mount failed w/return code = -2
Oct 25 07:55:34 R7UNRAID unassigned.devices: SMB3 mount failed: mount error(2): No such file or directory Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg) .
Oct 25 07:55:34 R7UNRAID unassigned.devices: Mount SMB share '//192.168.1.1/WD_External' using SMB2 protocol.
Oct 25 07:55:34 R7UNRAID unassigned.devices: Mount SMB command: /sbin/mount -t cifs -o rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777,uid=99,gid=100,vers=2.0,credentials='/tmp/unassigned.devices/credentials_WD_External' '//192.168.1.1/WD_External' '/mnt/disks/KeeneticGiga'
Oct 25 07:55:34 R7UNRAID kernel: CIFS VFS: BAD_NETWORK_NAME: \\192.168.1.1\WD_External
Oct 25 07:55:34 R7UNRAID kernel: CIFS VFS: cifs_mount failed w/return code = -2
Oct 25 07:55:34 R7UNRAID unassigned.devices: Mount of '//192.168.1.1/WD_External' failed. Error message: 'mount error(2): No such file or directory Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg) '.

I have space symbol in my share name "WD External", seems that plugin replaces it with underscore.

Edited by SuberSeb
Link to comment
5 hours ago, SuberSeb said:

After updating to version 2020.10.24 I can't mount one of my shares.

 

Logs:


Oct 25 07:55:34 R7UNRAID unassigned.devices: Mount SMB share '//192.168.1.1/WD_External' using SMB3 protocol.
Oct 25 07:55:34 R7UNRAID unassigned.devices: Mount SMB command: /sbin/mount -t cifs -o rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777,uid=99,gid=100,vers=3.0,credentials='/tmp/unassigned.devices/credentials_WD_External' '//192.168.1.1/WD_External' '/mnt/disks/KeeneticGiga'
Oct 25 07:55:34 R7UNRAID kernel: CIFS VFS: BAD_NETWORK_NAME: \\192.168.1.1\WD_External
Oct 25 07:55:34 R7UNRAID kernel: CIFS VFS: cifs_mount failed w/return code = -2
Oct 25 07:55:34 R7UNRAID unassigned.devices: SMB3 mount failed: mount error(2): No such file or directory Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg) .
Oct 25 07:55:34 R7UNRAID unassigned.devices: Mount SMB share '//192.168.1.1/WD_External' using SMB2 protocol.
Oct 25 07:55:34 R7UNRAID unassigned.devices: Mount SMB command: /sbin/mount -t cifs -o rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777,uid=99,gid=100,vers=2.0,credentials='/tmp/unassigned.devices/credentials_WD_External' '//192.168.1.1/WD_External' '/mnt/disks/KeeneticGiga'
Oct 25 07:55:34 R7UNRAID kernel: CIFS VFS: BAD_NETWORK_NAME: \\192.168.1.1\WD_External
Oct 25 07:55:34 R7UNRAID kernel: CIFS VFS: cifs_mount failed w/return code = -2
Oct 25 07:55:34 R7UNRAID unassigned.devices: Mount of '//192.168.1.1/WD_External' failed. Error message: 'mount error(2): No such file or directory Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg) '.

I have space symbol in my share name "WD External", seems that plugin replaces it with underscore.

Fixed in latest release.

  • Thanks 1
Link to comment

I'm trying to run a Mango docker instance with my Windows 10 SMB share. Im getting an error: `[INFO] Starting DB optimization
Unhandled exception: database is locked (SQLite3::Exception)`

 

The docker mount setting is `/mnt/disks/MYDISK/`. I can terminal from Unraid and read/write to the folder without issue. From my google searches, this could be an issue with how the docker talks to the SMB share; possibly something to do with "byte range lock requests"? I've tried setting "Access Mode" in the docker configuration (both R/W Slave and R/W Share).

This docker does work if I don't use the SMB share, but I'd really like to use it since the SMB share holds 50x the capacity of my Tower. Any ideas how I can get this to work?

Link to comment

I'm trying to setup a VM to run on an uassigned SSD, but when I select the disk under `/mnt/disks/XXX` and save it seems to create it under `/mnt/user/domains` anyway. What's the correct way of dealing with this? Should I just create the VM, edit the config and set it to manual, and then move the file over? (or let it create a new one)

Link to comment
7 hours ago, SuberSeb said:

Recently I deleted old share but now I have this in logs every 4 seconds:


kernel: CIFS VFS: BAD_NETWORK_NAME: \\192.168.1.1\WD External

Maybe old config somewhere?

Your log is impossible to read because of the massive amount of these messages:

Nov  1 05:17:41 R7UNRAID kernel: IPv6: ADDRCONF(NETDEV_UP): veth1e6b4ff: link is not ready
Nov  1 05:17:41 R7UNRAID kernel: docker0: port 12(veth1e6b4ff) entered blocking state
Nov  1 05:17:41 R7UNRAID kernel: docker0: port 12(veth1e6b4ff) entered forwarding state
Nov  1 05:17:41 R7UNRAID kernel: docker0: port 12(veth1e6b4ff) entered disabled state
Nov  1 05:17:42 R7UNRAID kernel: CIFS VFS: BAD_NETWORK_NAME: \\192.168.1.1\WD External
Nov  1 05:17:42 R7UNRAID kernel: eth0: renamed from veth0cbfcee
Nov  1 05:17:42 R7UNRAID kernel: IPv6: ADDRCONF(NETDEV_CHANGE): veth1e6b4ff: link becomes ready
Nov  1 05:17:42 R7UNRAID kernel: docker0: port 12(veth1e6b4ff) entered blocking state
Nov  1 05:17:42 R7UNRAID kernel: docker0: port 12(veth1e6b4ff) entered forwarding state

This one should be investigated:

Nov  1 05:17:42 R7UNRAID kernel: TCP: request_sock_TCP: Possible SYN flooding on port 51328. Sending cookies.  Check SNMP counters.

Your remote share server is 192.168.1.1.  That's normally a router address.  Is your WD External attached to your router?

Link to comment
4 minutes ago, SuberSeb said:

Yes, WD External is share on router. But I don't have that share at all, it's renamed to WDEX. Also I don't have any mounts to WD External share in Unraid.

Where is it renamed to WDEX?  UD mount point?  UD will still have to mount it by its name on the router.

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.