Tape? Does anyone care about tape anymore?

Various friends and colleagues have been amused, occasionally stunned, but more often incredulous when I tell them that I am working on a project based on data tape. The commonly ventured opinion is that I should maybe think about working with a technology that someone has cared about in the past 30 years. 🙂

I understand where these people are coming from. In some ways my recent few years diving deep into data storage systems has felt like a backwards step from my time working on web-middleware, process-migration, and programming language work. But on the other hand, our need for data storage continues to grow at amazing rates. Ultimately continued expansion of data storage needs results in ever-increasing costs. So we, as a community, need to find ways to flatten out that cost curve.

As far as data tape itself is concerned, tape still has some very interesting properties for data storage. Tape is not the only answer for storage, but in many scenarios tape can be preferable over spinning disk or flash storage.

Some of the properties that make data tape storage interesting are outlined below the break. I’ll dive into more detail about these properties and usage scenarios in future posts where I explain how my work has made tape more accessible. Continue reading

Posted in data storage, LTFS | 3 Comments

# reboot

I have planned to move my blog to a hosting service for a while now. The administration overhead of self-hosting ended up taking up time that could be better spent writing. An unexpected change to my DSL service took my blog offline for some time so let’s try to re-boot this (hopefully a) habit.

I should also post some real content soon. First few posts will probably be about my recent projects as architect and development lead for the Linear Tape File System (LTFS). I want to give some overview of the trade-offs and choices that are necessary when architecting a file-system for sequential media.

Posted in blog, Uncategorized | Leave a comment

Problems with the OS X 10.5.5 update and X11

After upgrading to OS X 10.5.5 I ran into an issue with X11 refusing to start. I first noticed this issue as a problem with ssh hanging while trying to establish a connection. When I dug into this problem I noticed that ssh was hanging immediately after some X11 related operations were performed. I have ssh configured to set up X11 forwarding unless otherwise specified on the ssh command line. By explicitly disabling X11 forwarding (using ssh -x) the connection would connect normally. Unfortunately this means that the very cool auto-start of X11 that Apple implemented with OS X 10.5 is lost.

With X11 being the suspected cause of the ssh problem I tried launching X11.app manually by double clicking the X11 application in /Applications/Utilities/X11.app. I noticed that X11 did not bounce in the Dock. In fact X11 did not appear in the Dock at all. That’s odd…

I noticed the following lines repeating in the system logs:
Oct 17 10:25:34 macBook com.apple.launchd[113] (org.x.startx): Throttling respawn: Will start in 10 seconds
Oct 17 10:26:04 macBook com.apple.launchd[113] (org.x.startx): Throttling respawn: Will start in 10 seconds

At least these log entries confirm that X11 is unhappy.

The machine on which I first noticed this problem may have had the XQuartz updates to X11 installed at some point. To eliminate this third-party code as a contributor to the problem I attempted to reproduce the problem a few configurations:

Before upgrade After upgrade Exhibits problem?
OS X 10.5.4 (PPC)
XQuartz not installed
OS X 10.5.5 (PPC)
XQuartz not installed
yes
OS X 10.5.4 (Intel)
Apple X11 installed
XQuartz not installed
OS X 10.5.5 (Intel)
XQuartz not installed
yes
OS X 10.5.4 (Intel)
XQuartz not installed
OS X 10.5.5 (Intel)
XQuartz installed (updated to 2.3.1)
yes
OS X 10.5.4 (Intel)
XQuartz installed
OS X 10.5.5 (Intel)
XQuartz installed (updated to 2.3.1)
yes

Since the problem can be reproduced on machines that have never had XQuartz installed I can rule out XQuartz as contributing to the problem.

Based on a tip found on the Apple support forums I investigated whether any of my shell start-up scripts had any impact on the problem. It appears that Apple has made a change to the way that X11 starts in 10.5.5. These changes make X11 start-up brittle in the face of the common shell start-up idiom of using the exec command to replace the current shell process with another process.

I have used my old .profile start-up script for bash has been in use on various machines since OS X 10.2 without problems. This old script was:

if [ -e /sw/bin/tcsh ]; then
    # We prefer to use the fink installed version of tcsh..
    exec /sw/bin/tcsh
elif [ -e /bin/tcsh ]; then
    # ... but we will use the OS X installed version if it exists
    echo "warning: using Apple version of tcsh from /bin/tcsh"
    exec /bin/tcsh
else
    echo "error: could not find a version of tcsh to exec!"
    echo "       dropping to default bash setup (no fink environment)"
fi

Nothing exciting there other than the exec. exec is commonly used in this manner to dynamically change the user’s shell for typically one of two reasons:

  • to change to a user shell that uses a different syntax (such as csh or ksh) without risking breaking system shell scripts and installer scripts, or
  • to lock the user into a program that limits what the user can do on the system. (For example, locking the user into a menu-driven terminal program rather than providing full shell access.)

Back when I worked on Solaris and Ultrix (showing my age) machines, the guidance was that shells used to start system services should be executed with options that prevent execution of user-supplied shell configuration files. This was advised to ensure that commands and environment variables applied by the user-supplied configuration files would not interfere with the system service. Said in another way, you want to ensure that your services scripts are executing in a known environment rather than an environment that the user has futzed with. bash provides the options –noprofile and –norc to provide this level of control over the script execution environment.

Working on the theory that the exec commands are tickling this X11 start-up problem I have worked around the problem by switching to the following .profile start-up script:

if [ -t 0 ]; then
  export INTERACTIVE=true
else
  export INTERACTIVE=false
fi
  
if [ "${INTERACTIVE}" == "true" ]; then
  if [ -e /sw/bin/tcsh ]; then
    # We prefer to use the fink installed version of tcsh..
    exec /sw/bin/tcsh
  elif [ -e /bin/tcsh ]; then
    # ... but we will use the OS X installed version if it exists
    echo "warning: using Apple version of tcsh from /bin/tcsh"
    exec /bin/tcsh
  else
    echo "error: could not find a version of tcsh to exec!"
    echo "       dropping to default bash setup (no fink environment)"
  fi
fi

This work-around avoids tickling the problem with the Apple start-up scripts for X11 by determining if the shell invoking my .profile is an interactive shell (i.e. something that a user will type commands into). If the shell is not interactive then set an environment variable and exit. Otherwise, the .profile file executes the commands in my old start-up script.

Note the use of test -t 0 to determine if we are an interactive shell. Until recently I used tty -s to determine if the script was in an interactive shell. Apparently POSIX has deprecated the -s option so test -t 0 may be a safer choice.

Posted in apple, os x | 2 Comments

How to install Windows XP on an external USB drive connect to an Apple MacBook

In August 2006, I posted instructions on how to install Windows XP onto an external USB drive to the macrumors.com forums. I’m reposting the instructions here so that this information does not get lost.

Some notes on these instructions:

  • These instructions result in an installation of Windows XP that is completely contained on an external USB drive. Other approaches usually create a Windows partition on the internal drive.
  • The instructions require you to remove your internal drive from your MacBook during the installation. If you do not remove the internal drive you risk damaging the operating systems installed on your internal drive. Also, if the internal drive is not removed then Windows will not correctly install onto the external drive.
  • For the past year I have relied on VMware to eliminate the need to boot to Windows on bare hardware.

Windows XP on USB for MacBook instructions:

I have completed this install 4 different times.

Steps:

  1. Modify Windows install CD to support booting off a USB drive. (Instructions are on the web. Original page no-longer exists. A snapshot is held at the wayback machine. I also have a PDF file.)
  2. Remove internal hard drive from MacBook.
  3. Connect external USB drive to MacBook.
  4. Boot from modified Windows install CD.
  5. Progress through Windows install, creating partitions and formating the partitions as you see fit. In most of my installed I partitioned the drive under OS X using a firewire connection to the drive since Disk Tool isn’t always happy partitioning USB drives. I have also successfully used a GParted boot disk to partition an external USB drive and then running the Windows installer without modifying the partition table on the external drive.
  6. Wait for about 34 minutes for the Windows install to finish.
  7. Reboot into Windows on the external drive.
  8. Install the Apple device drivers for windows.
  9. Replace internal drive.

After all of this you will be able to boot into OS X. You will not be able to boot into Windows by holding down the option key when booting. Instead you will need to connect the USB drive to a running OS X system, open the Startup Disk Preference Pane and select the windows partition. Then when you reboot you will boot into Windows. To return to OS X you need to use the Windows Startup Disk control panel to select OS X.

(OS X will also boot if the USB drive is not connected.)

This fiddling with the Startup Disk Preference Pane is a limitation that I haven’t found a way to work around. For me, I can live with this since I only boot to Windows occasionally.

Additional notes:

  • I have always plugged my USB drive into the rear-most USB port on my MacBook (the USB port closest to the MagSafe power connector). Some forum posts report that using another USB port results in Windows errors.
  • Windows is unable to use a pagefile that on an external USB drive. After completing a install based on these instructions you will not be able to set up a working pagefile for Windows. Since I rarely boot to Windows and only then put it to light use then my 2GB of main memory means that I don’t require a working pagefile. Realistically, if you have less than 1.5GB of RAM in your Mac then you are will have problems with Windows running out of memory. Your mileage may vary.
  • Even after following these instructions exactly some people have reported that they are unable to successfully boot Windows. It is likely that these failed attempts are due to differences in USB enclosure implementations and/or Windows memory issues.
Posted in apple, hardware, operating systems, usb, windows | Leave a comment

Embedding a command line tool within a Cocoa application

Back in 2006 I posted a forum question seeking help with embedding a command line tool inside a Cocoa application. After a few days I had muddled out a way to both embed the command line tool and set up Xcode to automatically build the command line tool when the Cocoa wrapper is rebuilt. I posted my solution answering my own question.

Recently I received a message from someone who stumbled on my solution and found it useful. I’m reposting the solution here so that this information does not get lost.

My original question:

I’m hacking together a small Cocoa application in Xcode. I have all the GUI and events coded up and now I need to integrate a command line tool that I coded up in C a while back.

Poking around in the package contents for a few applications I’ve noticed that it is not uncommon for developers to package up small command line tools within the main Cocoa application. Presumably these command line tools are executed as a new process from the Cocoa application.

I’m developing in Xcode and have manged to import the source code for the command line tool as say command_line.c. What do I need to do to have this file built as a command line tool that is embedded in the main Cocoa application?

My solution:
(Warning: Long and technical post.)
Continue reading

Posted in apple, cocoa, development, xcode | 3 Comments

Undoing Undo!

Consistency in the user interface is a vital part of making applications easy to use. Arguably, UI consistency is a significant factor in the oft-repeated ease-of-use provided by MacOS and now OS X. Certainly Apple pushed their User Interface Design Guidelines for many years to foster UI consistency. Unfortunately, software developers occasionally forget about consistency.

In the recent release of the Adobe CS3 Design suite UI consistency has been forgotten in favor of conflating two separate notions of “undo” onto a single key-stroke across applications. In Photoshop CS3, the Command-Z keystroke performs Undo/Redo as has been the case in Photoshop in my experience since at least version 2.5.8. However with InDesign CS3, Command-Z steps back through the undo list reversing the document through all edits were made. In Photoshop CS3 stepping back through the edit history is performed using Command-Shift-Z.

Both types of undo make sense. Both types of undo are necessary in modern applications that keep track of edit histories. The problem here is lack of consistency. This is particularly insidious in a suite of applications that are intended to be used together.

Across the CS3 suite Command-Z is used differently depending on current application. In Photoshop CS3, Command-Z performs Undo/Redo for the last user action. Whereas in Illustrator, InDesign, Flash, and Dreamweaver, Command-Z is used to step back through the edit history. In each application, Command-Shift-Z, Command-Option-Z, and/or Command-Y are used to perform some variant of the Undo/Redo command for the current application. Illustrator and InDesign use Command-Shift-Z to Redo, while Dreamweaver uses Command-Y for Redo.

UnDo in InDesign CS3 is particularly bad because it captures view changes such as normal/preview and zoom changes as part of the edit history. It is not possible to switch to the preview view and then alternate between before and after the most recent edit to assess the edit. As soon as you hit Undo, the change to the preview view is reversed.

Photoshop Illustrator InDesign Flash Dreamweaver
UnDo Command-Z        
ReDo Command-Z
Step Forward Command-Shift-Z Command-Shift-Z Command-Shift-Z Command-Y Command-Y
Step Backward Command-Option-Z Command-Z Command-Z Command-Z Command-Z

Wrapped up in this issue are concerns about user inertia—Photoshop has been using Command-Z for Undo/Redo since the time before applications kept track of edit histories. I am one of the users who feel this inertia. My fingers automatically perform Command-Z in Photoshop when I want to compare whether my last image adjustment has been an improvement. But user inertia shouldn’t be used to prevent improvement and consistency in the User Experience. I remember the transition from Photoshop v2.5.8 to v3.0 where virtually all keyboard shortcuts were changed. The transition was painful but limited to a couple of weeks whereas with the inconsistency in CS3 the transition pains happen again every time you switch applications.

Posted in os x, Uncategorized, user interface | Leave a comment

Rhapsody DR2


Apple acquired Next Software in 1997 bringing OpenStep into the Apple fold. OpenStep (and NeXTstep before it) was based on BSD Unix running on top of a heavily modified version of the Mach micro-kernel. OpenStep was used as the foundation of operating system development at Apple through the late 1990s up to the release of OS X v10.0 in March 2001.

Rhapsody DR2 screenshot

In 1997 Apple released previews a new operating system that would be the next step in the evolution of MacOS. This new operating system was known as Rhapsody. Rhapsody was heavily based on OpenStep while providing a user interface experience based on the traditional MacOS Finder. With the Rhapsody release coming so soon after the public Copland demo CDs and abrupt cancellation of Copland it was difficult to see where Apple was heading at the time. But after the problems with MacOS v7.5 and v8 it was becoming clear to Mac developers that Apple needed a new operating system direction.

Both PowerPC and Intel x86 versions of Rhapsody were released in two developer previews – DR1 in early 1997 and DR2 in August 1997. Much of the work that went into Rhapsody was carried forward into OS X including Quicktime integration, early Carbon/Cocoa libraries, Interface Builder, and Java integration. At both user interface and developer levels, a clear lineage exists from NeXTstep through OpenStep to Rhapsody and on to OS X.

Digging through my old software collection I decided to get Rhapsody DR2 running in VMware on my [first generation Intel] MacBook. Instructions for getting Rhapsody DR2 working in VMware Fusion are provided after the jump.

Continue reading

Posted in apple, computer history, operating systems, os x | 12 Comments

Papers for OS X… tame those random .pdf piles

During the course of my Masters and PhD work I accumulated a veritable mountain of papers… articles ordered from library research services, photocopied papers tossed on my desk by my advisor, and the occasional seminal paper that I stumbled across in an old journal that I knew that I’d never be able to find again. A similar electronic mess was accumulated in the form of several archive folders of .PS.Z and .pdf files. The mountain of physical papers currently resides in a couple of filing boxes stored back in Australia but I can finally do something with the backups of the electronic papers that I’ve been religiously copying from one system to another since I finished my studies.

Papers v1.0.2 screenshot

Papers screenshot

Papers is an OS X application for managing archives of research papers. I toyed with Papers during the public preview and though the application had numerous bugs I was impressed with it enough to order a license before v1.0. As it turns out, my faith was well placed. Papers v1.0 resolved many of the obvious problems in the preview versions and the developers have quickly released a couple of updates to resolve some glaring bugs in subsequent versions.

Papers is currently at v1.0.2. The current version still has a few rough edges such as some odd quirks when updating Paper entries, off-by-one update issues when redisplaying the list of documents in the database after a delete, and phantom authors that persist in the authors list until the user triggers a clean-up of the database. But overall, this is a handy application for getting the typical mess of .pdf files under control.

In the same way that iTunes absolves the user from having to manage the storage of music files, Papers absolves the user from having to manage storage of your research papers. Documents stored in papers can be browsed by paper, author, or journal and the browse list can be constrained by a one-off keyword search. If that isn’t sufficient, then the user can build up Smart Collections of documents as required.

The current version of Papers is slanted to best manage papers from the area of biology and genetics. For example, the only online paper repository that Papers hooks into is PubMed, and there is currently no support for capturing author affiliations where a paper has multiple authors from different organizations. The developers of Papers have told me via email that they are aware of the slant toward the biomed space (due to the developer’s own background), but they hope to expand Papers to provide better coverage of metadata for other research fields. The developers also have defined an API that will eventually be made public to allow users to develop hooks into other online paper repositories.

Posted in os x, research, review, Uncategorized | 1 Comment

Apple’s new sales feature

Time was when purchasing an Apple computer was a pleasant experience. You went into your local Apple Store and browsed around. Maybe you did this a few times, poking at all the shiny machines on display. Eventually, one one of this visits you asked a sales associate to bring a cleverly packaged machine out for you to purchase.

For some reason, Apple appears to have decided that there was something lacking in the whole process. The hard sell. Fortunately, Apple appears to have moved to address this shortcoming in the experience of acquiring and owning a Macintosh.

Continue reading

Posted in apple, hardware | 2 Comments

When RAID-edition doesn’t mean “will work in a RAID”

At work last year I built out a home-grown RAID solution to support my current project. RAID stands for Redundant Array of Independent Disks. RAID technology has been around since the 1970s and provides both a way to use multiple drives together to form a larger “disk” or RAID-volume. The drawback to using multiple drives together is that you need all the individual drives to be operating for the RAID-volume to be available. With multiple drives, the probability of any one drive in the RAID-set will fail increases according to the number of drives in the RAID-set.

However, when you start using drives together to build a RAID-set the reliability of the RAID-volume will decrease in relation to the number of drives in the RAID-set. If a given drive has a 1 in 16 chance of failing over a given time frame then when you construct a RAID-set using 8 of these drives you have an 8/16 or 1 in 2 chance that the RAID-volume will fail in that same period of time. Real-world drives are much less likely to fail, but an increase in the likelihood that your RAID-volume will fail is not good. To address this increased chance of failure RAID technology also provides a level of data redundancy. Depending on the type of RAID in use, this redundancy typically allows one drive in the RAID-set to fail without loosing access to the RAID-Volume. So long as you replace the failed drive before any other drive fails the RAID-Volume will continue to operate with possibly reduced performance.

Since we were building the RAID from scratch I looked around to find some suitable drives and stumbled onto the Western Digital Caviar RE2 500GB (5000YS) drives. The “RE” stands for “RAID-edition”. The marketing copy for this drive explains that this model has a MTBF (Mean Time Between Failure) rating of 1.2 million hours, a 5-year warranty and it provides “optimum performance for enterprise applications.” In other words, a very reliable hard drive that is designed for use in a RAID.

All hard-drives occasionally encounter read errors. Desktop hard drives are designed to attempt to make significant efforts to correct for read errors so that we don’t loose the data on our desktop hard drive due to a temporary, or “soft” error. These attempts to correct the read error means that the desktop drive will spend some extra time trying to correctly read the data and send it on to the computer.

In a RAID-set this extra time spent by the drive trying to correct the read error is a problem. Firstly, the extra effort made by the drive is not necessary because the RAID-controller is designed to detect and correct for minor read errors. Second, the extra time before the drive responds to the read request can cause the RAID controller to determine that the drive is dead. When the RAID controller determines that a drive is failing, or dead, the controller will drop the drive from the array which is not a good thing at all.

The marketing copy also notes that the RAID-edition drives have “RAID-specific, time-limited error recovery (TLER) – A feature pioneered by WD, significantly reduces drive fallout caused by the extended hard drive error-recovery modes common to desktop drives.” That’s great, a drive designed to work correctly in a RAID! We ordered 10 of them – 8 for the RAID and two spares giving us a total of 3.5TB of RAID-5 storage.

A few months go by during we have an on-going unexplained problem where the RAID will randomly drop a drive. Unexplained problems never sit with me well so I asked around the lab. I happen to work in the lab where RAID technology was invented so I bounced some questions off a few people and didn’t come to any real conclusion about the source of the problem. That is, until a coincidental Google search turned up a notice that Western Digital has admitted that several models of their RAID-edition drives will occasionally drop out of a RAID-set for no particular reason. Hmm, the special RAID-edition drives do not work correctly in a RAID. The irony fairies must be falling over themselves about that one.

Continue reading

Posted in data storage, hardware | Leave a comment