OpenSolaris and Linux: filesystem setup

I've recently moved to OpenSolaris from Linux, one of the reasons was to learn something new, and this included ZFS. The fact is taht ZFS has changed the way I set up my filesystems. Let me explain why.

My Linux setup

After many years of working with Linux I think I've gained some experience in setting up filesystems.

The main requisites for me when setting up filesystems are that my $HOME directory and my preferred applications should never be altered, even if I reinstall the whole operating system.

To be able to do this with Linux I had to set up different partitions on my hard disk. One partition with my $HOME stuff, and another partition with my peferred applications. I also had another one with multimedia stuff (all my music and videos were there) and finally I had another one just for holding downloads and virtualization images (VirtualBox and VMWare images).

I could end up with tons of partitions. People was surprised that I had as much as 17 partitions on my hard drive.

The main benefits of this setup are that I could have different Linux distributions on the same hard disk, so for instance I could have both Ubuntu 8/10 and Ubuntu 8/04 on the same box. This made it easier for me to evaluate a distribution before making it my default choice.

Of course this setup had some problems. Whenever I installed a new distribution I could end up deleting the whole ".kde" directory in my $HOME, so that my KDE preferrences could be regenerated for the new distribution.

But overall I was quite happy with the setup. I could reinstall the whole stuff while preserving all my data.

But then OpenSolaris changed the way I work now. Let's see why.

OpenSolaris: why zfs changed the way I work

There're tons of zfs tutorials out there. Some of them show the benefits of ZFS with tons of USB dongles, some others show you the basics with a flash demo.

This is all very cool and very multimedia and whatever, but if you really want to learn zfs you'd better read a very good (and short) first tutorial, and its continuation. After that you can start doing some serious ZFS stuff.

Surprisingly this is not a Sun tutorial and, furthermore, it allows you to play with ZFS without having to partition your disk or having to use an arbitrary number of USB dongles. You just need some files to play with it.

These are the features I liked most about ZFS:

  • you don't have to format the ZFS pools (you just say "I want to use that partition" and you're all set). So you don't need to wait ages for "mkfs.ext" to finish.
  • you can mount a ZFS pool wherever you want (well, almost, see below) so you're not limited to the 1:1 relationship between partitions and mount points, as in Linux.
  • you can make a photo of a filesystem at a given moment in time, do whatever you need there, and then revert to the photo.
  • you can compress stuff, and this may be actually be better and faster for you if you have lots of idle CPU cycles to spare (as I do).
  • you can mirror stuff (although I actually don't)
  • you will be able to do enctryption (this is on the works, though).

Wow, that's a set of features, right?

Something I didn't like about ZFS is that you can only use primary partitions, so I could not use ZFS in those other 17 partitions I used to have in my old system. That was a little bit shocking but, hey, this is a new system so I tried to keep my mind open to new approaches.

The solution to using primary partitions was simple enough: delete those 17 partitions and create a single (huge) primary partition and create a ZFS pool there. The solution is indeed simple but scary to someone that, like me, has been used to using different partitions for so many years.

Since you can create different ZFS filesystems within a single ZFS pool I could end up emulating those partitions as ZFS filesystems.

So to summarize: I have a big ZFS pool in a primary hard disk partition and different ZFS filesystems, instead of having different partitions as I used to have in Linux.

Filesystem setup under OpenSolaris

Installing different OpenSolaris versions

I still had one problem: how to install different OpenSolaris versions there? What will happen whenever OpenSolaris 09/06 is released? Will I have to reinstall the whole hard disk?

The answer is no: OpenSolaris has the so called "Boot Environments", that allow you to try out different versions, experiment with them, and then roll back the changes if you don't like them.

D'oh! But this is fantastic! I can install a new release and, if things don't work, roll it back to a previous state. Isn't this cool?

The fact is that I am still new to OpenSolaris Boot Environments, as I have never upgraded OpenSolaris 8/11, but hey, there's plenty of time for me to learn about them before 09/06 is released, right?

So time for me to learn (any good pointers to boot environment tutorials will be appreciated).

Happy open-solaris-ing,


P.S.: Of course I was a little bit confused with OpenSolaris disk device names, as there's no more /dev/sdan] nor /dev/hda[n]. [This guide proved very helpful.

blog comments powered by Disqus