Russell's Blog

New. Improved. Stays crunchy in milk.

Converting an IBM X40 to Flash

Posted by Russell on February 21, 2008 at 7:02 p.m.
The Hitachi 1.8" hard drive in the IBM X40 is probably the worst data storage product I've ever used. It is expensive, excruciatingly slow, irritatingly loud, and non-standard. There are basically no options for replacement except to just buy another one. And, as I discovered to my sorrow, it is also fragile and unreliable. So, I decided to replace it with a Compact Flash card.

You may have heard something about Solid State Drives (SSDs), such as the one available as an option for Apple's MacBook Air. You can think of this project as sort of a poor-man's version of these products.

While most CF drives are relatively small and expensive, there are a few products that seem to sacrifice speed for capacity. This may seem sub-optimal, but the drive it will be replacing is astonishingly slow to begin with. According to hdparm, it can do buffered reads at 18 MB/sec, but in practice that seems pretty optimistic.

If I understand correctly, the Compact Flash interconnect standard is basically a subset of IDE. So, you just need a little passive adapter board, and you can plug a CF card directly into an IDE port. I used a D44MIDECF adapter card from Addonics. At $20, it's a little overpriced. There are no active components, and the board contains only the CF plug, the 44 pin IDE pinout, a jumper, a surface mount resistor, a surface mount capacitor, and a surface mount LED. On the other hand, it is something of a specialty part, so I suppose I should be happy that they bothered to sell it to me at all. For the CF card, I found this monster on NewEgg.

The X40 doesn't have removable media (other than the SD/MMC reader). I've always hated fiddling around with boot floppies and installers anyway. Supposedly, Debian has gotten their installer in better shape since I last played with it. That was more than five years ago. I just skipped that whole process, and built out a minimal Debian install by hand. I popped the CF disk into my SanDisk USB Flash reader, and did the following :

sudo fdisk /dev/sdc 
   # created a 31 GB primary partition tagged as Linux [id 83]
   # and a 1 GB primary partition tagged as Linux Swap [id 82]
sudo mkfs.ext3 /dev/sdc1
sudo mkswap /dev/sdc2
sudo mount /dev/sdc1 /mnt/flash
sudo debootstrap sid /mnt/flash/
sudo chroot /mnt/flash
vi /etc/apt/sources.list
apt-get update
apt-get dist-upgrade
apt-get install linux-image-2.6.24-1-686 grub sudo 
mkdir /boot/grub
vim /boot/grub/menu.lst
sudo grub-install --root-directory=/mnt/flash --recheck /dev/sdc
Then, pop the CF card in its little adapter board into the drive bay, and boot. Hooray! Here is how hdparm identifies the CF disk :

 Model=, FwRev=20070912, SerialNo=CF CARD 000040D9
 Config={ HardSect NotMFM Fixed DTR>10Mbs }
 RawCHS=16383/15/63, TrkSize=0, SectSize=576, ECCbytes=4
 BuffType=DualPort, BuffSize=1kB, MaxMultSect=1, MultSect=off
 CurCHS=16383/15/63, CurSects=15481935, LBA=yes, LBAsects=63438848
 IORDY=no, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4 
 DMA modes:  mdma0 mdma1 *mdma2 

 * signifies the current active mode
The default IDE settings for the CF drive result in very slow performance, so some tuning is in order. I edited /etc/hdparm.conf accordingly :
/dev/hda {
        write_cache = on
        io32_support = 3
        dma = on
        lookahead = on
        interrupt_unmask = on
Here is the output of the script :
Setting parameters of disc:
 setting 32-bit IO_support flag to 3
 setting unmaskirq to 1 (on)
 setting using_dma to 1 (on)
 setting drive read-lookahead to 1 (on)
 setting drive write-caching to 1 (on)
 IO_support    =  3 (32-bit w/sync)
 unmaskirq     =  1 (on)
 using_dma     =  1 (on)
 look-ahead    = not supported
 write-caching = not supported
The result is actually a little faster than the Hitachi hard drive :
sudo hdparm -Tt /dev/hda

 Timing cached reads:   1474 MB in  2.00 seconds = 737.30 MB/sec
 Timing buffered disk reads:   44 MB in  3.13 seconds =  14.06 MB/sec
So far, I'm pretty happy.


Posted by Russell on February 12, 2008 at 4:03 a.m.
Now that it looks like the Pentagon is finally ready to use the Military Comissions Act, I think it's important that we all get something straight. Waterboarding is not "simulated drowning." It does not "mimic the sensation of drowning." It is actual drowning. Just as you can choke on a under-chewed wad of burger meat without actually choking death, you can drown for a couple of minutes without expiring. It is absolutely possible to kill someone in the process of waterboarding them.

So yeah. It's torture. And we did that to some guy as part of an investigation by the duely constituted authorities. America is in the torture business, and it's official. The only question now is what sort of paperwork has to be filed for torture-induced confessions to be admissible in the tribunals, which by the way, are entirely under the direction of the executive branch.

The only question is this: Can we be as good at show trials as the Soviet Union? It's a challange, but I have great faith that us dilligent, hardworking can-do Americans can put together the most justice-y show trial yet.

Primary 2008

Posted by Russell on February 05, 2008 at 1:50 p.m.
Here's my ballot for the 2008 California Democratic primary. As you can see, I voted for Obama. I hope you will vote for whoever you feel would be the best nominee, but some people may be intersted to hear my reasons for voting as I have.

Why I Won't Vote for Hillary

Hillary's campaign has focused relentlessly on one theme: Experience. She's been fighting for middle-class Americans for a long time, particularly on the subject of health care. People who don't like her have tried to minimize Hillary's role in the Clinton White House; they evidently don't remember the 1990s. The trouble is not that I don't think she has the experience, it's that I'm not particularly impressed by her accomplishments.

That's a pretty sweeping assertion, so let me offer the most important example of what I am talking about. The touchstone moment of Hillary Clinton's tenure in the White House was the introduction of the health care package. At the time, it was clear that health care was in crisis, and the plan assembled by the Clinton White House under Hillary's supervision probably would have more-or-less ended the crisis. I'm not going to claim that it would have been a great system, or that it was a wonderful piece of legislation, but it was clearly a bold step in the right direction. Unfortunately, the bill failed, and it failed so spectacularly that it hobbled Bill Clinton's domestic agenda even after his successful reelection.

Why did it fail? It failed for a lot of reasons, but here are the ones that stick in my mind :

  • It was a gigantic piece of legislation, more than a thousand pages of dense legal jargon. I still remember the news clips of Congressional aides setting out copies of the bill on overloaded, buckling folding tables. There was no hope whatsoever that an ordinary person, even a very motivated one, could have learned enough about the bill to understand it on its merits.
  • The bill was produced in secret. The Association of American Physicians and Surgeons even went as far as to sue the Health Care Task Force to find out what was happening in the closed meetings. They were drafting legislation that would change the whole health care system, and they shut out the doctors. Dumb, dumb, dumb.
  • The plan itself was a hideous chimera; the idea was to take the scenario under which most Americans obtain health care coverage (i.e., from their employer), make it mandatory. Then, there was a system of price controls, and various other administrative thingamajigs... In short, it lacked any kind of unity of vision that would have allowed the Clintons to articulate how it was supposed to work.
  • The Task Force deliberated for a very long time to excrete this gorgon of a proposal, and by the time it was out in the open, the initial enthusiasm and excitement had evaporated. The bill's opponents had a nice, long time to organize their attack. The attack went off like clockwork, and Newt and his cronies rode the momentum of this attack into the 1994 elections and seized control of Congress. The Clinton's didn't just loose the health care bill, they lost every bill that could have been promulgated to a Democratic Congress.
Universal health care is a pretty grand endeavor. You'd have to look at the Social Security Act to find a piece of legislation with a similar breadth and scope, so let's take a peek at the Social Security Act of 1935. It represented a historic change in the relationship between citizens and government, but the legislation is only a few dozen pages long. It doesn't take long to read, and an ordinary person can pretty much follow what most of the bill does.

The original act has been updated several times since the program was created, but the original legislation completely captured the theory, practice and most of the essential features of the program. It was fairly simple, it was astonishingly efficient (even before computers), and it works.

Hillary's health care bill didn't fail because the nasty Republicans killed it. It failed because it was a murky tangle of legal spaghetti-code constructed in secret under dubious circumstances and championed by a callous, tardy and tone-deaf technocrat.

Hillary claims that she's learned from her mistakes. On a personal level, I'm more than happy to forgive her. I think she made an earnest effort to do something good for a lot of people. However, the fact remains that we've seen Hillary spearhead a major legislative effort, and she did just about the worst job you could possibly imagine.

There are a lot of people who are very excited about the prospect of a female president. I think it would be pretty great, actually. On the other hand, she is running for president. You don't put someone in that office because you like them and think they deserve your loyalty. You put them in that office because you want them to do a good job, period. The presidency is not a reward; it is a duty. It should be given to person best able to peform that duty, and Hillary has an established record of arrogance and poor decisions.

Women have fought for a long time to be taken seriously in the workplace, in academia, and in politics. I take Hillary seriously, and I seriously don't want her to be president. She clearly has the brains and the grit to be president, but then again, I don't think she's particularly unique among women in that regard. There are millions of women who could competently serve in the capacity of President of the United States. There are women out there doing much harder jobs.

The Clinton campaign mantra is that Hillary is experienced. Yep, she certainly has lots of experience fighting for good, worthy things. On the other hand, she also has a conspicuously inauspicious track record when it comes to accomplishing these good, worthy things. She and her husband presided over the Democratic Party's most devastating legislative failure of the 20th century. I don't see why we, as voters, should reward failure.

Since then, Hillary has managed to help precipitate a number of other spectacular legislative failures :

  • Voted to authorize the Iraq war
  • Voted for the PATRIOT act (twice)
  • Voted to confirm John Roberts
On the Other hand, we've got Barack Obama. Mr. Obama might not have quite as impressive a resume as Mrs. Clinton, but
  1. he is nevertheless an astonishingly accomplished individual and
  2. he has never done anything to wreck the Democratic Party.
Both Obama and Clinton are clearly competent to hold the office -- especially in contrast with its current occupant. Mr. Obama is more charismatic, though I thik more has been made of this point than it deserves. The reason I am voting for him is that of the candidates on the ballot, he is the one with the best record of good decision making. I don't agree with everything Mr. Obama says -- I emphatically agree with Paul Krugman on the topic of mandates -- but I think Mr. Obama is the most likely candidate to actually deliver a health care package. Mr. and Mrs. Clinton had their chance, and they blew it.