[unRAID 6 beta14+] Unassigned Devices [former Auto Mount USB]


Recommended Posts

ok, been working on this for a bit with a ton of googling

 

i have this script that does exactly what i want it to do

 

for r in ${DESTINATION}/*.MOV; do
mod_date=$(stat --format %y "$i"|awk '{print $1"_"$2}'|cut -f1 -d'.'|sed 's/[: -]//g')
cp "$i" "$mod_date$i"
done
fi

 

It appears that you may have carriage returns in this script.  Linux does not like carriage returns.  Use an editor that is Linux compatible and uses line feeds to terminate lines.

 

The "fi" at the end does not have a corresponding "if".

 

thnaks for the tips. I am using Notepad++ and set the language to "shell"

I am no longer using the code posted above.

Link to comment

Hey folks...

 

Trying to get a 2TB drive mounted with Unassigned Devices. I plan on using it for DVR software Blue Iris running in a Windows 10 VM.

 

When I first added the disk to Unassigned Devices it had already been formatted as NTFS. I was able to mount and share the drive no problem. I pointed Blue Iris at is and was getting errors that it could not write. I manually copied some files to the share and this worked fine.

 

My next thought (I should state I am really new to UnRaid and not a Linux guy yet) was to create a image on the the disk and mount it as a local drive in the VM. This was not an ideal solution as it locks the records to the VM only but better then having to write out the array and constant party writes it would generate. Windows saw the disk as unformatted (expected) so I tried to format it. When I do this the format hangs at 0% and the Unraid GUI stops responding. Everything else seems to continue to work. The only option I could find was to reboot the server to get the GUI back. I repeated this a couple of times to confirm it was the format causing the hang.

 

Next thought is the disk was not formatted properly. so following the commands earlier in this thread I tried to format the disk.

gdisk /dev/sdX

  o

  n  (taking defaults)

  w

mkfs.xfs /dev/sdX1

 

Now I cannot mount the disk I a greyed out mount button and a greyed out format button (see attached).

 

Any thoughts on getting this disk formatted for a share for a Windows 10 VM?

 

Again I am new so be gentle (or at least thorough). Let me know if I can provide anything to help troubleshoot or find a solution!

 

Many thanks in advance!

 

Mike

unraid-UD.PNG.751e2acce67d3e95b9abd14bbc96925d.PNG

Link to comment

Hey folks...

 

Trying to get a 2TB drive mounted with Unassigned Devices. I plan on using it for DVR software Blue Iris running in a Windows 10 VM.

 

When I first added the disk to Unassigned Devices it had already been formatted as NTFS. I was able to mount and share the drive no problem. I pointed Blue Iris at is and was getting errors that it could not write. I manually copied some files to the share and this worked fine.

 

My next thought (I should state I am really new to UnRaid and not a Linux guy yet) was to create a image on the the disk and mount it as a local drive in the VM. This was not an ideal solution as it locks the records to the VM only but better then having to write out the array and constant party writes it would generate. Windows saw the disk as unformatted (expected) so I tried to format it. When I do this the format hangs at 0% and the Unraid GUI stops responding. Everything else seems to continue to work. The only option I could find was to reboot the server to get the GUI back. I repeated this a couple of times to confirm it was the format causing the hang.

 

Next thought is the disk was not formatted properly. so following the commands earlier in this thread I tried to format the disk.

gdisk /dev/sdX

  o

  n  (taking defaults)

  w

mkfs.xfs /dev/sdX1

 

Now I cannot mount the disk I a greyed out mount button and a greyed out format button (see attached).

 

Any thoughts on getting this disk formatted for a share for a Windows 10 VM?

 

Again I am new so be gentle (or at least thorough). Let me know if I can provide anything to help troubleshoot or find a solution!

 

Many thanks in advance!

 

Mike

 

Why not just pass the disk into the VM then share it from the VM if you need network access

Link to comment

Sounds like a great plan.. Just trying to figure out how to do that :-) I don't see an option with the VM to pass disks. Just images. Still reading/searching..

 

Why not just pass the disk into the VM then share it from the VM if you need network access

 

Stop VM

Edit VM

On the bottom in USB DEVICES, check your drive

Start VM

Profit!

image.png.c8014cb6c5db839a2499348311165a26.png

Link to comment

Looking forward to the profit part!

 

I don't see anything in the USB part but the USB Keyboard dongle that I have. No other devices appear there. To be sure the plugin "unassigned devices" was not taking possession of the drive I removed it. I see the disk listed under unassigned on the main page, but not as an option within the VM. I am searching how to do this. Seems like the right answer, just need to figure out how :-)

 

Thanks!

 

Mike

 

 

***edit

 

For what its worth the drive is a SATA drive attached to the motherboard that I am trying to use.

Stop VM

Edit VM

On the bottom in USB DEVICES, check your drive

Start VM

Profit!

Link to comment

I'm new to this plugin. Trying to use it on my 6.1.4 unRaid to add a disk that I got from a friend (it has content and he claims it was formatted as NTFS).  The disk shows up in Unassigned Devices but there is no Mount button :

 

https://www.dropbox.com/s/uilwyrsc1r2dux5/Unassigned%20Devices.png?dl=0

 

fdisk -l for this disk gives this :

 

Disk /dev/sdc: 4000.8 GB, 4000787030016 bytes
256 heads, 63 sectors/track, 484501 cylinders, total 7814037168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

 

Any idea how to mount this disk?

Link to comment

I got it working.. I had to modify the XML and add in code for the drive. Although it is working I think I am going to go back and try Unassigned Devices plugin again. I would prefer to have it operate as a share from Unraid then a share out of windows.... Really only to keep the shares all consolidated. More playing around tonight.

 

Thanks for the idea.. At least I am operating for now.

 

Stop VM

Edit VM

On the bottom in USB DEVICES, check your drive

Start VM

Profit!

Link to comment

I'm new to this plugin. Trying to use it on my 6.1.4 unRaid to add a disk that I got from a friend (it has content and he claims it was formatted as NTFS).  The disk shows up in Unassigned Devices but there is no Mount button :

 

https://www.dropbox.com/s/uilwyrsc1r2dux5/Unassigned%20Devices.png?dl=0

 

fdisk -l for this disk gives this :

 

Disk /dev/sdc: 4000.8 GB, 4000787030016 bytes
256 heads, 63 sectors/track, 484501 cylinders, total 7814037168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1  4294967295  2147483647+  ee  [b]GPT[/b]
Partition 1 does not start on physical sector boundary.

 

Any idea how to mount this disk?

 

Pretty sure you have to use gdisk, not fdisk, on a GPT drive.

Link to comment

Ok... Need some help.

 

I setup a 2TB drive, finally got it formatted, mounted and shared out correctly using the Unassigned Devices Plugin. In a Win10 VM I am running Blue Iris (DVR software). I am trying to push the recordings from it to the 2TB drive.  From Windows I can see the share and have access to it to create/delete etc. When point Blue Iris towards it, it is unable to record and generates an error "trouble creating file". This is indication as I understand of a write error. Pointing Blue Iris to other local drives and normal shares from UnRaid works fine. It is only the share from Unassigned Devices that causes this error.

 

A couple posts back it was suggested that I just attached the drive to the VM. Doing this the drive works fine. Windows sees it as an attached drive and I have no problems recording.

 

Am I missing something? What logs can I look at to see possible permission problems being thrown by Unassigned Devices? Any suggestions on trouble shooting are greatly appreciated!

 

Many thanks in advance,

 

Mike

Link to comment

I got it working.. I had to modify the XML and add in code for the drive. Although it is working I think I am going to go back and try Unassigned Devices plugin again. I would prefer to have it operate as a share from Unraid then a share out of windows.... Really only to keep the shares all consolidated. More playing around tonight.

 

Thanks for the idea.. At least I am operating for now.

 

Stop VM

Edit VM

On the bottom in USB DEVICES, check your drive

Start VM

Profit!

 

8)

Link to comment

Ok... Need some help.

 

I setup a 2TB drive, finally got it formatted, mounted and shared out correctly using the Unassigned Devices Plugin. In a Win10 VM I am running Blue Iris (DVR software). I am trying to push the recordings from it to the 2TB drive.  From Windows I can see the share and have access to it to create/delete etc. When point Blue Iris towards it, it is unable to record and generates an error "trouble creating file". This is indication as I understand of a write error. Pointing Blue Iris to other local drives and normal shares from UnRaid works fine. It is only the share from Unassigned Devices that causes this error.

 

A couple posts back it was suggested that I just attached the drive to the VM. Doing this the drive works fine. Windows sees it as an attached drive and I have no problems recording.

 

Am I missing something? What logs can I look at to see possible permission problems being thrown by Unassigned Devices? Any suggestions on trouble shooting are greatly appreciated!

 

Many thanks in advance,

 

Mike

 

is blue iris running as admin, or as an account that has access to the drive?

open notepad as normal and try to save a test text file to the share, then open notepad as admin and see if you can save another text file in the share. I had this issue with CrashPlan some moons ago. Programs that ran as admin did not have access to the mapped shares. Try not pointing iris to the mapped drive and just typing in the smb/ip address and path directly

Link to comment

Just found the Common Script setting. Is that executed before or after the mount? I guess i could experiment and find out. I could have one script int he mount settings and the other in the common and this would solve all my problems i think

 

OK,

    Finally got all this working the way I like.

I ended up leaving that long initial script provided in the first page.

I was able to write up a very simple script to do what I wanted. I'm sure this could be cleaner maybe. But it works without issues and I'm happy.

 

#!/bin/bash
cd /mnt/disks/dji32/DCIM/100MEDIA/
for v in *.MP4
do
mod_datev=$(date +"%m%d%Y%H%M")
mv "$v" /mnt/user/Drone/"$mod_datev$v"
done
cd /mnt/disks/dji32/DCIM/100MEDIA/
for p in *.JPG
do
mod_datep=$(date +"%m%d%Y%H%M")
mv "$p" /mnt/user/Drone/"$mod_datep$p"
done
curl http://192.168.1.2:32400/library/sections/9/refresh?deep=0
curl http://192.168.1.2:32400/library/sections/7/refresh?deep=0

 

it pretty much CD's to the mounted card, Copies the files to the directory it runs out of (/mnt/user/Drone) with the date and time as the filename. then uses Curl to update my plex. Not to figure out the sendmail command. Have it working without issue in windows, but the arguments dont seem to translate well to the Linux version.

Link to comment

Thanks for the ideas Pete. I have tried a few different options. Blue Iris will run as a service or on a user level. Unassigned Devices from what I can tell does not support any permissions for the shares so I assume this makes all its shares public?

With Blue Iris I have run just as a standard user. I have tried giving it elevated permissions and running it as Admin. I have run it as a service using default credentials as well as using an admin account. I have tried with a UNC path as well as mapped drives. All with the same results.

 

The share itself appears to be working with Windows. I can make/delete new files on the share without issue. I would be inclined to blame Blue Iris however it has no problems with any other shares from unraid or other devices.

 

I don't think I have tried using the IP address instead of the UNC name. I will try that as well. Any logging in Unassigned Devices I can look at to see if its reporting anything? I will try the same with Blue Iris and fire a post up on a user forum for them as well to see if they have any ideas.

 

Any ideas or input is greatly appreciated!

 

Thanks,

 

Mike

 

 

is blue iris running as admin, or as an account that has access to the drive?

open notepad as normal and try to save a test text file to the share, then open notepad as admin and see if you can save another text file in the share. I had this issue with CrashPlan some moons ago. Programs that ran as admin did not have access to the mapped shares. Try not pointing iris to the mapped drive and just typing in the smb/ip address and path directly

Link to comment

Thanks for the ideas Pete. I have tried a few different options. Blue Iris will run as a service or on a user level. Unassigned Devices from what I can tell does not support any permissions for the shares so I assume this makes all its shares public?

With Blue Iris I have run just as a standard user. I have tried giving it elevated permissions and running it as Admin. I have run it as a service using default credentials as well as using an admin account. I have tried with a UNC path as well as mapped drives. All with the same results.

 

The share itself appears to be working with Windows. I can make/delete new files on the share without issue. I would be inclined to blame Blue Iris however it has no problems with any other shares from unraid or other devices.

 

I don't think I have tried using the IP address instead of the UNC name. I will try that as well. Any logging in Unassigned Devices I can look at to see if its reporting anything? I will try the same with Blue Iris and fire a post up on a user forum for them as well to see if they have any ideas.

 

Any ideas or input is greatly appreciated!

 

Thanks,

 

Mike

 

 

is blue iris running as admin, or as an account that has access to the drive?

open notepad as normal and try to save a test text file to the share, then open notepad as admin and see if you can save another text file in the share. I had this issue with CrashPlan some moons ago. Programs that ran as admin did not have access to the mapped shares. Try not pointing iris to the mapped drive and just typing in the smb/ip address and path directly

 

I know when apps run and their background service runs as a "Service" as you mentioned have issues with access user mapped drives. but that doesn't seem like the case here since it can access other shared as you mentioned.

for shits and giggles, try this tutorial on how to mount a drive as a service using a bat file and task scheduler. if that doesn't work im clueless.

http://www.tipsdotcom.com/crashplan-network-drive.html

Link to comment

Well I owe you a Beer Pete. If you ever up near Oshawa Ontario Canada poke by.

 

Although not a direct solution you got me headed in a new direction. I got Blue Iris running as a  service again and did some more testing and it was failing. I played around with the service credentials a bit and got it working. For some reason running it as "Local System Account" did not work, nor with "Allow service to interact with desktop" checked. In the account setting I specified the local admin account on the machine and off it went. I would have swore I tried it before but its working now.

 

Anyways... Thanks for taking the time to reply and give me some ideas. I am monitoring now to make sure its good. I just did a full unraid reboot and everything came back online.. Next up Crashplan..

 

Mike

Link to comment

Hi,

 

is there an easy way to add nvme disks (pcie ssds) to the plugins list?

Since they are not yet supported as cache disks, this awesome plugin would be ne next best thing :)

 

Right now they dont show up, you are probably not looking into /dev/nvme* for disks?

Not nesseseraly all features, but at least auto-mount (for VMs) would be nice.

 

If you dont have access to a nvme drive, I could test it for you or provide console output to your device search pattern.

 

Dont mind if it's too much work, it'll probably work without the plugin.

 

Anyway, great plugins so far, keep it up :)

 

I'll try this soon.

 

Any luck with this gfjardim?

 

I'm in the same situation where I have a 256gb nvme drive I want to mount for 2 windows vms but am unable to currently.

 

I am more then happy to help test this and it may be very helpful to unraid itself if this works.

 

Regards,

Jamie

 

Edit: as a side note, the nvme drives show up in lsblk as a disk but not in lsscsi. So it may be worth looking through lsblk for devices of type disk, and checking if their mounted or not? I'm unsure how you do this currently

 

It would still use /dev/ but may be a way to look for them quickly? I haven't touched Linux in a good while so I am most likely wrong

Link to comment

Hi,

 

is there an easy way to add nvme disks (pcie ssds) to the plugins list?

Since they are not yet supported as cache disks, this awesome plugin would be ne next best thing :)

 

Right now they dont show up, you are probably not looking into /dev/nvme* for disks?

Not nesseseraly all features, but at least auto-mount (for VMs) would be nice.

 

If you dont have access to a nvme drive, I could test it for you or provide console output to your device search pattern.

 

Dont mind if it's too much work, it'll probably work without the plugin.

 

Anyway, great plugins so far, keep it up :)

 

I'll try this soon.

 

Any luck with this gfjardim?

 

I'm in the same situation where I have a 256gb nvme drive I want to mount for 2 windows vms but am unable to currently.

 

I am more then happy to help test this and it may be very helpful to unraid itself if this works.

 

Regards,

Jamie

 

Edit: as a side note, the nvme drives show up in lsblk as a disk but not in lsscsi. So it may be worth looking through lsblk for devices of type disk, and checking if their mounted or not? I'm unsure how you do this currently

 

It would still use /dev/ but may be a way to look for them quickly? I haven't touched Linux in a good while so I am most likely wrong

 

Unfortunatly, it seems nvme is a little bit "more different" than one would expect.

 

From what I saw, when I looked through the source code, he is using /dev/sdX (and hdX), but not /dev/nvme (as suspected)

But he also uses /dev/disk/by-id symlinks, probably because unraid itself uses these symlinks and he needs to see wich disk is in fact "unassigned".

 

The thing is, that id wont change, even if your reorganize how your disks are plugged into your mainboard, because its supposed to be unique (serial number etc.). Which is problably why unraid uses it. /dev/sda, sdb and probably even /dev/nvme can change.

I mean, if you have two identical disks how do you know which one is /dev/nvme0 and which is /dev/nvme1? unlike sata ports. pci slots usually dont even have a number on consumer mainboards... but I digress.

 

I dont know if its a bug or if there are good reasons for it, but right now, the kernel does not create a "by-id" symlink. (at least on my system)

It seems, that this need fixing in the kernel. (Source)

 

So I guess, its either a lot of new code needed, wich may end up useless/harmfull if the kernel/unraid changes the nvme behavior or unraid needs to change things, so that a nvme disk behaves like any normal disk, which would need proper testing and therfore some time.

 

It seems, that unRaid 6.2 may add some new stuff regarding sdds, so I guess we wait and see how much love nvme will get.

Link to comment

I had been hoping to use this plug in along with external USB drives for my backup plan.  But with the 5TB USB3 Seagates I purchased I could never get anything better the 30MB/s writing.    I've tried copying with MC from disk shares to the mount and its ~30MB/s at best.  I've tried copying with Windows 10 to the share, and it's ~30MB/s.  I bought a whole new USB3 card and it performed just as poorly as the previous one.  I began to suspect that it was the drive itself.  So I moved the USB3 card to my Windows 10 PC and performance was just as terrible.  Then I discover USB drives by default don't have write caching.  Once I enabled that, the drive took off and was doing 150MB/s.  Looking for something similar in the linux world I've discovered the SYNC command in NTFS-3G, but from my limited knowledge it doesn't appear that the drive is mounting with that. 

Dec  9 12:05:56 Tera ntfs-3g[18552]: Version 2015.3.14 integrated FUSE 27
Dec  9 12:05:56 Tera ntfs-3g[18552]: Mounted /dev/sda2 (Read-Write, label "5TB-External", NTFS 3.1)
Dec  9 12:05:56 Tera ntfs-3g[18552]: Cmdline options: rw,nosuid,nodev,umask=000
Dec  9 12:05:56 Tera ntfs-3g[18552]: Mount options: rw,nosuid,nodev,allow_other,nonempty,relatime,default_permissions,fsname=/dev/sda2,blkdev,blksize=4096

 

Then I learned that NTFS performance with NTFS-3G is just poor in general and CPU bound.  While it does get up there, it never maxes out the cores.  Though I have repurposed an ancient Athlon X2 for unRAID.

 

With

 

dd if=/dev/zero of=/mnt/disks/5TB-External/zero.tmp bs=1M count=1024 conv=fdatasync,notrunc

 

I get ~50MB/s

 

1024+0 records in

1024+0 records out

1073741824 bytes (1.1 GB) copied, 22.4819 s, 47.8 MB/s

 

Have I run out of options now?  I wanted them attach to unRAID so my Windows PC could sleep.  Would a Windows VM running on unRAID get better performance?  Not that I have the memory for that.

Link to comment

Hi,

 

I am using this plugin to auto-mount and hare my permanent SSD apps drive. Thank you for the great tool!

I have a question about the sharing: should share=on survive reboots? In other words, should it automatically re-share the drive after rebooting? I am asking because auto-mounting works like a charm, but I need to manually turn on sharing on each reboot. Is there a setting somewhere I miss for this?

 

thank you in advance for the support!

 

Edit: actually I have the feeling sometimes it is auto-resharing the drive, sometimes not. Not sure about that though.

Link to comment
  • Squid locked this topic
Guest
This topic is now closed to further replies.