I've been using the QNAP TS-459 Pro+ for about a year now, which is a very nice file server. It has a lot of network services, but it seems to be missing the ones i want. Initially i was thinking of putting a server next to it with the data mounted from the QNAP file server, until i noticed the CPU in the QNAP is about 1.8GHZ, and the firmware is already some sort of unix-flavor. So why not replace the OS with Ubuntu?
Just to be on the safe side, backup the onboard qnap-image.
dd if=/dev/sdx of=/share/MD0_DATA/onboard_flash.img
Don't forget to download this file to something other than the QNAP server.
Download Ubuntu LTS iso from http://www.ubuntu.com/
vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 62.179.104.196 213.46.228.196
dns-search domain.eu
and activate:
ifdown eth0; ifup eth0
cat /proc/mdstat
...
md124 : active (auto-read-only) raid1 sdb3[1](S)
1951945600 blocks
...
If it says inactive, just reboot the server.
Mount disk and start copying data
mount /dev/md124 /mnt
Copy whatever you want to keep to the new disk
mkdir /home/multimedia
(cd /mnt/multimedia ; tar -cf - .) | tar -xvf - -C /home/multimedia
chmod -R o-w /home/multimedia
chown -R <newuser>:<newgroup> /home/multimedia
unmount it
umount /mnt
Remove the existing partitions
fdisk /dev/sdb (d=remove, w=write changes, q=quit)
Reboot to get rid of any still existing raid devices for this disk
Duplicate partitioning from the mirror to this disk (sdc=active disk in mirror, sdb=our empty disk)
sfdisk -d /dev/sdc | sfdisk /dev/sdb
Attach to mirror
mdadm --manage /dev/md0 --add /dev/sdb1
Check if it worked
cat /proc/mdstat
md0 : active raid1 sdb1[2] sdc1[0]
1953382208 blocks super 1.2 [2/1] [U_]
[>....................] recovery = 1.5% (31163712/1953382208) finish=319.7min speed=100204K/sec
echo check > /sys/block/md0/md/sync_action
cat /proc/mdstat
md0 : active raid1 sdd1[2] sde1[0]
1953382208 blocks super 1.2 [2/2] [UU]
[>....................] check = 0.0% (251904/1953382208) finish=387.6min speed=83968K/sec
apt-get install lm-sensors
sensors-detect
service module-init-tools restart
Either configure fancontrol manually by running "pwmconfig" or edit /etc/fancontrol: vi /etc/fancontrol
# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=10
DEVPATH=hwmon1=devices/platform/it87.2576
DEVNAME=hwmon1=it8718
FCTEMPS=hwmon1/device/pwm1=hwmon1/device/temp3_input
FCFANS= hwmon1/device/pwm1=hwmon1/device/fan1_input
MINTEMP=hwmon1/device/pwm1=20
MAXTEMP=hwmon1/device/pwm1=60
MINSTART=hwmon1/device/pwm1=150
MINSTOP=hwmon1/device/pwm1=0
Restart to activate:
service fancontrol restart
Configure the lcd panel like this:
stty -F /dev/ttyS1 1200
And then execute these commands to control the LCD (Switch on, Switch off, Set text in line 1, Set text in line 2):
echo -e "M^\x1" > /dev/ttyS1
echo -e "M^\x0" > /dev/ttyS1
echo -e "M\f\x0 HELLO WORLD 1234" > /dev/ttyS1
echo -e "M\f\x1 HELLO WORLD 1234" > /dev/ttyS1
The text has to be exactly 16 characters.