Introduction

Requirements: for the backup data I will be using a partimage file.

The OS of my nas will be Xubuntu 14.04. This distro is fairly lightweight for a NAS system and gives me a sleek GUI interface. I could do without a GUI but this makes some of the services quite ‘Spartan’ to handle. A NAS is not a production environment. I want to handle sudden events, light, swift and simple. There’s no real point in debugging your NAS at 11:00 PM in a command line interface when you need to go to work at 5:00 AM in the morning.

For detailed instructions about how to install Xubuntu I’d like to refer you to Google:
The only thing that needs to be changed in the installation is login by default. This is a must, if you want to config services which will run at boot time with a GUI, you’ll need an active session to start these programs.

Let’s start with the basics (in case you didn’t download the latest updates while installing):

sudoapt-get updatesudoapt-get upgrade

sudo apt-get update
sudo apt-get upgrade

Installing remote access (OpenSSH, XRDP)

Start by installing openssh, this will be the backbone of our communication with the NAS server.

sudoapt-get installssh

sudo apt-get install ssh

By default the openSSH deamon times out, I don’t really like this so I’ll be adding a ServerAliveInterval.

sudonano/etc/ssh/ssh_config

sudo nano /etc/ssh/ssh_config

And add following line to it:

ServerAliveInterval 60

ServerAliveInterval 60

Next, I chose Xubuntu for a reason, I want to have XRDP installed. Scarygliders has a neat install tool which works for all *untu distro’s. I really recommend you use this file. It will take quite some time and is as slow as a snail but it works. It works flawless.
Note: It should work for all Ubuntu based distributions, however for Lubuntu and Bhodi it doesn’t seem to work very well. Xubuntu gave me a near perfect XRDP session.

I don’t like to have git installed on this system so I’ll just grab the master.zip and unzip it.

Migrating data from old drive

This part assumes you took a backup from the old drive with partimage. If you don’t have any data to migrate, you can skip this test.

First install partimage to be able to restore the data.

sudoapt-get install partimage

sudo apt-get install partimage

Next grab the block size of the partition you wish to restore. You can find this one by using fdisk and dividing the resulting size by 1024. Add some extra blocks as this result isn’t 100% exact. In my case the old backup disk was /dev/sdh1.

sudofdisk-l/dev/sdh1

sudo fdisk -l /dev/sdh1

Next create an empty image file with the disk size found in the previous step.

ddif=/dev/zero of=restore.img bs=1024count=31719727

dd if=/dev/zero of=restore.img bs=1024 count=31719727

Associate this empty disk image with a loopback device (loop0).

sudo losetup /dev/loop0 restore.img

sudo losetup /dev/loop0 restore.img

Now you can restore the image with partimage. In my case my backup image is called ‘image.000’ and resides on a disk mounted on: ‘/media/nas/05885c86-ae41-4839-b0dc-f1282c59dea4’

Migrating MySQL data (optional)

Sometimes it’s not possible to have a MySQL dump available. Lucky all data can be migrated from an old installation. In this example the disk is mounted on ‘/media/nas/backup/’. If you don’t have any old MySQL data to migrate, skip this step.

During this install you will be asked for a root password for the MySQL server.

The problem with VMWare 10.0.0 and a linux kernel 3.13 is that it just won’t work. As Xubuntu 14.04 uses this kernel, this system also suffers from this error. A patch can be found at:
Below is the content of the page (In case it vanishes):

#Change directory into the vmware module source directorycd/usr/lib/vmware/modules/source# untar the vmnet modulestar-xvf vmnet.tar
#run a the patch you should have just saved earlierpatch vmnet-only/filter.c < ~/vmnet313.patch
# re-tar the modulestar-uvf vmnet.tar vmnet-only
#delete the previous working directoryrm-r vmnet-only
# run the vmware module build program. (alternatively just run the GUI app)/usr/lib/vmware/bin/vmware-modconfig --console--install-all

Tip: When running VMWare images on a CPU which allows you to scale the frequency then your clock might get a little bit off if you don’t install the VMWare tools.
A little workaround to this is to add this to your cron jobs. (My example BE, Brussels NTP server Telenet)

sudo crontab -e

sudo crontab -e

00 1 * * * ntpdate ntp.telenet.be

There you go, one fresh NAS server ready to serve your content and configured to add more scalable services.