火曜日 8 12, 2008
火曜日 8 12, 2008
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:
If you already has installed machine (which has not destroy the @install snapshot), you can do the same on that machine as well.jack@opensolaris:~$ pfexec su jack@opensolaris:~# zfs send -R rpool@install | ssh someotherhost -l loginname "dd of=path_to_file bs=1024k"
which gives you the root access to the system (so be careful).jack@opensolaris:~$ pfexec su jack@opensolaris:~#
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>
"zfs recv" wants mount the just received zfs file system, but if conflict, its stop right there. Moving /opt to avoid this.jack@opensolaris:~$ mv /opt /opt-
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
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
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.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
and while rebooting, taking out the liveCD/InstallCD to make sure boot from hard disk.jack@opensolaris:~# reboot
System should boot fine, but there are few things need to be fixed.
Need reboot to take effect.LAYOUT=Your_keyboard_layout_name
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月月 13日, 2008年 at 02:32 午前 JST #
Great, would you mind to share your result?
Posted by ako on 8月月 13日, 2008年 at 10:17 午前 JST #