Mac OS X Lion and Creating a new Rascal ext3 microSD card

Using this technique it is possible to insert the Rascal ext3 microSD card in the Mac card reader and have it appear on the Mac desktop. According to the README for FUSE-EXT2 it is possible to write to the card but the document states “Although write support is available (and it is pretty stable) please do not mount your filesystems with write support unless you do not have anything to lose”. In any case, as far as I know, it is not possible for Mac OS X to format an SD card as ext3 so I chose not to take the risk.

I have VMWare Fusion installed so it was relatively easy to create a virtual machine running Ubuntu 10.04. Make sure you install VMWare Tools which optimises connectivity between Mac OS X Lion and the virtual machine. Once Ubuntu is running and assuming you have already installed OSXFUSE and FUSE-EXT2, you can do the following:

  1. Insert the Rascal microSD card into the Mac card reader. The “rascal-beta” card should appear on the Mac desktop
  2. In VMWare Fusion choose the Virtual Machine menu, then in the submenu USB & Bluetooth choose “Connect rascal-beta (Apple Internal Memory Card Reader)”. The “rascal-beta” card should disappear from the Mac desktop and in a few moments appear on the Ubuntu desktop
  3. In Ubuntu 10.04 it will have been mounted as /media/rascal-beta. You can then follow Brandon’s recipe for archiving the existing card filesystem.
  4. Having made a copy, you can right-click the mounted SD card in Ubuntu and choose Safely Remove Card. The card will disappear from the Ubuntu desktop but the card reader is still connected to the Ubuntu VM. Then from VMWare Fusion: Virtual Machine: USB & Bluetooth choose “Disconnect rascal-beta (Apple Internal Memory Card Reader)” and the SD card should reappear on the Mac desktop.

I repeated this with a new card, formatting it as ext3 according to Brandon’s recipe and then extracting the saved archive onto it. I’m running my Rascal off this copy.

While repeating these steps before writing this post, after ejecting the card safely from Ubuntu it entered the dreaded state on the Mac “The disk you inserted was not readable by this computer.” with the options Ignore and Eject. I tried everything – multiple restarts of the Mac and Ubuntu, uninstalling and reinstalling FUSE-EXT2 and OSX-FUSE etc. After an hour I concluded that the card must have been corrupted and was about to wipe it in Apple Disk Utility when I noticed it was read only. I had accidentally locked the card when pulling it out of the reader.

Apart from this, the above procedure seems reasonably robust. I did try some experiments without installing OSXFUSE and FUSE-EXT2 on the Mac. If you choose Ignore in the initial card insertion dialogue, it is possible to connect the card reader to the Ubuntu virtual machine and get it to recognise the card. However this seems to be a matter of luck and often requires multiple restarts.

First posted in the Rascal hardware and software forum.

Mac OS X Lion and Backing up the Rascal ext3 microSD card

I hadn’t had much experience with Linux so when my Rascal arrived, I thought I ought to back up its microSD card. I inserted the card into my iMac and got the message “The disk you inserted was not readable by this computer.” with the options Initialize (No…!), Ignore or Eject. What to do? Googling for “Mac OS X and ext3” mostly returned old links. There was a something called MacFUSE but development stopped before Lion was released. To cut a long story short, there does seem to be a recipe that works well – you insert the Rascal microSD card into the reader and it appears on the Mac desktop, just as it should.

The Recipe
Before starting, it is worth reading this recent blog entry which provides an overview.

  1. Install OSXFUSE (FUSE for Mac OS X), a replacement version of MacFUSE that does work with Lion and is being maintained. IMPORTANT In the initial installation dialogue you must tick “MacFUSE Compatibility Layer”. According to the developer, installing it afterwards won’t work! OSXFUSE v2.3.8 can be downloaded from here
  2. Install FUSE-EXT2 which runs on top of MacFUSE to provide support for ext2 and ext3 filesystems. You can read about it here and download from here.

It is probably a good idea to restart your Mac after the installation.

After this, when you insert the Rascal microSD card, it should appear on the desktop. You can then back the card up by following Brandon’s recipe for archiving a file system. Note that the location of the card will be /Volumes/rascal-beta/.

The SD card has to be unlocked to allow it to be mounted. However this recipe always mounts the filesystem as read only.

First posted in the Rascal hardware and software forum.

Mac OS X Lion, Rascal and nano

When using Terminal on OS X Lion to connect to the Rascal (e.g. ssh root@rascalNN.local), I noticed that nano was unreliable. For example when deleting a long line, the cursor sometimes jumps to the right leaving characters on the screen which do not match the nano buffer (which you can redisplay with Ctrl-L). This seems to be a common problem with Lion, not confined to Rascal, for example see this blog page. The problem seems to be that Lion has changed the default TERM setting from xterm-color to xterm256-color.

There are a number of ways to change your TERM setting but one of the simplest is to open Preferences from the Terminal menu, choose the Settings tab, click on the scheme you will be using (e.g. “Basic”) then click on the Advanced tab and change “Declare terminal as:” from xterm256-color to xterm-color. This setting gets carried over to Rascal when you use ssh and seems to make nano work as expected. If not, according to a nano FAQ, setting TERM to vt100 should always work!

First posted in the Rascal hardware and software forum.