Is it possible to mount network share (smb)?


Recommended Posts

For some reason, I store my Jukebox on the internal harddrive on my Popcorn Hour.  I currently run YAMJ from my pc to scan the Media share on my unRaid server and then writes the jukebox to the drive on the PCH.

 

I would like to migrate YAMJ to my server and was wondering what is the best way to mount the PCH smb share on the server?  I know I could just keep the jukebox files on the server, but this way the drives don't need to spin up until a movie is selected.

Link to comment
  • 1 month later...

I used this:

mount -t cifs -o user=nmt,password=1234 //192.168.2.120/Share /mnt/cache/unRAID_Apps/PCH_LivingRoom

Where 192.168.2.120 is my PCH-200 machine's IP address and the default PCH username and password (nmt/1234).

 

Works great.

Thank you.

 

Link to comment

I used this:

mount -t cifs -o user=nmt,password=1234 //192.168.2.120/Share /mnt/cache/unRAID_Apps/PCH_LivingRoom

Where 192.168.2.120 is my PCH-200 machine's IP address and the default PCH username and password (nmt/1234).

 

Works great.

Thank you.

Just be aware that if you mount a remote system like this on either the cache drive OR on any of the data drives,  they (the cache or unrAID data drive) will be considered as "busy" and that will prevent the unRAID array from stopping, even if you are not actively using the remotely mounted shared drive..

 

Prior to stopping the array, you must un-mount the remote shared drive. 

 

Joe L.

Link to comment

Where is the powerdown script located?

Does it run before unRAID tries to unmount the array?

It is an add-on you must install.  It is located in /sbin/powerdown when installed.

 

No, unRAID does not use it before stopping the array.

 

if using a recent 5.0 version, there are events available to start and stop services.  Unfortunately, they are still evolving and basically none are being used by most add-ons.

 

If using the 4.5.6 version or later you can do as I do and use a script that monitors the syslog for clues when the array is starting or stopping.  (search the forum for unraid_addon_control.sh )  it in turn will invoke rc.* scripts located in /etc/rc.d/unraid.d

 

Granted you have to create the rc.* scripts, but many add-ons already do.

 

You would need to create a rc.smb_remote script that looks something like this:

 

case $1 in

start)

  mount -t cifs -o user=nmt,password=1234 //192.168.2.120/Share /mnt/cache/unRAID_Apps/PCH_LivingRoom

;;

stop)

  umount /mnt/cache/unRAID_Apps/PCH_LivingRoom

;;

esac

 

Note, when you copy the script into place from your flash drive, you must also make it executable:

 

cp /boot/rc.smb_remote /etc/rc.d/rc.smb_remote

chmod +x  /etc/rc.d/rc.smb_remote

those two lines need to be added to the end of your "go" script in addition to the one line to invoke the unraid_addon_control.sh process.

 

In my case, since my unraid_addon_control.sh exists in /boot/custom/bin, that line is:

/boot/custom/bin/unraid_addon_control.sh -u

I invoke it using the full path.

 

Joe L.

Link to comment

Joe,

 

Does the "/boot/custom/bin/unraid_addon_control.sh -u" command automatically run start function on all rc.* scripts located under /etc/rc.d/unraid.d?

 

Edit:

Did restart of the array and indeed it invokes the stop command of each script on shutdown the start command for each script on start up of the unraid_addon_control.sh script.

 

Thank you Joe L.

Link to comment

Joe,

 

Does the "/boot/custom/bin/unraid_addon_control.sh -u" command automatically run start function on all rc.* scripts located under /etc/rc.d/unraid.d?

Yes, all of them that are execuitable.

Edit:

Did restart of the array and indeed it invokes the stop command of each script on shutdown the start command for each script on start up of the unraid_addon_control.sh script.

 

Thank you Joe L.

you are welcome.
Link to comment
  • 4 years later...

Sorry to jump on this thread - could i mount a network drive (different NAS) to the boot usb/flash drive without causing any problems on the Unraid

 

i.e BOOT USB:\Flash\network\Music      (mapped to)      192.168.2.15/Music

    BOOT USB:\Flash\network\Movies      (mapped to)      192.168.2.15/Movies

    BOOT USB:\Flash\network\Software      (mapped to)      192.168.2.15/Software

 

therefore i can map lets say BOOT USB:\Flash\network\Movies into my Plex Server Docker

and BOOT USB:\Flash\network\Music in to my other docker and so on?

 

I have multiple NAS servers

 

Thanks

 

Ric

Link to comment

Sorry to jump on this thread - could i mount a network drive (different NAS) to the boot usb/flash drive without causing any problems on the Unraid

 

i.e BOOT USB:\Flash\network\Music      (mapped to)      192.168.2.15/Music

    BOOT USB:\Flash\network\Movies      (mapped to)      192.168.2.15/Movies

    BOOT USB:\Flash\network\Software      (mapped to)      192.168.2.15/Software

 

therefore i can map lets say BOOT USB:\Flash\network\Movies into my Plex Server Docker

and BOOT USB:\Flash\network\Music in to my other docker and so on?

 

I have multiple NAS servers

 

Thanks

 

Ric

Easiest to use the unassigned devices plugin to do this, but it will create the mount points at /mnt/disks/xxxxx.  To mount the shares on the USB, then you will have to manually issue the mount commands.

 

No problems to add the paths to any docker container.  But, if you're on 6.1.9 you have to stop and restart the entire docker service for it to recognize files contained within the mount points.  On 6.2, when adding the volumes, select RW:Slave as the mode to avoid this problem.  Note that slave mode on 6.2 will only work with the mounts in /mnt/disks/  If you choose to mount them elsewhere, then you will also have to stop and start the entire docker service for any container to recognize them.

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.