Archive for July, 2009

We are still unfortunately waiting for the memory to arrive from crucial, *sigh*, so in this part I will cover what the “extras” are and the installation of them.

Parts list:

  1. Chenbro ES34069
  2. Jetway JNC92 Motherboard
  3. Jetway SATA II Daughterboard
  4. 2GB Transcend Flash Memory Module
  5. 4 x Samsung Spinpoint 1TB
  6. 2GB Low profile Ram (When it arrives)

The Case

Chenbro ES34069Chenbro ES34069 "guts"

The Chenbro ES34069 case has 4 ‘hot swappable’ SATA 2 HD caddies, optional card reader, internal PSU.

PROS:

Good quite case, has all the required features, even some extras such as LED’s for the network interfaces, nice and compact, with the hot swap being a major bonus

CONS:

I’d have to say the price, this case weighs in at £200+ which is a bit hefty for a case.

The proprietary PSU adapter, I’ve not had any issues with the PSU’s power adapter, but by the looks of things it is bespoke to Chenbro, so I doubt getting a spare/replacement is going to be easy.

The USB header, and optional Card reader, this is more a ‘con’ of this build, as the motherboard used only has 2 USB headers, one of which is being used by the USB storage for the operating system, meaning you have the choice of either using the front facing USB or the optional card reader.

Inaccessible backplane, now this for me was the kicker, the Daughterboard comes with some finely crafted 90 degree SATA cables, which would of been perfect, if I had been able to actually access the backplane to attach them, I could not for the life of me find a way to get to the backplane without causing irreversible damage to the case itself.

The Motherboard

The Jetway JNC92 Motherboard comes with an Intel Atom Dual core 330 processor, the reasoning behind this will become clear later on, however you can opt for the cheaper single core processors if you wish.

Jetway JNC92 Motherboard, CN1 Sata Daughtboard, Transcend 2GB "SSD"

As the picture shows I have opted to use a Transcend 2GB USB module which attaches directly onto the motherboard, this will be used to store the freeNAS operating system

The SATA II Daughterboard has onboard hardware RAID support 0, 1, 0+1, and 5 RAID options across the 4 ports, I am still debating using the hardware RAID over Software RAID for the following reasons.

Yes I know Hardware raid is much much faster however as I understand it due to the XOR logic used in the hardware processor, using hardware raid essentially locks you into using a particular manufacturers hardware, which if this line is discontinued by the time something goes wrong is a serious issue when trying to recover data, this is where software raid shines as it is code based, and will run from any x86 capable hardware, and lets face it, it is not as if we are lacking CPU power in this build!

PROS:

Cheap and cheerfull motherboard

Powerful dual core CPU (Not like we’re going to be playing Crysis here, but for the use it is intended this CPU has ample power)

Expandability, this HAS to be the biggest selling point for this motherboard, you do not have to use it for any one thing in particular, I will shortly be looking at using this motherboard with the 3 x Gigabit daughterboard for building a hardware network monitor, think IDS, man in the middle machine goodness!

CONS:

Heatsinks, or their rotation they are top to bottom, where as the case I am using as most cases now has the airflow front to back, this is a minor con, but the heatsinks should be orientated for the best airflow.

USB headers, the Transcend USB module is designed to lock into the plastic socket you useually find on your USB headers, this motherboard does not have the sockets just the raw pins.

More images

Tags: , , ,

Comments 4 Comments »

As the company I am working for (Psycle Interactive Ltd) grow there became an increasing need to store and share large files between machines, granted we are all on MACs here, but the “drop box” becomes inconvenient when you want to share that file with multiple people.

As such I looked for ways to build a “cost effective” NAS, and now following the success of a recent build using FreeNAS for deploying an office NAS with 2.7TB of usable disk space I/we have developed a concept for using these relatively cheap NAS systems for Disaster Recovery Purposes.

This NAS build at the time of writing costs £740.54 inc VAT, for a 4TB system, giving approx 2.7TB of usable diskspace in a RAID 5 configuration, try getting a pre-built model for that, here’s a comparison

  • 4TB NAS Built in this series £740.54 inc VAT
  • Iomega 4TB NAS ~£2576.50
  • HP Proliant 4TB ~£4502
  • Netgear Readynas ~£1322.17

note: “~”
As show above I will be building our 4 NAS systems (1 I have already built) for around £1600 less than the price of a single HP Proliant system.

This blog series will cover the build process of the NAS systems as they are built, along with the theory and methods used to allow them to function as DR devices.

Currently we are waiting for the memory to arrive from Crucial, so until that arrives the new builds will not progress, in Part 2 I will be going over the motherboard and the “extras” we have chosen to use for this build.

See you in part 2!

Tags: , , ,

Comments 1 Comment »

    The problem

We’ve all been in this position at some point, working for a company who wants to internationalize their website, and so their mySQL CMS data …

But all is not so well as just using ‘SET NAMES utf8′ and changing all ‘charset’ on tables to utf8,

You may fall foul of seeing content like Á£

This is due to the fact in this case the latin1 encoded £ has not properly been converted to utf8 and as such is not rendering correctly, this is true of most ‘multibyte’ characters.

    The solution

What you need to do is actually convert the character set to utf8, in order to do this your going to need to run it through a program you could use iconv if you are already familiar with it, however if your system has python installed you can grab a copy of my sysadmin program which has iconv like functionality but is far more user friendly.

    What you will need
    Preparing the file

This assumes the database is currently using latin1, in theory this could be any encoding.

Get a dump of the database:

1
mysqldump --set-character-set=latin-1 --set-charset -u user -pPASSWORD databasename > databasename-latin1.sql

Now you have to be aware of what you need to replace using SED, you can’t just replace all instances of ‘latin1′ as Murphy’s law being as it is means that somewhere there will be ‘latin1′ in the physical content, especially for instance if I was using a mysql dump from this blog.

As such you need to replace the following:

1
/*!40101 SET NAMES latin1 */;

If your database dump is small enough (sub 100mb) you can edit this line directly in your text editor, alternatively you can do the following.

1
2
3
cat ./databasename-latin1.sql | sed 's/SET NAMES latin1/SET NAMES utf8/g' > tmp
cat ./tmp > ./databasename-latin1.sql
rm -f ./tmp

Now you need to replace all instances of ‘CHARSET=latin1′

1
2
3
cat ./databasename-latin1.sql | sed 's/CHARSET=latin1/CHARSET=utf8/g' > tmp
cat ./tmp > ./databasename-latin1.sql
rm -f ./tmp

Now we have to run the file through the charset converter

1
sysadmin -c iconv -d ./databasename-latin1.sql,latin-1,utf-8

If your sql dump is over 30mb, you will be prompted to confirm you wish to proceed, please remember that this will load the entire file into memory, so ensure you have enough available system memory before proceeding, I also suggest not running this on a production server.

If any characters could not be converted you will be alerted to their exact position within the file, from there you will either need to use sed to replace the character or use your text editor.

If all went well you now have ./databasename-latin1.sql.utf-8 (note the utf-8 extension), you now have a complete utf8 mySQL dump, all you need do now is import the dump.

    Further reading

  1. Force mySQL utf8 connections
  2. mySQL backup script

Tags: , , , , , , , , , ,

Comments 5 Comments »

spambag.org domain appears to have not been renewed as such it is sat at a generic ‘adverts’ placeholder.

This does mean that RBL lookups against blacklist.spambag.org are returning as a ‘false positive’, (similar to the ORDB issue)

If you are concerned about being listed on some RBL’s then get a copy of my sysadmin script here at the time of writing the ‘rblcheck’ function checks 27 RBL’s.

Comments No Comments »

PHP mail() not working?

getting “sh: -t: command not found” when testing using the cli?
what you have is a missing devel package!!!!

In my case sendmail-devel was missing, you’d think the configure script would alert on this but alas no, devel pack installed and one recompile later and the issue is solved.

Comments 3 Comments »

Title for a cheesy sysadmin novel I know.

But over the last month or so I have been plagued by a mySQL server that was reporting a full root partition, when it wasn’t full …

Causing me some headaches

Allow me to explain:

1
2
3
4
5
df -h
Filesystem                     Size    Used    Avail   Use%   Mounted On
/dev/sda1                     20G   17G      1.8G    91%    /  

...

Looks simple enough right? I just need to free up some space?

Afraid not.

1
2
3
du -mcs /
2264 /
2264 Total

Just for some clarification this small partition is in use for the operating system only, the mysql instance itself is infact mounted on a much larger partition using the same method as detailed in mysql moving /var/lib/mysql and error121

So here’s the problem, df and therfor all the monitoring systems are reporting the disk as full where as du clearly shows it is not …

Leaving me in the position of if I can not find where the disk usage is with du I have no way of freeing the disk space and bringing the service back online …

Or do I?

After talking with Matthew Ife of ukfast he suggests there must be a an unclosed file IO (aka a file descriptor) that is using up the diskspace, these descriptors do not show up using du

After some searching around I find the command lsof this command will list the open file descriptors for a process including their current size …

1
2
3
4
5
6
7
8
psa ux | grep mysqld
mysql     8131  2.8  1.5 304088 63668 ?        Sl   09:37   0:36 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --socket=/var/lib/mysql/mysql.sock

lsof -p 8131

...
mysqld  27878 mysql    3w   REG                8,2 14930490713   3290408 /var/log/mysql-slow.log.1 (deleted)
...

As you can see above the open file descriptor flagged as (deleted) was increasing in size until the diskspace ran out, for the time being I have since disabled mysql slow query logging whilst I sort out the log rolling as described in Mysql slow query log rotation

Comments No Comments »