Compressed ZFS root in Solaris Nevada 99

Hey all,

Just to say: I am messing around with VirtualBox and Solaris, and am using a dynamically-sized disk image of 16Gb to install Solaris upon; this Solaris installation is eventually meant to run on a MacBook Air without much disk space, so it makes sense to keep the footprint as small as possible for as long as possible. Following a chat with Darren I decided to have a go with compressed ZFS root; this is not exactly a supported process, but I see no reason not to be trying it.

In short: the technique is this:

  1. boot Solaris Nevada using option 3 – desktop install
  2. go through System Identification (for some reason this was hanging for me, maybe DHCP?)
  3. open a second terminal window with a shell running
  4. choose a ZFS install
  5. start the installation
  6. WAIT UNTIL THE INSTALLER FINISHES CREATING THE SWAP AND DUMP ZVOLS
  7. in the other window, type: zfs set compression=gzip rpool

You have to wait until the zvols are written; if you try enabling compression too early then the installer will crash-out and you will have to reboot to get into a state where you can try again.

I really wish this was a checkbox option, it would make sense for appliances and other small devices.

More info on how it goes, as I have it. I offer no guarantees, for all I know this is not supported, caveat hacker, etc…

Update: ok, this one’s not booting. Need to poke grub? That said, it occupies 2.7Gb for SUNWCxall with OEM, which is good…

Comments

3 responses to “Compressed ZFS root in Solaris Nevada 99”

  1. bartb

    IIRC GRUB can only handle the basic compression, so you would’ve wanted to use “compression=on” rather than “compression=gzip” .

  2. Hi Alec,

    the 16GB dynamic image will reach 16GB pretty soon, because of ZFS’ way to do copy-on-write. Over time it’ll touch most of the blocks anyway.

    So the question really becomes: how does one get the most out of these 16GB. Since the base Solaris installation is in the order of 2GB (including some extra tools), one could decide to only compress the home directory and perhaps /opt, leaving /root alone for the sake of less hassles with install tinkering and boot stability.

    While gzip is more powerful than the default LZJB, I’d still use LZJB for speed: The Mac Book Air doesn’t have a very powerful CPU and having Solaris perform a tad snappier is probably more preferable.

    Thanks for the entry, I’m now going to convert my home into its own compressed filesystem on my 20GB VB OpenSolaris image on my Macbook Pro :).

    Cheers,
    Constantin

  3. @bart:

    >GRUB can only handle the basic compression, so you would’ve wanted to use “compression=on”

    Yay! I will attack that forthwith!

    @gonzo:

    >the 16GB dynamic image will reach 16GB pretty soon, because of ZFS’ way to do copy-on-write.

    true, and there is nothing to be done about that; but maybe with compression I can save enough space to fit the root into less than 4Gb, which for CXall would be cool… thumb-drive sized, even…

    I’ll give it another go and post the results…

Leave a Reply

Your email address will not be published. Required fields are marked *