Indiana Preview 2: Installing to a 4GB CF card

Tim Foster of Sun Ireland wrote up this concise summary of installing the latest OpenSolaris Indiana Preview 2 on a CompactFlash card:

Hi Brian,

On Mon, 2008-02-18 at 13:44 +0000, Brian Nitz wrote:

> I wonder if you can post or blog the steps you took to accomplish this 

> and what exactly you accomplished (I assume it isn’t specific to the eePC?)

Sure, it was pretty straightforward actually, providing your machine is able to boot from the target device [ these steps won’t provide bios support where there was none before! ]

Here’s what you need in order to boot from an alternate pool, “tank” in the steps below, all done as the root user.

1. Install Indiana on a big disk, giving you a pool called “rpool” – I used an external USB hard disk.

2. Reboot the system as normal, from rpool

3. Take a recursive snapshot of this:

    # zfs snapshot -r rpool@snap

4. Create a pool on the device you want to boot from

    # zpool create tank c8t0d0s0

Obviously your device will differ.

Note that this needs to be a SMI labeled disk: run “format -e ” and use fdisk to determine that you definitely have a Solaris partition, and use ‘l’ within format to label the disk.

If you want to swap to that disk, remember to assign a slice for swap [ given that I only had a 4gb SD card, but 2gb of ram, I didn’t really need swap, and couldn’t afford to dedicate space for swap/dump on the target disk]

5. Send the snapshot to the target pool

    # zfs send -R rpool@snap | zfs recv -Fd tank

You’ll probably get warnings about not being able to mount /export/home or /opt – given that these are already mounted from rpool.

If you want the target pool to have compressed filesystems, you need to set this on the source filesystems *before* issuing the zfs send command, (zfs filesystem properties get copied over, along with the sendstream) so “zfs set compression=on rpool/ROOT/preview2” – obviously that’ll only affect new blocks written to rpool, but doing so will cause all new blocks on tank to get compressed when you send those snap shotstreams over to the other pool.

6. Fix up etc/vfstab entries, set the bootfs property on tank and install grub

    # mkdir /tmp/a

    # mount -F zfs tank/ROOT/preview2 /tmp/a

    # vi /tmp/a/etc/vfstab(edit swap and the entry for “/”)

    # zpool set bootfs=tank/ROOT/preview2 tank

    # installgrub /tmp/a/boot/grub/stage1 /tmp/a/boot/grub/stage2 /dev/rdsk/c8t0d0s0

    # bootadm update-archive -R /tmp/a

    # reboot

7. Set your bios to boot from your new target device, or remember to jump into the boot-device selection dialog from your bios screen.

I think that’s all I did – anyone else, feel free to point out any steps I’ve missed!

cheers,

tim  

 

 

2 thoughts on “Indiana Preview 2: Installing to a 4GB CF card”

  1. Thanks for the clear and simple instructions. I wanted to ask about memory wear avoidance, since you’re writing on flash media.

    If this was Linux, I’d probably make the root volume read-only and send changes to an overlay (unionfs) partition, which can be explicitly disabled temporarily when I want to write to it.

    Is there a similar solution for Solaris in this regard?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.