Difference between revisions of "Network Attached Storage"

From LinuxMCE
Jump to: navigation, search
m
 
(21 intermediate revisions by 7 users not shown)
Line 1: Line 1:
Include here a list of NAS that have been tested with LinuxMCE.
+
{{versioninfo}}
 +
{| align="right"
 +
  | __TOC__
 +
  |}
 +
==Device list==
  
{| class="wikitable" width="300" style="text-align:center; background:#efefef; width:75%; border:1px solid black"
+
*[[:Category:Network_Attached_Storage|Here is a list of NAS devices]] used with LinuxMCE.
|+ NAS
+
|-
+
| [[Buffalo Terastation]]
+
|-
+
|-
+
| [[Buffalo Linkstation]]
+
|-
+
|-
+
| [[FreeNAS]]
+
|-
+
|}
+
 
+
 
+
==Adding SMB Client to LinuxMCE==
+
As of this writing, the current version of LinuxMCE needs the smbfs application before the core will be able to read and write to any Samba or SMB server.  To do this, ssh into your LinuxMCE core as root and type the following:
+
 
+
<pre>
+
apt-get install smbfs
+
</pre>
+
 
+
After pressing enter, the core will download and install the smbfs application.
+
  
 
==Troubleshooting==
 
==Troubleshooting==
# I can see the files on the media directors, orbiters, and (while SSH'd) on /mnt/NAS_# and in the subdirectories of each user. But the files do not play. None of the music or video files play. All files stored on the core play fine.<br>
+
*Problem: The NAS is added, the shares are detected & configured but no files show up (they are not mounted)
 +
:Solution: Check that the shares don't have spaces in them. See [http://www.linuxmce.com/mantis/view.php?id=3803 this bug].
  
* (This solution comes from bliss01 on the forum.  Needs more detailed instructions please...)
+
*Problem: The files appear on the media directors, orbiters, and (while SSH'd) on /mnt/NAS_# and in the subdirectories of each user. But the files do not play. None of the music or video files play. All files stored on the core play fine.
Make sure you've mounted the device as the same name and dir and on the Core.
+
Edit the /etc/exports file on the core, and the /etc/fstab on the MDs to fix this. But also to make the changes stay after reboot, edit the templates in /usr/pluto/templates/
+
  
Also make sure the SMB drive is on the same network ie the 192.168.80.x as the core has a firewall which stops smb mounts.
+
:Solution: (from [http://forum.linuxmce.org/index.php?action=mlist;sa=search bliss01] on the forum)
 +
#Make sure you've mounted the device as the same name and dir and on the Core.
 +
#Edit the /etc/exports file on the core, and the /etc/fstab on the MDs to fix this. But also to make the changes stay after reboot, edit the templates in /usr/pluto/templates/
 +
#Also make sure the SMB drive is on the same network (ie. the 192.168.80.x) as the Core, which has a firewall which stops smb mounts, though there is a separate procedure for [[#Adding_NAS_to_LinuxMCE_Core.27s_.22Outside.22_LAN_Segment|attaching NAS to the outside LAN segment]].
  
==Manual==
+
==Make Network Attached Storage (NAS) and Windows shares Plug and Play==
Summary: How Network Attached Storage (NAS) and Windows shares are made plug and play
+
  
 
First, the detected event is fired.
 
First, the detected event is fired.
  
For a NAS this comes from dhcp monitor and has the ip/mac and plug and play plugin figures out what it is, like this:
+
For a detected NAS this event comes from dhcp monitor and has the ip/mac. The "plug and play" plugin figures out what it is, and fires an event like this:
  
 
   /usr/pluto/bin/MessageSend dcerouter 0 -1001 2 65 52 3 53 2 5 "00:0D:0B:99:10:43" 28 "192.168.80.7"
 
   /usr/pluto/bin/MessageSend dcerouter 0 -1001 2 65 52 3 53 2 5 "00:0D:0B:99:10:43" 28 "192.168.80.7"
  
For the “scan the network for windows shares” utility that always runs in the background, it explicitly sends a device detected event with the device template Generic File Server 1837, like this:
+
For a detected Windows share, this event comes from the "scan the network for windows shares" utility that always runs in the background. It explicitly sends a "device detected" event with the device template "Generic File Server 1837", like this:
  
 
   /usr/pluto/bin/MessageSend dcerouter 0 -1001 2 65 52 3 53 2 49 1837
 
   /usr/pluto/bin/MessageSend dcerouter 0 -1001 2 65 52 3 53 2 49 1837
  
Both the ‘generic file server’ and the nas devices like Maxtor & buffalo have a device data called “Pre Pnp Script”, which is set to: /usr/pluto/bin/CheckNASForPasswords.sh.  This means that before actually creating the device, this script will be run and is expected to send a command CMD_Pre_Pnp_Script_Done which includes additional parameters.  In the script the key thing is the: "182|1" change that 1 to a 0 if no password is required.  Maybe we will need a different script for different NAS devices.
+
Both the "generic file server" and the NAS devices like Maxtor & Buffalo have a device data called “Pre Pnp Script”, which is set to: /usr/pluto/bin/CheckNASForPasswords.sh.  This means that before actually creating the device, this script will be run and is expected to send a command CMD_Pre_Pnp_Script_Done which includes additional parameters.  In the script the key thing is the "182|'''1'''" parameter. Change that 1 to a 0 if no password is required.  Maybe we will need a different script for different NAS devices.
 +
 
 +
After that script runs, if 182|1 was specified, the user will be prompted for the username and password, as per: Pnp_PreCreateOptions::OkayToCreateDevice with the screen: SCREEN_Get_Username_Password_For_Devices.
 +
 
 +
Once the device is created, its configure script will be run, for example: Configure_1794.sh for the Buffalo.  This script will lookup the username and password for the device from the database and fire a "device detected" for each network share, as follows:
 +
 
 +
  /usr/pluto/bin/MessageSend dcerouter <X> -1001 2 65 52 3 53 2 49 1768 55 "182|1"
 +
 
 +
That <X> must be the ID# of the device created above, since the file share will be a child of that device.  1768 is the template for a samba share, 1769 for nfs.  If the share does not require a password, leave off the 55 "182|1".  If the username and password already specified in the database are valid for the share, then instead of 55 "182|1" use 55 "127|username|128|password".
 +
 
 +
This message will create the child device for each share and prompt the user if the username or password are needed.
  
After that script runs, if 182|1 was specified, the user will be prompted for the usernname and password, as per: Pnp_PreCreateOptions::OkayToCreateDevice with the screen: SCREEN_Get_Username_Password_For_Devices.
+
==Add NAS to the "External" LAN ==
 +
The default configuration of LinuxMCE supports the NAS within the "internal" LAN that is administered by the LinuxMCE Core server.
  
Once the device is created, the configure script will be ran, for example: Configure_1794.sh for the Buffalo. This script should lookup the username and password for the device from the database and fire a 'device detected' for each network share, as follows:
+
Forum user tkmedia tested [http://forum.linuxmce.org/index.php?topic=3097.msg17973#msg17973 how to reconfigure LinuxMCE to support the NAS on the external LAN]:
  
  /usr/pluto/bin/MessageSend dcerouter X -1001 2 65 52 3 53 2 49 1768 55 "182|1"
+
#In the Web admin select "show devices tree".
 +
#Select CORE from my devices.
 +
#Create child device.
 +
##Use the file server device template.
 +
##Put in its IP Address, username and password, and save it.
 +
#Now select the file server you just made and Create child device.
 +
##Use the "Windows share" device template put in its sharename, username and password and save it.
 +
##If you go the an Orbiter's KDE desktop, open Konqueror to /home/public/data/other , you should see something like "Windows Share [55]".
 +
#Now let it automatically sync the files. Takes a while (even to get started, then syncing is slow)..................... You can go resync the files using the web admin but if you have a lot of files just let it sync overnight on its own.
  
That that the X must be the device created above, since the file share will be a child of that.  1768 is the template for a samba share, 1769 for nfs.  If the share does not require a password, leave off the 55 "182|1".  If the username and password already specified in the database are valid for the share, then instead of 55 "182|1" do 55 "127|username|128|password".
+
In theory you may even be able to attach the NAS on the "internal" LAN, autodetect it, then change its IP address in the Web admin and reconnect it on the external LAN.
  
This will create the child device for each share and prompt the user if the username or password are needed.
+
=See also=
[[Category: Programmer's Guide]][[Category: Storage]]
+
*[[Network Settings]]
  
[[Category: Storage]]
+
[[Category: Programmer's Guide]][[Category: Storage]][[Category:Network Attached Storage]]

Latest revision as of 09:39, 5 May 2010

Version Status Date Updated Updated By
710 Unknown N/A N/A
810 Unknown N/A N/A
1004 Unknown N/A N/A
1204 Unknown N/A N/A
1404 Unknown N/A N/A
Usage Information

Device list

Troubleshooting

  • Problem: The NAS is added, the shares are detected & configured but no files show up (they are not mounted)
Solution: Check that the shares don't have spaces in them. See this bug.
  • Problem: The files appear on the media directors, orbiters, and (while SSH'd) on /mnt/NAS_# and in the subdirectories of each user. But the files do not play. None of the music or video files play. All files stored on the core play fine.
Solution: (from bliss01 on the forum)
  1. Make sure you've mounted the device as the same name and dir and on the Core.
  2. Edit the /etc/exports file on the core, and the /etc/fstab on the MDs to fix this. But also to make the changes stay after reboot, edit the templates in /usr/pluto/templates/
  3. Also make sure the SMB drive is on the same network (ie. the 192.168.80.x) as the Core, which has a firewall which stops smb mounts, though there is a separate procedure for attaching NAS to the outside LAN segment.

Make Network Attached Storage (NAS) and Windows shares Plug and Play

First, the detected event is fired.

For a detected NAS this event comes from dhcp monitor and has the ip/mac. The "plug and play" plugin figures out what it is, and fires an event like this:

 /usr/pluto/bin/MessageSend dcerouter 0 -1001 2 65 52 3 53 2 5 "00:0D:0B:99:10:43" 28 "192.168.80.7"

For a detected Windows share, this event comes from the "scan the network for windows shares" utility that always runs in the background. It explicitly sends a "device detected" event with the device template "Generic File Server 1837", like this:

 /usr/pluto/bin/MessageSend dcerouter 0 -1001 2 65 52 3 53 2 49 1837

Both the "generic file server" and the NAS devices like Maxtor & Buffalo have a device data called “Pre Pnp Script”, which is set to: /usr/pluto/bin/CheckNASForPasswords.sh. This means that before actually creating the device, this script will be run and is expected to send a command CMD_Pre_Pnp_Script_Done which includes additional parameters. In the script the key thing is the "182|1" parameter. Change that 1 to a 0 if no password is required. Maybe we will need a different script for different NAS devices.

After that script runs, if 182|1 was specified, the user will be prompted for the username and password, as per: Pnp_PreCreateOptions::OkayToCreateDevice with the screen: SCREEN_Get_Username_Password_For_Devices.

Once the device is created, its configure script will be run, for example: Configure_1794.sh for the Buffalo. This script will lookup the username and password for the device from the database and fire a "device detected" for each network share, as follows:

 /usr/pluto/bin/MessageSend dcerouter <X> -1001 2 65 52 3 53 2 49 1768 55 "182|1"

That <X> must be the ID# of the device created above, since the file share will be a child of that device. 1768 is the template for a samba share, 1769 for nfs. If the share does not require a password, leave off the 55 "182|1". If the username and password already specified in the database are valid for the share, then instead of 55 "182|1" use 55 "127|username|128|password".

This message will create the child device for each share and prompt the user if the username or password are needed.

Add NAS to the "External" LAN

The default configuration of LinuxMCE supports the NAS within the "internal" LAN that is administered by the LinuxMCE Core server.

Forum user tkmedia tested how to reconfigure LinuxMCE to support the NAS on the external LAN:

  1. In the Web admin select "show devices tree".
  2. Select CORE from my devices.
  3. Create child device.
    1. Use the file server device template.
    2. Put in its IP Address, username and password, and save it.
  4. Now select the file server you just made and Create child device.
    1. Use the "Windows share" device template put in its sharename, username and password and save it.
    2. If you go the an Orbiter's KDE desktop, open Konqueror to /home/public/data/other , you should see something like "Windows Share [55]".
  5. Now let it automatically sync the files. Takes a while (even to get started, then syncing is slow)..................... You can go resync the files using the web admin but if you have a lot of files just let it sync overnight on its own.

In theory you may even be able to attach the NAS on the "internal" LAN, autodetect it, then change its IP address in the Web admin and reconnect it on the external LAN.

See also