Archive for the ‘software’ Category

From Novice to Master, and Back Again

January 14, 2013

In 1985, I was a freshman at St. Olaf College in Minnesota. The college had a VAX 11/780 running 4.2BSD and a PDP-11/70 running v7 with some Berkeley and local code hacked in. It was my first experience with multi-user systems other than dialing into an MS-DOS BBS or two.

The college’s Academic Computing Center had printouts of the 4.2BSD manuals, plus some home-grown documentation, available for sale so students could learn how to use UNIX. One week I sat in the Science Center terminal room and started going through the alphabetical list of the commands available on the VAX, trying each one and reading its man page to learn what it did.

Eventually I got to “su”. “Become the super-user”? What’s that? Does it involve wearing a cape? Sounds interesting, so I tried it. To my disappointment, it just asked for a password, and wouldn’t do anything.

Shortly thereafter, someone came running into the room and asked, “Are you David MacKenzie? Did you just run ‘su’?” “Yeah… what does it do?” “Uh, don’t do that.” My failed “su” attempt had been logged on the system console and one of the sysadmins was worried about an attempted breakin.

Within a year, I did have root access on the VAX, as I learned enough to be hired as a student system programmer. I contributed to upgrading the machine to 4.3BSD when that was released.

Recently I was working on a CentOS Linux virtual machine and needed to look up the command-line options to “su”. I had worked for the past several years mostly on Macs where “sudo” is preferred, so my “su” skills were rusty. I ran “man su” and got the information I needed. Then at the bottom of the screen I sheepishly read “Written by David MacKenzie.”

In the 1990s, while filling in gaps in the GNU toolset, I wrote the GNU “su”, and I had forgotten about it. It’s still what Red Hat and other distributions are shipping.

At least I know what it does now.


Using Removable Drives on Windows

April 10, 2011

In the last few months, I’ve been using USB and Firewire hard drives (and flash drives) on Microsoft Windows more than I used to. Getting them to work well is not as simple as it is on MacOS X.

Below I refer to running the Computer Management console. You can run it by right-clicking My Computer (XP, Server 2003) or Computer (7, Server 2008R2), which is either on the Start menu or on the desktop, and selecting Manage. Or you can find it in the Control Panel under Administrative Tools. In Computer Management, go to Disk Management, under the Storage category in the left sidebar.

Here are a few things I’ve learned about working with removable drives on Windows.

  1. How to safely eject a removable drive on Windows? On MacOS X, there’s a little eject button next to the drive in the Finder, or you can drag the icon from the desktop to the trash can, or right-click on it and select Eject. On Windows, a little Safely Remove Hardware icon appears in the system tray, but sometimes it’s hidden. And on Windows XP, if you have multiple removable devices plugged in, it’s hard to figure out which is which because the descriptions are so generic. On Windows 7 and Server 2008R2 it shows you more details about each device.
  2. By default, throughput of removable drives on Windows is only around half of what the hardware is capable of. Because it’s so hard to figure out how to safely remove the drives in Windows, the default setting is to optimize for safety, so you can just unplug the drive without needing to worry about flushing buffer caches. If you’re willing to use the Safely Remove Hardware mechanism, you can roughly double the drive’s performance. In Computer Management, right-click on the drive name and select Properties, go to the Policies tab, and select Optimize for performance. You have to do this for each different removable drive you plug into the PC; there doesn’t appear to be a way to make it the default, e.g. through a registry edit.
  3. Windows 7 comes with multiple Firewire drivers. You can select a driver in the Device Manager in the Properties box for the Firewire adapter, Driver tab, Update Driver button. To run the Device Manager, on Windows 7 you can search for it in the Control Panel; on Windows XP, right-click on My Computer, select Properties, Hardware tab, Device Manager button. Easy to find, right? The default Windows 7 Firewire driver works poorly; it is very slow and incompatible with many devices. You can also select the “Legacy” Windows XP style driver, but it’s missing some features (especially good Firewire 800, a.k.a. 1394b, support). You might also have the option of selecting a driver from your Firewire chipset’s manufacturer, such as LSI or Texas Instruments; in my experience, those work better than Microsoft’s drivers. Also better than either of the Microsoft drivers is the Unibrain ubCore Firewire driver. It gives better transfer speeds and higher reliability than other Windows Firewire drivers I’ve tried. It supports all the Firewire cards I’ve tried it with, not just the ones Unibrain makes. It’s a free download although you have to enter your email address for the link. It comes with a utility to switch between Unibrain’s Firewire drivers and Microsoft’s.
  4. Speaking of Unibrain, they do make some of the best Firewire controller cards. They maximize performance by using a chipset that is native PCI Express, not PCI or a bridge to a PCI chip like many others. I recommend the FireBoard800-e V.2 1394b PCI-Express adapter (for desktops) and FireCard800-e 1394b ExpressCard 34 adapter (for laptops with ExpressCard slots). I get them from They work on Mac Pro and MacBook Pro computers with those slots (using the built-in Apple drivers) as well as on Windows PCs.
  5. Drive letters, the ridiculous legacy of MS-DOS being a copy of CP/M, can cause problems on Windows, especially in the presence of mapped network shares. If you have several removable drives plugged in, Windows might start assigning them drive letters that are already used by mapped network shares, hiding the network shares. Then you have to manually assign the drive a different drive letter to resolve the conflict. In Computer Management, right-click on the drive partition and select Change Drive Letter and Paths.
  6. If you get a hard drive that’s pre-formatted for Windows, it might use the NTFS file system or it might use FAT32. If you’ll be using the drive only on Windows, make sure it’s formatted with NTFS, which supports files larger than 4GB, and is faster and much less likely to corrupt your files, especially if the power fails and you don’t have a battery backup. If you need to use the drive to transfer files between Windows and Mac systems, it’s easiest to do it using FAT32, because Macs can read but not write NTFS file systems. However, there are several add-on products that allow Macs to write to NTFS, including the free NTFS-3G, which I’ve used occasionally and haven’t had problems with. You can reformat a drive in Computer Management; right-click on the partition and select Format. If you use a drive mainly on Macs, you can buy MacDrive to allow Windows to read and write Mac HFS formatted drives.

Solving Snow Leopard Crashes on a 24″ iMac

February 3, 2011

My 24″ iMac (early 2008, Core2 Duo 2.8GHz) came with MacOS 10.5 Leopard and worked great with it. When 10.6 Snow Leopard came out, I upgraded to it, and thereafter the iMac started crashing 1-3 times a week. The screen would turn black, or gray, or striped. It wasn’t totally dead, which would suggest a power supply failure. It wasn’t a kernel panic (with the multi-lingual “You need to restart your computer” message), which would suggest bad RAM. But it was hung and couldn’t be reached over the network. To recover, I had to hold down the power switch to force a shutdown, then turn it back on.

It happened sometimes while the machine was idling, other times while I was in the middle of doing something. This persisted through the 10.6.4 update, at which point I decided MacOS updates weren’t going to fix it.

I tried a clean install of Snow Leopard, but that didn’t fix it. I replaced the RAM with a different brand, but that didn’t fix it. I had the main logic board replaced under AppleCare, but that didn’t fix it. After some searching of the web, I found the solution. It confirmed my hunch that the video chip was overheating. The video chip (GPU) in mine is an ATI Radeon HD 2600 Pro. Apparently Snow Leopard drives the GPU harder than Leopard does, but runs the iMac’s fans at the same barely-audible speeds. The problem is more likely to occur on iMacs that are left on all the time, as mine is.

The solution is to install a third-party fan control program to force the fans to run faster and keep the inside of the Mac cooler. I installed iMac Fan Control. The iMac’s fans are now audible, but not too objectionable, and it hasn’t crashed in the two months or so since I installed iMac Fan Control. The temperatures are significantly lower than before. Here is a picture of my iMac Fan Control System Preferences panel.

Update: A year after installing iMac Fan Control, the iMac hasn’t crashed even once from the video chip problem. It’s currently running MacOS 10.6.7 plus the Snow Leopard Font Update.