apple

Create Mac OS X Disk Images (dmg file format/hfsplus file system) under Linux

I wanted to create a second Aperture Vault on a hfsplus volume, but hosted on my network. I could do this using Disk Utility, but due to some complications in the way my Linux Samba server is setup I needed to create the disk images on my Linux server directly.

In this case I am creating a 160GB volume named 'APV.dmg' to match the size of the external firewire drive I use with Aperture.

The following command will create the empty disk image:

dd if=/dev/zero of=APV.dmg bs=1M count=163840

Then to format it as a hfsplus volume:

mkfs.hfsplus -v 'Aperture Vault' APV.dmg

I test copied some files over my LAN (gigE) to this volume when it was mounted on my Mac, and the speeds are equivalent to an external firewire drive. That is, they are limited by the 5400rpm 2.5" SATA drive in my laptop rather than any other component.

The operation cannot be completed because the item is in use error in OSX

If you try and empty your trash can in OSX while a file is in use, you'll be presented with a message that looks like this:

This is not particularly useful, because if you're trying to delete a file you have worked on in multiple applications you won't know what is actually using the file. You can use terminal to force delete the trash, or resort to rebooting to get around this problem - but there's a better way. Open up terminal and enter the following command:

lsof | grep filename

Replace filename with part of or all of the filename that produced the error. You'll get some output like this:

In this case two applications have the problematic file open. PathFinder and Preview. If I close these applications and try and empty the Trash again it will allow the file to be deleted.

Syndicate content