By default, most computers come with one partition and one volume on that partition. Well, in OS X there’s also a recovery partition, but that’s hidden so we’ll pretend like there’s just one. You can create additional volumes, which are useful for a number of different scenarios. The operation of creating partitions usually involves resizing a partition. That can be somewhat dangerous, so make sure to backup your Mac before doing so. To create an additional partition (and by default an HFS+ filesystem on that partition), first open Disk Utility from /Applications/Utilities. Note that by default, the boot volume is highlighted. You can’t create a partition inside a volume or partition, so click on the name of the disk above that. Here, you can choose to run First Aid, Erase, Mount/Unmount, and Info. Most are unavailable when clicked on a disk, so let’s click on Partition. Doing so shows you each partition on the physical disk. You can click on each partition to see information about the partition. Let’s click on the plus sign (+) to create our new partition. When prompted, provide a name for the partition. You can choose a different format for the partition, but let’s leave that as the default for now. Then enter a size and click on Apply. If you’re taking space away from a partition, the old partition will be resized as a smaller partition, provided that there’s enough free space to do so. Once the process is complete, you should see your new volume mount.
Someone hands you a USB drive. You put it in your computer and you can’t access anything on it. You are running an imaging lab and you want to backup or troubleshoot a device before you re-image it, but you can’t access certain files. Obviously, you can sudo. But, you can also simply disable permissions on that volume (which, like getting someone to make you a sandwich, requires sudo of course). The command used to enable and disable permissions on a volume is vsdbutil, located at /usr/sbin/vsdbutil. And there’s a LaunchDaemon at /System/Library/LaunchDaemons/com.apple.vsdbutil.plist that interacts with diskarbitrationd so that when a volume is mounted, it is marked as having permissions activated or deactivated (which is basically “Ignore Permissions” at the Finder). To use vsdbutil to enable “Ignore Permissions”, use the -d flag followed by the path to the volume:
sudo /usr/sbin/vsdbutil -d /Volumes/MyvolumeTo then enable (or activate, thus the a) permissions again, use the -a flag:
sudo /usr/sbin/vsdbutil -a /Volumes/MyvolumeYou can also run the -c to see the status for a given path:
sudo /usr/sbin/vsdbutil -c /Volumes/MyvolumeAnd last but certainly not least if you’re working on a lot of volumes, the -i option will enable permissions on all mounted HFS and HFS+ volumes:
sudo /usr/sbin/vsdbutil -iOverall, it’s very easy to send these commands using a positional parameter (e.g. $1) to a script, performing a mount, some operation (backup, reimage, restore, repair some corrupted data, etc). Note: You can’t Ignore Permissions of FAT or FAT32 volumes using the command line or a Finder Get Info screen.
Back when I worked with Xsan a lot more than I do now, one of the things we spent a lot of time doing was working with metadata and journal data on Xsan volumes. You can also view journal data for non-Xsan volumes. The hfs.util binary is used to view journal data about volumes. In this example, we’ll look at the journal size and location the boot volume of our system:
/System/Library/Filesystems/hfs.fs/Contents/Resources/hfs.util -I /Volumes/Macintosh\ HDThe output shows the size of the journal and the location, as follows:
/Volumes/Macintosh HD : journal size 40960 k at offset 0x1a38b000
I did a little article for afp548 that was posted while I was out of town. It’s on moving the journal of an HFS+ file system to offload the performance hit. Not terribly complicated but hopefully useful. Anyway, check it out here.
Tivoli, Backup Exec, NetBackup – they don’t backup resource forks. So if you need your resource forks (and you probably do) then look towards a Mac backup app, like Retrospect, Bakbone, Atempo or Archiware.