Encrypting filesystems with OS X Lion

Sadly some manufacturers1 of portable USB hard drives have yet to realise that there are operating systems other than Windows™ and include non-OS specific hardware encryption. OS X Lion supports software encrypted filesystems but the graphical Disk Utility application can only create new encrypted partitions. Fortunately the command line version of the same program can encrypt an existing partition without loss of data.

The drive must have a GUID partition scheme and the partition must have a HFS Journaled filesystem. You can view the partition information by typing diskutil list in a Terminal. The final column of output shows the IDENTIFIER you must use in the next command (disk1s2 in my case).

Encrypt the partition using the command:
diskutil cs convert disk1s2 -passphrase

You will them be prompted for a passphrase (do not lose or forget this, there is no way to recover the data if you do!). The drive will then be converted to a special corestorage volume and encrypted. Converting and encrypting a 1TB drive (with 500GB of data) took nearly 24 hours for me. You can monitor the process using the command diskutil cs list (the cs stands for core storage).

  1. Western Digital being one for which this is not true, their My Passport drive has been an excellent Mac citizen.[back]

HP DeskJet 3050A — The Missing Manual

Printers used to be a simple peripheral: connect it to your computer and hope that it will automatically configure the correct driver. If your printer was newer than your OS you accepted that you had no choice but to insert the supplied CD and install the driver along with whatever useless software the manufacturer decided would “enrich your experience”.

In an ideal world a networked printer would be similarly simple: connect it to your network and proceed as before but without the USB cable. Entering a non-trivial wireless password into device with just 6 buttons would be a tedious but infrequent task. Sadly not that simple.
Continue reading

Canberra

A few photos of Canberra, a city with ample green space and grand architecture. It is difficult to get around without a car though. Despite its master plan being devised in 1912, much of the implementation came much later and exemplifies urban planning of the 1940s and 1950s with large curving roads and roundabouts which make it seem like a grander version of Milton Keynes. Either the original 1912 architect was incredibly prescient to foresee the rise of the motor car, or perhaps he envisioned self-sufficient communities linked by a rail network, it is really not clear how his plan could work otherwise.

Canberra is a very bicycle friendly city, relatively flat with light traffic and ample space for bicycle lanes. Nearby hills such as Mt Ainslie also make for excellent mountain biking apparently, and the coast is only two and a half hours away if you hanker for a weekend on the beach.

Au Revoir, Internet Café

On previous trips, publishing a blog post or keeping in touch with home meant allocating some time to locate a reasonably priced Internet café and writing while watching a ticking timer. For this trip however I have been able to write at leisure in spare moments on my phone thanks to the availability of pre-pay GSM sim cards with data allowances.

In Australia, amaysim have been particularly good value although I only discovered their existence after considerable Internet research. A $10 purchase in-store sim card purchase gave us 1GB of data valid for 30 days plus $10 of pre-pay phone credit (90 day expiry). The network is provided by Optus, in common with most of the cheap prepaid sim offerings. There were a couple of issues though which I document here for future travellers.

  • We bought the sim card in a Seven-Eleven. The website claims you can buy them in post offices but the one we tried did not stock it so the availability might not be great. The same pack contains a sim that may be used with either the normal or micro sim formats.
  • Online activation claimed to work but actually failed because of my non-Australian address and credit card. You must call them to get your $10 purchase converted to a data plan. I have not tried to top up the credit yet but it makes me think that credit card top ups might be difficult. Buying vouchers works around this, but see the note above on availability.
  • The sim we bought has been used in multiple devices. I can report that despite rumours to the contrary, a sync with iTunes is not required to change the provider on an iPhone (at least on iOS5). However some devices could not access the Internet until the APN had been set manually to “Internet”, others just worked, for reasons I have yet to figure out.

Khao Lak, Thailand

We chose Khao Lak in Thailand as a good place to break the long trip to Australia because of the opportunity to visit the Simulan Islands, one of the world’s top dive sites. With no accommodation permitted on the islands access to the snorkelling involved a bumpy 60 minute speed boat ride, and even the slightly slower dive boat felt like a two hour fairground ride! The snorkelling was good for fish but sadly the coral bleaching that occurred two years ago had yet to show much progress in its recovery.

Having come to snorkel we also thoroughly enjoyed the inland expedition to Cheow Lan Lake. The highlight of this was a trip on the lake in a long-tail boat which gave us a close up view of the imposing limestone islands that rose vertically up out of the water and towered over our little boat. The limestone had beautiful red colouring too, complimented by the green of the trees clinging to a precarious life on a sheer vertical wall of cliff and overhanging the water. Some of the islands have developed cave systems and we visited one which had spectacular stalactite and stalagmite formations, the iron giving them a rich red colour that invited comparison to the marble cathedrals of Italy.

Although we were only in a small part of Thailand for a few days, we really enjoyed our stay. Thai people were universally friendly and genuinely welcoming of tourists. The absence of pushy street salesmen that are commonly found in tourist areas the world over was also very pleasant—I look forward to returning.

Using the Terminal to restore from a Time Machine backup

I recently had to restore some Application Data from a Time Machine backup and since Finder in OS X 10.7 (Lion) now hides the Library folder in your home directory I thought it easiest to just cp the files from the mounted volume to the right place. It turned out that this it was not as straightforward as that because the restored files retained the read only permissions that prevent you from modifying a backup.

The ACL does not appear in the Finder, but can be seen using ls -le:

0: group:everyone deny write,delete,append,writeattr,writeextattr,chown

and also metadata: com.apple.metadata:_kTimeMachineNewestSnapshot 50

The ACL can be removed using chmod -a #n filename where n is replaced by the number at the front of the ACL description (0 in this case). Applying it recursively is possible but potentially dangerous1 unless you know this is the only ACL applied to the files in the directory. The metadata can be removed using xattr, like this:
xattr -d com.apple.metadata filename

  1. and consequently left as an exercise to the reader[back]