Difference between revisions of "Howto: Using Network Shares"

From LinuxMCE
Jump to: navigation, search
(NFS Server Hints)
(Manual Creation of Network Shares)
Line 103: Line 103:
 
# In the ''Device Template'' menu select the appropriate share type for your file server.
 
# In the ''Device Template'' menu select the appropriate share type for your file server.
 
# In the ''Device data'' area, fill in:
 
# In the ''Device data'' area, fill in:
## '''PK_Users''': Leave empty for a public share, or select the desired user
+
## '''PK_Users''': Leave empty for a public share, or select the desired user [Starting with 0710, select "''Public''", "''Pluto's structure''", or a user name.  "''Public''" will mount under data/other.]
 
## '''Share Name''' (if the share is \\my_server\my_share, enter ''my_share'')
 
## '''Share Name''' (if the share is \\my_server\my_share, enter ''my_share'')
 
## '''Filesystem''': ''cifs'' for Windows shares, ''nfs'' for *nix shares
 
## '''Filesystem''': ''cifs'' for Windows shares, ''nfs'' for *nix shares

Revision as of 00:03, 25 April 2008

The LinuxMCE core is able to auto-detect, configure and use Windows (SMB or CIFS) and *nix (NFS) network shares. This document details the different options for using network shares in LinuxMCE and the actions required to successfully configure them, when the automated discovery processes fail.

Network Share Use

Network shares are accessed in LinuxMCE using synbolic links created in the media storage directories, either in /home/public/data in the case of public shares, or in /home/<user_name>/data if the share has been assigned to a user.

LinuxMCE offers two alternatives for use of network shares:

  1. Using LinuxMCE's directory structure
  2. As a simple storage area, either public or private

Network Share Using LinuxMCE's Directory Structure

In this case LinuxMCE uses separate directories on the share for each user, with media sub-directories in each one. These directory trees are created if they do not already exist on the share.

For a typical Windows share, the storage layout will look like this:

my_share\public\audio
my_share\public\documents
my_share\public\pictures
my_share\public\videos
my_share\<user_1>\audio
my_share\<user_1>\documents
my_share\<user_1>\pictures
my_share\<user_1>\videos

Network Share As a Simple Storage Device

In this case the share will simply be attached either to the public storage or to a specified user, using a symbolic link in the other media directory. For example:

/home/public/data/other/my_share

or:

/home/<user_1>/data/other/my_share

Adding Network Shares Using Auto-Detection and the Orbiter

Adding a new network share to LinuxMCE consists of two stages: Adding the computer hosting the share as a File Server, and then adding each share on this computer.

Adding a File Server

  1. Ensure that the file server is active and connected to your network.
  2. Quick-reload the router. In the Orbiter, click More -> Advanced options -> Quick reload router.
  3. The orbiter will display a message identifying the detected network share, and ask what you would like to do with this share. Click File Server.
  4. The orbiter will ask for the user name and password for this file server. If the file server does not require a login, simply click Ok.
  5. The orbiter will inform you that the File Server has been created, and ask which room the file server is in.

This concludes the first stage. LinuxMCE will now proceed to detect and configure any available shares on this file server. At some point, the message "I finished installing the software for your new devices. You will need to restart the router before you can use them" will be displayed. You can press Ok to dismiss the message, but you should not reload the router as this will interrupt the share configuration process.

Adding File Shares

  1. For each available file share on your new file server, the orbiter will display the share name and ask what you would like to do with it. The list will contain a single option - either Windows Share or NFS Share. Click this option.
  2. The orbiter will ask if the new storage device can be used automatically for storing media. If you select Yes, LinuxMCE will store ripped CDs and DVDs and recorded TV shows on this device.
  3. The next orbiter screen will ask allow you to select if you would like to use LinuxMCE's directory structure on the new storage device. You have three options:
    1. Use LinuxMCE's directory structure
    2. Access the device content as-is and make it public
    3. Access the device content as-is and make it private for a selected user

When you have finished with this process, quick-reload the router.

Troubleshooting and Manual Configuration

The automated configuration process can fail at several places. This section explains how to complete the configuration in each case, using the LinuxMCE admin website and a Linux shell.

For all processes described below, start by navigating to the devices tree in the administration site: Either click show devices tree in the left-hand Wizard menu, or select Advances -> configuration -> Devices from the top menu.

To enter shell commands, either press Ctrl+Alt+F2 on the core console, or use SSH to connect to the core from another computer. In either case, log in using the user account you created when installing Ubuntu. When running a sudo operation, enter the password of the same user.

Manual Creation of a File Server

In case LinuxMCE fails to detect your file server, or if it detected it in the past and you selected to ignore it:

  1. Click Core in the left-hand navigation tree.
  2. Click Create Child Device in the main window.
  3. Enter the file server's description and IP address.
  4. Click Pick device template.
  5. In the Device Category menu select File/Media Server.
  6. Click Apply Filter.
  7. In the Device Template menu select File Server.
  8. Click Pick device template.
  9. If the file server requires a login, in the Device data section, enter the username and password for the file server, and check Password Required. Then click Save.
  10. Note the device number of the new file server, displayed at the top of the main window.
  11. In the shell, trigger the network share detection script for the new file server:
sudo /usr/pluto/bin/Configure_1837.sh -d <device number>

At this point, return to the orbiter to continue the automated process.

Manual Creation of Network Shares

In case LinuxMCE fails to detect the shares on your file server:

  1. In the left-hand navigation tree, locate and click the file server entry.
  2. Click Create Child Device in the main window.
  3. Click Pick device template.
  4. In the Device Template menu select the appropriate share type for your file server.
  5. In the Device data area, fill in:
    1. PK_Users: Leave empty for a public share, or select the desired user [Starting with 0710, select "Public", "Pluto's structure", or a user name. "Public" will mount under data/other.]
    2. Share Name (if the share is \\my_server\my_share, enter my_share)
    3. Filesystem: cifs for Windows shares, nfs for *nix shares
    4. Check Use Automatically if desired
    5. Username, Password and Password Required if the file server requires login.

LinuxMCE should now mount your new share and create the required links to make your data available.

NOTE: I have not been able to find how to select to use LinuxMCE's directory structure in this process.

Advanced Configuration Options

Network shares use can be further customized using the LinuxMCE admin site. To use the following options, navigate to the network share device and scroll to the Device data section.

  • Directories: When a share is configured to use LinuxMCE's directory structure, it will by default be used in all media directories: audio, documents, pictures and videos. You can restrict which media directories will be used by entering their names in this field, separated by commas.
  • Readonly: checking this option will make LinuxMCE mount the share as read-only. This will stop LinuxMCE from creating .id3 files for all your videos, and from modifying the MP3 tags of your music files.

NFS Server Hints

If you are wanting to have a linux system be your server, here are a few hints.

As of 0710 beta 3, LinuxMCE requires your sever to be very open (insecure). You must allow root access to the share as LinuxMCE writes files as root:public.

So on the server to share /var/media, assuming your core is at 192.168.80.1, you need to add your share to the /etc/exports like:

 /var/media/ 192.168.80.1(async,no_subtree_check,rw,no_root_squash)

Ownership in your share of media files should be: root:public (0:1002) and permissions should be set to 2775 (rwxrwsr-x)

You may need to change a groupid if another group is already using 1002. The process will vary depending on your system, but here are the general steps:

  1. examine /etc/groups and find an unused group id to move the conflicting group to. This example will use 1234 for the new group id.
  2. find all files with that currently have 1002 groupid: find / -group 1002 -print
    • if it's just a few files then you can change their group id with: chgrp 1234 filename
    • if it's a lot of files, then you might prefer using the find command: find / -group 1002 -exec chgrp 1234 '{}' \;
  3. now double check that you changed all the files with group id 1002: find / -group 1002 -print
  4. edit /etc/groups and change the group id for the conflicting group from 1002 to the new group id (1234 in this example)
  5. while editing /etc/groups, edit or add the public group with a group id of 1002
  6. save /etc/groups
  7. if the conflicting group was for a service, then restart the service.
  8. if the service was one of the critical service (mine was hald), I'd go ahead and reboot the box.