Generally, if you install OpenIndiana with the wizard, it creates your rpool for you, and the greatest influence you have on this process is to prepare the partition which would be wiped to create a default rpool.

The information and procedures below can help if you are migrating your system to a new rpool device, or perhaps if you are into writing new installation wizards.

The bootable "root" pools have some limitations compared to general-use "data" pools:

Now, assuming that you have already prepared an MBR partition and marked it as bootable, and prepared a Solaris SMI table in this partition, let's make some rpool!

:; zpool create -f -O checksum=sha256 -O org.openindiana.caiman:install=busy \
   -O atime=off -O compression=off -O com.sun:auto-snapshot=true \
   -o failmode=continue -o listsnapshots=off -R /a rpool c5d1s0
:; zfs umount rpool

Now, let's make the dump and swap volumes the way the installation wizard makes them (as of oi_151a8):

:; zfs create -o com.sun:auto-snapshot=false -o compression=off \
   -o primarycache=metadata -b `getconf PAGESIZE` -V 2045m rpool/swap
:; zfs create -o com.sun:auto-snapshot=false -o compression=off \
   -o dedup=off -o checksum=off -b 131072 -V 2045m rpool/dump

:; zfs create -o com.sun:auto-snapshot=false -o compression=off \
   -b 131072 -V 100m rpool/rsvd

Now, let's prepare a simple dataset structure for the traditional monolithic root filesystem:

:; zfs create -o mountpoint=legacy -o canmount=off rpool/ROOT
:; zfs create -o mountpoint=/ -o canmount=noauto rpool/ROOT/openindiana
:; zfs set org.opensolaris.libbe:uuid=c2c6c968-9866-c662-aac1-86c6cc77c2c8 rpool/ROOT/openindiana
### UUID is random, individual for each BE; maintained by beadm in live systems
### This is where you can customize stuff for the root-BE dataset only; except compression.
:; zfs mount -O rpool/ROOT/openindiana

The administrative user's home also lives in rpool, and it can be compressed well:

:; zfs create -o mountpoint=/export -o compression=gzip-9 rpool/export
:; zfs create rpool/export/home
:; zfs create rpool/export/home/admin

To go deeper with compressing parts of the operating environment to save some space and IOPS, see Advanced - Split-root installation.

...After you've installed or migrated the OS to this new rpool, don't forget to make it bootable:

### Note the rpool disk(s):
:; zpool status rpool | grep ONLINE | awk '{print $1}' | egrep '^c.+s.$' | \
   while read SLICE; do echo "=== $SLICE"; \
     /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 "/dev/rdsk/$SLICE"; \
:; zpool set failmode=continue rpool
:; zpool set bootfs=rpool/ROOT/openindiana rpool
:; zfs set org.openindiana.caiman:install=ready rpool
:; zfs set mountpoint=/rpool rpool
:; zfs mount rpool
### Just in case - should become /a/rpool
:; mkdir -p /a/rpool/boot/grub/bootsign
:; for F in capability menu.lst splash.xpm.gz; do \
   cp -pf /a/boot/grub/$F /a/rpool/boot/grub/; done 
### Set up "boot signs" to point GRUB to bootable pools:
:; mkdir -p /a/rpool/etc:; touch /a/rpool/boot/grub/bootsign/pool_rpool
:; echo "pool_rpool" >> /a/rpool/etc/bootsign 
:; touch /a/reconfigure
:; bootadm update-archive -R /a
### When you are ready to try the new pool...
:; init 6

Finally, as a trick that can help to quickly export and re-import the rpool in the Live Media or comparable environment, you can do something like this:

:; zpool export rpool
:; zpool import -N -R /a -f rpool && \
   zfs mount -O rpool/ROOT/openindiana && \
   zfs mount -a

//Jim Klimov

See also: