iSCSI Nightmares

The other day I was working on our home network and ran into an issue with iSCSI.  We had decided that it was time to build a shared storage device that we could share files instead of using E-Mail.  Well this turned into a major disaster and got fugly real quick.  Here are some of the problems we ran into:

When we would transfer a file from one computer to the iSCSI target only the original computer would see the file.

The next problem which turned out to be the last straw that broke the camel's back was after working on a client project for several hours and copying more files to the storage one of our major folders wound up with files from our backup.

As I started to think about this problem and all my networking and programming experience an idea started to emerge.  iSCSI is not a file system so don’t treat it like that!  We had connected 4 different computers to the same iSCSI target, first bad idea!  The reason this will not work is each computer would create a file table for the drive and cache this information in memory.  Once our computers did the drive initialization it would only write to the storage device and not read the file system again.

This then gets even more complicated by the fact that when we created new files on the storage device there was no master system assigning disk blocks to write our data.  Can we say corruption!  Which is exactly what happened after about 2 hours of production work.  Our data store got majorly corrupted and ultimately I had to format and start over.

The corruption was also complicated but the fact now 4 different computer pretended to be the owner of the drive so many folder kept saying they were corrupt and inaccessible.  This wasn’t the case because the original computer that copied the files to the data store could still access the files even after a reboot.  The cause of this was Windows security and that the OS wouldn’t allow us to access these files even after setting the appropriate rights to Everyone.

Even after mounting the drive on a server and trying to take over rights to the files this because useless and would of taken me more hours to fix then it was worth.  Moral of the story if you want to get into shared drive space make sure to plan your needs.  Now that my server is up and running and is the only device connection to the iSCSI target things are a lot more stable.  Plus I get the added bonus of being able to version my files.

If you don’t have access to a server like I do you can support this design by connecting it to one computer and setting up a network share.  This does mean you will need to get of the Home version of windows and upgrade to a professional license or better.  The downside to this design is that you will not be able to provide version to your file structure.  This can be eliminated by using a version system like SVN, GIT, or Perforce.

Now back to fixing my network.  Things broke so fast the other day that I’m still dealing with the problems.  And don’t forget to build in a good backup plan!  But even then plan on that not working because now one of our backup drives is no longer mounting in our computers because of this disaster.