Nahum Shalman

SmartOS ZFS Boot Media

Someone recently asked about this on the mailing list so I decided to get this out of the drafts folder and published.

I used these instructions to create a ZFS formatted USB stick with a pool name of smartos that I use in my server at home. I update it from time to time by downloading and extracting the latest platform tarball.

This is based on the more complicated wiki page about creating a bootable zones pool (which I generally don't recommend doing.)

  1. Boot SmartOS from the live CD in noinstall mode and log in as root.

  2. run diskinfo to identify your target drive and run rmformat to identify the CD drive. (In my example c0t0d0 is my target USB stick and c1t1d0p0 is the CD drive)

  3. Create the pool, copy the CD content, install GRUB, fix up menu.lst, etc.:

zpool create smartos c0t0d0  
mount -F hsfs /dev/dsk/c1t1d0p0 /mnt  
rsync -av /mnt/ /smartos/  
umount /mnt  
cd /smartos/boot/grub  
installgrub -m -f stage1 stage2 /dev/rdsk/c0t0d0s0  
cp menu.lst{,.orig}  
< menu.lst.orig > menu.lst awk 'BEGIN{print "findroot (pool_smartos,0)"} {print} /title/{print "   bootfs smartos"}'  
zfs snapshot smartos@$(uname -v)  
cd /  
zpool export smartos  
poweroff  

Now you can remove the CD and boot from your new boot media.

Update: It looks like the resulting image can safely be dropped onto a larger device and expanded to gain the full capacity of your USB stick:

zpool import smartos  
zpool online -e c0t0d0  
cd /smartos/boot/grub  
installgrub -m -f stage1 stage2 /dev/rdsk/c0t0d0s0  

I've created a 450MB image for others to use. It can be downloaded from Manta here.

Let me know on twitter if it worked for you.

smartos