Featured Post

HOW TO: Install VPN server on Ubuntu when server is behind firewall

The whole point in this post is to run your own VPN service, and allow you to connect remote devices to your home network. To start off yo...

Jun 9, 2013

Adding Drives to OpeneELEC install

So the hard drive I had previously removed from my NAS4Free system, two terabyte drive, was going to be place into one of my openelec systems as local storage.  I used gParted to format the encrypted disk and then hooked it up to my system , unfortunately the drive wasn't automatically recognized.

Logging into openelec via ssh I ran parted.  Once using parted I entered print all and saw that my disk was indeed there, it just wasn't being picked up.  The solution was to mount the drive manually, and automate this process for every startup, since openelec doesn't adhere to fstab etc.

Within /storage/.config/ I created a file called autostart.sh.  Using nano, I entered the following details (modify for your own setup)

mkdir /media/extended
mount -t ext4 /dev/sdb1 /media/extended

Make the autostart.sh file executable

chmod +x autostart.sh

Encrypted Disks and NAS4Free

The other day I bought a 4TB disk for my NAS, I needed to move all my data from an existing 2TB disk to the new 4TB disk.  I used TeraCopy (http://codesector.com/teracopy) for this, as not only does it appear to move the data quicker than Windows Explorer, but it can validate it after transfer.

The main problems I had related to the fact that I wasn't simply adding a disk, I was replacing a disk.

First of all I used a free box that I had to run live NAS4Free and setup the disk.  The sequence for encrpyting a disk in NAS4Free is as follows:
  1. Add Disk
  2. Create your encrypted volume using the previously added disk : This step will automatically ‘attach’ this volume
  3. Format this encrypted volume
  4. Add a Mount Point using this encrypted volume
It's very important to follow this order, I tried to do 3 before 2 and always ran into problems mounting.

Once the disk was added I was able to transfer the data, the next step was waiting 24hrs.

After all the data had transferred it was time to remove the old drive and replace it with the new one.

Before removing the drive physically I deleted the following:
  • CIFS/SMB shares
  • Mount Point
  • Disk
I did not remove encrypted reference, as I thought it would delete the contents of the drive, which I wanted as backup until I had confirmed the new drive was working.

Next step was to physically remove the drive and replace it with the new one.  Once the drive was in I had to do the following steps to get everything up and running:
  1. Add disk (note it is encrypted)
  2. Remove previous encypted disk information
  3. Add new disk to encryption list (NOTE: DO NOT INITIALIZE)
  4. Create Mount Point (NOTE: I had to fsck/check-disk first, as I was receiving errors when mounting)
  5. Add CIFS/SMB share
I did a couple of reboots to make sure everything was coming up as expected.  At this point I took a new backup of the NAS4Free configuration.