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


dlandon

Recommended Posts

4 hours ago, dlandon said:

You create a script in User Scripts and put the disk mount command in the script at the beginning.

/usr/local/sbin/rc.unassigned mount /dev/devX

The devX is the device name in the UD page. If the device name is 'Dev 1', then use dev1 as the device to mount.

This is my original post. What you told me to do is the problem. I'm asking for a solution lol

 

 

Hi guys, I've searched but I haven't found the solution. I have some disks connected internally (not's USB) to unassigned devices.
I need to run a script to mount, backup, unmount. I use CA Scrips Users. I'm trying to do this:


LABEL="4TB"
SERIAL="01056498A"

 

if [ ! -d "/mnt/disks/${LABEL}" ]; then
     DISK_MOUNT="ls -l /dev/disk/by-id/ | grep '${SERIAL}' | head -1 | tail -c4"
     DEVICE="${DISK_MOUNT}1"
     mkdir "/mnt/disks/${LABEL}"
     /usr/local/emhttp/plugins/unassigned.devices/scripts/rc.unassigned mount "/dev/${DEVICE}"
fi

 

On the command line, it identifies the sdX drive (ls -l /dev/disk/by-id/ | grep '${SERIAL}' | head -1 | tail -c4), but in the script it doesn't save to the variable. The variable's output is the command itself, that is, it doesn't execute, it just saves the variable as text.

 

I just need to identify the sdX according to the device serial.
I can't use a fixed sdX because when I restart Unraid it might change the sdX.

 

Can you help me? Tks
Forgive my english.

Link to comment
11 minutes ago, Braulio said:

This is my original post. What you told me to do is the problem. I'm asking for a solution lol

 

 

Hi guys, I've searched but I haven't found the solution. I have some disks connected internally (not's USB) to unassigned devices.
I need to run a script to mount, backup, unmount. I use CA Scrips Users. I'm trying to do this:


LABEL="4TB"
SERIAL="01056498A"

 

if [ ! -d "/mnt/disks/${LABEL}" ]; then
     DISK_MOUNT="ls -l /dev/disk/by-id/ | grep '${SERIAL}' | head -1 | tail -c4"
     DEVICE="${DISK_MOUNT}1"
     mkdir "/mnt/disks/${LABEL}"
     /usr/local/emhttp/plugins/unassigned.devices/scripts/rc.unassigned mount "/dev/${DEVICE}"
fi

 

On the command line, it identifies the sdX drive (ls -l /dev/disk/by-id/ | grep '${SERIAL}' | head -1 | tail -c4), but in the script it doesn't save to the variable. The variable's output is the command itself, that is, it doesn't execute, it just saves the variable as text.

 

I just need to identify the sdX according to the device serial.
I can't use a fixed sdX because when I restart Unraid it might change the sdX.

 

Can you help me? Tks
Forgive my english.

You don't need to use sdX.  In Unraid 6.9, UD devices are referenced by a devX device nomenclature that does not change on reboot and remains the same for the UD disk even if it is removed and re-installed.  Use that in the command I showed you and UD will mount the device.

Link to comment
18 minutes ago, dlandon said:

You don't need to use sdX.  In Unraid 6.9, UD devices are referenced by a devX device nomenclature that does not change on reboot and remains the same for the UD disk even if it is removed and re-installed.  Use that in the command I showed you and UD will mount the device.

I thought it changed because in another post Space Invader commented that it could change.

So it was easy, the way I'm doing it worked.
Thanks for the information

Link to comment

Hey, guys. I created a backup script analyzing other scripts.

The script make backup to PLUG & PLAY devices or FIXED devices and make incremental or sync backup.
 

Any suggestions or corrections are welcome.

 

 

Edited by Braulio
Link to comment

I am trying to use a hard drive for CCTV storage and therefore do NOT want it on the array being parity written.

 

the drive has been pre-cleared and shows up in unassigned devices as completed preclear.

 

mount is greyed out and I can't figure out how to format or use this disk.  I need to be able to pass to docker or potentially VM for my CCTV system.

 

Destructive mode is turned on in UD options.

 

371594613_ScreenShot2021-10-14at11_48_01AM.thumb.png.168ec07674b7c51d9b45930b4ae3086b.png

Link to comment
1 hour ago, Ystebad said:

I am trying to use a hard drive for CCTV storage and therefore do NOT want it on the array being parity written.

This is a prime candidate for adding a single device pool directly in Unraid vs. trying to manage it in UD. It would make things much easier and accomplish exactly what you asked.

Link to comment

Hi. I just setup a second Unraid machine to do some other types of tasks. I am trying to mount a share from one Unraid server into another using the Unassigned Devices plugin.

 

I've tried NFS and SMB and neither will mount. I have also tried manually creating a mountpoint for the share. When I click 'Mount' in the unassigned devices table, it fails to mount. Where are the logs for unassigned devices?

khan-diagnostics-20211014-1059.zip

Link to comment
1 hour ago, segaboy said:

Hi. I just setup a second Unraid machine to do some other types of tasks. I am trying to mount a share from one Unraid server into another using the Unassigned Devices plugin.

 

I've tried NFS and SMB and neither will mount. I have also tried manually creating a mountpoint for the share. When I click 'Mount' in the unassigned devices table, it fails to mount. Where are the logs for unassigned devices?

khan-diagnostics-20211014-1059.zip 80.24 kB · 0 downloads

UD logs to the syslog.

 

There is only one attempt to mount the remote share using NFS:

Oct 14 07:31:28 khan unassigned.devices: Mounting Remote SMB/NFS Share '192.168.1.10:/mnt/user/Automation'...
Oct 14 07:31:28 khan unassigned.devices: Mount NFS command: /sbin/mount -t 'nfs' -o rw,noacl '192.168.1.10:/mnt/user/Automation' '/mnt/remotes/192.168.1.10_Automation'
Oct 14 07:31:28 khan rpcbind[14328]: connect from 127.0.0.1 to getport/addr(status)
Oct 14 07:31:28 khan unassigned.devices: NFS mount failed: 'mount.nfs: access denied by server while mounting 192.168.1.10:/mnt/user/Automation '.
Oct 14 07:31:28 khan unassigned.devices: Mount of '192.168.1.10:/mnt/user/Automation' failed: 'mount.nfs: access denied by server while mounting 192.168.1.10:/mnt/user/Automation '.

It fails to mount because of an access issue on the server.  Do you have NFS enabled on the remote server?

Link to comment
3 hours ago, Ystebad said:

I am trying to use a hard drive for CCTV storage and therefore do NOT want it on the array being parity written.

 

the drive has been pre-cleared and shows up in unassigned devices as completed preclear.

 

mount is greyed out and I can't figure out how to format or use this disk.  I need to be able to pass to docker or potentially VM for my CCTV system.

 

Destructive mode is turned on in UD options.

 

371594613_ScreenShot2021-10-14at11_48_01AM.thumb.png.168ec07674b7c51d9b45930b4ae3086b.png

Click on the red X and delete the preclear logs.

Link to comment
20 minutes ago, dlandon said:

UD logs to the syslog.

 

There is only one attempt to mount the remote share using NFS:

Oct 14 07:31:28 khan unassigned.devices: Mounting Remote SMB/NFS Share '192.168.1.10:/mnt/user/Automation'...
Oct 14 07:31:28 khan unassigned.devices: Mount NFS command: /sbin/mount -t 'nfs' -o rw,noacl '192.168.1.10:/mnt/user/Automation' '/mnt/remotes/192.168.1.10_Automation'
Oct 14 07:31:28 khan rpcbind[14328]: connect from 127.0.0.1 to getport/addr(status)
Oct 14 07:31:28 khan unassigned.devices: NFS mount failed: 'mount.nfs: access denied by server while mounting 192.168.1.10:/mnt/user/Automation '.
Oct 14 07:31:28 khan unassigned.devices: Mount of '192.168.1.10:/mnt/user/Automation' failed: 'mount.nfs: access denied by server while mounting 192.168.1.10:/mnt/user/Automation '.

It fails to mount because of an access issue on the server.  Do you have NFS enabled on the remote server?

 

That was it. I usually access this share via SMB, but this is the first time using it over NFS. I exported the share and it mount right away. Thanks!

Link to comment

I removed one of the drives from the array, created new config and let it recreate parity. But it seems that it's using unassigned device (the one I removed) for some reason. You can see the reads amount on the screen, it's on par with the array disks and is growing with them. dstat shows 0MB/s read and write on it though, so it might be a visual bug. But on the other hand, it won't let me spin-down this drive, logs will show:

Quote

Oct 16 11:10:40 Tower emhttpd: spinning down /dev/sdc
Oct 16 11:10:40 Tower emhttpd: read SMART /dev/sdc

 

I don't know if it's UA's bug or Unraid one and I'm screwing up my parity.

I'm on 6.10.0 RC1

unraid parity.png

Link to comment
On 10/2/2021 at 2:29 PM, NAS said:

Apologies if this is covered in the previous 252 pages but has consideration been given to adding the ability to mount and/or create disk/partition images (typically using dd in the background)

 

Perhaps niche but genuinely useful especially if RO mode is an option.

Any thoughts on this?

 

If image options are out of scope please consider the read only mount option.

 

There is a lot to be said to mounting disks RO by default with an option to seamlessly remount RW if needed.

Link to comment
1 hour ago, Tomr said:

I don't know if it's UA's bug or Unraid one and I'm screwing up my parity.

I'm on 6.10.0 RC1

Unraid has a routine that tracks reads and writes to all disks.  UD gets its information for reads and writes from that routine.  It appears that it may be tracking the reads and writes incorrectly on the disk you removed from the array.  I can't say if this disk is being included in the parity calculations.

 

Try one thing.  Click on the double arrows on the upper right of the UD GUI to refresh the UD disks and see if it clears it up.  If not, I would post this issue as a potential bug in the 6.10.0 forum.

  • Like 1
Link to comment
1 hour ago, NAS said:

Any thoughts on this?

 

If image options are out of scope please consider the read only mount option.

 

There is a lot to be said to mounting disks RO by default with an option to seamlessly remount RW if needed.

What is it you are trying to accomplish?  I don't understand the use case you are asking for.

Link to comment
15 minutes ago, dlandon said:

Unraid has a routine that tracks reads and writes to all disks.  UD gets its information for reads and writes from that routine.  It appears that it may be tracking the reads and writes incorrectly on the disk you removed from the array.  I can't say if this disk is being included in the parity calculations.

 

Try one thing.  Click on the double arrows on the upper right of the UD GUI to refresh the UD disks and see if it clears it up.  If not, I would post this issue as a potential bug in the 6.10.0 forum.

That didn't help, I've posted a report here

Link to comment
51 minutes ago, dlandon said:

What is it you are trying to accomplish?  I don't understand the use case you are asking for.

 

Nothing especially complicated I am just suggesting that disks should only be mounted RW if you actually need RW. Failing that an option that allows you chose RO.

 

For example if you are loading data from a backup then RO would be a safer option especially in the scenario where you are needing to restore from backup in the first place.

 

As for working with images this gives a practical example of a use case https://wiki.unraid.net/Manual/Troubleshooting#Using_ddrescue_to_recover_data_from_a_failing_disk

Link to comment
2 minutes ago, NAS said:

Nothing especially complicated I am just suggesting that disks should only be mounted RW if you actually need RW. Failing that an option that allows you chose RO.

You can already do that.  Click on the double gear icon and there is a switch for RO.

181003188_ROSwitch.png.8ecc5bc1abf9f6c013540cb8f287ec18.png

 

9 minutes ago, NAS said:

As for working with images this gives a practical example of a use case

I don't see this as being something that UD should be doing.  It is an edge case and can be done using manual methods.  Disk recovery is not something I care to support.

Link to comment

Thank you. Even after mounting countless hundreds of disk using UD I was not aware of those settings in the GUI at all. Perhaps that hints at either PEBCAK or an area where interface changes would help.

 

As for image work, I cited that specific example as it was easy to do using the wiki itself but other examples include the more mundane tasks of backing up disks, thumb drives, RPI SD cards etc but I accept that these examples whilst not disk recovery are still intended more for the sysop than the average user.

 

Thank you for the education and consideration.

Link to comment

Hi,

I noticed my VMs stop responding yesterday and attempting to login did not work. When I looked closer it seems like the disk image files are missing from unraid and even worse the /mnt/disks folder. 

 

What could cause the /mnt/disks folder to disappear? Is there a way to fix or recover this folder/link? You can see the vm disks are still seen under /mnt/disks1.
attached are some screenies from the unraid terminal.

 

Didn't notice any unraid errors, and not hard shutdowns. I rebooted today to try and see if that helped, it didn't.

 

Any help appreciated thanks.

 

2021-10-17 12_19_06-bash --login (Empoleon) - Brave.png

2021-10-17 13_17_13-Window.png

2021-10-17 13_19_25-Window.png

2021-10-17 12_17_52-bash --login (Empoleon) - Brave.png

2021-10-17 12_18_16-bash --login (Empoleon) - Brave.png

2021-10-17 12_18_34-bash --login (Empoleon) - Brave.png

Link to comment
7 hours ago, vuribe1221 said:

What could cause the /mnt/disks folder to disappear?

 

The relevant UD device is not online, has not been mounted or has failed as /mnt/disks is where local UD devices get mounted.

 

I assume that the vdisk image on disk1 is just your backup?

Link to comment

Hello guys, newbie here, please excuse me, but I searched the whole internet and could't find solution to my issue.

 

I have around 35 drives both array and/or unassigned devices and they all work fine EXCEPT one.

It's a Toshiba 500GB SATA hdd that whatever I do I can't mount, Mount button is gray.

SMART is ok, drive is healthy.

 

I tried formatting XFS, NTFS, same thing.

I tried re-formatting on my windows PC and plugging it back, same thing, can't mount.

Drive is not set for Pass-through, checked many times.

I tried both SATA and USB and same behavior, Mount button grayed.

 

Can someone point me what to look for? Thanks in advance!

Link to comment
1 hour ago, ToTo said:

Hello guys, newbie here, please excuse me, but I searched the whole internet and could't find solution to my issue.

 

I have around 35 drives both array and/or unassigned devices and they all work fine EXCEPT one.

It's a Toshiba 500GB SATA hdd that whatever I do I can't mount, Mount button is gray.

SMART is ok, drive is healthy.

 

I tried formatting XFS, NTFS, same thing.

I tried re-formatting on my windows PC and plugging it back, same thing, can't mount.

Drive is not set for Pass-through, checked many times.

I tried both SATA and USB and same behavior, Mount button grayed.

 

Can someone point me what to look for? Thanks in advance!

Post your 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.