ZFS is arguably the greatest thing since sliced bread. However, the OpenSolaris installer doesn’t support it, so normally you end up with a boot disk with UFS and then the rest of the system on ZFS. Doesn’t seem sensible (although I suppose putting the UFS on a small amount of flash memory might make sense). So there is ZFS boot which futzes around a bit and gets GRUB to boot OSOL from a ZFS pool. Tim provides a script and some more documentation, but there’s an issue with getting the disk partitions just right so ZFS will work with it. Like so:
Suppose you’ve just zeroed out a disk and want to use it for ZFS root. You have an installed OSOL and want to transition to ZFS root. The disk is totally unlabled and has no partition table. What now? I kept running around in circles until I found a recipe for re-labeling. But there’s one thing left: you have to go into format’s partition menu and manually add a partition (number 0) that spans the disk. You only need to do this if you’ve zeroed or otherwise seriously buggered the partitions, and it looks like this:<blockquote>bash-3.2# format -e c2t0d0
The ‘pr’ is there to print out the current partition table, and you’ll see partition 2 ‘backup’ which covers the entire disk including the boot blocks; partition 8 boot and covers the first cylinder. The ‘0’ command creates a new partition 0, and you can use the defaults except for starting cylinder (use 1) and ending cylinder or size (use the last one on the disk). For me the relevant bits look like this:<blockquote> 2 backup wu 0 - 30397 232.86GB (30398/0/0) 488343870
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl: 1
Enter partition size[0b, 0c, 1e, 0.00mb, 0.00gb]: 30397c</blockquote>After all that, you will have a c2t0d0s0 partition that you can hand off to zpool or Tim’s script. Then afterwards, follow Scott’s recipe for swap on ZFS, and you are all set to say goodbye to UFS.
The Wayback Machine doesn’t archive everything. Broken links are marked with a 💔.