Difference between revisions of "Alx9r's Network Attached Storage Setup"

From LinuxMCE
Jump to: navigation, search
(Symlink and Permissions)
 
(18 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
{{Alx9rSampleSetup}}
 
{{Alx9rSampleSetup}}
  
I opted to use a built-in (sata connected) secondary media storage drive for my hybrid core.   
+
I store all my media on a Network Attached Storage box. 
 +
 
 +
''Side Note: Originally I opted to use a built-in (sata connected) secondary media storage drive for my hybrid core.  That configuration was simple and cheap to set up but suffered from a few shortcomings.  You can read about that original setup in earlier versions of this page.''
 +
 
 +
===Description===
 +
Here are some details on my NAS setup:
 +
*Hardware:
 +
**D-Link DNS-323 ($180)
 +
**2x 1.5TB Seagate Barracuda 7200.11 hard drives ($225 each)
 +
*Firmware:
 +
**D-Link version 1.05
 +
**[http://wiki.dns323.info/howto:ffp ffp]
 +
*backup configuration: the 2 drives are entirely independent volumes (i.e. not a RAID configuration).  Only the second drive is used by LinuxMCE.  Every night, a script synchronizes the contents of the first drive with the second drive.
  
 
===Rationale===
 
===Rationale===
The two-drive scheme has three key qualities:
+
Here are some reasons why I store all my media using this network attached storage scheme:
*The media drive can be formatted XFS so that LinuxMCE can "listen" for new media files that are copied to the drive.  Other filesystems don't allow for this.
+
*Having media on a separate drive drive from LinuxMCE ensures that media and its attributes are safe when installing LinuxMCE fresh.
*Fresh installations of LinuxMCE can be put on the primary drive without losing media. If you have only a single drive, you need to use the [[DVD Install And Custom Partitions|custom partition installation]] which is somewhat less-supported
+
*The NAS box can be located away from my hybrid/core which cuts down on noise in the living room.
*Checkpoint images of the system drive can be copied to and restored from the media drive. This means that you can get my hybrid core working just right, and copy the system drive to my media driveOnce I've done that I can experiment with changes to my hybrid core until it is [http://en.wikipedia.org/wiki/FUBAR FUBAR], then simply copy the good version back to the system drive.
+
*As compared to adding more hard drives to my hybrid/core, NAS offers the following benefits:
 +
**limitless expansion
 +
**much fewer overheating and power supply concerns
 +
*As compared to RAID1 on the DNS-323, syncronizing independent drives nightly is less buggy.
 +
*As compared to RAID1 or RAID5, having a backup provides a second ''independent'' copy in case a human, software, or hardware error corrupts, deletes, or otherwise destroys the media on the drive.
 +
*Unlike with RAID1, using one drive as a nightly backup only means that the two drives have a different usage pattern and are unlikely to fail simultaneously.
 +
*Unlike with RAID5, if the NAS box fails I can just plug either of the drives into a PC and recover the contents.
 +
 
 +
===Setup===
 +
There are a number of wikis and forums dedicated to the DNS-323.  I'll just provide the general steps that I took to prepare mine.  Here is what I did:
 +
#With no hard drives in the slots, I upgraded the DNS-323 firmware to 1.05 using the DNS-323 admin web page.
 +
#Changed the name of the device to <tt>NAS-1</tt> from the DNS-323 admin web page.
 +
#Added the drives and used the wizard on the DNS-323 admin web page to format them in "standard" mode.  This mode results in two separate volumes called <tt>Volume_2</tt> and <tt>Volume_1</tt>.
 +
#Copied all my media to the LinuxMCE folder structure on <tt>Volume_2</tt>.  See the next section for folder structure details.
 +
#Installed [http://wiki.dns323.info/howto:ffp ffp (aka fun_plug)] following [http://nas-tweaks.net/CH3SNAS:Tutorials/fun_plug#Steps_for_installing_fun_plug these instructions].
 +
#Set up a nightly rsync to copy all of the data from <tt>Volume_2</tt> to <tt>Volume_1</tt> by following [http://forum.dsmg600.info/t1150-Tutorial:-Backup-Everything-from-once-night.html these instructions].
 +
#With the DNS-323 turned off, connected it to the INTERNAL network, then switched it on.
 +
#Once the DNS-323 completed booting, I performed a reload router.  After a what seemed like a long time (probably a few minutes), LinuxMCE detected the DNS-323 and asked me if I wanted to use the drive.  LinuxMCE prompted for each of three shares that the DNS-323 set up: <tt>Volume_1</tt>, <tt>Volume_2</tt>, and <tt>web_page</tt>.  I told LinuxMCE to use only Volume_2 with the LinuxMCE folder structure.
 +
#After this, LinuxMCE displayed that it was "Installing Software" for a few minutes and eventually hung indefinitely doing some sort of "Configuration".  I finally, forced reload router, and the DNS-323 was fully set up.
  
 
===Folder Structure and Media (Pre-Installation)===
 
===Folder Structure and Media (Pre-Installation)===
Before installing LinuxMCE, I formatted my secondary media drive to the XFS filesystem using the [http://gparted.sourceforge.net/ gparted LiveCD].  Then I created the standard LinuxMCE media drive folder structure on that drive.  The structure looks like this:
+
Before connecting the DNS-323 to LinuxMCE, I created the standard LinuxMCE media drive folder structure on the <tt>Volume_2</tt> drive.  The structure looks like this:
 
<code>
 
<code>
 
+
 
public
+
Volume_2
|-data
+
  |-public
    |-videos
+
    |-data
    |-music
+
        |-videos
    |-pictures
+
        |-music
 +
        |-pictures
 
</code>
 
</code>
  
Also before installation, I moved all of my media to the appropriate folder on the media drive.
+
Also before connecting, I moved all of my media to the appropriate folder on the media drive.
 
+
===Symlink and Permissions (Post-Installation)===
+
Once LinuxMCE is installed, there are some steps that I performed to prepare the media drive: I created a symlink to the drive and set appropriate permissions to it.
+
 
+
I wanted the drive to be accessible as <tt>/media/bi</tt> (<tt>bi</tt> short for built-in).  I created a symlink accordingly using this command:
+
ln -s /mnt/device/XX /media/bi
+
Where <tt>XX</tt> is some sort of ID number for the media drive that seems to change each time I install LinuxMCE.
+
 
+
I wanted the default user, <tt>linuxmce</tt> to be able to do things at will on that drive, so I made that user the owner:
+
sudo chown -R linuxmce /media/bi
+
 
+
Everyone should be able to delete, rename, and copy stuff to the public folder, so I changed the permissions accordingly:
+
chmod a+w -R /media/bi/public
+
 
+
These permissions pass through on the samba shares, which means that I can put stuff on the media drive folders from a Windows computer by browsing to <tt>\\mce\public</tt><sup>1.</sup> and logging in as a LinuxMCE user.
+
 
+
===Footnotes===
+
<font size=-1>1. The string <tt>mce</tt> in the path <tt>\\mce\public</tt> is mapped in my router's <tt>hosts</tt> file.  See [[Alx9r's Router Setup|my router setup]] for details.</font>
+
  
 
{{Alx9rSampleSetupNavbox}}
 
{{Alx9rSampleSetupNavbox}}

Latest revision as of 23:42, 20 September 2015

Alx9r's Sample Setup
System Diagram

I store all my media on a Network Attached Storage box.

Side Note: Originally I opted to use a built-in (sata connected) secondary media storage drive for my hybrid core. That configuration was simple and cheap to set up but suffered from a few shortcomings. You can read about that original setup in earlier versions of this page.

Description

Here are some details on my NAS setup:

  • Hardware:
    • D-Link DNS-323 ($180)
    • 2x 1.5TB Seagate Barracuda 7200.11 hard drives ($225 each)
  • Firmware:
    • D-Link version 1.05
    • ffp
  • backup configuration: the 2 drives are entirely independent volumes (i.e. not a RAID configuration). Only the second drive is used by LinuxMCE. Every night, a script synchronizes the contents of the first drive with the second drive.

Rationale

Here are some reasons why I store all my media using this network attached storage scheme:

  • Having media on a separate drive drive from LinuxMCE ensures that media and its attributes are safe when installing LinuxMCE fresh.
  • The NAS box can be located away from my hybrid/core which cuts down on noise in the living room.
  • As compared to adding more hard drives to my hybrid/core, NAS offers the following benefits:
    • limitless expansion
    • much fewer overheating and power supply concerns
  • As compared to RAID1 on the DNS-323, syncronizing independent drives nightly is less buggy.
  • As compared to RAID1 or RAID5, having a backup provides a second independent copy in case a human, software, or hardware error corrupts, deletes, or otherwise destroys the media on the drive.
  • Unlike with RAID1, using one drive as a nightly backup only means that the two drives have a different usage pattern and are unlikely to fail simultaneously.
  • Unlike with RAID5, if the NAS box fails I can just plug either of the drives into a PC and recover the contents.

Setup

There are a number of wikis and forums dedicated to the DNS-323. I'll just provide the general steps that I took to prepare mine. Here is what I did:

  1. With no hard drives in the slots, I upgraded the DNS-323 firmware to 1.05 using the DNS-323 admin web page.
  2. Changed the name of the device to NAS-1 from the DNS-323 admin web page.
  3. Added the drives and used the wizard on the DNS-323 admin web page to format them in "standard" mode. This mode results in two separate volumes called Volume_2 and Volume_1.
  4. Copied all my media to the LinuxMCE folder structure on Volume_2. See the next section for folder structure details.
  5. Installed ffp (aka fun_plug) following these instructions.
  6. Set up a nightly rsync to copy all of the data from Volume_2 to Volume_1 by following these instructions.
  7. With the DNS-323 turned off, connected it to the INTERNAL network, then switched it on.
  8. Once the DNS-323 completed booting, I performed a reload router. After a what seemed like a long time (probably a few minutes), LinuxMCE detected the DNS-323 and asked me if I wanted to use the drive. LinuxMCE prompted for each of three shares that the DNS-323 set up: Volume_1, Volume_2, and web_page. I told LinuxMCE to use only Volume_2 with the LinuxMCE folder structure.
  9. After this, LinuxMCE displayed that it was "Installing Software" for a few minutes and eventually hung indefinitely doing some sort of "Configuration". I finally, forced reload router, and the DNS-323 was fully set up.

Folder Structure and Media (Pre-Installation)

Before connecting the DNS-323 to LinuxMCE, I created the standard LinuxMCE media drive folder structure on the Volume_2 drive. The structure looks like this:

Volume_2
 |-public
    |-data
       |-videos
       |-music
       |-pictures

Also before connecting, I moved all of my media to the appropriate folder on the media drive.



Alx9r's Sample Setup
Materials Network Gear · Hybrid Core (living room) · AV Gear (living room) · Orbiters · Glue
Preparation Router Setup · Aquos TV Power-on
Hybrid Core pre-LinuxMCE Setup Assembly · BIOS Tweaks · Hardware Testing · NAS Media Drive Setup
Hybrid Core LinuxMCE Installation Bare-metal Install · AV Wizard · Sarah (Setup Wizard) · Special Steps · PVR-150 Remote · Aquos TV · Denon Receiver · Media Drive Setup · Laptop Orbiter · Webpad Orbiter
Hybrid Core Additional Software Bittorrent · Synergy
Toolkit Laptop · telnet/ssh client · Remote Mouse and Keyboard · Partition Tools
Design Rationale Network Topology · NAS