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


Recommended Posts

6 hours ago, ClintE said:

BTW, this does not happen on an older version of unRAID that I haven't updated yet (think it's 6.7.something), perhaps because the plugins can't update on that old version.

Yes, you're right @ClintE, I have two servers, the 6.11 server exhibits the problem. The older 6.10 server does not.

 

I upgraded the older 6.10 server to to the current 6.11.5, changed nothing else, now it also exhibit the problem.

 

This is a good clue @dlandon, it's something with how UnRAID changed between 6.10 and 6.11 that's causing the conflict with UD.

Link to comment

Hi All,

 

I'm new to Unraid and just recently got setup and running on a new build. everything is up and running as expected, however I'm having an issue with transferring files via an external USB HDD. I've got the unassigned plugin and when I plug in my HDD via usb port, I can mount the drive and access the files I need. However, now it's intermittently mounting (even though auto mount is disabled) but with i click on the files it doesn't show anything there even though they are there. when i click unmount it doesn't do anything. 

 

I'm not sure even where to start to troubleshoot this issue. this has been my primary method of file transfer because my primary computer is owned by my company and they don't allow network connections to outside servers or i'd just use that method. 

 

Second question is, is there another way to connect to file transport without using another PC?

 

Hardware:

i5-12600k

gigabyte Z690 UD DDR4

32 GB Mem

2x Parity 14 TB WD Reds

2x 4 TB drives

1 SSD Cache Pool

 

Latest Unraid version (6.11.5)

Link to comment
30 minutes ago, 2Cents said:

Hi All,

 

I'm new to Unraid and just recently got setup and running on a new build. everything is up and running as expected, however I'm having an issue with transferring files via an external USB HDD. I've got the unassigned plugin and when I plug in my HDD via usb port, I can mount the drive and access the files I need. However, now it's intermittently mounting (even though auto mount is disabled) but with i click on the files it doesn't show anything there even though they are there. when i click unmount it doesn't do anything. 

 

I'm not sure even where to start to troubleshoot this issue. this has been my primary method of file transfer because my primary computer is owned by my company and they don't allow network connections to outside servers or i'd just use that method. 

 

Second question is, is there another way to connect to file transport without using another PC?

 

Hardware:

i5-12600k

gigabyte Z690 UD DDR4

32 GB Mem

2x Parity 14 TB WD Reds

2x 4 TB drives

1 SSD Cache Pool

 

Latest Unraid version (6.11.5)

Post diagnostics.

Link to comment

Dear all i have the issue that i dont get the script running when i plug in a HDD (USB). Did i miss something how it should work?

I verified that the User Script location is correct and the Script itself is also running within User Script, but does not Autostart.

 

image.thumb.png.a6ba8c5981b1e0ec611deda670c8fa44.png

 

Syslog note the PHP Warnings but i think its just a Warning because of exfat:

Jan 26 00:53:25 Nas kernel: usb 2-2: new SuperSpeed USB device number 7 using xhci_hcd
Jan 26 00:53:30 Nas kernel: usb-storage 2-2:1.0: USB Mass Storage device detected
Jan 26 00:53:30 Nas kernel: usb-storage 2-2:1.0: Quirks match for vid 174c pid 55aa: 400000
Jan 26 00:53:30 Nas kernel: scsi host0: usb-storage 2-2:1.0
Jan 26 00:53:31 Nas kernel: scsi 0:0:0:0: Direct-Access     WDC WD40 EFAX-68JH4N1     0    PQ: 0 ANSI: 6
Jan 26 00:53:31 Nas kernel: sd 0:0:0:0: Attached scsi generic sg0 type 0
Jan 26 00:53:31 Nas kernel: sd 0:0:0:0: [sda] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)
Jan 26 00:53:31 Nas kernel: sd 0:0:0:0: [sda] 4096-byte physical blocks
Jan 26 00:53:31 Nas kernel: sd 0:0:0:0: [sda] Write Protect is off
Jan 26 00:53:31 Nas kernel: sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
Jan 26 00:53:31 Nas kernel: sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Jan 26 00:53:31 Nas kernel: sda: sda1
Jan 26 00:53:31 Nas kernel: sd 0:0:0:0: [sda] Attached SCSI disk
Jan 26 00:53:33 Nas unassigned.devices: Adding partition 'sda1'...
Jan 26 00:53:33 Nas unassigned.devices: Mounting partition 'sda1' at mountpoint '/mnt/disks/CoolBackup1'...
Jan 26 00:53:33 Nas unassigned.devices: Mount drive command: /sbin/mount -t 'exfat' -o rw,noatime,nodiratime,nodev,nosuid,umask=000 '/dev/sda1' '/mnt/disks/CoolBackup1'
Jan 26 00:53:33 Nas unassigned.devices: Successfully mounted 'sda1' on '/mnt/disks/CoolBackup1'.
Jan 26 00:53:33 Nas unassigned.devices: PHP Warning: copy(): The first argument to copy() function cannot be a directory in /usr/local/emhttp/plugins/unassigned.devices/include/lib.php on line 1225
Jan 26 00:53:33 Nas unassigned.devices: PHP Warning: chmod(): No such file or directory in /usr/local/emhttp/plugins/unassigned.devices/include/lib.php on line 1226
Jan 26 00:53:33 Nas unassigned.devices: Running device script: 'packages' with action 'ADD'.

 

Script:

#!/bin/bash
rsync -a --no-perms --no-owner --no-group /mnt/user/Nas /mnt/disks/CoolBackup1/
umount -l /mnt/disks/CoolBackup1

 

Link to comment
4 minutes ago, NasMuc said:

I verified that the User Script location is correct and the Script itself is also running within User Script, but does not Autostart.

The device script "/boot/config/plugins/unassigned.devices/packages/" is a directory not a script file.  This is the script that is executed when the device is auto mounted.  The User script is the script that is tracked to show the "Running" condition when it is run in the User Script plugin.

 

Click on the 'Help' icon in the upper right part of the page and read the help script - the question mark in the circle.

Link to comment
12 hours ago, 2Cents said:

Your disk is dropping off-line or is being removed before it is unmounted:

Jan 24 16:51:27 LunaServer  ntfs-3g[13140]: ntfs_attr_pread_i: ntfs_pread failed: Input/output error
Jan 24 16:51:27 LunaServer  ntfs-3g[13140]: Failed to read vcn 0x0 from inode 5: Input/output error
Jan 24 16:51:27 LunaServer  ntfs-3g[13140]: ntfs_attr_pread_i: ntfs_pread failed: Input/output error
Jan 24 16:51:27 LunaServer  ntfs-3g[13140]: Failed to read vcn 0x0 from inode 5: Input/output error
Jan 24 16:51:27 LunaServer  ntfs-3g[13140]: ntfs_attr_pread_i: ntfs_pread failed: Input/output error
Jan 24 16:51:27 LunaServer  ntfs-3g[13140]: Failed to read vcn 0x0 from inode 5: Input/output error
Jan 24 16:51:27 LunaServer  ntfs-3g[13140]: ntfs_attr_pread_i: ntfs_pread failed: Input/output error
Jan 24 16:51:27 LunaServer  ntfs-3g[13140]: Failed to read vcn 0x0 from inode 5: Input/output error
Jan 24 16:51:27 LunaServer kernel: Buffer I/O error on dev sdf1, logical block 36, async page read

How is it connected?

Link to comment
16 minutes ago, dlandon said:

Your disk is dropping off-line or is being removed before it is unmounted:

Jan 24 16:51:27 LunaServer  ntfs-3g[13140]: ntfs_attr_pread_i: ntfs_pread failed: Input/output error
Jan 24 16:51:27 LunaServer  ntfs-3g[13140]: Failed to read vcn 0x0 from inode 5: Input/output error
Jan 24 16:51:27 LunaServer  ntfs-3g[13140]: ntfs_attr_pread_i: ntfs_pread failed: Input/output error
Jan 24 16:51:27 LunaServer  ntfs-3g[13140]: Failed to read vcn 0x0 from inode 5: Input/output error
Jan 24 16:51:27 LunaServer  ntfs-3g[13140]: ntfs_attr_pread_i: ntfs_pread failed: Input/output error
Jan 24 16:51:27 LunaServer  ntfs-3g[13140]: Failed to read vcn 0x0 from inode 5: Input/output error
Jan 24 16:51:27 LunaServer  ntfs-3g[13140]: ntfs_attr_pread_i: ntfs_pread failed: Input/output error
Jan 24 16:51:27 LunaServer  ntfs-3g[13140]: Failed to read vcn 0x0 from inode 5: Input/output error
Jan 24 16:51:27 LunaServer kernel: Buffer I/O error on dev sdf1, logical block 36, async page read

How is it connected?

 

it's two different drives with same issue connected via USB. one is a 1 TB solid state USB-C, and one is a powered 8TB HDD USB-A 3.0. tried different ports as well. Not sure what's happening.  

Link to comment
3 minutes ago, 2Cents said:

 

it's two different drives with same issue connected via USB. one is a 1 TB solid state USB-C, and one is a powered 8TB HDD USB-A 3.0. tried different ports as well. Not sure what's happening.  

Cables?  Try USB 2.0 ports.  Check BIOS for legacy USB support.

Link to comment
On 1/26/2023 at 8:11 AM, dlandon said:

Cables?  Try USB 2.0 ports.  Check BIOS for legacy USB support.

Ok, so it seems to be working but I don't know if I actually fixed it or not. I went into bios and confirmed that Legacy USB was enabled already. what I did changed though was enabling VT-d (IOMMU). I don't see how that would affect this but since then it's been working. or maybe the reboot helped somehow too. Will post again if the issue returns. thanks for the help so far!

Link to comment

I've just had UD again misdetect a device and run an automount script on the wrong drive. 

 

My backup drive is

 scr.png.e628cfdd4083af4a9755f4b17af10caa.png

 

That's the only drive that has a script assigned and automount enabled in historical devices. It mounts to an UNRAID_BACKUP mountpoint.

 

I connected a different drive that identifies completely differently:

 

drive.thumb.png.ab8b35a6f6a07dd59c1ad94ddeb10e3a.png

 

And has a different mountpoint (default, not manually changed), no automount and no script:

 

script.thumb.png.7c3ab3bb6ac502e37b76bf799c33bd96.png

 

But it automounted on UNRAID_BACKUP and the script was run.

Clicking the mount button tries to mount to the correct mountpoint and fails since the partition is already mounted of course.

The only thing there seems to be in common is that linux assigned sdg to both drives.

 

log2.thumb.png.4fd48f28f4e793e625c38711573f939a.png

 

Had to kill the script and unmount manually. 

 

 

unraid-diagnostics-20230129-1249.zip

image.png

Edited by Kilrah
Link to comment
46 minutes ago, Kilrah said:

But it automounted on UNRAID_BACKUP and the script was run.

When one drive is removed and another added, Linux will assign the same sdX to the new drive.  That's not a problem.

 

I suspect that the usb manager may be causing this issue.  It looks like ithe removed drive was found after it was removed and then the new drive.  The removed drive was then auto mounted, and when the new drive was found, UD did not mount it because sdg1 was already mounted.  I'm not familiar with how the usb manager works, but maybe @SimonF can offer some insight.

 

You can track the udev discovery of disks and hotplug events to see what UD is presented by setting "Debug Log Level" in UD settings to "Udev and Hotplug".  You can then see what udev finds and how it's being presented to UD.

Link to comment
4 minutes ago, dlandon said:

You can track the udev discovery of disks and hotplug events to see what UD is presented by setting "Debug Log Level" in UD settings to "Udev and Hotplug".  You can then see what udev finds and how it's being presented to UD.

OK, I've enabled that, will report if it happens again. It's of course not really reproducible but seems to happen once every couple of months with no clear pattern...

Link to comment
3 minutes ago, Kilrah said:

OK, I've enabled that, will report if it happens again. It's of course not really reproducible but seems to happen once every couple of months with no clear pattern...

Maybe when disks are swapped quickly?  Not giving enoough time for things to settle.

Link to comment
1 hour ago, dlandon said:

I suspect that the usb manager may be causing this issue.  It looks like ithe removed drive was found after it was removed and then the new drive.  The removed drive was then auto mounted, and when the new drive was found, UD did not mount it because sdg1 was already mounted.  I'm not familiar with how the usb manager works, but maybe @SimonF can offer some insight.

USB manager does not mount a device but could connect to a VM. Looking at the looks USB Manager took no action as no mapping found it would have just added to my .ini file.

 

Does look like UA mounted the disk ok but was triggered again, could that be the backup script?

 

Jan 29 12:48:00 Unraid usb_manager: Info: rc.usb_manager usb_add JMicron_USB_to_ATA_ATAPI_Bridge_0123456789ABCDEF /dev/bus/usb/002/008 002 008
Jan 29 12:48:00 Unraid usb_manager: Info: rc.usb_manager Autoconnect No Mapping found JMicron_USB_to_ATA_ATAPI_Bridge_0123456789ABCDEF /dev/bus/usb/002/008 002 008 port 2-3
Jan 29 12:48:01 Unraid kernel: scsi 7:0:0:0: Direct-Access     JMicron  Generic          0508 PQ: 0 ANSI: 6
Jan 29 12:48:01 Unraid kernel: sd 7:0:0:0: Attached scsi generic sg6 type 0
Jan 29 12:48:02 Unraid kernel: sd 7:0:0:0: [sdg] 468862128 512-byte logical blocks: (240 GB/224 GiB)
Jan 29 12:48:02 Unraid kernel: sd 7:0:0:0: [sdg] Write Protect is off
Jan 29 12:48:02 Unraid kernel: sd 7:0:0:0: [sdg] Mode Sense: 47 00 00 08
Jan 29 12:48:02 Unraid kernel: sd 7:0:0:0: [sdg] Disabling FUA
Jan 29 12:48:02 Unraid kernel: sd 7:0:0:0: [sdg] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Jan 29 12:48:02 Unraid kernel: sdg: sdg1
Jan 29 12:48:02 Unraid kernel: sd 7:0:0:0: [sdg] Attached SCSI disk
Jan 29 12:48:03 Unraid unassigned.devices: Adding partition 'sdg1'...
Jan 29 12:48:03 Unraid unassigned.devices: Mounting partition 'sdg1' at mountpoint '/mnt/disks/UNRAID_BACKUP'...
Jan 29 12:48:03 Unraid unassigned.devices: Mount drive command: /sbin/mount -t 'xfs' -o rw,noatime,nodiratime '/dev/sdg1' '/mnt/disks/UNRAID_BACKUP'
Jan 29 12:48:03 Unraid kernel: XFS (sdg1): Mounting V5 Filesystem
Jan 29 12:48:03 Unraid kernel: XFS (sdg1): Ending clean mount
Jan 29 12:48:03 Unraid unassigned.devices: Successfully mounted 'sdg1' on '/mnt/disks/UNRAID_BACKUP'.
Jan 29 12:48:03 Unraid unassigned.devices: Running device script: 'UNRAID_BACKUP.sh' with action 'ADD'.
Jan 29 12:48:06 Unraid UNRAID_BACKUP: Started
Jan 29 12:48:19 Unraid unassigned.devices: Adding partition 'sdg1'...
Jan 29 12:48:19 Unraid unassigned.devices: Mounting partition 'sdg1' at mountpoint '/mnt/disks/JMicron_Generic'...
Jan 29 12:48:19 Unraid unassigned.devices: Partition 'sdg1' is already mounted.
Jan 29 12:48:19 Unraid unassigned.devices: Partition 'JMicron Generic' cannot be mounted.

 

Link to comment
27 minutes ago, SimonF said:

Does look like UA mounted the disk ok but was triggered again, could that be the backup script?

UA mounted the disk in "UNRAID_BACKUP", which I initially didn't notice, and the attempt to mount in "JMicron_Generic" was me clicking the Mount button (it failed since it was already mounted).

Edited by Kilrah
Link to comment
1 hour ago, Kilrah said:

UA mounted the disk in "UNRAID_BACKUP", which I initially didn't notice, and the attempt to mount in "JMicron_Generic" was me clicking the Mount button (it failed since it was already mounted).

Keep the UD logging on until it happens again.  This will show us better what is happening.

Link to comment
1 hour ago, SimonF said:

USB manager does not mount a device but could connect to a VM. Looking at the looks USB Manager took no action as no mapping found it would have just added to my .ini file.

Can you think of anything the USB Manager could possibly do to confuse udev?  I have no idea why udev would detect a removed device and report it to UD.

Link to comment
19 minutes ago, dlandon said:

Can you think of anything the USB Manager could possibly do to confuse udev?  I have no idea why udev would detect a removed device and report it to UD.

Not that I can think of. USBM udev rules just spawn a process to disconnect from VM or connect and update the ini files. Normally for a removal I just remove the ini entries. rules below for info.

 


ACTION=="add",SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",RUN+="/usr/local/emhttp/plugins/usb_manager/scripts/rc.usb_manager usb_add >/dev/null 2>&1 & disown"
ACTION=="remove",SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",RUN+="/usr/local/emhttp/plugins/usb_manager/scripts/rc.usb_manager usb_remove >/dev/null 2>&1 & disown"
ACTION=="add",SUBSYSTEM=="tty",RUN+="/usr/local/emhttp/plugins/usb_manager/scripts/rc.usb_manager tty_add >/dev/null 2>&1 & disown"

 

Link to comment
4 minutes ago, SimonF said:

Not that I can think of. USBM udev rules just spawn a process to disconnect from VM or connect and update the ini files. Normally for a removal I just remove the ini entries. rules below for info.

 


ACTION=="add",SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",RUN+="/usr/local/emhttp/plugins/usb_manager/scripts/rc.usb_manager usb_add >/dev/null 2>&1 & disown"
ACTION=="remove",SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",RUN+="/usr/local/emhttp/plugins/usb_manager/scripts/rc.usb_manager usb_remove >/dev/null 2>&1 & disown"
ACTION=="add",SUBSYSTEM=="tty",RUN+="/usr/local/emhttp/plugins/usb_manager/scripts/rc.usb_manager tty_add >/dev/null 2>&1 & disown"

 

UD does the same thing.  I wasn't sure how you handled a udev event.  The only disk Unraid sees as unassigned in this case is the JMicron.  UD looks up the disk configuration by the serial number of the disk.  I don't see how UD can find the wrong one, unless the config file is corrupted in ram.

Link to comment

When trying to clear/format my nvme drive on Unassigned Devices it's still stays grey on the mount button. The passthrough is not selected for it. I had an NVME disk assigned to UD before however recently I had 4 nvme drives plugged into a mixture of pci-e 1x and 4x lanes which resulted in a serious problem and slow speeds when I attempted to mirror them in zfs raid 10. I ended up having to remove the devices after many hard restarts and testing them on other computers. Anyone have any ideas what I can do to clear out the history of this device or is the best way to zero out the nvme? I've tried creating a new zpool and deleting it with being assigned to the device thinking that would clear it out but no luck.

Edited by Andrew Dens
Link to comment
27 minutes ago, Andrew Dens said:

When trying to clear/format my nvme drive on Unassigned Devices it's still stays grey on the mount button. The passthrough is not selected for it. I had an NVME disk assigned to UD before however recently I had 4 nvme drives plugged into a mixture of pci-e 1x and 4x lanes which resulted in a serious problem and slow speeds when I attempted to mirror them in zfs raid 10. I ended up having to remove the devices after many hard restarts and testing them on other computers. Anyone have any ideas what I can do to clear out the history of this device or is the best way to zero out the nvme? I've tried creating a new zpool and deleting it with being assigned to the device thinking that would clear it out but no luck.

Post diagnostics.

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.