Archive for September, 2008

LINUX HOME SERVER – Storage setup

The main job of the home server is to secure the storage of family photos and other files I really don’t want to loose and to share them over the network to any PC in the house. The storage in the server is held as identical 250GB drives in a 4-way ICYDOCK disk carrier.

This is connected to a SATALINK Sil3114 4-port SATA PCI – it’s only SATA-I (1.5Gbps) so I don’t expect blistering performance. In addition although it 4-port apparently it’s only a 2 channel card with a port multiplier. What can I say the card including postage was less than £15 (including postage)!

I decided that although it’s expensive on disks I should make the storage RAID-1. Although the Sil3114 card does allow you to create ‘HARDWARE’ RAID devices in the SATA card’s BIOS this is not true RAID but a ‘fakeraid’ (apparently).

After some research the recommend solution in LINUX is to use the very mature software raid capability – since I want to manage a number of filesystems for different items (videos,music etc.) possibly resize them and modify the allocation of space – I decided to go the route of LVM on top of RAID. There are loads of howto guides and blog entries explaining how to do this. I’ve really created this entry to document the setup for myself.

HARDWARE:

Trying to be organised….I fiddled around with the wiring so that the top drive is drive 0 on the controlled, – 1,2 & 3 go down the carrier (4 at the base). Also, to try to get maximum performance, I arranged the RAID drives so that there is one drive on each channels in a mirrored pair. So drive 0 & 2 are a pair as are drives 1 & 3.

SOFTWARE RAID

This guide gave me all I needed to know about creating a RAID-1 device from two underlying physical drives (http://www.devil-linux.org/documentation/1.0.x/ch01s05.html).

1. First fdisk the drives to prepare them;
I set a single primary partition up on each disk to occupy the whole space available and set the partition type to ‘Linux RAID autodetect’ (fd).

2. Prepare the mdmadm.conf file
echo ‘DEVICE /dev/sd[bcde]1’ > /etc/mdadm.conf

3. Use mdadm to create a RAID-1 device:
mdadm –create /dev/md0 –chunk=64 –level=raid1 –raid-devices=2 /dev/sdb1 /dev/sdc1

4. Save the information about the just created array(s)
# mdadm –detail –scan >> /etc/mdadm.conf

So in the end my mdadm.conf looks like this…
DEVICE /dev/sd[bcde]1
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=d016aaee:80f4911b:acb5d753:fd2968f0

5. Waited for the RAID device to be built..don’t reboot until it’s done!
# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdc1[1] sdb1[0]
245111616 blocks [2/2] [UU]
[>………………..]  resync =  2.1% (5344192/245111616) finish=11256.6min speed=353K/sec

Christ this doesn’t look good 353k/sec in SLOW and 11256.6Min is a LONG TIME.

Oh hang on 2 minutes later…
# tail /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdc1[1] sdb1[0]
245111616 blocks [2/2] [UU]
[==>………………]  resync = 13.8% (33990784/245111616) finish=72.0min speed=48838K/sec

6. Worry about the disk performance
The second /proc/mdstat doesn’t look so bad but it’s not 1.5 Gb/sec is it – I must do some benchmarking to see if there is an underlying problem with the disk/controller setup!

7. Do some Benchmarking
Once the RAID device (/dev/md0) was built I rebooted to check it would come back up as a RAID array – everything seems OK. Then I tried testing the performance of the raid device /dev/md0 and the underlying drives (sdb and sdc). It’s not very thorough but I used ‘hdparm -tT’ to get and estimate of the disk performance;

Disk                                          Device         Cached Reads    Buffered Reads
(system disk 5400rpm 2.5″)     /dev/sda      2190                 35
(storage disk 1 7200rpm 3.5″) /dev/sdb      2120                 66
(storage disk 2 7200rpm 3.5″) /dev/sdc      2115                 68
(raid device software raid)       /dev/md0     2060                 66

It turns out that the storage drives as a RAID aren’t too bad – from what I can gather through the magic of google that kind of value for a SATA-I drive of that vintage is OK.
The system drive result is disappointing – I guess it reflects trade-off in performance that you suffer when you choose a fairly old-style mobile hard drive to decrease power consumption. It still seems low to me but not low enough to start exploring AHCI versus IDE and all that mularky.

SOFTWARE – LVM setup

Firstly according to this guy’s blog “As I learnt the hard way, the LVM detection happens before RAID”. His instructions call for you to modify the filter setting in the /etc/lvm/lvm.conf file. I’ve created a filter for my specific setup:

filter = [ "r|/dev/cdrom|", "r|/dev/sd[bcde]1|", "a|/dev/md[01]|" ] Now go through the LVM set-up of the /dev/md0 raid array 1. Create physical volume

#pvcreate /dev/md0
Physical volume “/dev/md0” successfully created

2.  Create the Volume group

#vgcreate array1 /dev/md0
Volume group “array1” successfully created

3.  Create the logical volumes (the actual ‘drives/devices’ visible to the user)

I couldn’t really decide on what volumes to create I guess the thing about using LVM is that I don’t have to. To help manage I wanted to have separate volume for different items (one for picture, one for videos, one for music and one for ‘general’). Given the total storage available of 250GB I decided on an initial layout of;
General – 25GB
Pictures – 50GB
Music    – 50GB
Videos  – 125GB

So I set them up like this…

#lvcreate –name general –size 25G array1
Logical volume “general” created
#lvcreate –name pictures –size 50G array1
Logical volume “pictures” created
#lvcreate –name music –size 50G array1
Logical volume “music” created
#lvcreate –name videos –size 108G array1
Logical volume “videos” created

Ah yes the difference between the inflated way disk salesmen measure capacity and the miserly way linux does have lost me nearly 20GB somewhere (nevermind).

4. Finally create the filesystems
Now the logical volumes exist the filesystems need to be created . Sod researching to very best type of filesystem I just set them up as ext3….

#mkfs.ext3 -m 0 -T largefile /dev/array1/videos
#mkfs.ext3 -m 0 /dev/array1/pictures
#mkfs.ext3 -m 0 /dev/array1/music
#mkfs.ext3 -m 0 /dev/array1/general

They all have no space allocated for root (hence -m 0) and the video filesystem is optimised for large files. All seems well (no error messages anyway). Ok that’s it should be done – when I reboot it will all come back OK (fingers crossed).

When I rebooted it all came back and I ran the LVM tool that comes with CENTOS – it all seems OK (not that I’m at all suprised!)

 

OK so far so good! Using the LVM tool I created mount points for the volumes and got them to be mounted at boot.

Comments (147)

LINUX HOME SERVER – power consumption measurements

With the set-up of my LINUX HOME SERVER I choose components in the hope to minimise the power consumption (at the obvious expense of performance) of the system. The cost of electricity isn’t going down and I wanted to try and avoid an enormous bill each year just for having the server idel for long periods of time. As well as choosing power saving components I disabled anything in the BIOS that wasn’t going to be used (e.g sound, serial and parallel devices) in an attempt to reduce power consumption still further.

First I made a sort of back of the envelope calculation at what the maximum power consumption should be;
31W CPU (published TDP of the chip)
25W Motherboard/chipset (can’t remember where I saw this! – oh yes here…http://www.silentpcreview.com/forums/viewtopic.php?p=285356)
4W System disk
2W RAM
16W 2x Storage disks
78W TOTAL POWER CONSUMPTION BY COMPONENTS
104W Allowing for PSU 75% efficiency

That’s my target but I don’t have to guess because I borrowed a plug-in energy monitor that tells me the power consumption of any appliance.
 

So what the verdict?   Actually when I booted the machine for the first time the power consumption spiked at 105W (blimey that’s uncanny!) for a second or so then subsided to a steady 60W when the machine is totally idle (just sitting at the login screen). I should note that the server used 4W when turned off.

I wanted to dig a bit deeper and estimate the contribution of individual components the overall idle power consumption. so I started to systematically remove all the components I could
1. Turned off – 4W
2. Maximum recorded – 105W 
3. At Idle – 60W
4. As 3 but with the two storage disk removed – 42W
5. As 4 but with the ICYDOCK cage unplugged – 42W
6. As 5 but with the PCI SATA card removed –  39.5W*
7. As 6 but with a Hauppauge Nova-T tuner card installed  – 44.5W*
8. As 3 but with a Hauppauge Nova-T tuner card installed  –  65.5W*
The only other things I could unplug would be the cooling fans and I didn’t fancy doing that. 

*The meter measures to the nearest Watt – but in some readings the value oscillated up and down by 1W.

Overall I guess I’m pretty happy with 60W at idle. I saw a review of Windows Home Server Machines where they measured power consumption and it’s pretty comparable (the range was 40 to 55W) if a little on the high side. This is acceptable considering my server is a much more capable machine that the average WHS offering. I guess the most striking results are;
— Just how much power Hard Drives consume…my estimate is that each drive uses 9W of power just sitting idle.
— Having a PCI card sitting in the machine that I’m not using (the Hauppauge card) is undoing alot of savings made elsewhere – the card uses about 5 or 6W of power and is just sitting there doing nothing at the moment.
— Although not all PCI cards are the same (obvious I guess) they all consume a few Watts – the PCI SATA card is estimated to use about 2.5W while the PCI DVB-T tuner card about 5/6W. It occurs to me that a PCI-express based card (which operate at lower voltages) should consume less power – it would be interesting to do a comparison using a Sil3114 PCI-e card (if such a thing exists) or a PCI-e based TV tuner.

Cost implications…
Well if it runs 24 hours a day at 60W (idle) then my bill will be increased by about £65.

I’ve based this on my simple calculation;
0.06Kw * 24 = 1.44 kWh (kiloWatt Hour) per day
1.44 * 365 = 525.60 Total kWh per year
£0.1236  * = £64.96 Total cost of running the computer

Next steps….
I guess I must see if I can make use of the mobile style power saving capabilities of the setup yet more by using power management to power down most if not all of the system if it sits idel for long periods of time. I guess the obvious place to start is with the hard disks since they use so much juice.

Comments (149)

MCP9350i: Installing VISTA

Previously I had blogged about adding tuners to my MCP9350i which seemed to work just fine until I booted into Windows XP (media centre) and fell foul of microsoft’s licensing and activation nonsense – the machine has a COA label on it and was installed with Media Center 2005 as standard but I couldn’t get the thing to activate. I couldn’t even log in to the machine – it was completely locked! I tried the F11 system recovery process but with the same end results – you can’t log in until you activate the copy of windows.

Well never mind I was going to try out VISTA media centre anyway!
So here is a very quick run down of installing VISTA on the phillips machine.

1: Backup
The crucial backup is the c:\phillips directory which contains all the original drivers shipped with the machine – they don’t seem to be available anywhere online. Even with the machine locked by the windows activation problems I was able to get a copy by booting into safemode and using a USB memory stick.
You should get a image of the hidden partition that contains the recovery software and a fresh install of the O/S. 

2: VISTA installation
I just booted the vista DVD and let it do it’s worst – when it came to selecting the disk partition to install vista on I chose to delete all the existing partitions and do a completly new install. This included deleting the hidden partition that the recovery (F11) proceedure runs from. I guess if you wanted to be able to go back to XP at some point then you could try leaving that partition intact.

 3:Drivers
Most of the information needed to find all the vista drivers came from this very usefull blog – verydodgblog.com.
One key file to source is the VISTA drivers for the MCP9360i from the phillips support site.
http://www.p4c.philips.com/cgi-bin/dcbint/get?url=/sca/sca/070314/070314170811_18207.zip&ofn=Vista drivers.zip 
Although these are for the later MCP9360i rather than the MCP9350i the two machines have a lot in common and the drivers seem to be OK for the sound and front panel at least. 

3a. Graphics (intel GMA950).
Initially the VISTA install used it’s own drivers. I downloaded the very lastest GMA950 drivers from the intel support website and these seem to improve a number of things and add a widget to the control panel for advanced graphics card settings. The link is here but I suspect the intel support website is pretty fluid just go to intel site and search for GMA950 drivers!
http://downloadcenter.intel.com/filter_results.aspx?strTypes=all&ProductID=2102&OSFullName=Windows+Vista*+Ultimate,+32-bit+version&lang=eng&strOSs=156&submit=Go! 
 

3b. VFD display drivers (Intel front panel manager).
I used the ‘Front Panel Manager’ drivers from the phillips MCP9360i drivers (see above). This worked just fine and I’ve tried a few of other possible FPM drivers but this is the only one that works. A quick note (although it does say this in the readme notes) you need to disable User Account Control before installing the FPM driver.

3c. Sound drivers (Sigmatel 9221).
Again the best and only place I could find drivers was in the MCP9360i vista drivers update from phillips. I did try a number of other drivers whcih are supposed to be for the sigmatel 9221 but none woudl even install. My sound seems to work fine now (I’m not using the SP/DIF or anything fancy just the RCA outputs). 

3d. Standard TV tuner card (Nvidia DualTV).
Nvidia support site has the latest download for this card that includes a custom media centre application for tweaking the settings. The link is here but probably subject to change.
http://www.nvidia.com/object/tvtuner_drivers.html 

3e. LAN Networking (Intel PRO/100 VE)
Vista finds the device and installs default drivers but I went to the intel support site and downloaded what I think is the very latest driver.
Get it from here – http://support.intel.com/support/network/adapter/pro100/pro100ve/ or just go to intel site and search for PRO/100 VE. 

3f. WLAN Networking (ATHEROS miniPCI AR5413 802.11abg card).
Vista default drivers seem OK – I don’t use the wireless networking so I didn’t bother to see if I could find latest ATHEROS drivers. There is a site here (http://www.atheros.cz/) that claims to have all the latest drivers.

 

That’t it really I’m very pleased with it – I’m not sure that any idea of upgrading the CPU and graphics card will ever be followed-up it just seems to work – High praise indeed!

PROBLEMS
There are a couple of things;

1. The front panel doesn’t wake-up after standby.
Initially when you turn the machine on the front panel work fine it says the date/time and track information where relevant BUT when you ‘wake’ the box up after it’s been in standby the front panel doesn’t wake-up it constantly says – ‘starting up’ but never does. 
Others have pointed to the MCE Standby tool to fix this (http://slicksolutions.eu/) but I haven’t tried it yet. 

2. Something wierd about rebooting
I had thought that it was a problem with a regular user (rather than an administrator) account not bootinh into media centre. In fact it seems to be that when an account is set to start media centre automatically I get a message about the video card not having enough RAM (a damn lie!) – I think it maybe something to do with the phillips decoder/transcoder I installed (maybe it didn’t fully support vista?) I need to fiddle about and see if I can work out what’ happening – I think that the Nvidia tuner comes with a Nvidia decoder.

Comments (168)

MCP9350i: Upgrading the CPU

I wrote a description on adding and extra tuner to the MCP9350i box and as I was doing it I could see that the whole motherboard was mounted on a tray that could be easily slid out. I thought then that upgrading the CPU wouldn’t be as hard as I first thought so here goes.

I bought a Pentium-D 820 on ebay. I went for this because it’s a pretty lowly model so I guessed it would be more likely to work than something released more recently. Also Pentium-D CPUs still seem to command alot of money second hand – I didn’t want to buy something for 50 quid only to find that I’d watsed my money.

STEP 1: Remove the lid and riser assembly

A description of how to do this is in my previous post on adding a new tuner.

STEP 2: Slid out the motherboard tray

 They’ve made this easy all you need to do is undo two screws…
P9100006P9100007

Then slide out the motherboard tray. There are a couple of things to be carefull about…P9100009
The power connector needs to be unscrewed since the cables connecting it to the PSU are very short
P9100008
There is a fixed cable tie that fouls the heatsink assembly as you try to slide it back.

As well as the two points I highlight alot of connectors need to be undone so the tray can slide out fully.
P9100010
Here’s a photo of the machine with the tray slid out just far enough to get access to the CPU and heatsink.

 

STEP 3: Remove the heatsink 

P9100011
Here’s the same shot but with the heatsink assembly removed

P9100012
Here’s the heatsink assembly removed from the case – considering it’s got to deal with nearly 100W (with a Pentium-D) it doesn’t seem all that impressive!

 

STEP 5: Replace the CPU

All the usual precuations apply – la la la – don’t blame me if you screw the whole thing up! I cleaned the heatsink (very carefully) and applied a liberal amount of arctic silver then put the new CPU in.

 

STEP 6: reassemble and boot

P9100018
Sorry about the quality of this shot but as you can see it seems to work both in BIOS an in the VISTA the new PENTIUM-D is recognised and both cores are picked up!

Comments (3)

MCP9350i: Adding additional tuners.

The MCP9350i is a great machine mainly because of the form-factor (i.e. it’s acceptable to wifey/gf/lady) I got mine cheap because the existing TV tuner wasn’t working so (hence it’s cheapness – I mean real cheapness!).

So the first thing I did when I got the machine was to look around for a replacement card. I couldn’t find an nvidia dualTV card (the standard fitment) but I thought that I was being clever when I uncovered the what I thought was the identical layout of the Hauppauge Wintv-PVR-500 to the machine’s existing Nvidia dual tuner. Further research reveals that the connector that allows extra inputs to be added is infact pin-for-pin identical on the two cards. Plus when you look at the pictures of the cards they have the same connectors arranged in the same order. What a very clever chap I am – oh yes.

comparing old and new tuner cards.JPG
Here you can see a photo comparing the Hauppauge wintv-pvr-500 (top) and the Nvidia dual tuner card (fitted as standard to the MCP9350i).

However my smugness at being so clever was short lived – I bought a PVR500 card off ebay and when I looked closely at the configuration of the connectors I realised they’re the same and in the same order but the don’t line-up – doh!

comparing old and new tuner cards end on.JPG
Here are the connectors of the two cards (Hauppauge underneath)

My vision of just dropping the new card as a direct replacement was destroyed. Having bought it I decided to add the Hauppauge card anyway. Although it would be possible to cut the backplate so the new card would fit I thought it would be neater to add it and leave the existing card in position.

For my own amusement I wrote a guide to doing the modification. I’ve written this walk-through using the hauppauge card but this modification is not specific to that card you could fit any PCI tuner card in this way.

STEP 1: Remove the lid

step 1 removing the lid.JPG
Unscrew the 4 torx drive screws on the outside of the case

step 1 machine with lid removed.JPG
Here’s the machine with the lid removed.

STEP 2: Remove the riser assembly

step 2 removing the backplane.JPG
The PCI and PCI-express cards are mounted in a riser assembly that can be removed intact. Start by removing the 2 silver coloured phillips screws (see the photo).

step 2 backplane assembly removed.JPG
Here’s the complete riser assembly when removed.

STEP 3: removed the outer skin of the riser assembly

step 3 remove external skin from backplane assembly.JPG
Unscrew the black phillips-head screw on the back of the riser assembly

step 3 external skin removed.JPG
Here’s the riser assembly with the outer skin removed.

STEP 4: Modify inter skin of the riser assembly.

The inner part of the riser assembly has holes in BUT they aren’t in the correct place. I might be possible to drill holes in the right place but since it will not be visible at the end I decided to put out a big slot so all the connectors fit through – more precise holes can then be drilled in the outer skin where it will be visible.
step 4 cut out backplane.JPG
The inner part of the riser assembly before being attacked.

step 4 cut-out backplane (finished).JPG
Here’s the inner part of the riser after being butchered.

STEP 5: Drill the outer skin of the riser assembly

This is the part that will be visible when the machine is reassembled to care is needed to get the holes just right and drill then neatly.
step 5 drilled external skin (done).JPG
The outer skin of the after drilling the holes.

STEP 6: Fit new tuner card

step 6 reassembly - new tuner fitted.JPG

Done it – here’s the riser with the new card in it. In my case the s-video input is slightly mis-aligned. This is annoying but the machine has other s-video inputs on the original analgue card so it’s not worth hacking away at the case to make it fit.

One problem I did not resolve is that the little tags that you can screw the card in place with are not aligned correctly. I decided that there wasn’t alot of movement possible since the holes are quite a tight fit – maybe if I have the thing in pieces again I’ll bodge some kind of fixing tab.

step 4 brackets are not aligned 1.JPGstep 4 brackets not aligned 2.JPG
The tabs on the riser assembly don’t line up with the holes in the new card.

STEP 7: Reassembly is the reverse of removal

Reassembly is the reverse of removal as they say in all the manuals – simple really. While reassmbling you have time for a quite prayer to the deity of your choice – please don’t let me have wrecked this TV card that I spent all that money on.

step 5  drill external skin.JPGstep 6 reassembled machine with lid off.JPG
A quick photo of the riser assmbly with both tuner card in it and of the whole machine when completed before the lid goes back on.

STEP 8: Reboot and pray

Oh bloody hell it boots but the axis of evil that it microsoft (maybe the EU should invade and install a democracy) has detected a hardware change and the pre-installed copy of XP/MCE asks to be authenticated.

step 7 reboot - or dear.JPG

Maybe I’ll go straight to vista – I did think I should upgrade to vista anyway, or maybe I’ll try the system recovery option at boot?

UPDATE – Having gone to all that trouble I subsequntly swapped out the PVR-500 dual analogue tuner for a PEAK Dual DVB-T tuner – it was pretty much a drop in replacement – the holes almost lined up only one (the aerial one) needed to be enlarged with a larger drill bit.

Comments (157)