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


Recommended Posts

6 hours ago, dlandon said:

I'll have a look and see what makes sense.

 

Thanks a lot.

 

IMHO the question is, what activitiy is a host responsible for on passed through disks:

 

 

#1 check SMART: yes (VM can't check SMART for passed through disks, don't know how or if this works currently)

 

#2 spinup/spindown: yes (VM can't spinup/spindown passed through disks, currently it works perfect, no change required)

 

#3 show "Format" text: no (host does not catch the finish until host reboot - host reboot is not done if VM formats/rebuilds a passed through disk)

 

#4 show Partitions: no (host does not catch new partitions until host reboot - host reboot is not done if VM creates/deletes partitions on a passed through disk)

 

 

So in my opinion the checkbox "passed through" within UD disk settings becomes the driver for #1 to #4 mentioned above on passed through disks.

 

Perhaps you need to talk to Limetech about their vision.

 

Thanks again.

 

Edited by hawihoney
Link to comment

The original idea behind the 'Passed Through' setting was to prevent UD from mounting the disk (if automount was set), and to prevent a user from accidently mounting a disk already mounted in a VM.   It wasn't necessarily intended to provide passed through functionality.

 

When a VM formats a disk, UD isn't aware of that because udev hasn't detected the change.  Udev is triggered when a disk is installed, or a refresh initiated.

Link to comment

Hi all,

 

I hope someone can help me with my problem. I just replaced my 1TB external HDD with an 4TB one for my backups. 

 

First I have formatted it with XFS and mounting was no problem, but I wanted to have this disk being encrypted so I formatted the disk again, now with XFS_encrypted aka LUKS. I chose a password and also put it in the UAD settings. But for some reason mounting this encrypted partition is not possible.

 

May 7 09:55:36 Unraid unassigned.devices: Format disk '/dev/sda' with 'xfs-encrypted' filesystem: meta-data=/dev/mapper/format_sda isize=512 agcount=4, agsize=244187635 blks = sectsz=4096 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=1, rmapbt=0 = reflink=1 data = bsize=4096 blocks=976750537, imaxpct=5 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0, ftype=1 log =internal log bsize=4096 blocks=476928, version=2 = sectsz=4096 sunit=1 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0
May 7 09:55:39 Unraid unassigned.devices: Reloading disk '/dev/sda' partition table.
May 7 09:55:39 Unraid kernel: sda: sda1
May 7 09:55:39 Unraid unassigned.devices: Reload partition table result: /dev/sda: re-reading partition table
May 7 09:55:39 Unraid unassigned.devices: Adding disk '/dev/mapper/Intenso_External_USB_3.0'...
May 7 09:55:41 Unraid unassigned.devices: Mount drive command: /sbin/mount -o rw,noatime,nodiratime '/dev/mapper/Intenso_External_USB_3.0' '/mnt/disks/Intenso_External_USB_3.0'
May 7 09:55:41 Unraid kernel: /dev/mapper/Intenso_External_USB_3.0: Can't open blockdev
May 7 09:55:41 Unraid unassigned.devices: Mount of '/dev/mapper/Intenso_External_USB_3.0' failed: 'mount: /mnt/disks/Intenso_External_USB_3.0: special device /dev/mapper/Intenso_External_USB_3.0 does not exist. '
May 7 09:55:41 Unraid unassigned.devices: Partition 'Intenso External_USB_3.0' cannot be mounted.
May 7 09:55:41 Unraid unassigned.devices: Running device script: 'Intenso_External_USB_3.0.sh' with action 'ERROR_MOUNT'.

 

May 7 10:14:12 Unraid unassigned.devices: Adding disk '/dev/mapper/Intenso_External_USB_3.0'...
May 7 10:14:14 Unraid unassigned.devices: Mount drive command: /sbin/mount -o rw,noatime,nodiratime '/dev/mapper/Intenso_External_USB_3.0' '/mnt/disks/Intenso_External_USB_3.0'
May 7 10:14:14 Unraid kernel: /dev/mapper/Intenso_External_USB_3.0: Can't open blockdev
May 7 10:14:14 Unraid unassigned.devices: Mount of '/dev/mapper/Intenso_External_USB_3.0' failed: 'mount: /mnt/disks/Intenso_External_USB_3.0: special device /dev/mapper/Intenso_External_USB_3.0 does not exist. '
May 7 10:14:14 Unraid unassigned.devices: Partition 'Intenso External_USB_3.0' cannot be mounted.
May 7 10:14:14 Unraid unassigned.devices: Running device script: 'Intenso_External_USB_3.0.sh' with action 'ERROR_MOUNT'.

 

Formatting it back to simple XFS mounting is just working fine again.

 

Any idea what is causing this issue? Any help would be much appreciated. Thanks in advance.

Edited by monarc
Link to comment
On 5/4/2021 at 10:18 AM, Bob@unraid said:

Hello everyone,

 

is it possible to add a remote Synology NAS with Unassigned Devices via the internet?

The NAS is reachable through the Synology dynDNS service with the address "mom.myds.me" (not the real name). Uploads with filezilla and this adress are also possilbe.

My main questions 1) is it possible? and 2) if so what is the right "mounting term" to connect it with Unassigned Devices

 

I am running Version: 6.9.2 and Unassigned Devices 2021.04.19

 

Thanks!

Not directly.  I connect two Unraid servers in different locations using Wireguard to set up a VPN tunnel.  Wireguard gives you a local IP address to access the remote server.  You then use that local IP address to access the remote server with UD.  Does the Synolog support Wireguard?

Link to comment

I'm hoping someone can help me with an issue I'm having  mounting an NFS share on another NAS.  There are two NFS shares on my synology that have the exact same configuration (photo and upload).   I've mounted photo just fine and can use Krusader to navigate and sync folders with my Unraid shares.  Today I did the same with the upload share and am experiencing a strange permissions issue.  As you can see from the first check the permissions look just fine.  When I try and access the upload folder in Krusader I get a premission denied and suddenly the directory permissions are changed.  If I wait a bit, the permissions seem to reset, but as soon as I try and access it changes again.  Here is the output from the terminal window in Krusader.  I can see the same thing happening watching in the Unraid terminal as well.  Any ideas would be much appreciated!

 

image.thumb.png.00b882963c67a0c8084e28e4945abaaa.png

 

Edited by Cpmiller22
Link to comment
52 minutes ago, sonic6 said:

Hey,

 

is there a way for mounting an connected Drive on a specific time, or trigger an automount with cron?

Click on the Help icon while on the UD page and read about using the rc.unassigned command to mount a disk.  You mount the disk with the /dev/sdX designation.  The issue is that the sdX can change for a disk on each reboot, so you have to be sure it is the one you want.

 

Use the User Scripts plugin and setup a script to run at a specific time to mount the disk.

Link to comment
1 hour ago, dlandon said:

The issue is that the sdX can change for a disk on each reboot

hm.. is there a workaround for that? maybe i can use UUID, or will the UUID also change each reboot?

 

Looks like i can do it with this command:

/usr/local/sbin/rc.unassigned umount /dev/disk/by-id/ata-WDC_WD20EFRX-blablabla

with 

ls /dev/disk/by-id/

i found out, that i have to use "ata-" infront of the device name

Edited by sonic6
Link to comment
On 5/7/2021 at 12:09 PM, dlandon said:

Not directly.  I connect two Unraid servers in different locations using Wireguard to set up a VPN tunnel.  Wireguard gives you a local IP address to access the remote server.  You then use that local IP address to access the remote server with UD.  Does the Synolog support Wireguard?

thanks for the replay. 

It is a quite old synology but maybe wireguard is option. at the moment at my mom's house a wireguard server my remote support is running anyway

Link to comment
10 hours ago, dlandon said:

Uninstall and reinstall UD or reboot.

 

Tried that already. No dice.  I've kinda tried all the obvious things.  I can confirm the `Legacy.php` file the template is looking for is straight up missing.  Not sure how this happened and not sure how to get it back.  

 

- Attempted rebooting Unraid multiple times

- Attempted reinstalling Unassigned Devices

 

I'll be attempting to boot into safe mode later today to see what happens.  Would appreciate anyone's guidance on where to look.

 

Link to comment
2 hours ago, clusterbox said:

 

Tried that already. No dice.  I've kinda tried all the obvious things.  I can confirm the `Legacy.php` file the template is looking for is straight up missing.  Not sure how this happened and not sure how to get it back.  

 

- Attempted rebooting Unraid multiple times

- Attempted reinstalling Unassigned Devices

 

I'll be attempting to boot into safe mode later today to see what happens.  Would appreciate anyone's guidance on where to look.

 

Post your diagnostics.

Link to comment
12 hours ago, sonic6 said:

hm.. is there a workaround for that? maybe i can use UUID, or will the UUID also change each reboot?

 

Looks like i can do it with this command:


/usr/local/sbin/rc.unassigned umount /dev/disk/by-id/ata-WDC_WD20EFRX-blablabla

with 


ls /dev/disk/by-id/

i found out, that i have to use "ata-" infront of the device name

I'm adding the ability to mount and unmount a device by the Dev X name used by Unraid 6.9.  The device will always have the same Dev X designation, even if the sdX device name changes.  This allows a consistent name for use by scripts.  The Dev X would be passed to rc.unassigned as devX.

Link to comment
9 hours ago, Bob@unraid said:

thanks for the replay. 

It is a quite old synology but maybe wireguard is option. at the moment at my mom's house a wireguard server my remote support is running anyway

I think there are other VPN options that would accomplish the same thing.  I'm not familiar with any but Wireguard.

Link to comment
1 hour ago, dlandon said:

Do this:

  • Remove the UD plugin.
  • Delete the /flash/config/plugin/unassigned.devices/*.tgz files.
  • Re-install UD.

 

Success!  That worked!  You sir, are a genius.

 

FYI my folder path was a bit different.  I ran the below command and then installed UD again.

 

rm /boot/config/plugins/unassigned.devices/*.tgz

 

Link to comment

hm... i dont know why, but i can't get the unmount work inside a backup script.

 

I try using mgutt backup scrpt: 

 

 

i added 

/usr/local/sbin/rc.unassigned mount /dev/disk/by-id/ata-WDC_WD20EFRX-blabla
sleep 30s

on the top and 

sleep 60s
/usr/local/sbin/rc.unassigned umount /dev/disk/by-id/ata-WDC_WD20EFRX-blabla

at the end of the script.

 

But i only got:

May  9 08:42:38 Unraid-1 unassigned.devices: Successfully mounted '/dev/sdg1' on '/mnt/disks/WDC_WD20EFRX-blabla'.
May  9 08:44:27 Unraid-1 unassigned.devices: Unmounting disk 'WDC_WD20EFRX-blabla'...
May  9 08:44:27 Unraid-1 unassigned.devices: Unmounting '/dev/sdg1'.
May  9 08:44:27 Unraid-1 unassigned.devices: Unmount cmd: /sbin/umount '/dev/sdg1' 2>&1
May  9 08:44:27 Unraid-1 unassigned.devices: Unmount of '/dev/sdg1' failed: 'umount: /mnt/disks/WDC_WD20EFRX-blabla: target is busy. '
May  9 08:44:27 Unraid-1 unassigned.devices: Disk 'WDC_WD20EFRX-blabla' cannot be unmounted.

 

If i am using a single script only for umount, the unmount works fine.

 

I tried this as an User Script and as an UD Script.

Link to comment
19 minutes ago, sonic6 said:

If i am using a single script only for umount, the unmount works fine.

I think this is because my script writes the terminal output to the target and as long the script is running, this can't be stopped. This is sometimes what I will change in the next version.

 

Until then you could try to save it as a script and execute it by a different one:

#!/bin/bash
/mnt/user/sharename/backup.sh
umount blabla

 

  • Thanks 1
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.