January 2004 Archives

Captivating Flash

I don't like non-interactive flash. I will not eat it on a train or in the rain.

Our old friend Jesse over at PlasticMind.com showed us a site that just had to be checked out. But I just spent a good half hour building atoms on the PBS web site. Flash has the ability to be interactive, and this seems to be a great method to instruct. For the first time since 1982, I learned something about physics and atoms.

When I was in school, they didn't have up and down quarks, just plain old nutrons and protons. It turns out that Mr. McVee didn't tell us the whole story, but PBS does it with flash in a way that informs us and teaches us something instead of the usual Flash eye candy that just rots the brain.

Historical Bits

While digging around cleaning up old files, I came accross the original Advisor Bits. The name was something my then partner Tom Gilbert had a part in choosing. He liked the word "advisor" a lot, I like bits and piece of things. The orignal Bits was an email newsletter "sponsored" by our company Gilbert Walker Group.

GWG has since been dissolved, but Tom and I still work together occasionally. When I started this blog last year, I was "name challenged" and asked Tom if I could re-use Advisor Bits. ... and you know the rest of the story.

Common Gateway Interface (CGI)

What is CGI-BIN?

It's a term that gets thrown about all the time in "web circles". CGI, CGI-BIN, Common Gateway Interface all generally refer to an environment where users "run" a program on a server, using a web browser on a client computer to submit input. The program may store the data, or lookup information based on the data, the possibilities are being expanded all the time. Whatever the program does with the input data, it typically also returns some information or confirmation (output) to the user's browser.

CGI-BIN is usually a directory on a server that is setup with special permissions. These permissions include allowing Internet users to run, or execute, the programs. On some web servers, any file with the extension ".cgi" can run without regard to what directory the script file is located in.

The University of Kansas Academic Computing Center has a fairly detailed description of CGI and HTML forms.

There is a CGI standard defined here. NSCA was the first widely available web server, and so in the early days of the Internet, other web server software such as Netscape conformed more or less to these standards.

That document is also mentioned on the W3C site's own comprehensive listing of information related to the various technical implementations of CGI, the Common Gateway Interface.

Watching the master at work

There are a lot of Linux Engineers out there with more experience than me. I always read their posts when I get in trouble, and some times it helps me out. I was really close last night when one of the few guys I actually know who certifiably "Knows his sh*t waaay better than me" showed up.

My problem was I had half of a mirror set (Linux software RAID1) and the other half had gone south during a reboot. The half I had wouldn't boot. Murphy's law explicitly states that when I have part of a mirror set fail, the bootstrap will never be on the drive that survives. Murphy is one of the reasons I was suprised to see Dan L.

Given that I now have a reconstructed and booted system, I thought I would record the steps I took, so that if someone else encounters the same situation it may be of use to them.

The box all this was setup on is an entry level Intel server board, with integrated IDE controller and dual 80GB IDE drives. The RAID was setup as part of the installation process of RedHat 7.3, and I use GRUB as the bootloader.

To repair the RAID, I was using a RedHat install disk and booting to Linux Rescue. You can get a tiny Linux booted up to mount partitions and try to fix systems using this option. Debian has something like this too on their install CD.

I managed to partition the new drive exactly the same as the old drive. I should also mention that when the drive failed I initially tried some totally desparate switching of slave to master and cable swaping to get the other good drive to boot. No dice. Somehow at the end of this whole story when I finally booted and got everything running, it was OK that the drive on the second IDE channel had migrated to the primary IDE channel, and that the jumper setting had been changed. I really have to like an OS that can stand up to my hardware skills.

Once Dan became involved things started to come together. The first thing he noted was that none of the partitions were marked as bootable. Using fdisk, he made the partition which contained the kernel images (i.e. /boot) bootable. I am going to have to do more reading about this bootable partition thing; I have not used this in the past. On the other hand one of my most stable boxes has the swap partition on each drive marked as bootable. Making the /boot partition bootable makes a lot more sense to me. YMMV, this is a whole other topic.

In RH73 fdisk the option to mark a partition as bootable is "a". I am told I should look into cfdisk, in fact the main page for fdisk says to choose cfdisk over fdisk.

Once the disk was setup, he mounted the root partition from the drive that was good, and performed a chroot to the temporarily mounted root partion. This enabled him to edit the raidtab to mark the new disk as "failed" so that once the operating system saw it the kernel wouldn't accidentally reconstruct the wrong (i.e., blank) half of the mirror. That looks something like this for each md device:

raiddev /dev/md0
raid-level 1
nr-raid-disks 2
chunk-size 64k
persistent-superblock 1
nr-spare-disks 0
device /dev/hda2
raid-disk 0
device /dev/hdd2
raid-disk 1
failed-disk 1

Dan also suggested we disconnect the new drive to be doubly sure there were no accidental reconstructions. Good plan.

Since I use GRUB, it is already installed. One of the very cool things about GRUB is that it has a tiny shell which allows you to setup the boot environment and also to install the bootloader. Once you're in the shell you can tell grub to install a bootstrap using a command something like this where "hd0" is the master drive on the primary IDE channel:

grub> install (hd0)And sure enough, the darn thing booted to grub and from there the system came up. The RAID barely complained about running in degraded mode because of the drive that we had disconnected and marked failed in the raidtab. It came up again when we reconnected the device too. Dan was hungry and I was tired, so we decided to call it a night after the box came up and the services were all running again.

Besides which, I couldn't very well ask him for the help I needed to figure out how to reconstruct the arrays after everything else he had done. Fortunately the NEW documentation for NEW raidtools (2.4 kernel and above) is very good and it worked.

To reconstruct the array use the raidhotadd command:

raidhotadd /dev/md0 /dev/hdd2It doesn't look like anything is happening, but you can check your /proc/mdstat to see whats going on. array reconsruction took a few minutes for small partitions and more than an hour for a 60GB partition. Reconstruction occurs in the background, so load on the server may effect this time. The drives can remain mounted and active while reconstruction occurs.

[root@cp root]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md2 : active raid1 hdd9[0] hda9[1]
104320 blocks [2/2] [UU]
md6 : active raid1 hdd8[0] hda8[1]
66565184 blocks [2/2] [UU]
md3 : active raid1 hdd7[0] hda7[1]
3076352 blocks [2/2] [UU]
md1 : active raid1 hdd6[0] hda6[1]
513984 blocks [2/2] [UU]
md5 : active raid1 hdd5[0] hda5[1]
6144704 blocks [2/2] [UU]
md4 : active raid1 hdd3[0] hda3[1]
104320 blocks [2/2] [UU]
md0 : active raid1 hdd2[0] hda2[1]
722816 blocks [2/2] [UU]
unused devices:

I think since I manually marked the disk failed I am going to have to manually remove the failed entry from the raidtab, but I am going to deal with that when I am on-site.

I have been in this same situation three times in 5 years, and this is the first time I actually got reconstructed arrays working cleanly. I don't really want to confess to the lengths I have gone to in order to fix this issue, but I guess I already have.

Sneak Preview this Weekend

I am putting the finishing touches on the JSW4.NET main company site. This is only the third redesign of the JSW4.NET site since it was founded in 1999. There are a few things to polish up and the form script still has to be written. Undoubtedly, I need to run the spelling checker on several pages that I missed.

The CSS on this site is designed very carefully so that the main body of the text is always at the top of the page (code wise) and special care has been taken to make the CSS nice for print media. I changed the visibility attribute of the

that has all the navigation stuff to "hidden" and although that caused it to not print, the space that would have been taken by the element usually caused an extra page to print.


The solution was to change the display attribute to "none". I was more familiar with the use of the display attribute to control whether an element was inline or a block; it can also be set to several other values.

Berners-Lee to be knighted

The Queen of England will knight the inventor of the Web. Read the press release at http://www.w3.org/2003/12/timbl_knighted.

Tim Berners-Lee invented the concept for the web in 1989, and wrote the first functioning web server and browser software in 1990. To put that in historical perspective: TCP/IP was eight years old; it was two years before Al Gore was the first person to talk a lot about the "information superhighway".

It was a long time ago in net time. Thanks, Tim.

About this Archive

This page is an archive of entries from January 2004 listed from newest to oldest.

December 2003 is the previous archive.

February 2004 is the next archive.

Find recent content on the main index or look in the archives to find all content.

OpenID accepted here Learn more about OpenID

Subscribe by Email

Enter your email address:

Delivered by FeedBurner