Tuesday, October 27, 2009

Thursday, May 28, 2009

RAID 1 vs Windows Vista

I recently needed to upgrade a computer with Windows Vista to RAID 1 (drum roll please)
without reinstalling vista.

Here are the steps to follow.

Disclaimer : Do not attempt these procedures. If you do attempt this, you and only you are responsible for any damage, loss of data, etc.

Note : Your RAID controller must support creating a mirrored array (RAID 1) without erasing the drive.

Note 2 : I got lucky with this one.

Note 3 : You should be familiar with setting up RAID already, this is NOT FOR NOVICE USERS.

Note 4 : One tiny mistake could result in complete loss of data, you've been warned.

The steps:

  3. Did I mention BACKUP YOUR DATA!
  4. Download the correct RAID drivers.
  5. Main Disk in SATA port 0.0 Spare Disk in SATA port 0.1
  6. Enable RAID in the BIOS but disable RAID support on SATA port 0.0
  7. Allow windows to load.
  8. Install RAID drivers.
  9. Shutdown system.
  10. Enable RAID support on SATA port 0.0 and 0.1 via BIOS.
  11. Create a new mirrored array via BIOS utility using SATA 0.0 and 0.1.
  12. If it asks you to erase the disk choose no.
  13. Shutdown computer and remove SATA data cable from spare disk (0.1)
  14. On startup the BIOS should report that the raid array is degraded.
  15. Enter RAID setup utility and make the RAID array to bootable.
  16. Shutdown and replug the SATA data cable to spare disk (0.1)
  17. Enter RAID setup utility.
  18. If it shows 2 arrays delete the one that is the spare disk (0.1)
  19. Choose the remaining raid 1 array and choose repair, select the spare disk.
  20. Allow windows to load.
  21. Wait for the mirror to rebuild.
  22. Enjoy!
After thoughts, if you wanted to migrate to a striped (raid 0, raid 5, etc) array, follow the steps for a mirrored array, then image your hard drive (Trinity Rescue Kit anyone?), construct your RAID array, and copy the files back over onto the new array, then hope windows boots.

Monday, May 04, 2009


And so begins the project....

  1. Create a song database backend.
  2. Create a management front end.
  3. Create a customer selection front end.
  4. Create a server based music player.

And so begins the problems....

1) Using a database to represent song data seems like a good choice. However, it isn't as straight forward as it seems when you through in genres. I would like the manager to be able to include(or exclude) genres from playing.
  • I seem to have solved the problem by using a parent child relationship between genres, eg Rock->Alternative ->Adult Alternative. Using stored procedures to iterate through the children to the parent to generate the combined name (for user readability), and children to the parent checking id's. eg: if Rock is selected as an excluded genre, we also need to exclude all of it's children (Alternative, Adult Alternative) Had I chose Oracle or MsSQL I could have used SQL Recursion, MySQL doesn't support this. However, in my view, MySQL Community Edition beats the pants off MsSQL Express. In the end I want this to be able to function on low end hardware running Linux, so MS was out from the start anyway. However I'm looking forward to MySQL implementing this type of feature in the future (got to love community driven development).
2) I will need to either script a file transfer client, or write one into the manager program to transfer the actual mp3 files to the server.
  • Undecided
3) The web programming seems pretty straight forward and I plan on using PHP as the backend for interfacing with the SQL Server. I want this to be very user friendly and "pretty", however I don't claim to be much of a graphic artist, maybe I can leverage some contacts to help with this.

Updates to follow.

Monday, April 27, 2009

"100% Dell Servers - Unlike many of our competitors, we do not piece together our dedicated servers from the cheapest parts available." -InMotion Hosting - Dedicated Servers
I just thought that was funny. I wonder if there is any hardware that is cheaper than the parts Dell uses in their computers?

Monday, January 05, 2009

TCP / IP in C#

I'm currently working on a Generic Client Server setup in C#. It uses asynchronous IO, and fires events on; connect, disconnect, message recieved, and message sent. I used testing consoles for each of the librarys (Client and Server) and was able to send packets at 10ms delay from 30 clients and the server would send packets to all connected clients at 1ms delay. I let this run for a few hours just to make sure it could handle a little bit of a load.

My plans for this server don't require very much message traffic, but I wanted to know it could handle what ever I plan on throwing at it.

Every message that is sent is prefaced with how much data is in the message, so there is no need to add "" or any other such clunky mechanism to the end of a byte[] to tell the other side when they've got the whole message.

The buffers are 1024 bytes (1Kb) using a const that can be changed if needed, and if a message is sent longer than this, the receiving side will simply make another read callback until all of the message is received.

Each connection to the server, uses an internal ID system:

class Connection
private static int LastID;
private static Queue unusedID;
private int getID()
if(unusedID.Count > 0)
return unusedID.dequeue();
return ++LastID;
private int myID;
public int ID
get{return myID;}
public Connection()
myID = getID();
private ~Connection()
myID = 0;