hdiutil Requires sudo for Read/Write

Another unwelcome surprise from Apple: in some recent OS X update (I don’t know exactly which one as I ran into the problem this morning) they changed how hdiutil behaves when mounting sparsebundles in read/write mode (it is used in my build scripts as a step toward generating the final setup DMG): it now requires sudo-ing when you use the -readwrite flag.

The problem is that sudo by default prompts for a password and silently fails when used from a script. The solution is to remove that password requirement. This is carried out by adding a line to the /etc/sudoers file:

%admin ALL=(ALL) NOPASSWD: /usr/bin/hdiutil

This innocent one-line edit requires lots of command-line gymnastics, however. Permissions on the sudoers file is 440 by default, and the sudo command fails to work with anything other that that.

So you have to boot your Mac in single user mode to do the edit (by holding down Command+S at startup). Then you have to mount the root file system in read-write mode and change the permissions on the file:

mount -o update /
cd /etc
chmod 640 sudoers
vim sudoers

Add the line to the end of the file, save it and restore the file’s permissions:

chmod 440 sudoers

You can now reboot, and sudo hdiutil will not ask for a password any more! So it can be safely used from within build scripts.

MacBook Pro with Retina Display

It took a month, but my machine finally arrived two days ago. I spent the whole yesterday on moving my digital life over to the new machine and set it up for work. This post is a collection of my initial impressions. I will not reiterate the specs that can be found in numerous online reviews. All of those I recommend watching just this one.

My configuration is the 2.6GHz machine with 16GB of RAM and a 500GB SSD.

Winner of Two Lotteries

You enter two “lotteries” when you buy an Apple notebook. The SSD lottery and the display lottery. The reason is that Apple sources these components from two vendors: Samsung and Toshiba for SSDs/flash memory (I will use the Solid State Disk term instead of Apple’s “flash memory” marketing talk from now on – because these are all SATA connected SSDs – although in different form factors) and Samsung and LG in case of displays. Unfortunately the non-Samsung options are vastly inferior to the Samsung ones.

For example, Samsung SSDs are using the great Samsung PM830 controller. The Toshiba one use a Sandforce SSD controller. Sandforce SSD controllers compress all the data before it gets written into the chips for an almost twofold throughput increase. But if you are like me, and use FileVault to encrypt your disk then this compression becomes useless: almost random data can’t be compressed. Which results in halved performance. Fortunately, for larger capacity drives Apple seems to be using the Samsung ones. So I ended up with an 500GB Samsung SSD. One win.

You might wonder why did I mention 500GB instead of the advertised 512GB. Because the 512GB is simply a lie. The drive actually measures 500GB (if you count 1,000,000 bytes as one GB – as the storage industry as well as Apple does) and 476GB if you count (1,048,576 bytes as one GB – which is how many bytes a GB truly is).

Regarding the display lottery, lots of LG manufactured panels are defective out of the box. Just execute the command in the linked article to show your display’s manufacturer. LP is for LG and LSN stands for Samsung. I have a Samsung panel. Another win.

Is the Lack of Upgradeability a True Problem?

Lots of people on the Internet fret about this. Frankly, in the last 15 years I can only mention two occasions when I upgraded memory in my machines. And CPUs were never changed. Disks are another story. Before SSDs I regularly went to faster disks as they became available. But since I’m using SSDs I don’t feel the need to upgrade yearly. I usually buy my machines maxed out with RAM and disk, and opt for the one-less-that-the-fastest CPU option (they cost way less and the performance difference is negligible). So the lack of upgradeability is not a problem for me.

And on the positive side, soldering RAM to the motherboard gives some huge performance benefits (read the section below the graph). Wow, 99.9% processor bandwidth utilization IS something!

Two Missing Pro Features

ECC memory and 30-bit display output capability. I know that ECC (Error Check and Correction) has disappeared from consumer machines and Intel only supports ECC with their Xeon processor line, but 16GB is a lot and for mission critical work (like huge CAD models) ECC is a must. So for situations where it is not acceptable that your memory can forget a few bits here and there, the Mac Pro is the way to go. For example I use a Xeon E3-based server machine with 16GB of ECC memory.

The other one is 30-bit color. This is available on all current high end graphics displays and NVIDIA makes mobile chips that support 30-bit. Usually these chips are completely identical to the consumers ones Apple is using, just high precision stuff is enabled in them (I remember those times when I hacked consumer NVIDIA cards to Quadro ones…). For a notebook at this price point, pro graphics should be the standard.

Needs a Thunberbolt Dock

On the left side of the machine I have:

  • The power cable.
  • A mini displayport to DVI adapter for my EIZO CG241W display.
  • A Thunderbolt to Gigabit Ethernet adapter.
  • An USB connection to the EIZO. Keyboard and mouse is attached to the EIZO’s hub.

Looks ugly. And plugging in all these when I use the machine as a desktop is a hassle. I can hardly wait for Matrox’s solution.

Usability

The machine is light (for such a powerhouse), fits neatly into the notebook pocket of my Lowepro Pro Trekker 400. Key travel is a bit short, but it’s not really a problem. I miss PageUp/PageDown and Home/End keys…

It gets a bit warm during use, but it’s bearable. As the majority of current applications are incapable of driving the four processor cores (with eight processing threads), so fans are spinning silently. Even if you can put some heavy load on the machine they produce an almost pleasant noise. Nothing disturbing (and believe me I’m overly sensitive to machine vibration and noise).

Battery life is rather short – I found it about 5 hours in my normal usage patters. This is way less than Apple’s advertised 7 hours, but there are reports that Mountain Lion causes this reduction. We’ll see.

Applications and the Retina Screen

The screen resolution is astonishing. Brightness uniformity is not on the same level as my EIZO (actually I would score this as pretty bad). The display calibrates very accurately (in one spot at least). I was surprised that it produced less deltaE2000 than the EIZO. If uniformity would be better, this could be a great graphics display. All in all I want this high resolution on my desktop graphics monitor! Hope that either EIZO or NEC will come out with a high resolution display like this.

I would also note that the Intel integrated graphics is not capable of handling such large amount of pixels. You can’t even watch a movie full screen using integrated graphics, so the machine uses the NVIDIA chip a lot.

The real problem is that most of the applications are not yet ready for supporting the HiDPI modes of the Retina display. These apps would really need the upgrade:

  • Photoshop
  • Lightroom (it displays UI text in high res, but everything else is pixel-doubled)
  • Capture One
  • Kindle

Others, like Parallels Dekstop and VLC, already support the display. It’s still a waiting game. And the display would only realize its full potential when these apps become ready.