This article (v0.1) explains and describes the steps to follow in order to create a usb pendrive (usb stick) bootable Solaris 10 operating system install media. This procedure should also work if you need to install Solaris onto your netbook or any laptop without a dvd drive.


Now unplug your USB pendrive.



1 ) Check that volfs is activated

ps -fea | grep -i vol
root 546 1 0 11:38:48 ? 0:01 /usr/sbin/vold -f /etc/vold.conf
root 1115 1106 0 11:44:39 ? 0:00 gnome-volcheck -i 30-z 3 -m cdrom,floppy,zip,jaz,dvdrom --s m-client-id default
root 1106 1 0 11:44:38 ? 0:00 gnome-volcheck -i 30-z 3 -m cdrom,floppy,zip,jaz,dvdrom --s m-client-id default
bash-3.00# ps -fea | grep -i vol
root 546 1 0 11:38:48 ? 0:01 /usr/sbin/vold -f /etc/vold.conf
root 1115 1106 0 11:44:39 ? 0:00 gnome-volcheck -i 30-z 3 -m cdrom,floppy,zip,jaz,dvdrom --sm-client-id default
root 1106 1 0 11:44:38 ? 0:00 gnome-volcheck -i 30-z 3 -m cdrom,floppy,zip,jaz,dvdrom --sm-client-id default


2 ) Disable volfs

svcadm -v disable volfs
svc:/system/filesystem/volfs:default disabled.


The Gnome daemon won't annoy you:

ps -fea | grep -i vol
root 1064 1063 0 17:11:04 ? 0:00 gnome-volcheck -i 30-z 3 -m cdrom,floppy,zip,jaz,dvdrom --sm-client-id default
root 1063 1 0 17:11:04 ? 0:00 gnome-volcheck -i 30-z 3 -m cdrom,floppy,zip,jaz,dvdrom --sm-client-id default


3 ) Now plug your usb pendrive and identity its PATH and use the rmformat command

rmformat -l
Looking for devices...
1. Logical Node: /dev/rdsk/c1t0d0p0
Physical Node: /pci@0,0/pci-ide@7,1/ide@1/sd@0,0
Connected Device: NECVMWar VMware IDE CDR10 1.00
Device Type: DVD Reader/Writer
2. Logical Node: /dev/rdsk/c2t0d0p0
Physical Node: /pci@0,0/pci15ad,790@11/pci15ad,770@4/storage@1/disk@0,0
Connected Device: USB Flash Memory PMAP
Device Type: Removable

Here you can see my Logical Node /dev/rdsk/c2t0d0p0 is the PATH to my pendrive first slice.




4 ) Let's prepare this pendrive as a new Solaris disk with one partition

fdisk -d -B /dev/rdsk/c2t0d0p0
Physical Geometry:
cylinders[3825] heads[128] sectors[32]
sector size[512] blocks[15667200] mbytes[-542]
Virtual (HBA) Geometry:
cylinders[975] heads[255] sectors[63]
sector size[512] blocks[15663375] mbytes[-543]
About to write fdisk table:
SYSID ACT BHEAD BSECT BEGCYL EHEAD ESECT ENDCYL RELSECT NUMSECT
191 128 65 2 0 60 45 975 4096 15663104
100 0 0 0 0 0 0 0 100 100
100 0 0 0 0 0 0 0 100 100
100 0 0 0 0 0 0 0 100 100

fdisk man page states the following about -B parameter:

-B

Default to one Solaris partition that uses the whole
disk. On an x86 machine, if the disk is larger than 2 TB
(terabytes), the default size of the Solaris partition
will be limited to 2 TB.

Now we have the following layout with fdisk (by issuing: fdisk -d /dev/rdsk/c2t0d0p0)

Cylinders
Partition Status Type Start End Length %
========= ====== ============ ===== === ====== ===
1 Active Solaris2 1 3824 3824 100

Note that the type is Solaris2 by default. This is good.


5 ) ask Solaris to recheck and clean the devices

devfsadm -v
devfsadm[1385]: verbose: symlink /dev/cfg/usb0/1 -> ../../../devices/pci@0,0/pci15ad,790@11/pci15ad,1976@3:1
devfsadm[1385]: verbose: symlink /dev/cfg/usb0/2 -> ../../../devices/pci@0,0/pci15ad,790@11/pci15ad,1976@3:2
devfsadm[1385]: verbose: symlink /dev/usb/hub0 -> ../../devices/pci@0,0/pci15ad,790@11/pci15ad,1976@3:hubd
devfsadm[1385]: verbose: symlink /dev/cfg/usb1/1 -> ../../../devices/pci@0,0/pci15ad,790@11/pci15ad,770@4:1
devfsadm[1385]: verbose: symlink /dev/cfg/usb1/2 -> ../../../devices/pci@0,0/pci15ad,790@11/pci15ad,770@4:2
devfsadm[1385]: verbose: symlink /dev/cfg/usb1/3 -> ../../../devices/pci@0,0/pci15ad,790@11/pci15ad,770@4:3
devfsadm[1385]: verbose: symlink /dev/cfg/usb1/4 -> ../../../devices/pci@0,0/pci15ad,790@11/pci15ad,770@4:4
devfsadm[1385]: verbose: symlink /dev/cfg/usb1/5 -> ../../../devices/pci@0,0/pci15ad,790@11/pci15ad,770@4:5
devfsadm[1385]: verbose: symlink /dev/cfg/usb1/6 -> ../../../devices/pci@0,0/pci15ad,790@11/pci15ad,770@4:6
devfsadm[1385]: verbose: symlink /dev/usb/hub1 -> ../../devices/pci@0,0/pci15ad,790@11/pci15ad,770@4:hubd

you can run "devfsadm -v -C" but if it gives no output it is because previous command would have done its job already


6 ) Now, lets create the new pendrive layout

Knowing you have 8 Giga pendrive you'll need to create a text file to describe the new layout of your Solaris partition so rmformat can process it.

the file will be named "slices" (as you wish). Here is a known working layout:

----------- content of the "slices" text file:

slices: 0 = 2MB, 6990MB, "wm", "root" :
1 = 0, 1MB, "wu", "boot" :
2 = 0, 7000MB, "wm", "backup"
------------

now execute rmformat using your "slices" input file.

rmformat -s ./slices /dev/rdsk/c2t0d0p0

ask again Solaris to recheck and clean the devices tree:

devfsadm; devfsadm -C


7 ) And finally create the file system on the single slice:

newfs /dev/rdsk/c2t0d0s0

newfs: construct a new file system /dev/rdsk/c2t0d0s0: (y/n)? y
/dev/rdsk/c2t0d0s0: 14315520 sectors in 2330 cylinders of 48 tracks, 128 sectors
6990.0MB in 146 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
13370400, 13468832, 13567264, 13665696, 13764128, 13862560, 13960992,
14059424, 14157856, 14256288




8 ) How to copy the Solaris install files to the pendrive?

now insert your Solaris DVDRom or mount its ISO (using lofiadm) . Also mount your usb pendrive.

tip: just restart volfs which will mount both medias at the same time.

svcadm -v enable volfs

your pendrive should be available and mounted too.

This is the output of "mount" command. You can see where are my Solaris Media and pendrive mounted:

/cdrom/sol_10_1009_x86 on /vol/dev/dsk/c1t0d0/sol_10_1009_x86 readonly/nosetuid/nodevices/noglobal/maplcase/rr/traildot/dev=1740001 onFri Feb 19 19:19:28 2010
/rmdisk/unnamed_rmdisk/s0 on /vol/dev/dsk/c2t0d0/unnamed_rmdisk/s0read/write/nosetuid/nodevices/intr/largefiles/logging/xattr/onerror=panic/dev=1740002on Fri Feb 19 19:19:30 2010


the output of "df -h" is as follow:

/vol/dev/dsk/c1t0d0/sol_10_1009_x86
2.4G 2.4G 0K 100% /cdrom/sol_10_1009_x86
/vol/dev/dsk/c2t0d0/unnamed_rmdisk/s0
6.7G 6.8M 6.6G 1% /rmdisk/unnamed_rmdisk/s0

you may know that /rmdisk/unnamed_rmdisk/s0 points to /rmdisk/rmdisk0/s0

So now we will just copy the full content of our DVD media to the pendrive mounted file system:
Destination is /rmdisk/rmdisk0/s0

Enter into the dvdrom path (cd) and use cpio to copy the whole content:

cd /cdrom/sol_10_1009_x86/
find . | cpio -pdum /rmdisk/rmdisk0/s0/

5116192 blocks


it tooks exactly 30 minutes to copy all the files to the pendrive. It's not that bad knowing we had run it on a virtual

system hosted under Mac OS X and the dvd drive itself is also emulated(pointing to the true iso file located somewhere else in my SnowLeopard Desktop!).



------------------ tips:
I believe it might be quicker transfer by using the tar command:
cd /cdrom/sol_10_1009_x86 && tar -cf - . | (cd /rmdisk/rmdisk0/s0/ && tar -xpvf -)

of course you can use basic "cp" command this way:
cd /cdrom/sol_10_1009_x86 ; cp -rP@ .??* * /rmdisk/rmdisk0/s0
-----------------

by the way, here is the content of the root of your media dvd rom:

pwd
/cdrom/sol_10_1009_x86

ls -lsha
total 1007
8 dr-xr-xr-x 2 root sys 4.0K Sep 17 00:31 .
3 drwxr-xr-x 3 root nobody 4 Feb 19 19:19 ..
4 -r--r--r-- 1 root root 2.0K Sep 17 00:31 .catalog
1 -r--r--r-- 1 root root 68 Aug 21 2009 .cdtoc
4 dr-xr-xr-x 5 root root 2.0K Sep 17 00:31 .install
1 lr-xr-xr-x 1 root root 33 Sep 17 00:30 .install_config -> ./Solaris_10/Misc/.install_config
1 -r--r--r-- 1 root root 388 Aug 21 2009 .slicemapfile
1 -r--r--r-- 1 root root 20 Aug 21 2009 .volume.inf
1 -r--r--r-- 1 root root 27 Sep 17 00:16 .volume.inf.1
1 -r--r--r-- 1 root root 27 Sep 17 00:17 .volume.inf.2
1 -r--r--r-- 1 root root 22 Sep 17 00:15 .volume.inf.3
1 -r--r--r-- 1 root root 22 Sep 17 00:15 .volume.inf.4
1 -r--r--r-- 1 root root 22 Sep 17 00:16 .volume.inf.5
13 -r--r--r-- 1 root root 6.4K Aug 21 2009 Copyright
953 -r--r--r-- 1 root root 476K Aug 21 2009 JDS-THIRDPARTYLICENSEREADME
4 dr-xr-xr-x 2 root root 2.0K Sep 17 00:30 License
4 dr-xr-xr-x 7 root root 2.0K Sep 17 00:31 Solaris_10
4 dr-xr-xr-x 5 root root 2.0K Sep 17 00:31 boot
1 -r-xr-xr-x 1 root root 257 Sep 17 00:16 installer


9 ) it's not enough, last step is to make this pendrive bootable by installing a bootloader:

first lets unmount the f/s pendrive: (it might also be good to disable volfs)

umount /vol/dev/dsk/c2t0d0/unnamed_rmdisk/s0
or
umount /rmdisk/unnamed_rmdisk/s0

note: we let the pendrive plugged to the system!

then we use the grub files from our Solaris current installation and install the bootloader:

cd /boot/grub/
/sbin/installgrub ./stage1 ./stage2 /dev/rdsk/c2t0d0s0


Now you can reboot your VMWare guest (I used "PLoP Boot Manager" iso to boot the pendrive from within Fusion)
--otherwise-- give it a try to any true physical system! e.g your own PC.

I have successfully installed a Sun Fire V20z (AMD Opteron processors)in less than 30 minutes from booting into my pendrive! so sweet!




10 ) Once we have booted our usb pendrive ?




be patient when loading the pendrive, the kernel takes time to show up because the loading is slow from a usb perspective.

The first stages of the installation will appear and you can already answer some of the basic questions.

Obviously the installer would search for the install media content from /cdrom path and won't find its contents.


So once you get into the shell, just mount the proper path to the install media:
mount -o ro /dev/dsk/c0t0d0s0 /cdrom




Note that the rmformat utility is not in the installer x86.miniroot f/sbut in my case, c0t0d0s0 was my usb pendrive once it had booted.
For sure you will have to give it some tries before you can get theright path to your pendrive and the proper slice (looking for thepartition where is located the Solaris install files).




Go into /cdrom:
cd /cdrom

and relaunch the installer:
install-solaris (see http://docs.sun.com/app/docs/doc/816...tall-1m?a=view)



Solaris will install like a charm. I have noticed that some X11 related packages could not be installed properly.

You can check the install log (in /var/sadm/) and fix yourself the issue (by installing manually each packages) in case you have a need of a graphical interface.




Enjoy!







Some ressources:

USB FAQ
http://www.sun.com/io_technologies/usb/USB-Faq.html
http://www.cyberciti.biz/faq/mount-a...-solaris-unix/

Solaris 10 Installation Guide: Basic Installations
http://docs.sun.com/app/docs/doc/817-0544

Flash Archive
http://it.toolbox.com/wiki/index.php..._flash_archive

Boot from USB disk / pendrive
http://blogs.sun.com/timc/entry/inst...ris_from_a_usb
http://blogs.sun.com/PotstickerGuru/...e_boot_install







More...