Faster/Cheating installation method for OpenSolaris 2008.05 via network

Faster/Cheating installation method for OpenSolaris 2008.05 via network - English

When I wrote Installing OpenSolaris 2008.05 without CD/DVD nor network - English about month ago (already a month!), I mentioned about having new idea on installing OpenSolaris. Since ZFS are so much powerful and flexible, I thought I can cheat installation process by using the "zfs send" image. I have tried one desktop machine (Sun W1100z) and one notebook PC (Panasonic CF-W5), and so far found no major issues (but some).

When you install OpenSolaris 2008.05, especially "All language" version, it does takes while isn't it? Just measuring about CD image copy phase took more than full hour on CF-W5, and more than 40 minutes for W1100z. It is still just single CD, but compressed. For CF-W5, its more likely depend on the CPU speed than disk or CD drive. At same time, "zfs recv" seems to be efficient and fast, even on the notebook PC. This is where my idea came from.

Here is my cheat process:

  • Create "zfs send" image. When installing the OpenSolaris 2008.05 from CD. final step are click "Reboot" button. Stop there, and do:
    jack@opensolaris:~$ pfexec su jack@opensolaris:~# zfs send -R rpool@install | ssh someotherhost -l loginname "dd of=path_to_file bs=1024k"
    If you already has installed machine (which has not destroy the @install snapshot), you can do the same on that machine as well.
  • Prepare the target machine. As normal install process, boot the machine via LiveCD/InstallCD of OpenSolaris 2008.05.
  • Instead of click on install button, bring up the terminal window. And type:
    jack@opensolaris:~$ pfexec su jack@opensolaris:~#
    which gives you the root access to the system (so be careful).
  • Using format(1M) command to prepare the target disk/partition. Following are example from CF-W5
    format> fdisk Total disk size is 9729 cylinders Cylinder size is 16065 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === 1 Other OS 0 254 255 3 2 IFS: NTFS 255 4629 4375 45 3 Active Solaris2 4629 8714 4086 42 SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 6 format> p PARTITION MENU: 0 - change `0' partition 1 - change `1' partition 2 - change `2' partition 3 - change `3' partition 4 - change `4' partition 5 - change `5' partition 6 - change `6' partition 7 - change `7' partition select - select a predefined table modify - modify a predefined partition table name - name the current table print - display the current table label - write partition map and label to the disk ! - execute , then return quit partition> p Current partition table (original): Total disk cylinders available: 4084 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 root wm 262 - 4083 29.28GB (3822/0/0) 61400430 1 swap wu 1 - 261 2.00GB (261/0/0) 4192965 2 backup wu 0 - 4083 31.29GB (4084/0/0) 65609460 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 0 0 (0/0/0) 0 5 unassigned wm 0 0 (0/0/0) 0 6 unassigned wm 0 0 (0/0/0) 0 7 unassigned wm 0 0 (0/0/0) 0 8 boot wu 0 - 0 7.84MB (1/0/0) 16065 9 unassigned wm 0 0 (0/0/0) 0 partition>
  • Move /opt by type:
    jack@opensolaris:~$ mv /opt /opt-
    "zfs recv" wants mount the just received zfs file system, but if conflict, its stop right there. Moving /opt to avoid this.
  • Create rpool and run the "zfs recv" as:
    jack@opensolaris:~# zpool create -f yourdisk(such as c5d0s0) jack@opensolaris:~# ssh someotherhost -l loginname "dd if=path_to_file bs=1024k" | zfs recv -Fvd rpool
  • Rollback to @install time image, and mount the root partiton:
    jack@opensolaris:~# zfs rollback rpool@install jack@opensolaris:~# zfs rollback rpool/ROOT@install jack@opensolaris:~# zfs rollback rpool/ROOT/opensolaris@install jack@opensolaris:~# mkdir /a jack@opensolaris:~# mount -F zfs rpool/ROOT/opensolaris /a
  • swap partition are still hard coded into the vfstab, comment out the swap partition from /a/etc/vfstab.
  • Run following magic sequence (\^ \^;).
    jack@opensolaris:~# cp /etc/zfs/zpool.cache /a/etc/zfs/ jack@opensolaris:~# cp /etc/path_to_inst /a/etc jack@opensolaris:~# /sbin/install-finish /a cd jack@opensolaris:~# installgrub -m /a/boot/grub/stage1 /a/boot/grub/stage2 /dev/rdsk/$1 <<. y . jack@opensolaris:~# umount /a
    Seriously, I don't exactly know what install-finish script does, but without this, menu.lst will not have other than Solaris (in case of my CF-W5, Windows Vista). Also, zpool.cache seems to do some trick as well.
  • Reboot by reboot!
    jack@opensolaris:~# reboot
    and while rebooting, taking out the liveCD/InstallCD to make sure boot from hard disk.
This is basically the my cheat install process. Start from "zpool create" to "umount /a", it takes less than 5 minutes on both W1100z and CF-W5 using fast ethernet (not Giga) from Sun X4200 server. I also uploaded above as script at here. You have to modify the script for "ssh" command line.

System should boot fine, but there are few things need to be fixed.

  • keyboard layout. Your keyboard layout might be screwed up. Check to see your keyboard works as expected (in case of the Japanese/English, try press "@"). If does not work as it should, try "kbd -s". When you choose correct layout, copy the English letter name for the layout (such as "US-English"). And add line into the /etc/default/kbd file as:
    Need reboot to take effect.
  • swap. As above process taking out the swap partition from vfstab, you need fix the vfstab file. Originally, I thought this can be done before the reboot, but CF-W5 some how came up with different device path name for the harddisk (when booted from LiveCD, it was c5d0s0, after the reboot, it became c6d0s0). I took this process for just in case. Need reboot to take effect.
  • dumpadm. You may see the error message when you run the install-finish script about dumpadm. If you need to configure the dump (memory dump upon system crash), please do so with dumpadm(1M) command.
This is the list of issue I came across so far.

Obviously this isn't supported way of installing OpenSolaris 2008.05, and if you are installing just one machine once, this isn't interested. But for the testing or need to install bunch of machine, this might help you. It is so much faster!.


Thanks. I am going to try it.

Posted by W. Wayne Liauh on 8月月 12日, 2008年 at 07:32 午後 JST #

Great, would you mind to share your result?

Posted by ako on 8月月 13日, 2008年 at 03:17 午前 JST #




« 7月 2016