The Art of Slicing
By templedf on Nov 02, 2006
Back when I first joined Sun, in the hardware sales organization (SMCC), I was always very careful about how I'd lay out my file systems when installing a new system. See, Solaris (the greatest OS on earth) subdivides disks (and partitions) into slices. Slices give you a convenient way of allotting a specific amount of space to specific file systems. For example, it is common practice to put the users' home directories on their own slice. That means that if a user tries to download the entire Star Wars movie series rendered in ASCII art, he can fill up the slice he's on, but he can't affect the root file system, because it's on another slice.
Slices are great, but they can also cause some problems. For example, if you were to completely dice up your system the way Solaris 2.5.1 recommended, you'd have almost every file system on a separate slice. Well, what happens if you run out of space in /opt but have free space in /usr? Too bad. They're on different slices, and there's no way to easily reslice the disk without losing the data. For this reason, the common practice has become to place /export/home on one slice and everything else on another. When installing a desktop machine, it often makes sense to just keep everything in the same slice. In fact, I hadn't properly used slices since last century. Until yesterday.
Yesterday I managed to blow up my desktop. I know how I did it, but I'm still not entirely sure why it happened. (Fortunately, even though I couldn't boot the machine, I was still able to prop it up enough that I could mount my hard disk, tar up all my data, and FTP it to another machine before reinstalling. I love Solaris!) In any case, I was talking to some of our Solaris folks about it, and they suggested that I not only reinstall Solaris 10, but that I should also install the latest build of Nevada, the next version of Solaris. There's a catch, though. The Solaris boot loader for x86 can't deal with two Solaris partitions on the same disk. To get around the issue, you have to install each version of Solaris on its own slice in the same partition. As an added bonus, though, you can share the non-OS slices among all the installed versions, including the swap space. Following this formula, I'm now back to 1997, with a slice for every major non-OS file system so that I can share them between both OSes. But this time it's because I'm cool. Really.
An interesting footnote to this story is Solaris Flash Archives. Remember what I said about being hosed if you fill up a partition? flar fixes that. flar allows you to do a file-system-based (not slice-based) data dump. With flar, you can dump your data to a temporary location, reformat and reslice your disk, and then dump the data back. flar doesn't care if your slices change between dumps. It will put your files into the right file systems, regardless of what the slices look like.