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


Recommended Posts

  • 2 weeks later...

Great job gfjardim! First time I tried this plugin and all I can say is Yes! This plugin adds to unraid some basic functionality ... that should be included by unraid itself!

Thx mate.

EDIT: How do you get your temps in your main screen like shown in your youtube video?

Link to comment

Great job gfjardim! First time I tried this plugin and all I can say is Yes! This plugin adds to unraid some basic functionality ... that should be included by unraid itself!

Thx mate.

EDIT: How do you get your temps in your main screen like shown in your youtube video?

 

Here's where to start to get your temps showing.

 

Luca did that UPS script ever see the light of day and if so did it work?

Link to comment

I am sorry chbmb but I have not tried it yet. I was busy migrating my array to v6 and other personal stuff. Now I also have my old server up and running in v6 too. So I will try it definitely this week.

 

No worries, just let me know if it works or not  ;)

Link to comment

I have an rsync script which does monthly external backups of a couple of my shares for offsite storage. Up until now I have been running this script manually from the command line.

 

This morning I decided to test the script capabilities of this plugin and configured it to run my script for me.

 

The webGUI became very unresponsive while the script was running. I didn't actually wait to see if it would eventually respond, instead closing my browser and monitoring progress by tailing the log from the command line.

 

After the script completed in about 30 minutes everything was back to normal.

 

Not sure if this is expected behavior or not, or if anything can be done about it. I can live with it as is now that I know about it.

Link to comment

I have an rsync script which does monthly external backups of a couple of my shares for offsite storage. Up until now I have been running this script manually from the command line.

 

This morning I decided to test the script capabilities of this plugin and configured it to run my script for me.

 

The webGUI became very unresponsive while the script was running. I didn't actually wait to see if it would eventually respond, instead closing my browser and monitoring progress by tailing the log from the command line.

 

After the script completed in about 30 minutes everything was back to normal.

 

Not sure if this is expected behavior or not, or if anything can be done about it. I can live with it as is now that I know about it.

 

I did a little testing and found the same issue.  This plugin should probably run the script in the background so the webpage will come back and not get "stuck" while the script is running.

 

Eventually I will replace SNAP with this plugin, but it has a little ways to go yet.  This is one of the issues.

Link to comment

I have an rsync script which does monthly external backups of a couple of my shares for offsite storage. Up until now I have been running this script manually from the command line.

 

This morning I decided to test the script capabilities of this plugin and configured it to run my script for me.

 

The webGUI became very unresponsive while the script was running. I didn't actually wait to see if it would eventually respond, instead closing my browser and monitoring progress by tailing the log from the command line.

 

After the script completed in about 30 minutes everything was back to normal.

 

Not sure if this is expected behavior or not, or if anything can be done about it. I can live with it as is now that I know about it.

 

I did a little testing and found the same issue.  This plugin should probably run the script in the background so the webpage will come back and not get "stuck" while the script is running.

 

Eventually I will replace SNAP with this plugin, but it has a little ways to go yet.  This is one of the issues.

Thanks for reporting this. I'll fix it soon.

Link to comment

I just started a preclear for a new drive in via Screen terminal in my Backup Server before I throw it into my Main Server. I went to the Backup Server GUI and noticed that there was a monitor for the progress of the preclear in the Unassigned Devices area! This is excellent. BUT I noticed that the speed it reports is very different to the speed being reported at the terminal....

 

I thought it was a lag of sorts so I hit refresh several times and monitored for about 5 mins. Essentially the terminal is reporting ~165MB/s and the GUI is reporting ~135MB/s.

 

Thought I would report it.

 

UPDATE: 20 mins since the screenshot and still reporting 175MB/s at the terminal and 137MB/s in the GUI.

Preclear_report_status_of_Unassigned_Devices_Plugin.jpg.10df787920b20d44b22e9e6746e18207.jpg

Link to comment

 

I just started a preclear for a new drive in via Screen terminal in my Backup Server before I throw it into my Main Server. I went to the Backup Server GUI and noticed that there was a monitor for the progress of the preclear in the Unassigned Devices area! This is excellent. BUT I noticed that the speed it reports is very different to the speed being reported at the terminal....

 

I thought it was a lag of sorts so I hit refresh several times and monitored for about 5 mins. Essentially the terminal is reporting ~165MB/s and the GUI is reporting ~135MB/s.

 

Thought I would report it.

 

UPDATE: 20 mins since the screenshot and still reporting 175MB/s at the terminal and 137MB/s in the GUI.

 

I think I've seen this before. If I remember correctly, one is reported you instantaneous speed and one is the average so far.

Link to comment

 

I just started a preclear for a new drive in via Screen terminal in my Backup Server before I throw it into my Main Server. I went to the Backup Server GUI and noticed that there was a monitor for the progress of the preclear in the Unassigned Devices area! This is excellent. BUT I noticed that the speed it reports is very different to the speed being reported at the terminal....

 

I thought it was a lag of sorts so I hit refresh several times and monitored for about 5 mins. Essentially the terminal is reporting ~165MB/s and the GUI is reporting ~135MB/s.

 

Thought I would report it.

 

UPDATE: 20 mins since the screenshot and still reporting 175MB/s at the terminal and 137MB/s in the GUI.

 

I think I've seen this before. If I remember correctly, one is reported you instantaneous speed and one is the average so far.

 

Ah, makes sense. Maybe a good change would be a simple symbolic identifier prefix to the speed variable to indicate that it is an average ..... maybe use x-bar or ~ symbol?

 

 

Link to comment

Nifty plugin. Can it be added to create/change/remove partitions on the unassigned drive(s)? Right now I have one 2TB drive, but want to split it in two maybe. This utility would be great if it had that capability.

 

Thanks for the time.

 

Link to comment

I added something like that (quick and dirty) as a script. It works when USB disk is mounted/unmounted manually from GUI.

 

But it doesn't work when unRAID is restarted. It is not executed looking at /etc/exports contents.

 

case $ACTION in
  'ADD' )
    // do your stuff here
    echo '"/mnt/disks/wd2t" -async,no_subtree_check,fsid=150 *(rw,insecure,anongid=100,anonuid=99,all_squash)' >>/etc/exports
exportfs -rav
  ;;
  'REMOVE' )
sed '/wd2t/d' /etc/exports > /tmp/exp
cp -f /tmp/exp /etc/exports
exportfs -rav
  ;;
esac

Link to comment

Is there a way to add an event to a USB device just being plugged in and removed?  The idea is similar to what Windows does.  A sound is made when a device is plugged in or removed.

 

I use the following in my SNAP notify configuration.

Plugged in:

beep  -l 200 -f 600 -n -l 200 -f 800

 

Removed:

beep  -l 200 -f 800 -n -l 200 -f 600

 

This lets me know that the device was recognized when plugged in and that the script should start shortly.  I make another sound when the script starts and stops so I can tell when it has started and stopped.

 

This is nice because I can just plug a device into the server and listen for the sounds to know when the device is plugged in and the script completed.

Link to comment

Is there a way to add an event to a USB device just being plugged in and removed?  The idea is similar to what Windows does.  A sound is made when a device is plugged in or removed.

 

I use the following in my SNAP notify configuration.

Plugged in:

beep  -l 200 -f 600 -n -l 200 -f 800

 

Removed:

beep  -l 200 -f 800 -n -l 200 -f 600

 

This lets me know that the device was recognized when plugged in and that the script should start shortly.  I make another sound when the script starts and stops so I can tell when it has started and stopped.

 

This is nice because I can just plug a device into the server and listen for the sounds to know when the device is plugged in and the script completed.

In post 9 he gave an example of a beep function and calling it when plugged in. You could then add a different beep to the removed section or when your script finishes.

Link to comment

I have converted from SNAP to the unassigned devices plugin.  I managed to get the beeps working like I want.

 

I have a few suggestions:

- When editing a drive script and "Done" is clicked, return to the "Unassigned Devices" tab and not the "Array Devices" tab.

- When a drive is "Unmounted" from the webpage and the drive can't be unmounted because it is busy, bring up a message to indicate that, or show a "busy" indicator on the webpage, or better yet disable (grey out) the "Unmount" button until the drive is no longer busy.  It is logged, but is a bit confusing when "Unmount" is clicked and it returns showing "Unmount" again.

 

Other than that, the plugin works quite well and is more in line with the V6 Dynamix layout than SNAP.

Link to comment

I'm also getting this in the middle of running a backup script.

 

Jun 7 14:49:41 MediaServer udevd[18542]: timeout: killing '/usr/local/sbin/unassigned_mount' [18558]
Jun 7 14:49:41 MediaServer udevd[18542]: '/usr/local/sbin/unassigned_mount' [18558] terminated by signal 9 (Killed)

 

The backup seems to run fine, I just get these log entries.  I'm not sure if this is a problem or not.

 

EDIT: I've found a few more issues.

 

When I have a USB drive set to not auto mount and plug it in and then unplug it I get the following:

Jun 7 15:29:11 MediaServer kernel: usb 1-5: new high-speed USB device number 21 using xhci_hcd
Jun 7 15:29:11 MediaServer kernel: usb-storage 1-5:1.0: USB Mass Storage device detected
Jun 7 15:29:11 MediaServer kernel: usb-storage 1-5:1.0: Quirks match for vid 1058 pid 070a: 200000
Jun 7 15:29:11 MediaServer kernel: scsi host24: usb-storage 1-5:1.0
Jun 7 15:29:12 MediaServer kernel: scsi 24:0:0:0: Direct-Access WD My Passport 070A 2018 PQ: 0 ANSI: 4
Jun 7 15:29:12 MediaServer kernel: sd 24:0:0:0: Attached scsi generic sg11 type 0
Jun 7 15:29:12 MediaServer kernel: sd 24:0:0:0: [sdm] 1952151552 512-byte logical blocks: (999 GB/930 GiB)
Jun 7 15:29:12 MediaServer kernel: scsi 24:0:0:1: Enclosure WD SES Device 2018 PQ: 0 ANSI: 4
Jun 7 15:29:12 MediaServer kernel: sd 24:0:0:0: [sdm] Write Protect is off
Jun 7 15:29:12 MediaServer kernel: sd 24:0:0:0: [sdm] Mode Sense: 2b 00 10 08
Jun 7 15:29:12 MediaServer kernel: sd 24:0:0:0: [sdm] No Caching mode page found
Jun 7 15:29:12 MediaServer kernel: sd 24:0:0:0: [sdm] Assuming drive cache: write back
Jun 7 15:29:12 MediaServer kernel: scsi 24:0:0:1: Attached scsi generic sg12 type 13
Jun 7 15:29:13 MediaServer kernel: sdm: sdm1
Jun 7 15:29:13 MediaServer kernel: sd 24:0:0:0: [sdm] Attached SCSI disk
Jun 7 15:29:29 MediaServer kernel: usb 1-5: USB disconnect, device number 21
Jun 7 15:29:29 MediaServer kernel: sd 24:0:0:0: [sdm] Synchronizing SCSI cache
Jun 7 15:29:29 MediaServer kernel: sd 24:0:0:0: [sdm] Synchronize Cache(10) failed: Result: hostbyte=0x01 driverbyte=0x00

 

When I mount and unmount it from the webgui I get the following:

Jun 7 15:33:13 MediaServer kernel: usb 1-5: new high-speed USB device number 22 using xhci_hcd
Jun 7 15:33:13 MediaServer kernel: usb-storage 1-5:1.0: USB Mass Storage device detected
Jun 7 15:33:13 MediaServer kernel: usb-storage 1-5:1.0: Quirks match for vid 1058 pid 070a: 200000
Jun 7 15:33:13 MediaServer kernel: scsi host25: usb-storage 1-5:1.0
Jun 7 15:33:14 MediaServer kernel: scsi 25:0:0:0: Direct-Access WD My Passport 070A 2018 PQ: 0 ANSI: 4
Jun 7 15:33:14 MediaServer kernel: sd 25:0:0:0: Attached scsi generic sg11 type 0
Jun 7 15:33:14 MediaServer kernel: scsi 25:0:0:1: Enclosure WD SES Device 2018 PQ: 0 ANSI: 4
Jun 7 15:33:14 MediaServer kernel: sd 25:0:0:0: [sdm] 1952151552 512-byte logical blocks: (999 GB/930 GiB)
Jun 7 15:33:14 MediaServer kernel: sd 25:0:0:0: [sdm] Write Protect is off
Jun 7 15:33:14 MediaServer kernel: sd 25:0:0:0: [sdm] Mode Sense: 2b 00 10 08
Jun 7 15:33:14 MediaServer kernel: sd 25:0:0:0: [sdm] No Caching mode page found
Jun 7 15:33:14 MediaServer kernel: sd 25:0:0:0: [sdm] Assuming drive cache: write back
Jun 7 15:33:14 MediaServer kernel: scsi 25:0:0:1: Attached scsi generic sg12 type 13
Jun 7 15:33:14 MediaServer kernel: sdm: sdm1
Jun 7 15:33:14 MediaServer kernel: sd 25:0:0:0: [sdm] Attached SCSI disk
Jun 7 15:33:26 MediaServer emhttp: sendOutput: write
Jun 7 15:33:52 MediaServer emhttp: /usr/bin/tail -n 42 -f /var/log/syslog 2>&1
Jun 7 15:34:11 MediaServer php: /usr/local/sbin/unassigned_mount /dev/sdm
Jun 7 15:34:12 MediaServer ntfs-3g[17885]: Version 2015.3.14 integrated FUSE 27
Jun 7 15:34:12 MediaServer ntfs-3g[17885]: Mounted /dev/sdm1 (Read-Write, label "WeeklyBackups", NTFS 3.1)
Jun 7 15:34:12 MediaServer ntfs-3g[17885]: Cmdline options: rw,nosuid,nodev,umask=000
Jun 7 15:34:12 MediaServer ntfs-3g[17885]: Mount options: rw,nosuid,nodev,allow_other,nonempty,relatime,default_permissions,fsname=/dev/sdm1,blkdev,blksize=4096
Jun 7 15:34:12 MediaServer ntfs-3g[17885]: Global ownership and permissions enforced, configuration type 1
Jun 7 15:34:17 MediaServer emhttp: /usr/bin/tail -n 42 -f /var/log/syslog 2>&1
Jun 7 15:34:24 MediaServer php: /usr/local/sbin/unassigned_umount /dev/sdm
Jun 7 15:34:24 MediaServer ntfs-3g[17885]: Unmounting /dev/sdm1 (WeeklyBackups)
Jun 7 15:34:24 MediaServer php: 
Jun 7 15:34:24 MediaServer php: Warning: rmdir(/mnt/disks/WeeklyBackups): Device or resource busy in /usr/local/emhttp/plugins/unassigned.devices/include/lib.php on line 205

 

Notning was done but mount and unmount.  The device shows as busy.

 

I'm not a php expert but I believe this function is not right:

function do_unmount($dev, $dir) {
  if (is_mounted($dev) != 0){
    debug("Unmounting ${dev}...");
    $o = shell_exec("umount '${dev}' 2>&1");
    for ($i=0; $i < 10; $i++) {
      if (! is_mounted($dev)){
        if (is_dir($dir)) rmdir($dir);
        debug("Successfully unmounted '$dev'"); return TRUE;
      } else { sleep(0.5);}
    }
    debug("Unmount of ${dev} failed. Error message: $o"); return FALSE;
  }
}

 

It looks like you want to walk through all the partitions to unmount them ($i).  I don't see where that is happening.

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