Showing posts with label MacOS. Show all posts
Showing posts with label MacOS. Show all posts

Tuesday, January 13, 2009

Using ZFS with Mac OS X 10.5

A few days ago I got a new MacBook Pro. While waiting for it to be delivered, I started thinking about how I want to layout the installation of the OS. For a long long time I wanted to try to use ZFS file system on Mac and this looked like a wonderful opportunity. Getting rid of HFS+, which was causing me lots of problems (especially its case insensitive re-incarnation), sounds like a dream come true.

If you've never heard of ZFS before, check out this good 5min screencast of some of the important features.

A brief google search revealed that there are several people using and developing ZFS for Mac. There is a Mac ZFS porting project at http://zfs.macosforge.org and I found a lot of good info at AlBlue's blog.

Some noteworthy info:
  • The current ZFS port (build 119) is based on ZFS code that shipped with Solaris build 72
  • It's currently not possible to boot Mac OS X from a ZFS filesystem
  • Finder integration is not perfect yet - Finder lists a ZFS pool as an unmountable drive under devices
  • There are several reports of kernel panics, most of which appeared in connection to the use of cheap external USB disks (I haven't experienced any)
  • There are a bunch of minor issues, which I'm sure will eventually go away.
None of the above was a show stopper for me, so I went ahead with the installation. My plan was simple - repartition the internal hard drive to a small bootable partition and a large partition used by ZFS, which will hold my home directory and other filesystems.

Install ZFS

Even though MacOS X 10.5 comes with ZFS support, it's only a read-only support. In order to be able to really use ZFS, full ZFS implementation must be installed.

The installation is very simple and can be done by following these instructions: http://zfs.macosforge.org/trac/wiki/downloads. Alternatively, AlBlue created a fancy installer for the lazy ones out there.

Repartition Disk

Once ZFS is installed and the OS was rebooted, I could repartition the internal disk. If you are using an external hard drive, you'll most likely need to use zpool command instead.

First let's check what the disk looks like:
$ diskutil list
/dev/disk0
#:                       TYPE NAME                    SIZE       IDENTIFIER
0:      GUID_partition_scheme                        *298.1 Gi   disk0
1:                        EFI                         200.0 Mi   disk0s1
2:                  Apple_HFS boot                    297.8 Gi   disk0s2
Good, the internal disk was identified as /dev/disk0 and it currently contains an EFI (boot) slice and ~300G data slice/partition. Let's repartition the disk so that it contains two data partitions.
$ sudo diskutil resizeVolume disk0s2 40G ZFS tank 257G
Password:
Started resizing on disk disk0s2 boot
Verifying
Resizing Volume
Adjusting Partitions
Formatting new partitions
Formatting disk0s3 as ZFS File System with name tank
[ + 0%..10%..20%..30%..40%..50%..60%..70%..80%..90%..100% ]
Finished resizing on disk disk0
/dev/disk0
#:                       TYPE NAME                    SIZE       IDENTIFIER
0:      GUID_partition_scheme                        *298.1 Gi   disk0
1:                        EFI                         200.0 Mi   disk0s1
2:                  Apple_HFS boot                    39.9 Gi    disk0s2
3:                        ZFS tank                    252.0 Gi   disk0s3


Great, the disk was repartitioned and the existing data partition, which I call boot, was resized into a smaller 40GB partition and the extra space was used to create a ZFS pool called tank. Btw all the data on the boot partition was preserved.

Let's check my new pool:
$ zpool list
NAME                    SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT
tank                    256G    360K    256G     0%  ONLINE     -
$ zpool status
pool: tank
state: ONLINE
status: The pool is formatted using an older on-disk format.  The pool can
 still be used, but some features are unavailable.
action: Upgrade the pool using 'zpool upgrade'.  Once this is done, the
 pool will no longer be accessible on older software versions.
scrub: none requested
config:

 NAME        STATE     READ WRITE CKSUM
 tank        ONLINE       0     0     0
   disk0s3   ONLINE       0     0     0

errors: No known data errors
The warning above just means that a new ZFS storage format is available but is not used by the current pool. As far as I could find there are no benefits for upgrading to the new format on Mac, but if I did, I would lose compatibility with Macs that have only the read-only ZFS support.

Create Filesystems

So now that the new pool exists, I can create a shiny new filesystem using a single command:
$ sudo zfs create tank/me3x
$ zfs list
NAME        USED  AVAIL  REFER  MOUNTPOINT
tank        388K   252G   270K  /Volumes/tank
tank/me3x    19K   252G    19K  /Volumes/tank/me3x
To configure this new filesystem as my home directory, I created a temporary admin account, logged in under this account and mounted the ZFS fs as /Users/me3x:
$ sudo mv /Users/me3x /Users/me3x.hfs
$ sudo zfs set mountpoint=/Users/me3x tank/me3x
$ sudo cp -rp /Users/me3x.hfs /Users/me3x
That's it. My Mac account now resides on a ZFS file system. Now I can finally enjoy all the benefits of using ZFS on my OpenSolaris box in my office as well as on my Mac. Bye bye HFS, I won't miss you! 

Thursday, September 11, 2008

Unintrusive but secure passwordless ssh authentication

On a daily basis I need to log in to many remote servers inside or outside of Sun via SSH, often dozens of times per day. This can get pretty tiresome if you need to type in your password with every log in.

Some suggest setting up so-called "passwordless" authentication by generating ssh keys and specifying empty passphrase for the private key. This will result in passwordless authentication, but will also decreased security. Should anyone get hold of your private key, (s)he'll get access to all of your remote systems.

ssh-agent can help a lot in keeping the security level high and minimizing the number of times you need to type in the password. However, if you use a terminal with tabs or use both local and remote terminals on your workstation, you'll end up running many ssh-agent processes and having to authenticate every time you start such a process, which diminishes most of the conveniences of using ssh-agent.

Frustrated with this situation and with a bit of help from Martin, I created a shell script, which I added to my .bash_profile startup script. All I have to do now is to authenticate when my first terminal session starts and I'm good until the next time I restart my OS. sweeeet...

Here is how you could set it up on a workstation and a remote-server:

First, if you haven't generated your private/public ssh key pair, do that now:
workstation $ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/user/.ssh/id_rsa): **********************
Enter same passphrase again: **********************
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
01:a6:95:23:1c:74:53:c7:f4:87:07:a2:50:ef:99:16 user@Computer.local
Now make sure that the file system permissions are set up correctly:
workstation $ cd ~/.ssh/
workstation $ ls -l
total 56
-rw-------  1 user  staff  1743 Aug 31 00:13 id_rsa
-rw-r--r--  1 user  staff   398 Aug 31 00:13 id_rsa.pub
The id_rsa file must be readable only by owner, if this is not true, the key will be ignored.

On the remote server you need to authorize your newly generated key pair by appending it's public key to the ~/.ssh/authorized_keys file under your remote home directory:
workstation $ cat ~/.ssh/id_rsa.pub |ssh user@remote-server 'sh -c "cat - >>~/.ssh/authorized_keys"'
Now you can try to log in:
workstation $ ssh user@remote-server
Enter passphrase for /Users/user/.ssh/id_rsa: **********************
Identity added: /Users/user/.ssh/id_rsa (/Users/user/.ssh/id_rsa)
Last login: Thu Sep 11 20:19:19 2008
remote-server $

If you open a new tab in your terminal and try to log in again, you'll be asked to enter the passphrase yet again. This is where my script becomes useful. First download the script from Mediacast: ssh-agent-init.sh and store it somewhere in your home directory
workstation $ mkdir ~/bin
workstation $ cd ~/bin
workstation $ wget http://mediacast.sun.com/users/IgorMinar/media/ssh-agent-init.sh
workstation $ chmod o+x ~/bin/ssh-agent-init.sh

The next (last) step is optional if you want to start the script manually you can skip it.

I wanted to have this script automatically invoked when I start my terminal for the first time in the interactive mode. All I needed to modify were my .bash_profile (used for interactive sessions) and .bashrc (used for non-interactive sessions) startup scripts for my bash shell (modifications are in italics):
workstation $ cat ~/.bash_profile
...
...

. ~/bin/ssh-agent-init.sh

workstation $ cat ~/.bashrc
export NONINTERACTIVE=1
. ~/.bash_profile
(Note: I source the ~/.bash_profile script from the ~/.bashrc script to enable code reuse between the two scripts.)

That's it! If you now try to open a terminal tab for the first time, you'll be asked for passphrase. Once that is done, any new tab or any other shell session created under the same account will reuse the same ssh-agent process.

I've been using this script on my MacOS X laptop as well as OpenSolaris workstation for a few weeks now and it's been working like charm.

Sunday, January 20, 2008

My Custom Prompt for Leopard's Terminal

As I mentioned in my previous post, even though it is not perfect, I settled on using Terminal as my terminal application.

The default prompt that comes with MacOS is not very useful, so I configured my own by adding this line to my .bashrc file:
export PS1="\[\033]0;\u@\h:\w\007\]\u@\h:\W\\$ "

This results in a prompt that looks like this:

This prompt displays the prompt as username@hostname:currentdir$ and in addition to that it sets the window title to username@hostname:pwd.

Leopard's Terminal Tabs

As I shared yesterday, I love tabs. One of the few good things that MacOS 10.5 Leopard brought, was enhanced Terminal application. A basic feature - Tab support - that was missing in Terminal for way too long, was finally added, and Terminal app became finally usable for anyone who spends a great time of the day working on the command line.

Before Leopard, I used iTerm, but there was just something about it that I didn't like, but the availability of tabs made me get over it. Now with Leopard there is no need for iTerm any more.

Just to point out that Apple seems to be unable to get anything 100% right these days, there are two flaws in the Terminal's tab implementation.

The first flaw is that you can't easily switch between tabs using keyboard shortcut. All you can do is to use cmd+{ and cmd+} to switch to previous or next tab respectively. What a "wonderful" choice of keys that require use of right hand or both hands. Most importantly, one can't use the handy cmd+1, cmd+2, ..., cmd+9 shortcuts (or anything similar) to switch to one of the first nine tabs. Maybe Apple doesn't want to overload us with new features and is planning to add this to Terminal in MacOS 10.6. :-) Fortunately, the cmd+{ and cmd+} shortcuts can be remapped via System Preferences.

The second flaw is that Terminal doesn't let you name the tabs or configure how the tabs should be named. This is a useful feature that many other terminal applications have, but Apple decided that using the name of the program of the currently running process is good enough. Well, this is what it looks like:

People are doing all kinds of crazy things to work around this issue. Including using hardlinks to change names of programs or creating dummy processes that carry the tab name.

I would be very happy if Apple did something similar to what xterm does - using an environmental variable to set name of the tab dynamically. But I have a feeling that we'll see MacOSX Trash go 3D sooner than properly working Terminal tabs. :(

Mac Applications That I Use

I've been meaning to write this entry on applications installed on my computer for a few months now, but never found time to do it. Hopefully none of those new Mac users that I told to check out my blog "in a few days", several months ago, got angry at me. If nothing else, my promise helped me to get more regular readers :).

Anyway, here is the list of apps installed on my Mac (all these apps work with Leopard, unless I noted otherwise):

Essentials

A Mac without these apps would never be the same:
  • Quicksilver - an app that helps you find things on your computer and execute actions on these things. I use it to launch apps, pause iTunes, find contacts in the AddressBook, and many many many other things. Most of the cool functionality is added via plugins, so don't forget to checkout the plugin section of preferences. This app is a must have. Here are Some docs and a good video.
  • Adium - a really handy IM client that can handle all the popular IM protocols. Definitely a must have. (it's much better than iChat when it comes to IM-ing).
  • Growl - Growl is a notification system for Mac OS X: it allows applications that support Growl to send you notifications. Notifications include Adium or Skype messages, network up/down events, volume mount/unmount events, currently played iTunes song and many others. More info - One extension that I found to be incompatible with Leopard is GrowlMail for Mail.app notifications, when I received many new messages at once this extension would cause the Mail.app to crash.
  • MacPorts - This is a geeky one: The MacPorts Project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the Mac OS X operating system.
  • Firefox - no description needed :)

Nice to Have

  • iStat menus - a nifty app that displays stats about cpu load, cpu temperature, memory and network utilization, and a lot of other interesting data about your Mac. I use it as a replacement of MenuMeters which I couldn't get to run reliably on Leopard.
  • Perian - Perian is a free, open source QuickTime component that adds native support for many popular video formats.
  • Camino - yeah, as if the fact that I'm obsessed with tabs was not enough, I usually run 2 or 3 browsers at the same time to be able to take advantage of their unique features, or more often, while developing webapps, I need to be able to have more than one session open.
  • Chicken of the VNC - A handy VNC client
  • MacFUSE + sshfs - MacOS X implementation of FUSE, which makes it possible to painlessly mount all kinds of different filesystems e.g. sshfs.
  • MacFusion - GUI frontend for MacFUSE
  • VLC - alternative to QuickTime video player with build-in support for all kinds of video and audio codes, subtitle support and many other features
  • Vine Server (OSXvnc) - a good VNC server in case you need a bit more control than the Leopard's built-in server offers
  • Skype - I have a love-hate relationship with Skype. As soon as I find an alternative crossplatform communication tool with audio and video support and cheap calls to Slovakia, I'll switch. Maybe Gizmo will become that tool one day
  • NeoOffice - don't forget to install the latest Patch. I have big hopes for OpenOffice Aqua to be released soon. My initial experiments revealed some very good performance results.
  • iShowU - a cool app for creating screencasts. This is the only paid-for app on my list. But it's well worth it.
  • Caffeine - Caffeine is a tiny program that prevents your Mac from automatically going to sleep, dimming the screen or starting screen savers. Very useful during video calls, while reading PDFs or watching movies.
  • Twitterrific - a Twitter client
  • Azureus - Java BitTorrent client
  • SkeyCalc - An OTP (S/Key) calculator
  • Cisco VPN Client

Development

  • NetBeans - there is a lot of controversy in the community when it comes to the Eclipse vs NetBeans question. I used Eclipse for a really long time, but ever since I tried NB6 Milestone 8 or so, I started liking NB more than Eclipse. I'll give Eclipse another shot in a few weeks, but for now NetBeans is my default IDE. And as far as Ruby/JRuby development is concerned, I don't think that this is going to change for a long time.
  • JRuby - a pure Java-based Ruby interpreter
  • GlassFish - JavaEE 5.0 compliant application server

Other Stuff



Other Lists

Rama and Martin composed similar lists some time ago, so you might want to check those out as well.

Monday, October 29, 2007

10 Things I Hate About MacOS X Leopard

Almost everyone is hyped about the new release of MacOS. All those great new features. Auweeeeee! I'm a an Apple fan, for now - I'm starting to struggle to justify it. Leopard does have a lot of nice features, but it is missing a lot as well. Considering the delay of the OS, I'm disappointed mainly about these ten things:

  1. JDK6 is missing - WTF Apple!?!?!?
  2. Only read-only support for ZFS, unless you count the developer preview version at ADC
  3. Where is Xray? - The neat DTrace GUI that used to be promoted on Apple.com website a few weeks ago Update: The app is now called Instruments and is part of developer tools. Thanks Ron and Barry for pointing this out to me
  4. JDK6 is missing!!!!! Are you kidding me? Even James Gosling who liked to work on Macs, left Mac for Solaris
  5. MacPorts break here and there - This might not sound like Apple's fault, but considering that Fink and MacPorts are the two main ways to get unix apps installed on Mac, Apple should have cared more about making sure that "things will just work"
  6. Case sensitive FS is still only a second class citizen - I'm sick of all the dupes that iTunes and iPhoto creates, I'll be migrating to case insensitive FS soon
  7. Mac Mini and possibly some other Macs, currently come with "upgrade only" Leopard DVDs - this means that if my Mac goes fubared, I'll have to install Tiger and only then I can install Leopard. Lame!
  8. Why are Spaces one of the major features of Leopard? If I were Steve Jobs, I'd have added it long time ago, or if I added it only now, I'd be quiet and try not to attract too much attention to my past failures
  9. JDK6 is still missing! - Seriously how much longer do we have to wait?!?!?
  10. Why did Apple bothered to include built-in Ruby on Rails? Or should I say broken Ruby on Rails!?!? There was nothing wrong with installing Rails via MacPorts, but the one from Apple is already outdated and when I tried to upgrade it, it broke


MacOS X Leopard is "the most impressive Mac OS X version yet"? It's pretty good but hardly the most impressive without the latest Java.

Wednesday, October 17, 2007

Apple to Bundle a Wiki Server with MacOS X Leopard Server

Now that Apple finally released information about MacOS X Leopard, I learned that a wiki server will be part of Leopard Server OS.
Mac OS X [Leopard] Server makes it easy for groups to collaborate and communicate through their own wiki-powered intranet website complete with group calendar, blog, and mailing list. Users can create and edit wiki pages, tag and cross-reference material, upload files and images, add comments, and search content with point-and-click ease. (Source)
Pretty interesting, right? I wonder how the wiki server is implemented. I'd expect to see a lot of eye candy, seamless integration with other Apple offerings, but I'm not holding my breath for too many features.

The website doesn't offer many details, but it seems that the wiki server is intended mainly for team collaboration and not for external facing sites like wikis.sun.com. I hope that I'll get more information soon. MacOS Server is not that easy to see around here. No wonder, after all, we have our cool Solaris everywhere. :)

Tuesday, September 18, 2007

Are You a Right Clicka or an iBook Flippa?

This video made me laugh hard today:

Sunday, September 16, 2007

Solution for the Java Web Start Not Launching Problem

A couple months ago I noticed that I couldn't launch any Java Web Start application from my browser (by downloading and launching a *.jnlp file). When I try to launch an app, the Java Web Start logo appeared and after 20-30 seconds it went away and that was it. How frustrating!

Java Web Start


I struggled for a long time, but then I found a solution posted on a site.

All you need to do is to delete the cache:
rm ~/Library/Caches/Java/deployment.properties
Today the problem re-appeared, but armed with this knowledge, I fixed it in a second.

I have a feeling that this problem is somehow related to the preview version of JDK6 that I installed on my Mac. Apple, where is that darn JDK6 final?!?!? Unfortunately, even when Apple JDK6 is out, it most likely won't be any good for my Mac OSX 10.4 Tiger.

Tuesday, July 17, 2007

Mail.app Unread Message Mystery Resolved

Last night I finally resolved an issue that was bothering me ever since I got my MacBook Pro and by posting this entry I hope to help others with the same issue.

I use Mail.app for reading my emails via pop3s and imaps and I noticed that some messages were randomly getting flagged as unread. Sometimes the message would stay read forever, other times I had to mark it 10 times as read and a couple of hours or days later it would become unread again.

This was really frustrating and even though I tried googling around, I couldn't find the cause or resolution for this problem. When asking others, nobody knew or suffered from the same issue and that gave me hope that there must be a fix or a way to avoid it.

Last night enough was enough and I googled again. I don't know if I used the right combination of keywords, or if Google's index got better, but I found a forum thread discussing the very same issue I was having!

Apparently GPGMail (an extension that integrates GPG with Mail.app) is responsible for this. Sure enough, the author even acknowledges the issue on his site.

Q: Since I installed GPGMail, some read messages have their 'read' status come back to 'unread'. What's happening? A: It's is a bug in GPGMail that I've been unable to fix yet. The only workaround that works for most people (but not all) is to disable automatic decryption/verification of emails.


The workaround didn't work for me, uninstalling the extension did!

I'm not thrilled by not having GPG support in my mail client, but for now I'd rather be without GPG than having to bear with ~500 unread emails in my mailbox.

Since in my case the issue is repeatable (even after reinstalling MacOSX), I can provide any necessary information to the author if he's interested in fixing it.

In my opinion the issue has something to do with imap or imaps mailboxes and I wouldn't be surprised if many people at Sun would be suffering from the same issue, since imaps is the default mail retrieval protocol at Sun.

Thursday, June 21, 2007

I Survived Upgrade to MacOS X 10.4.10




Last night I installed the freshly released update for Tiger (update 10.4.10).

The installation went fine, but took unusually long time, which made me a little worried for a moment (a spinning wheel is not the best indicator of progress).

After the problems I (and many others) had with 10.4.9, I recommend doing at least these steps in order to install a MacOSX Update:

  • close all the apps
  • backup important stuff
  • launch Disk Utility and verify the disk *and* disk permissions
  • start the installation
  • don't touch your machine until the update is done
  • start praying

Sunday, June 10, 2007

OpenOffice.org Aqua Development Snapshot - First Impressions and Comparison with NeoOffice

I came across the news that the first OOo Aqua build was released. This is still an early alpha and as my brief testing proved it's not suitable for any kind of production use.

First impressions are good though. OOo Aqua looks a lot like NeoOffice. There is still of lot of areas where OOo Aqua is lacking behind, but the improvement from the X11 based OOo are definitely noticeable.


OOo Aqua



NeoOffice


The application is much faster than the X11 version and feels more like a Mac application than X11 application. If any of you tried running OOo via X11 on a Mac you know what a pain it is :-/.

My shallow experiments showed that OOo Aqua uses only half of the memory compared to NeoOffice. If the stable release will keep this feature it will be a huge improvement and a slap in the face to NeoOffice.


Don't forget the NeoOffice numbers don't include memory used by X11


Some users claim that the alpha version of OOo Aqua is faster in certain areas than the current NeoOffice (see this in-depth review). I didn't notice a big difference between the two, except for performance in window resizing where NeoOffice is faster (but still terribly slow compared to any other Aqua application).

Overall I'm impressed about the results of only a few weeks of active development since the project announcement in the May. OOo Aqua developers keep up the good job!!!

(If you ever wondered why OOo Aqua and NeoOffice are two very similar projects that run in parallel, then here is a couple of answers that shed some light on this situation)

Sunday, May 20, 2007

Where Is Apple JDK6?

Apple usually takes its time to get Java on MacOS up to date with Sun's releases. But with JDK6 it seemed that things will be different. Apple kept on releasing "Developer Preview" versions of JDK along Sun's beta builds.

The last Java SE 6.0 Release 1 Developer Preview 6 was released on Sepember 13th 2006 and after that date Apple became quiet. What has happened?

All the unconfirmed and confirmed rumors about changes of the UI framework in the 10.5 version of MacOS X (Leopard), has given me a feeling that JDK6 got stuck because of Leopard's delay.

Each significant modification to the user interface has to be reflected in the Swing Java UI library. And since Leopard was scheduled to be released in spring 2007, I think that it was safe for Apple to modify Swing to support the latest UI and to release JDK6 along with Leopard.

That's why I think that the roadmap of JDK6 probably got disrupted by Leopard's delay. JDK6 simply can't be released because Leopard hasn't been released yet.

Does it mean that JDK/JRE6 won't run on Tiger? Unfortunately I think so. After all that's exactly what Apple did with JDK5 and MacOS X 10.3 Panther.

While writing this entry I stumbled upon an article by Matthew Schmidt from Javalobby, who has very similar feelings.

Does anyone have a better explanation?

Btw, I checked, Sept 13th 2006 wasn't a Friday, so we can't blame the delay on the date of last Developer Preview release :)

Will Apple Start Giving MacOS X Tiger Away for Free?

According to the AppleInsider, Steve Jobs made an interesting comment regarding the future of MacOS 10.4 Tiger:

During the shareholders meeting, Jobs also entertained the suggestion that Apple could mimic Microsoft's strategy of offering developing nations Windows Starter Edition -- a low cost version of Windows XP as an alternative to the much more expensive Windows Vista. "Do you think we should offer Mac OS 9?" Jobs quipped in response.

"I think Apple could sell the developing world Tiger while selling Leopard here," the attendee replied. Jobs paused for a moment and said that could be an option.

If this really happened and Tiger was released to the community for free, it would be beneficial for both Apple and the community, especially for those folks from developing nations that don't have extra money to pay for software.

Tiger for free?

I don't think that Apple should charge users for the old versions of MacOS X. That seems to me like a business model that is very close to the one, that the company they laugh at all the time (read Microsoft) is using. Besides if a customer pays for a product he/she expects to get some support for it which would be an extra burden for Apple.

How would this work?

Apple would remove all the protection that prevents Tiger from running on non-Apple x86 hardware and encouraged the community to build a driver database for hardware that is not supported by Apple.

Tiger would not be released as an open source (Apple is not that generous! :) ). When it comes to support, Apple would not provide any support for customers that don't have AppleCare and/or that run Tiger on non-Apple HW.

Why would this be good for Apple?

The more users that get exposed to MacOS, the more potential customers Apple will have. I believe that some users after seeing and being able to play with MacOS would be willing to pay for the latest, more advanced version.

All of this for almost no effort (no support, drivers developed by community).

Why would this be good for the community?

Users that can't afford to pay for SW and for whatever reason don't want to or can't run Solaris or Linux would have a third choice (besides running a crippled version of Windows, which can't be really counted as a choice).

Do I see this happening?

Uhh.. well... I'm not sure... but it is certainly something that I would welcome!

Monday, April 16, 2007

Adobre Reader 8.0 Direct Download Link

I previously posted a direct download link for 7.x version of Adobe Reader and a bunch of people found it useful. So here is the link for version 8.0:

AdbeRdr80_en_US_i386.dmg

Enjoy Adobe Reader without the hassle of dealing with Adobe Reader Download Manager.

Saturday, March 24, 2007

iAlertU - Alarm System for your Apple MacBook Computer

When I saw the light saber fight video and tried the app I thought that it was cool, but sort of useless. The other day I stumbled upon the iAlertU application that uses the sudden motion sensor (SMS) to protect a Mac against thieves. Too bad that it is so easy to bypass it by using earphones :-/. But I have to admit that it is a creative idea and more useful than the mac saber.

Tuesday, March 20, 2007

Apple 10.4.9 Software Update follow-up

Today, I got an email from Apple Tech Support:

Dear Apple Customer:

You've expressed an issue on Apple's Discussions forum with the recent Mac OS X 10.4.9 software update.

Apple would like to investigate the issue by collecting some data from your system.

If this is acceptable to you, please run the attached "Capture Data" application. Then, simply attach the file that's generated into a reply email (to this email) This file will contain logs, configuration information etc.

Thanks for your support in assisting Apple Inc.


It seems that they have noticed my activity on Apple support forums, where I was helping users to resolve the problem with the latest 10.4.9 software update, that I wrote about last week.

The good thing is that Apple is interested in knowing more about this issue - hopefully with the intention to prevent similar problems in the future.

The bad thing is the way they are doing it. How do I know that this email really comes from Apple? How can I be sure that it's not a Trojan horse mass mailed by some malicious person who's trying to misuse my willingness to help?

Attached to this email email is a binary application, that I'm supposed to run. I don't know if it's just me and my strong sense of self-preservation, but isn't it something like rule #1 in all "security for dummies" books not to run applications coming to your email from unauthenticated sources?

I think that Apple should have just send me an email pointing me to an apple.com website where I could download the application from or they should have signed the email and the attachment with a key which certificate was pre-distributed with MacOS X.

Besides, if all that Apple wants to do on my computer is to gather some data, they could have used a script that I could easily review instead of a binary application that can do a lot more than just "capture data".

I'm not pleased that my blog has turned into a Apple complaint site. I really hope that Leopard will bring enough excitement to have me forget about all of this.

UPDATE: I sent an email back to the Apple Tech Support asking them to publish the application on their website.

UPDATE2: An Apple engineer contacted me regarding the email. I ran the application and reviewed the content of generated dmg file. It contained all the system logs present on the computer and some extra files, like output from the top and ps commands.

One think I really don't like is that I had to agree to this License Agreement that protects Apple, but I haven't seen a single sentence mentioning how Apple is going to protect my private information contained in the logs. :-/

Thursday, March 15, 2007

500GB eSATA External Storage with Throughput Upto 67MB/s

I was suffering from full-hard-drive disease for a couple of months. So last week I finally ordered an external drive to hold the piles of data I store on my MacBook Pro. This is what I got:
Everything came in mail today, so I unwrapped it and put it together.



The Seagate 7200.10 hard drive is a hard drive, there is not too much to say about it, except for the usual complaint that 500GB ain't 500GB of free space, you get 465.8GB with this baby.

The Vantec enclosure looks really good and has a very good feel to it. It feels much better than any other enclosure I put my hands on. Very sturdy, slim, well designed and well assembled. Thanks to the fact that it's aluminum based it keeps the hard drive REALLY cool - during heavy use it is just a bit warmer than my hand.

I picked the Vydeo/Meritline eSATA card based on the "feature set /price" ratio and didn't really know what to expect because there is not as much written about it on the Internet as I'd like. Luckily there were no surprises so far.

The card is based on SiI3132 chipset and the driver supplied with the card is an unmodified Silicon Image driver (version 1.1.5). When I tried to install it however, it didn't work. But the one I got from Silicon Image support site worked fine (version 1.1.9). I had to restart my MBP to get MacOS X to recognize it though.



An interesting thing that I noticed is that when I copy stuff from the external drive to my internal drive (not the other way around), my computer gets sluggish. Particularly, all the operations that needed to access the internal drive became almost unusable because of slow responsiveness. I'm not sure if it's the internal drive getting overloaded with all the traffic, or something else, but it happens only in this one scenario (using loading data from the external drive to memory causes no problems).

The only other complaint I have about the card is that it is relatively easy to accidentally unplug. It is safe enough to use on a desk, but I don't even want to think about the data corruption caused by an accidental unplugging while using the computer on my lap.

I ran a few very unscientific benchmarks to see what to expect from my new toys. Here are the results.

  1. Copying my 13.22GB of mp3 files from the internal drive to the external drive:
    time cp -r ~/Music /Volumes/ExternalHDD/BackUp/
    8m29.645s = 26.5MB/s
    (Keep in mind that the internal drive is the bottleneck in this test, not the eSATA drive)

    I ran this test while in USB2.0 mode (the enclosure supports both eSATA and USB2.0) and the results were:
    16m8s = 14MB/s

    That makes the eSATA configuration 1.89x faster than the USB2.0 one.

  2. Copying 13.22GB of mp3 files from one folder on the internal drive to another one:
    time cp -r /Volumes/ExternalHDD/BackUp/Music/ /Volumes/ExternalHDD/
    7m1.298s = 32.2MB/s
    Considering that the files had to be read and then written to the drive, the number can be doubled to get the combined throughput. This makes it 64.4MB/s

  3. Creating a 10GB file using mkfile command and storing it on the external drive:
    time mkfile 10g /Volumes/ExternalHDD/10GB.file
    2m37.377s = 65.2MB/s

  4. Creating a 5GB dmg image file using Disk Utility and storing it on the external drive:
    1m17s = 66.5MB/s

  5. Encrypting a 5GB file stored on the external drive using openssl and storing the encrypted file on the external drive:
    time openssl enc -in /Volumes/ExternalHDD/5GB.file \
    -out /Volumes/ExternalHDD/5GB-encrypted.file -e -aes-128-cbc
    3m24.313s = 25.1MB/s
    Again, since I'm reading and storing the file on the same drive, the combined throughput is the double: 50.2MB/s.

    Since this is a test that is very close to the real world usage, I ran it with the disk connected via USB2.0. The results were:
    8m27.985s = 10.1MB/s or 20.2MB/s combined

    That makes the eSATA configuration 2.49x faster than the USB2.0 one.

  6. Copying a 5GB file from the external drive to the internal drive:
    time cp /Volumes/ExternalHDD/5GB-encrypted.file .
    2m39.271s = 32.3MB/s

  7. Copying a 5GB file from the external drive to the internal drive and at same time copying another 5GB file from the internal drive to the external drive:
    time cp 5GB-encrypted.file /Volumes/ExternalHDD/5GB-encrypted2.file&
    time cp /Volumes/ExternalHDD/5GB-encrypted.file .
    5m46.592s = 29.6MB/s (counting with 10GB of data being transferred )
    Again the internal drive is the bottleneck in this test.

Looking at these numbers I'm pretty happy with my purchase. Not a bad outcome for little less than $300 total.

Wednesday, March 14, 2007

MacOS X 10.4.9 Update Killed My Mac!

The same problem can occur with update 10.4.10 and 10.4.11 and the same instructions can be used to resolve it. See Update9 below.

Today I tried to install the 10.4.9 update for MacOS X that Apple has just released. Unfortunately something went wrong when installing the update and I got an error message saying that the installation was unsuccessful and the installer was moved to the Trash. After that I was prompted to restart, because of other updates.

So I restarted my MacBook Pro and let it run for some time. When I came back a bit later (at least 10minutes after the restart), I found the computer stuck at the blue screen, that appears just before the login screen comes up.

In hopes that another restart will fix everything I powered off the notebook and started it again. This time it got stuck on the gray screen with the Apple logo and a wheel spinning forever:



I tried the verbose mode:



As well as single user mode:



But both of them were unusable with this an error message appearing on the screen:
Load of /sbin/launchd, errno 88, trying /sbin/mach_init
Load of /sbin/launchd failed, errno 88
Fortunately I managed to fix this and this is the way to do it, just in case more of you get stuck with this issue:
  • Use another computer (or a live CD/DVD OS) to download the Mac OS X 10.4.9 Combo Update from the Apple website: Intel, PPC
  • Put the update on a USB key
  • Boot from Mac OS X Installation Disc (put the disc in, restart and hold c key)
  • When the installer starts, run Disk Utility and repair disk permissions
  • Open a Terminal and copy the update from the USB key to your computer's hard drive
    cp "/Volumes/YOUR_USB_KEY/MacOSXUpdCombo10.4.9Intel.dmg" \
    "/Volumes/YOUR_HDD/"
  • Mount the dmg file
    hdiutil attach \
    "/Volumes/YOUR_HDD/MacOSXUpdCombo10.4.9Intel.dmg"
  • Run the update (for less experienced: the command has 4 lines, hit enter at the each line!). A GUI installer will start if the command was entered properly.
"/Volumes/YOUR_HDD/usr/bin/open" \
/Applications/Utilities/Installer.app \
"/Volumes/Mac OS X 10.4.9 Combined Update (Intel)/\
MacOSXUpdCombo10.4.9Intel.pkg"
  • Restart your computer when prompted
  • Delete the dmg file
Credits go to Mike Brooks who inspired me with his post in a forum discussion.

It seems that I'm not the only one who's having this problem. I wonder what is triggering this and why only certain users are experiencing these difficulties.

UPDATE: It seems that Apple doesn't like any discussion on this topic as two threads (1st, 2nd) on Apple forums discussing these issues were deleted/blocked by forum administrators. Come on Apple, that's lame!

UPDATE2: Some users claim that this issue is caused by messed up disk permissions. It is not a bad idea to repair your disk permissions before (and after) installing an update. I wonder why this procedure is not executed automatically before the system update.

UPDATE3: Many people are having problems with all the backslashes and forwardslashes in the commands, so I got rid of most of them by putting paths into quotes. I hope this will make it easier for people not used to working in the Terminal window.

UPDATE4: Apple has contacted me regarding this issue.

UPDATE 5: A friend of mine pointed me to this blog entry that provides a possible explanation to the software update issues.

UPDATE 6: Some users pointed out that you can fix a broken Mac by starting the computer in the target mode (requires second healthy Mac), running the update and selecting the broken Mac as the installation destination - this bypasses working with the terminal, which some users found difficult.

UPDATE 7: According to experience of some users, PowerPC Macs can't read usb drives formated as FAT. That complicates the recovery process quite a bit :-/

UPDATE 8: I put together a small shell script that runs all the command for you - no more pain for "average" users who don't live on the command line. Download the script, read the instructions in it, run it and provide feedback.

UPDATE 9:This issue happened to at least one user during upgrade to 10.4.10 (see comments for this blog entry). The same instructions resolved the issue - just replace MacOSXUpdCombo10.4.9Intel.dmg with MacOSXUpdCombo10.4.10Intel.dmg.

Wednesday, March 07, 2007

Cloning a CD/DVD Disc on MacOS Using a Console

MacOS has a handful of good command line tools for working with discs, images and burning devices. Unfortunately direct support for disc cloning is missing.

I wrote a little shell script that makes it very easy to create a 1:1 copy of CD/DVD discs.
#!/bin/sh

DEVICE_NAME=`drutil status | grep dev | cut -d / -f 3`

diskutil unmountDisk $DEVICE_NAME
watch ls -lh /tmp/disk2burn.iso&
WATCH_PID=$!
dd if=/dev/$DEVICE_NAME of=/tmp/disk2burn.iso
kill $WATCH_PID
hdiutil burn /tmp/disk2burn.iso
if test $? -eq 0; then
 rm -r /tmp/disk2burn.iso
 echo 'DONE!!!'
fi
This script uses watch command to display the progress of the dd command that creates an iso dump of the original media. You can get the watch from darwinports/macports. If you don't care about the progress of creating the iso dump, you can just use:
#!/bin/sh

DEVICE_NAME=`drutil status | grep dev | cut -d / -f 3`

diskutil unmountDisk $DEVICE_NAME
dd if=/dev/$DEVICE_NAME of=/tmp/disk2burn.iso
hdiutil burn /tmp/disk2burn.iso
if test $? -eq 0; then
 rm -r /tmp/disk2burn.iso
 echo 'DONE!!!'
fi

The script discoveres the name your DVD drive $DEVICE_NAME at runtime, e.g. disk1 for (/dev/disk1). This requires that the disc is present in the drive before you start the script.

Note: This script won't copy DRM protected discs (DVD movies, protected Audio CDs) :-(

Btw I didn't know what was the correct usage of the words "disk" and "disc", this article from apple makes it clear.

Update(07-03-24): I found a bug in my scripts that I fixed and I changed the scripts so that the DEVICE_NAME is discovered at run time.