Omg, The Card Reader Works!

Friday, 16th September, 2005 :: 07:46 EDT - Tech

I’ve been struggling with getting my USB card reader that came with my HP 873n to work for ages… It used to work just fine, then started being wonky, then altogether quite working thanks to the magic of udev. Apparently udev is supposed to make everyone’s life a bit easier, but I think I still prefer the old /dev/sda1 way of doing things… because it worked for me. It provides for a very direct hardware/topography connection.

Anyway, apparently my card reader is a bit of a bastard. Either it doesn’t play well with usb hotplug, or it just doesn’t notify the kernel that a card has been plugged in.

The big problem is at boot four device nodes are created, sda, sdb, sdc, and sdd. In linux, you access a partition instead of the device, so… if I wanted to access my compact flash card I’d need to mount /dev/sda1. The kernel/hotplug/udev and all of the other sinister characters in this saga just wouldn’t cooperate and actually create a /dev/sda1 node, no matter how much I cursed at them.

I read and read and read some more… everything I could get my hands on about udev and usb card readers… but again my card reader is a bastard; the only way to differentiate which slot is which is by the scsi LUN. I think that really is short for LUNatic… Instead of having a unique product, model, etc, like some other card readers like Lexar, it just repeats the same song and dance for every slot. Seriously, it just likes to be enigmatic about itself, won’t even tell the kernel who made the thing.

I fiddled and fiddled and finally figured out how to persuade udev and the reader to work together on something for once. Instead of relying on the card reader to actually tell the kernel and udev family how many places it would like set for dinner, I’m just having udev set the entire table.


BUS="scsi", SYSFS{model}="USB Card Reader", KERNEL="sd*", NAME{all_partitions}="%k"

This little piece of magic causes a plethora of device nodes to explode onto /dev… sda1-15, sdb1-15,sdc1-15, and finally sdd1-15. This way /dev/sda1, etc, will always be there, so no more of that backtalk from mount about /dev/sda1 not existing, hah! Take that!

Under a Rock!

Friday, 16th September, 2005 :: 03:10 EDT - Tech

I had absolutely no idea that Gig-E had come down to such reasonable prices… I remember the day when if you wanted gigabit ethernet you’d have to pledge an unborn child, or something like that. Hell, the last 100mbps card I bought was nearly $100… (well, sort of… I did buy two at $20 each for my router, but I can’t say that counts) and now you can get 1000mbps for $20! Gig-E switches are also very reasonable, coming in at slightly less than I paid for my last one, back in 2002, lol. I think I’ll have to add that to my little future-upgrades list too… even if it’s between my workstation and file server, speed will be amazingly better… perfect for when transfering gigs of data to that shiny new RAID 5.

Interestingly enough, when I first setup a network here I had a 4 port 10mbps hub… it cost me $100, lol. That was in the days before broadband, when we used a Windows 98 computer to share a single dialup connection… with network cable running through the hallways. Oh how things have changed!

Ouch, Hardware.

Friday, 16th September, 2005 :: 00:31 EDT - Tech

While I was taking out the 120GB drive I intended to place into the portable enclosure I also noticed that my file server’s motherboard had both SDR and DDR slots. I vaguely remember buying that one on purpose because I didn’t want to purchase DDR RAM when I was piecing together that system.

Some background: the reason I bought the HP 873n was because my computer (now the file server) died horribly in the middle of a wretched stretch of company server problems a couple of years ago. It was a situation where I needed a computer immediately, so… instead of building one I bought one. I then, as time and money permitted, fixed it and thus… the file server was born.

I was trying to remember just why it was that I bought DDR for the file server and I figure I did it because I couldn’t get Gentoo to compile properly using the SDR that was in it. Ahh, yes, those were the ultra-cheap dimms I bought on ebay, every single one of them ended up being faulty… it was cool to have a system with 1.5GB of RAM, but… not so good when it crashes constantly because of it, hehe.

Back in 2003 I put together a linux router box from some of the spare parts I had. I also bought a dual DDR & SDR board for the same sort of reason. I’m clueless as to where the 128MB chips came from that were in it though…

So it came to me… since I haven’t any plans on repairing the router box, it has something vile wrong with it (best guess is the CPU is fried, poor little ancient 800Mhz AMD Duron), I might as well use it for parts.

How much RAM does a headless file server need anyway? I hope it isn’t more than 128MB, lol. I did put two 128MB chips into it, stealing the juicy 512MB DDR for my workstation. It turns out that one of those 128MB chips was bad, d’oh. I’m sure it won’t need more than 256MB, quite frankly it didn’t occur to me to actually check memory usage before I pulled that little three machine swap, another oops. The system is holding steady at about half usage when idle and so far I’ve not noticed a slowdown on smb/cifs transfers. If I must, I’ll toss $25 into it (a drop in the bucket when compared to the new RAID, haha) and get a stick of 256MB DDR.

Now, as I mentioned, I have two 512MB sticks in my workstation. Oh, life is sweet… I guess. I haven’t been running long enough for it to make much of a difference, but more memory is always a good thing.

The bad magic number has shown its ugly faceless text… on one of those ‘old’ 120GB drives. The kernel yelps when mounting the drive now, saying it has errors and should be fscked. Whenever I try it mentions that bad magic number and how the superblock is messed up… hmmm. I suppose I’ll be wiping that drive and giving it a fresh superblock.

Before I realized that one of the 128MB RAM chips was actually bad I was having a terrible time with that 120GB drive, all sorts of errors… I kept changing around the IDE cables, etc, without help. I was beginning to think that somehow I’d damaged the drive. It wasn’t until I actually hooked the monitor up to see what was happening that I noticed the BIOS read only one of the chips; took out the bad one, via the process of elimination, and bingo… things are back to stable, good, and normal. Phew. The drive errors were simply a manifestation of the bad RAM.

So, yay, I was able to cross off an upgrade step without having to buy anything new! :D

I have a couple of steps left to go. I will need to repair the superblock/file system of the 120GB currently in the server. I’ll need to wipe & format the portable drive to vfat(32)… a horrible file system, but the only one very easily accessible by all three OSes. A new video card is certainly in the works… as I mentioned previously… just need to actually buy it.. and then pray it works.

The last step is one I’m a bit leary of, this could provide cause for buying new RAM for the file server. The OS is currently on a 17.2GB drive, it’s very old… very slow, very hot. While it does work, there is no way of telling just how long it’ll keep working. If you can’t tell, I’ve lost faith in the reliability of hardware, especially storage hardware. The 17.2GB drive is adequate, it keeps my portage tree for both computers, etc, and has a meager amount of home directory storage. I’d like to toss it though… which means getting Gentoo onto the 120GB drive and making that the boot.

In an ideal world I’d be able to just transfer the 17.2GB drive onto the 120GB… except I haven’t a clue how to accomplish that. I know dd can clone drives, as well as some commercial software, but I’m not really cloning, because they’re totally different sizes and they’ll have a totally different partition scheme ultimately. I don’t, though, really have a lot of desire to set gentoo up all over again, maybe it wouldn’t be so bad if I started out… say, on a higher stage than… ONE, lol.

I’m leaving that little endeavor as something I’ll get to eventually.

I Have RAID 5!

Thursday, 15th September, 2005 :: 18:59 EDT - Tech

I agonized over getting three or four drives for my RAID 5. I ultimately decided to go with just three, to have a total available space of 500GB (in theory). Making that economic choice allowed me to also get a nice portable drive enclosure and replace my busted DVD burner. It figures that as I copy data over to that new array, I’m starting to question the choice of going with less space. I really think it’s a matter of percentages… I have plenty of storage space, 500GB is, without doubt, a lot of storage. I get a little cringe whenever I notice the array is currently 41% full after dumping my existing data to it.

No matter, I guess… I can always add a second RAID 5 down the line if necessary; another three drives and a controller and I’ll have 1TB of storage. Having only three drives in the array helps with redundancy, in a way… there are fewer drives per array to have fail at once. It’ll end up costing me more in the long run though, of course, but… I’m hoping that prices will drop significantly in the future to make it worth while, being that larger drives will eventually cost as much as the 250GB drives do now.

The next upgrade steps would be to replace the video card in my workstation. Currently it’s running a horribly slow (even when it was new, sadly) Geforce 4 MX 420… the bottom of the bottom of the line. HP, in their infinite stupidity/cost cutting put a mere 200 Watt power supply in my 873n. Nearly all of the newer cards require a PSU in a significantly beefier flavour, which complicates matters. One would think that simply upgrading the PSU would be in order… except again in a fit of insipidness HP put in a funky PS3 form factor PSU, they’re smaller than the normal ATX power supplies. The size is more on the order of a Micro ATX PSU, except most are in the SFX form factor… it could work, but then again, it’s still not exactly right. I think that a Geforce 6200 card will work, it doesn’t have a molex power connector, thus is powered solely through the AGP connector… instead of, as indicated requiring additional power directly from the PSU. It’s a bottom-end, entry-level sort of graphics card, but… it’d probably still bring a tremendous increase when playing games. I’d settle for something like 20 FPS in doom 3, heh, while that’s horribly low… it’s a lot better than the “slideshow” I got had when trying to play the game on the MX 420, lol.

I’d also like to bump the RAM in my workstation, right now I have 512MB, which is generally sufficient, but Evolution (my email client) uses a phenomenal amount of memory… combine that with having a dozen firefox windows open, general system overhead, etc… and it’d be nice to see a bit of a performance boost.

I’ve clearly decided to shotgun approach getting my computer hardware back up to spec… I’ve ignored it all for an extremely long time.

Too Ahead of the Times.

Wednesday, 14th September, 2005 :: 21:56 EDT - Tech

I thought I was getting all the kernel driver fun taken care of prior to actually receiving the new SATA drives and controller card (Promise SATAII 300 TX4), I wasn’t quite afterall.

It turns out that the Promise card, which is a 300 versus a 150, isn’t supported by the kernel. I did find where a patch was added by someone discovering this, but it’s not in the ’stable’ version of even the 2.6 kernel yet. I’m still using a 2.4 kernel on the file server under the principle of “if it’s not broke, don’t fix it.” Unfortunately that patch doesn’t quite work on a the 2.4 kernel’s sata_promise.c, it causes a total system freeze, heh.

I could always just use the driver provided by Promise, but seeing how it’s not actually in the kernel that poses a problem — anytime the kernel is recompiled that driver is obliterated by the module installation, and poof it all stops working again. I could migrate over to the 2.6 kernel and patch it myself… but I’m not sure if that will actually work anyway.

My main concern is switching drivers later on down the line… and what sort of effect that might have on the RAID. I’ve just gone ‘unstable’ with gentoo-sources and built a 2.4.31 kernel. If the built-in driver doesn’t work I’ll just use the Promise provided “psuedo-open-source” one… I guess. It has benefits, apparently NCQ isn’t supported yet by the kernel driver, but it is under 2.4 with the Promise one… not that I really understand the benefit.

Oh, obviously all the new hardware arrived today. It wasn’t supposed to arrive until tomorrow, thus I wasn’t waiting around for it. I checked the tracking, just as a matter of course, only to discover it said “Delivered” …quite the shock.

Apparently the previously filed “leave at door” permission that my brother had is in effect for orders to me also, heh. I guess that’s good, otherwise I’d have went to find a little slip saying they’d try to redeliver it, heh.

I’m a tad bit irritated with Newegg over this order though. Since I don’t have a SATA compatible power supply, but instead have just regular 4 pin molex connectors, I asked Newegg’s customer service if the hard drives came with power adapters. I actually sent the message twice, to two different addresses because I wasn’t sure just which would be better. Under both replies, from different people, it was indicated that since they’re OEM you get just the drive. One of the representatives actually said something to the effect of ’since it isn’t in the picture of the drive, it isn’t provided with the drive.’ I thought it almost a bit condescending, especially considering that the photos of drives are really just iconic, and not actually photographs of the item.

Well, I open up on of the boxes, sorting through all the packing peanuts to locate the little adapters. I find two of the brand I ordered, then I find a third in just a bag. I continue to look, find another of the brand I ordered and then another two in just a bag. I ordered 3 adapters… I have six. Newegg provided adapters with the drives — even though they weren’t supposed to include them.

This is actually a good thing, it is to be commended… except I ordered 3, because I was told I’d need to. The way they do shipping is a bit odd, sometimes it works out to great advantage, othertimes you’re totally screwed. This is an instance where I was screwed. These power adapters cost about $2 each, not a big deal. The problem is that the shipping charge for that $6 is about $10; so I spent $16 I didn’t need to spend. It’s not worth my time or money to return them, they take a 15% restocking fee and of course the huge expense was the shipping which they’d never refund anyway. At least now I have them, in case I ever do need them, but I’ll certainly never order that sort of thing again.

Oh, and I really like the SATA data cables… they’re so much easier to work with than even rounded IDE cables. The Promise controller card has led headers for each drive, which is very nice… that also means I’ll need to hook up a series of LEDs to monitor the drive activity externally, ehe. If you don’t know, I’m a sucker for blinking LEDs.