Archive for November, 2012

Headless Parallels

November 12th, 2012 No comments

Generally I like to run servers headless, as in with no display or console. In Parallels this is a little tricky, but doable from Terminal. However, Parallels Desktop must not be running. If you do launch Parallels while a Terminal-spawned VM is running, a console will automatically be created.

To see a list of available VM:

prlctl list -a

To launch a VM:

prlctl start vm_name

Timemachine Problems – fix summary

November 4th, 2012 No comments

Continuing from my Timemachine post, here is my summary of instructions from Garth Gillespie’s site (

In Terminal:

sudo su - 

The verication that has already run has marked your sparsebundle as bad, so first we need to make it look normal:

chflags -R nouchg /Volumes/{name of your network share}/{name of}.sparsebundle

This may take a little while. Then:

hdiutil attach -nomount -noverify -noautofsck /Volumes/{name of your network share/{name of}.sparsebundle 

You will then see something like

/dev/diskx Apple_partition_scheme /dev/diskxs1 Apple_partition_map /dev/diskxs2 Apple_HFSX 

Where x is the disk id for the external disk. You are interested in the one labeled Apple_HFSX or Apple_HFS. It might be 2, 3, 4 or higher.

At this point, the filesystem check is running. To see what’s going on, tail the fsck_hfs.log

tail -f /var/log/fsck_hfs.log 

Normally, if fsck is running, it will successfully repair the sparsebundle, but it can take a long time (hours). Grab a coffee.

When done, you should see:

The Volume was repaired successfully

So far, this has always worked for me. But if you get:

The Volume could not be repaired
 You can try:
fsck_hfs -drfy /dev/diskxs2 

Make sure to replace x with whatever number your disk is from the output above. Like before, use tail to follow the fsck log output, and get comfy.

Once fsck has completed successfully, unmount the volume:

hdiutil detach /dev/diskxs2 

Lastly, you need to clean up your backup’s state by editing (top level of your sparsebundle) as follows:

1) Remove these two nodes:

<key>RecoveryBackupDeclinedDate</key> <date>{whatever-the-date}</date> 

2) Replace:



<key>VerificationState</key> <integer>0</integer> 

And you should be good to go!

Categories: OS X Tags: , , , , ,

Flush DNS Cache in OSX

November 2nd, 2012 No comments

I can never figure out why Apple has to be different, and especially why the change (break) stuff that already works fine. Today’s example: flushing the DNS cache.

From terminal, these are the commands to flush the cache on several (relatively) recent versions of OSX:

lookupd -flushcache

Leopard / Snow Leopard
dscacheutil -flushcache

Lion / Mountain Lion
sudo killall -HUP mDNSResponder

Categories: Uncategorized Tags: