Dual Boot Storm and Ubuntu from a single disk

REVISED VERSION !!!

If you want to install Storm and Ubuntu to multi boot, from a single
disk here is a HOWTO. It probably isn't the most elegant solution, but
it works. In this example I have Storm Beta3, Ubuntu 9.10, and WinXP and
a FAT32 storage partition all working together on a Compaq Evo n800v
with 1GB RAM and a 250GB harddisk.

You will need the following:
- a USB stick with enough space to install Storm (2GB is enough)
- a Ubuntu install CD
- a Stormos Install CD
- about 2 hours

1) Installing Storm and Disk Prep
1.1 Boot the Storm CD and install storm to your USB drive. When you are
done, boot from the live CD again.
1.2 Insert your USB stick and run "format -e" this will allow you to
chose both the USB and the internal drives. Select the USB drive and see
how many cylinders are reserved for swap by typing "ver". (in my case
130)
1.3 type "disk" and select the disk you wish to install to, then
type "fdisk" to partition it
1.4 delete all your existing partitions, and create new ones as
you wish (note, only one Solaris partition per disk) I set up 4
primaries:
Solaris2 20%, (for Storm), Active partition
Linux Native, 20%, (for Ubuntu)
Win95 Fat32 , 20% (for WinXP)
Win95 Fat32, 40% (for shared data between OS's)

Once you are satisfied with the partitions, exit "fdisk" with "6" saving
them, and return to the "format" top menu.
1.5 Type "verify" to see the layout of the solaris disk/partition. Now we
need to modify the solaris "disk" to give it a root and a swap
slice, the Verify tells you the total number of cylinders on the
Solaris slice, and above we checked how many cylinders are used
for swap. Now do a bit of cylinder math:

part2 is 6078, Swap is 130, alt is 2, and boot is 1,
therefore root will be 6078-133=5945 starting at 3

1.6 Type "p" to enter the partition menu
1.7 Create your root partition: "0", "root","wm","3","5945c".
1.8 type "p" to see where 0 ends (5947), swap starts at the next
cyl (i.e. 5948)
1.9 create your swap partition: "7","swap","wu","5948","130c"
1.10 type "la" to label the disk (i.e. write the changes), "q",
"q" to exit format.

2) Migrate syspool from USB to the Disk (still booted from the storm CD)
2.1 zpool import -f syspool
2.2 "zpool status" to determine the name of the USB disk. You
may wish to run "zpool scrub" to verify that the pool on the USB is
still ok.
2.3 Since we have prepared the solaris disk above, you can
now run "zpool replace" to migrate the pool to the harddisk. In my case
the exact command was:
"zpool replace -f syspool /dev/dsk/c3t0d0s0 /dev/dsk/c1d0s0"
the pool will immediately begin resilvering, migrating itself from the USB disk to the Harddisk. This process will only take a few minutes, you can check progress with "zpool status syspool". Wait until the resilvering is complete before you do anything else. Once the resilver is complete you should see no error messages on the status page.

2.4 Now we need to expand the pool to take on the size of the
slice we migrated it to, as it is currently only the size of the USB
stick. (you can see this by typing "zpool list" or "zfs list"). Due to
the wonders of zfs, this is simple, just type
"zpool set autoexpand=on syspool".
Type "zpool list" again and you will see that the pool is now
resized to fit the partition. If you are cautious like me, run
"zpool scrub syspool"
and wait for the scrub to finish, to verify that you have
no errors in the pool. I ran
"zpool set autoexpand=off syspool"
when I was done, just in case something goes wrong.

2.5 mkdir /a
2.6 mount -F zfs syspool/rootfs-nmu-000 /a
2.7 installgrub -f m /a/boot/grub/stage1 /a/boot/grub/stage2 /dev/rdsk/c1d0s0
2.8 umount /a
2.9 zfs set mountpoint=legacy syspool
2.10 mount -F zfs syspool /a
2.11 edit /a/boot/grub/menu.lst and add a section for each bootable OS:

#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Ubuntu 9.10
rootnoverify (hd0,1)
chainloader +1
#---------------------END BOOTADM--------------------
#---------- ADDED BY BOOTADM - DO NOT EDIT----------
title WinXP
rootnoverify (hd0,2)
chainloader +1
#---------------------END BOOTADM--------------------
(actually you don't need the "BOOTADM" comment lines for grub's sake, but they will stop apt-clone from clobbering them later on)

2.12 umount /a
2.13 poweroff, you will probably notice that the OS writes the boot archives as it shuts down.

3) Install your other OS(s)

3.1 Install Ubuntu to sda2, put grub on sda2 (advanced tab in step 7 of ubuntu install)
3.2) Install whatever OS you wish to the other partitions, just make sure that they can be chainloaded from grub. The Storm installation is going to use the MBR.

4) You're done, when you reboot to the disk you should have a complete grub menu, and should be able to boot all of the OSs you've installed.

This is really great :)

I've put a copy up on the StormOS project wiki over at nexenta.org, could probably use a bit of editing though: http://nexenta.org/projects/stormos/wiki/Dual-booting_StormOS_and_Ubuntu...

Thanks,
Andy