This is just a quick snippet that I spent quite a bit of time researching. It is easily possible to resize an HFS+/Mac OS X volume without using any other tools such as GParted or whatever. Just open up the terminal.app from /Applications/Utilities folder and run the following sequence (remember that I am held responsible for you mucking up your system, so be VERY EXTRA SUPER UBER DUPER CAREFUL when dealing with any sort of disk partitioning on any system):
This will list your volumes, what you will be resizing is #2 (Apple _HFS Macintosh HD), so that comes out to be ‘disk0s2’ (since your primary boot partition is /dev/disk0)
Next up we’ll get to the dirty work:
[bash]diskutil resizeVolume disk0s2 120G[/bash]
This should successfully shrink/grow your volume to whatever limit you’ve set (120GB in my case). Of course, you can check the volume limits by issuing:
[bash]diskutil resizeVolume disk0s2 limits[/bash]
Finder on Mac OS X should automatically pick up the changed size, but it sometimes could be helpful to reboot to ensure that no other issues pop up.
If you get any errors saying that the volume verification failed, reboot into the single user mode by pressing and holding CMD+S on bootup and run:
Which will in turn do a filesystem check on the main volume.
So I finally managed to get FreeBSD 8.1 root on ZFS done. There is a very helpful script called ‘mfsBSD” from http://mfsbsd.vx.sk/ that will do all the work for you – I know, the lazy way, but so far manual way may or may not work.
mfsBSD is a small memory/liveCD FreeBSD install that you can use to install FreeBSD root on ZFS. To install it, go right ahead and download the ‘8.1-RELEASE-zfsv15-amd64 special edition‘ ISO image and load it up on a spare computer or VirtualBox VM. Once it’s loaded, run the following command:
[bash]mount_cd9660 /dev/acd0 /cdrom[/bash]
If you get any errors concerning ‘ata timeouts’, make sure that your CD drive is set as a secondary slave. Once the DVD mounts, run the following to install FreeBSD/ZFS:
[bash]zfsinstall -d /dev/ad0 -t /cdrom/8.1-RELEASE-amd64.tar.xz -s 4G -V 15[/bash]
Where ‘-s 4G’ is your swap space amount. This should take few minutes and once that’s done, you’ll have a working FreeBSD root on ZFS install without spending countless hours to get this rolling.
Once you reboot, you might get some IRQ19 errors on VirtualBox – those can be easily squashed by changing “OS Type” in VirtualBox to “Other”.
So far I have not encountered any issues with ZFS on FreeBSD, but mind you, it is not as up-to-date as the ZFS version 22 on OpenSolaris b134. You will probably run into some issues, but it is worth a try now that OpenSolaris was shut down by Oracle (Though Illumos is gaining more and more momentum now that Oracle killed OSOL). I kinda need a good, working NAS/SAN solution :\