Difference between revisions of "Storage Devices"

From LinuxMCE
Jump to: navigation, search
(Configuration scripts for particular device templates)
 
(23 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<table width="100%"> <tr><td bgcolor="#FFCFCF">This page was written by Pluto and imported with their permission when LinuxMCE branched off in February, 2007.  In general any information should apply to LinuxMCE.  However, this page should be edited to reflect changes to LinuxMCE and remove old references to Pluto.</td></tr> </table>== General Info ==
+
[[Category: LinuxMCEBashScripts ]]
 +
[[Category: Programmer's Guide]]
 +
[[Category: Storage]]
 +
{| align="right"
 +
  | __TOC__
 +
  |}
 +
 
 +
 
 +
== General Info ==
 
'''Package:''' pluto-storage-devices
 
'''Package:''' pluto-storage-devices
  
Line 5: Line 13:
  
 
== Background Info ==
 
== Background Info ==
This bash scripts where created to configure / setup storage devices that can be used in pluto. Currently there are 2 device templates that can be configured by this scripts:
+
This bash scripts where created to configure / setup storage devices that can be used in LinuxMCE. Currently there are 2 device templates that can be configured by this scripts:
 
*Hard Drives / Generic Internal Driver (1790)
 
*Hard Drives / Generic Internal Driver (1790)
 
*Network Storage / HD-HG300LAN (1794)
 
*Network Storage / HD-HG300LAN (1794)
  
 
This device templates have some common device data:
 
This device templates have some common device data:
;PK_Users (3) : A list of integer values separated by comma. The numbers represent the id of the users who can use the storage device for storing private files on them. If the 0 value is there too, the storage device can also be used to store public files. If no value is entered, the default is considered 0 (public only). If the next device data (use pluto dir structure) is not set to 1, all the files will be accessible from one directory on the storage device, meaning that public / private files can be accessible by every user that can access that device.
+
;PK_Users (3) : A list of integer values separated by comma. The numbers represent the id of the users who can use the storage device for storing private files on them. If the 0 value is there too, the storage device can also be used to store public files. If no value is entered, the default is considered 0 (public only). If the next device data (use LinuxMCE dir structure) is not set to 1, all the files will be accessible from one directory on the storage device, meaning that public / private files can be accessible by every user that can access that device.
  
;Use Pluto Directory Structure (130) : This value can be 1 or 0, meaning that the information on that devices will be stored using a pluto directory structure, identical to the one in /home directory. For every user there will be a separate directory to store it's private data and there will also be a /public directory in there. The default is set to 1 but if other/no value is entered will be considered 0.
+
;Use LinuxMCE Directory Structure (130) : This value can be 1 or 0, meaning that the information on that devices will be stored using a LinuxMCE directory structure, identical to the one in /home directory. For every user there will be a separate directory to store it's private data and there will also be a /public directory in there. The default is set to 1 but if other/no value is entered will be considered 0.
  
;Use Automatically (134) : A leftover ? Not used
+
;Use Automatically (134) : Used by MythTV. If checked, LinuxMCE will add a storage group for the drive to MythTV.
  
;Directories (153) : The media directories from the pluto directory structure that can be used on this device. Example by entering ''music, movies'' only the music and movies folders will be available from pluto. The value can be empty, meaning that all directories will be available.
+
;Directories (153) : The media directories from the LinuxMCE directory structure that can be used on this device. Example by entering ''music, movies'' only the music and movies folders will be available from LinuxMCE. The value can be empty, meaning that all directories will be available.
  
 
== File Details ==
 
== File Details ==
 
=== Scripts used to do generic setup ===
 
=== Scripts used to do generic setup ===
  
;StorageDevices_Mounts.sh : This script instructs the automount daemon via the /etc/auto.PlutoStorageDevices file, how to mount the desired storage devices. After it updates the configuration file, the script reloads the automount daemon. All the devices will be accessible in the /mnt/device/device_id mount points. This script configures the automounter only on the computer that runs it.
+
;auto.PlutoStorageDevice : The /etc/auto.PlutoStorageDevices file is used by automounter to mount different storage device in the /mnt/device/device_id directories.
  
 
;StorageDevices_ExportsNFS.sh : Some devices can be attached to only one computer, for example the internal disc drive. This script generates a section in the /etc/exports file that can export the local mounts of this kind of devices over nfs. This way the local storage devices can be accessed by any computer over the network. After it updates the /etc/exports file it also triggers a nfs reload.
 
;StorageDevices_ExportsNFS.sh : Some devices can be attached to only one computer, for example the internal disc drive. This script generates a section in the /etc/exports file that can export the local mounts of this kind of devices over nfs. This way the local storage devices can be accessed by any computer over the network. After it updates the /etc/exports file it also triggers a nfs reload.
  
;StorageDevices_Symlinks.sh : The mounted storage devices will be accessible to the user via symlinks that are created in the /home directory by this script. Depending if the storage device uses a pluto directory structure or not the synlink will be pointing to the mount point directly or to the pluto media directors that where previously created in it. Also the symlinks will be created only in the directories listed on the ''Directories'' device data.
+
;StorageDevices_Symlinks.sh : The mounted storage devices will be accessible to the user via symlinks that are created in the /home directory by this script. Depending if the storage device uses a LinuxMCE directory structure or not the symlink will be pointing to the mount point directly or to the LinuxMCE media directors that where previously created in it. Also the symlinks will be created only in the directories listed on the ''Directories'' device data.
  
;StorageDevices_PlutoDirStructure.sh [-d <deviceID>]: Creates a pluto directory structure on a mounted storage device. Called without -d parameter it creates the pluto dir structure only on the localy mounted devices, used with ''-d'' it creates the pluto structure on the specified device. If a device doesn't have the corresponding device data (130) set to true that the script skips it.
+
;StorageDevices_PlutoDirStructure.sh [-d <deviceID>]: Creates a LinuxMCE directory structure on a mounted storage device. Called without -d parameter it creates the LinuxMCE dir structure only on the locally mounted devices, used with ''-d'' it creates the LinuxMCE structure on the specified device. If a device doesn't have the corresponding device data (130) set to true that the script skips it.
  
 
;StorageDevices_Setup.sh [--cascade]: is the main script that calls the previous script so that it can setup the storage devices. Is intended to be used as a startup script. At startup is called by sysv-rc without the cascade parameter. If the ''--cascade'' parameter is supplied that the scripts runs on the local machine and triggers itself to run on the other working machines too.
 
;StorageDevices_Setup.sh [--cascade]: is the main script that calls the previous script so that it can setup the storage devices. Is intended to be used as a startup script. At startup is called by sysv-rc without the cascade parameter. If the ''--cascade'' parameter is supplied that the scripts runs on the local machine and triggers itself to run on the other working machines too.
  
=== Configuration scripts for particular device templates ===
 
  
;StorageDevices_BuffaloNAS.sh : Configuration script for device template 1794. It runs ''StoregeDevices_Setup.sh --cascade'' to setup the storage devices on all powered on machines and ''StorageDevices_PlutoDirStructure.sh -d <DeviceID>'' to setup a directory structure on that particular device.
 
 
;StorageDevices_1790.sh : Configuration script for device template 1790. It runs the ''StorageDevices_Setup.sh --cascade'' so it can configure the new device on all the powered on machines.
 
  
 
== Use Case ==
 
== Use Case ==
 
=== Generic Internal Driver (1790) ===
 
=== Generic Internal Driver (1790) ===
This device can be associated with a spare partition that the user has on the drives located in one of the computers running pluto (Diskless MD, Core or Hybrid). The spare partition can be used to store data like movies, music or any other files that the user wants to be easily accessed by pluto.
+
This device can be associated with a spare partition that the user has on the drives located in one of the computers running LinuxMCE (Diskless MD, Core or Hybrid). The spare partition can be used to store data like movies, music or any other files that the user wants to be easily accessed by LinuxMCE.
 +
 
 +
This device is detected automatically by LinuxMCE.
 +
 
 +
=== HD-HG300LAN (Buffalo NAS) (1794) ===
 +
This device template is used for integrating Buffalo HD-HG300LAN Network Storage Device into LinuxMCE. The Buffalo device is detected via the DHCP Plug'n'Play daemon once inserted into the internal network of the LinuxMCE core.
 +
 
 +
=== Generic NFS/Samba Shares (1769/1678) ===
 +
This device can be associated with a samba(windows) or nfs share that is located on a computer/storage device. To add this kind of device, the user needs to manually add it from the LinuxMCE-admin web interface.
  
This device can only be added manually using pluto-admin web interface and shold be a child for the computer device that owns that partition. To add the device the user should select the computer that has the device connected to it, and click on the Create Child Device link. The Description entered for the device will be used when creating symlinks in the user directories (public, home). The device template is located in Peripherals/Hard Drives device category and is named Generic Internal Drive.
+
For the samba share the user needs to know:
 +
* The ip address which will need to added to the device IPaddress field
 +
* The username that that can have acces to that samba share. If the user is left empty or is 'guest', an unathenticated mount will be tried.
 +
* The password for the username (mandatory)
 +
* The share name
  
The device data field that the user can modify except the ones common for all storage devices is ''Block Device''. Here, the user should put the linux block device name for the partition associated with the pluto device. For example /dev/hda1, /dev/sda1 ...
+
He can also add the maximum file size that is supported by that share. For example on FAT32 partitions the maximum file size is limited to 4GB.
  
After a quick reload router (??? don't know when the configure script should have run) the drive will be accessible as folders(symlinks) located in the desired pluto directories from Orbiter, Samba and console.
+
For the nfs shares the user needs to know:
 +
* The ip address of the device/computer that has that share
 +
* The name of the directory that is shared
  
[[Category: Bash Tools ]]
+
After adding one of this devices the user should manually do a quick reload router.
[[Category: Pluto Devices ]]
+

Latest revision as of 03:00, 20 October 2012


General Info

Package: pluto-storage-devices

Directory: src/PlutoStorageDevices

Background Info

This bash scripts where created to configure / setup storage devices that can be used in LinuxMCE. Currently there are 2 device templates that can be configured by this scripts:

  • Hard Drives / Generic Internal Driver (1790)
  • Network Storage / HD-HG300LAN (1794)

This device templates have some common device data:

PK_Users (3) 
A list of integer values separated by comma. The numbers represent the id of the users who can use the storage device for storing private files on them. If the 0 value is there too, the storage device can also be used to store public files. If no value is entered, the default is considered 0 (public only). If the next device data (use LinuxMCE dir structure) is not set to 1, all the files will be accessible from one directory on the storage device, meaning that public / private files can be accessible by every user that can access that device.
Use LinuxMCE Directory Structure (130) 
This value can be 1 or 0, meaning that the information on that devices will be stored using a LinuxMCE directory structure, identical to the one in /home directory. For every user there will be a separate directory to store it's private data and there will also be a /public directory in there. The default is set to 1 but if other/no value is entered will be considered 0.
Use Automatically (134) 
Used by MythTV. If checked, LinuxMCE will add a storage group for the drive to MythTV.
Directories (153) 
The media directories from the LinuxMCE directory structure that can be used on this device. Example by entering music, movies only the music and movies folders will be available from LinuxMCE. The value can be empty, meaning that all directories will be available.

File Details

Scripts used to do generic setup

auto.PlutoStorageDevice 
The /etc/auto.PlutoStorageDevices file is used by automounter to mount different storage device in the /mnt/device/device_id directories.
StorageDevices_ExportsNFS.sh 
Some devices can be attached to only one computer, for example the internal disc drive. This script generates a section in the /etc/exports file that can export the local mounts of this kind of devices over nfs. This way the local storage devices can be accessed by any computer over the network. After it updates the /etc/exports file it also triggers a nfs reload.
StorageDevices_Symlinks.sh 
The mounted storage devices will be accessible to the user via symlinks that are created in the /home directory by this script. Depending if the storage device uses a LinuxMCE directory structure or not the symlink will be pointing to the mount point directly or to the LinuxMCE media directors that where previously created in it. Also the symlinks will be created only in the directories listed on the Directories device data.
StorageDevices_PlutoDirStructure.sh [-d <deviceID>]
Creates a LinuxMCE directory structure on a mounted storage device. Called without -d parameter it creates the LinuxMCE dir structure only on the locally mounted devices, used with -d it creates the LinuxMCE structure on the specified device. If a device doesn't have the corresponding device data (130) set to true that the script skips it.
StorageDevices_Setup.sh [--cascade]
is the main script that calls the previous script so that it can setup the storage devices. Is intended to be used as a startup script. At startup is called by sysv-rc without the cascade parameter. If the --cascade parameter is supplied that the scripts runs on the local machine and triggers itself to run on the other working machines too.


Use Case

Generic Internal Driver (1790)

This device can be associated with a spare partition that the user has on the drives located in one of the computers running LinuxMCE (Diskless MD, Core or Hybrid). The spare partition can be used to store data like movies, music or any other files that the user wants to be easily accessed by LinuxMCE.

This device is detected automatically by LinuxMCE.

HD-HG300LAN (Buffalo NAS) (1794)

This device template is used for integrating Buffalo HD-HG300LAN Network Storage Device into LinuxMCE. The Buffalo device is detected via the DHCP Plug'n'Play daemon once inserted into the internal network of the LinuxMCE core.

Generic NFS/Samba Shares (1769/1678)

This device can be associated with a samba(windows) or nfs share that is located on a computer/storage device. To add this kind of device, the user needs to manually add it from the LinuxMCE-admin web interface.

For the samba share the user needs to know:

  • The ip address which will need to added to the device IPaddress field
  • The username that that can have acces to that samba share. If the user is left empty or is 'guest', an unathenticated mount will be tried.
  • The password for the username (mandatory)
  • The share name

He can also add the maximum file size that is supported by that share. For example on FAT32 partitions the maximum file size is limited to 4GB.

For the nfs shares the user needs to know:

  • The ip address of the device/computer that has that share
  • The name of the directory that is shared

After adding one of this devices the user should manually do a quick reload router.