Carl the Zealot

October 29, 2008

The Ultimate Home Fileserver

Filed under: Uncategorized — Carl Myers @ 2:23 am

Greetings all, I am proud to announce that my ultimate home file server is now up and running (besides a defective hard drive, but the replacement is on the way, and when it arrives I will rebuild the array and complete my testing).

Now written here, preserved for posterity, are the complete instructions, hardware and software recommendations, and steps necessary to make your own ultimate file server for under $2300! First, the complete hardware list:

  • SUPERMICRO CSE-833T-R760 Beige Steel 3U Rackmount Server Case with 760W Triple-Redundant Power Supply
  • Intel BOXDX48BT2 LGA 775 Intel X48 ATX DDR3 Intel Motherboard
  • 2GB or 4GB of 1600Mhz DDR3 RAM (I suggest 2GB as when I tried 4GB it was very unstable with this mobo)
  • Any Core 2 duo processor (but feel free to go all-out if you really want…)
  • 8x 1TB 32MB cache SATAII Hard drives – if you don’t need as much space, feel free to save some money and go cheaper.
  • 1x IDE hard drive – use one you have lying around, or get a new one. The smallest I could find was a 40GB drive for $25 on pricewatch.
  • SIIG SATAII PCIe Controller – even though it doesn’t say, some internet research proves it does work on linux.
  • You probably want a video card for troubleshooting – I would have been lost without one (sadly). They just don’t make quality motherboards with good serial consoles these days.
  • You probably want a CPU fan, as the stock CPU fan for intel core 2 duos is QUITE disappointing in my experience.
  • You may want a SATA CDRom drive to use just for installation – the IDE is really picky about detecting hard drives and optical drives at the same time on boot.
  • You may want a power supply extension cable (24-pin, from pwr supply to mobo)
  • You may want some fan extension cables, this case has a ton of fans but the cables are short.

I know for a fact the above-mentioned hardware works, with Debian Lenny, as I am about to describe. With reasonable effort (not counting DOA parts… =| ), I now have my file server up and running. I can’t promise similar results, but let’s just say, it would have saved me a TON of time and money if someone had posted this list for me.


Ain’t she a beaut? Complete with 8 hot-swapable units of goodness. See the rest of the pics at the bottom.

First, you need to assemble everything. Open up the case, plop in the motherboard, screw it in (be sure to put in all the risers, they are necessary to support the expansion cards when you plug them in so the board doesn’t break. Hook up the power supply, motherboard, memory, main OS hard drive, and video card. If you have an optical drive, slap that in there, otherwise be prepared to network boot, USB boot, whatever.

Next, install your OS. Anyone who knows me knows Debian is the only way to go! Do a minimal install, you don’t want an X server lying around or anything. Apt-get install your usual necessities (zsh, screen, vim, sudo, less, etc). Next you will want to apt-get install “mdadm” and “lvm2″, and “nfs-kernel”, and probably “rsync” as well. Once you are sure your hardware is working, shut down, and go ahead and install the extra 8 drives by placing them in the hot-swap bays, then running SATA cables from the backplane to your motherboard. Since it is really tough to find a motherboard with 8 SATAII ports, all 8 of which are usable in Linux, I decided to compromise and just go for one with 6 ports, and buy a PCIe controller card. If you wanted your OS drive to be sata, or have some hot spares somewhere, feel free to buy additional controller cards, but this case only holds 8 hot-swap drives plus 2 5.25in bays.

I got these directions from LVM2 and Software RAID in Linux. Without these directions it would have been quite a bit more time consuming to figure out. The directions are a little old (and not debian specific), however, so best follow these. First, note that mdadm by default will scan all your devices (see: /etc/mdadm/mdadm.conf. Assuming all your drives show up and seem functional, go ahead and create partitions on them, then link them all in an array.

# for i in sda sdb sdc sde sdf sdg sdh sdi; do sudo fdisk /dev/$i; done

Each time fdisk runs, do the following. Press “n” to add a new partition, “p” for primary, then press enter twice to accept the defaults (use the whole disk). Then press “t” to change the partition ID to “8e” for “Linux LVM”. Next press “w” to write the new partition table and exit. After you have done this to all 8 disks…

# mdadm --create /dev/md0 --chunk=64 --level=raid6 --raid-devices=8 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sde1 ...etc

At this point it will create the raid and start syncing the disks. You can do this to check the status.

# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : active raid6 sdh1[6] sdg1[5] sdf1[4] sde1[3] sdd1[2] sdc1[1] sdb1[0]
      4883799680 blocks level 6, 64k chunk, algorithm 2 [7/7] [UUUUUUU]
      [==>..................]  resync = 10.2% (100386816/976759936) finish=640.8min speed=22789K/sec

unused devices: 

As you can see, it takes some time, but eventually you see this:

# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : active raid6 sdh1[6] sdg1[5] sdf1[4] sde1[3] sdd1[2] sdc1[1] sdb1[0]
      4883799680 blocks level 6, 64k chunk, algorithm 2 [7/7] [UUUUUUU]

unused devices: none

Now things are ready for you to set up LVM. I am writing this part after the fact, and in my set-up I decided not to do LVM. This may or may not be a bright idea. If you wanted to set it up, it’d go something like the steps below. Also, I may have forgotten some of the steps, so please let me know if I am missing anything or if you believe any of this stuff is wrong.

# pvcreate /dev/md/md0
# vgcreate fileserver /dev/md/md0
# sudo lvcreate -l 1192333 -n fileserverlv fileserver

I think the number after the “-l” was the size I got from the output of the vgcreate command. Basically, you are creating a physical volume (which is just composed of the array), then a volume group which consists of that physical volume, then a logical volume in that volume group. What does all of these levels of abstraction buy you? You can resize the array, or the partitions (logical volumes) you create on the array, at will. I just created one large partition for now, but later, I could break it up if I wanted to. Also, if I replace all the drives, one by one, with larger ones, I can grow the physical volumes then grow the logical volumes which lives on them. Yeh, it’s pretty hot. At this point, you should have a device for the logical volume you can use (in the example above, /dev/fileserverlv I think, or maybe /dev/mapper/fileserverlv).

Next you create the filesystem. Since the chunk size I chose was 64kb, I wanted something which evenly divided that, and I wanted the index sizes to be appropriate for what is, basically, an enormous drive by most standards.

# sudo mkfs.ext3 -b 4096 -m2 -T largefile -n /dev/md/md0

Now the drive is ready to mount

# sudo mount /dev/md/md0 -t ext3 fileserver

Finally, get NFS set up.

# sudo apt-get install nfs-kernel
# sudo vim /etc/exports

You probably want something like this:

cmyers@petabyte.cmyers.org:1 (3:47:18)] cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
/media/fileserver 10.0.0.0/255.0.0.0(rw,sync,no_root_squash,no_subtree_check)

The above example lets every host on the 10.0.0.0 network access the drive, read-write, and allows root users to get root access. Go ahead and start NFS next:

# sudo /etc/init.d/nfs-kernel-server restart

You probably want to copy over some stuff – here is the rsync command I used to grab stuff from the old server – be warned, I had to install rsync, then I had to muck with things to make sure the versions of rsync were the same – different versions are not always compatible, so if you have an old file server which is a couple years old, it probably has an older version of rsync.

# rsync -aAX --progress :/path/to/source :/path/to/second/source [...etc....] .

And there you have it! Your new fileserver is ready to go!

cmyers@petabyte.cmyers.org:1 (3:44:42)] df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              12G  902M   11G   8% /
tmpfs                1007M     0 1007M   0% /lib/init/rw
udev                   10M  148K  9.9M   2% /dev
tmpfs                1007M     0 1007M   0% /dev/shm
/dev/md0              5.5T  521G  4.9T  10% /media/fileserver
cmyers@petabyte.cmyers.org:1 (3:44:43)]

The inside of this case is so beautiful, I wanted to hang it on my wall next to a picture of Liz Hurley.


You can see the board layout pretty well in this shot. You can also see the totally sweet removable fans, and the ridiculous heatsink I picked up to replace the disappointing stock one that came with the CPU.


This shot shows off the SATA backplane. It’s a tight fit, but you can remove the fans to make it easier to work int here while you are plugging things in, as you can see in the picture.

October 26, 2008

What I don’t understand could fill several libraries of congress…

Filed under: Me, News — Tags: , , — Carl Myers @ 5:14 pm

…but anyone who claims that not to be true of themselves is quite deluded. The most recent subject of non-understanding which brings me to pour out my soul is happiness. Happiness is the drive by which evolution encourages certain very complicated behavior in animals, in a way which genetics alone cannot. Happiness is older than writing, older than language, older than music, older than just about any concept we take for granted today. It may be the second oldest emotion (I would wager it isn’t older than pain/sadness, but I bet it is close).

I have long wondered what it would take to make me happy. I mean, I am happy now, in that I am happy with my job, happy with my car, happy with my material possessions. I am happy to have my friends, and happy to have things which drive me (my current project at work, open source, music, and other things). But I always felt I could be happier. I often felt something was missing from my life. Primarily, I think that is someone to share it all with.

I often hear things from my friends like “You can’t find someone to be happy with if you are unhappy to start”, or, “you have like yourself or nobody will like you”, and other choice gems of wisdom. To me they seemed like quite the catch-22. We in the computer world call this a “circular dependency”. It is a real problem, A cannot be satisfied without B, but B cannot be satisfied without A. What is one to do?

The way to solve this problem, in Computer Science and in life, is by breaking the circular dependency. I always said “so what I am supposed to do, just try to be happy even though I’m not, that’s the only way I can be happy enough to meet someone and be happy?” and they would reply “um, basically, yes.” Well I think I finally understand that now.

Last weekend was an amazing weekend. I went out, I saw a show with friends, I saw a symphony concert with a date, and I met a new friend as well. None of these things were things I hadn’t done several times in the last year. Really, I have no idea what was different, maybe it was just that they were all in such close proximity, and I was just really trying to enjoy them, but I felt great. Last week, I went back to work on Monday feeling great. I didn’t let anything get to me. I worked hard to make progress on my project, and I did. I hung out with friends, went to rehearsal, and did all the stuff I normally did. I consider last week to be one of the happiest weeks of my life.

Now, this weekend, I had a concert. I had to wake up early for a rehearsal on Saturday. Then, I went to a cello lesson right after. The cello lesson didn’t go so great because I was pretty tired. After that I went home, and worked on my file server project, which is nearly done. I found that one of the 8 hard drives I had ordered was DOA, meaning I can’t complete the project until I RMA it. I didn’t care though, I still felt great that I all but had it working.

Today was our concert, at 2pm. I slept great – amazingly. I just took some Claritin to clear up my allergies and made sure everything was working right on my CPAP machine, and I went to bed around 1am, and woke up on my own around 10am, feeling great. Our concert could have gone better – we were playing VERY challenging music and we had a little slipup in the second number which was very disappointing (but, fortunately, was not particularly noticeable to anyone besides us). The soloist for Rhapsody in Blue was wonderful, and it went very well. The second half of the program was also pretty uneventful.

Well, all gussied up in my tux, dragging along my cello, I headed back to my car, put it in the back seat as usual, and sat down in the drivers seat. The car was warm, and I was warm from the tux, so I put down all the windows. It was a beautiful, absolutely perfect 56 degrees outside. I started driving, and I just…felt great. The concert was over, and the rest of my weekend was open, I could just go home and watch some TV or something, whatever I wanted. I started to put on some music to get the concert stuff out of my head, and the CD system settled on my “drivin’ mix” – a bunch of upbeat techno and trance from Overclocked Remix.

This is when I realized everything that I have written up to this point. I realized how great the last week was. I realized how great this weekend was. I realized how happy I was. And so, I opened the windows all the way, put down the moon roof, and turned up the music.

Now I have seen folks like this before. Driving down the road, blaring their music. I always thought how inconsiderate they were being, like they think their music is so good they have to blare it at the world or something. “Hey, everyone, look at me, I have a sweet car and loud music, and I want to turn heads”. Only now do I realize why people really do this (at least, I think my explanation is right). I did it because I was so happy, the wind in my face, the music loud and out there, and it just felt good. I was happy. The only way to keep that happy feeling was to turn up the music and put down the windows and just enjoy it all. Air conditioning blowing in my face was not going to replicate this priceless feeling.

And so I drove all the way home like that, windows down, music up, a big goofy grin on my face, wearing my tux still, driving around in a beautiful 2008 Acura TL, accompanied by the most excellent techo-ized theme songs from Mega Man, Sonic the Hedgehog, and Street Fighter.

The point of this whole story is, I was supremely happy. I don’t think even a significant other could have made that particular moment much happier. I realize now that finding someone isn’t everything. It remains the most important thing on my “to-do list” for certain, but that in no way prevents me from having the time of my life. Happiness is hard to understand, but that’s what is so great about it. You never know when it will strike.

October 24, 2008

Friday afternoon excitement at Pine and Summit

Filed under: Uncategorized — Carl Myers @ 5:45 pm

Well, I decided to head home a little early on Friday, I wasn’t getting much done anyways at work. As the bus tried to turn onto Pine, we saw a police vehicle blocking the way. The driver opened the door and asked what was going on, and the officer explained there was a pretty big wreck up ahead. We got off the bus and I started walking home to see police cars, fire trucks, and indeed a very bad wreck up ahead.

The ambulances, if there were any injuries, had already left, so I figured it had happened at least 10-20 minutes before I got there (around 4:50). I grabbed my camera and snapped a few photos.


View of the full scene.


Closer view – one of my better photographs, IMO.


Another close up.

Obviously, I didn’t want to get in anyone’s way so I took all my photographs from across the street, but it was pretty obvious what happened here. A taxi plowed straight into a white BMW. It seems likely someone was speeding, and someone else wasn’t paying attention. The taxi hit the BMW with enough force to drive it off hte road and onto the sidewalk, where it hit a telephone pole. I wouldn’t make any guesses about fault or what happened beyond that, however, since I didn’t actually see it, nor was I able to ask anyone what happened.

October 1, 2008

The ill-fated drive through the hills

Filed under: News — Tags: , , — Carl Myers @ 12:25 am

Last weekend I was supposed to go on a drive through rural Washington with some friends. It was to be a 400-mile trek during which we could enjoy our vehicles, form important male-bonding type stuff, and bitch about work. That was the plan, anyways.

It all started out last Sunday morning. The plan was to meet at a gas station about an hour north of Seattle, at 8:30am. I was careful to go the speed limit and leave myself plenty of time to get there. Ominously, I saw two cars pulled over on the way down, which seemed like a lot. I also saw about 4 billion bikers. One pack, some riding 3-wide in a lane, 15 rows, no fewer than 30 bikes at least, passed me on the right. Something was amiss.

I showed up a little early to find Ben and Keith already there. We gassed up and waited for our other friends, Jerry, and Forrest. At about 8:40, we decided to call them. “We’re on our way, we just got held up” was the reply. About 10 minutes later, they arrived, and explained what the delay was. Forrest was pulled over for speeding, getting his first speeding ticket ever. We commiserated briefly, I gave him the name of my lawyer, and we all made the requisite “ominous start” and “better not get another one today” jokes. They gassed up and we proceeded on our way.

We went Ben first in his dark blue BMW, with Keith as a passenger, then me in my black Acura, then Forrest in his red Honda Civic Del Sol (it’s a very nice car, not your run-of-the-mill civic) then Jerry (I forget what he drives, but it was white and fairly unassuming). There were bikers everywhere. We also seemed to be seeing a lot of cops. As we came to the first turn, there was a police car right in front of us, in fact. He made the light and turned left, while we sat at the light and waited for it to turn.

After the light turned, we made our left and proceeded down the road. We had little radios, and Ben and I were talking over hands-free cell phone as well. We weren’t sure of the speed limit, but this close to that many cops we were taking it pretty easy. I warned them that my radar was going nuts, but we were going under the speed limit anyways. Sure enough, the radar warning was right on, there was a cop sitting directly off the road, facing in our direction. As soon as we passed by him, he pulled out and headed right for us. I immediately saw this and exclaimed “oh shit”. I assumed Jerry was about to be accosted, but as Jerry pulled out of his way, he made a beeline for Forrest, and pulled him over. Again. Second time today. And we were CLEARLY under the speed limit, all of us.

Via the implicit, unspoken rules of common sense, we immediately entered radio silence, but Ben, Keith, and myself continued to speculate over the phone. We saw a church and pulled over in the parking lot, and waited for Forrest to catch up. There was this adorable white kitten we found – he was initially on the roof of the church. He jumped around, into trees, back to the roof, exploring, clearly playing and having a fine time. I grabbed my camera and the photo shoot began. After a while he decided to check us out. Forrest called us on the radio and we said where we had pulled over. When he arrived he explained that the cop pulled him over because he didn’t have a front license plate. Ben frowned, noting that he didn’t have one either. The cat literally jumped into Forrest’s car. He climbed in the driver side door, which was ajar, then all over the seats, then out the back window (it is a convertible which had the top down). The kitty started to climb into Ben’s car but he shooed the cat away since he is allergic to cats.

This time, the cop let Forrest off with a warning (what is that? I’ve certainly never heard of this strange “warning” you people sometimes talk about…I just get “Hello, sir, I see you have a pony tail, here is your speeding ticket”). He also explained to Forrest that there is a biker rally to the east today, and the entire area is crawling with cops, especially the back roads. He should expect to be pulled over several more times before the day is over unless he gets that plate on. Realizing that 50% of our caravan was now big shiny cop bait even without speeding, and the cops were CLEARLY biting today, we decided to call it off and try again next weekend.

Carefully ensuring no kitties were in the way, we pulled out of the parking lot and headed to a Denny’s to grab some breakfast, then headed back to Ben’s place for Rock Band. On our way back to the highway, we passed about 10 cops, including an unmarked car sitting by the side of the road training their radar directly at us. On the bright side, I had plenty of opportunity to prove my radar detector works (if you were curious, WA cops seem to use K/Ka band radar in that area, not laser). Drivers, bikers and car operators alike, were “dropping left and right”. I think they made their entire ticket quota for the month that very morning. Fortuitously, none of us were pulled over. Hopefully this means they will all have some vacation next weekend, I guess we’ll just have to try again then. Stay tuned for part two, and adorable kitty pics!

Powered by WordPress