How to create a usb pendrive bootable Solaris installation media ?

Now unplug your USB pendrive.


1 ) Check that volfs is activated yes/no

 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 read only/nosetuid/nodevices/noglobal/maplcase/rr/traildot/dev=1740001 on Fri Feb 19 19:19:28 2010
/rmdisk/unnamed_rmdisk/s0 on /vol/dev/dsk/c2t0d0/unnamed_rmdisk/s0 read/write/nosetuid/nodevices/intr/largefiles/logging/xattr/onerror=panic/dev=1740002 on 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 Snow Leopard 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/s but 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 the right path to your pendrive and the proper slice (looking for the partition 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-5166/suninstall-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!

Storyboard:

I needed to install a Sun Fire V20z which has no DVDRom drive. Of course we still have many options to boot Solaris installation media (for example, I can replace the original drive with a dvd drive or setup a PXE server and Jumpstart it).

But after some searches on the Internet where not enough complete/detailled informations could be found for  "Solaris 10", I have decided to create my own bootable pendrive "how to" document which I consider quite verbose.

I am a Macbook user. To create my bootable pendrive I had to use a virtual installation of Solaris 10u8 booted from VMWare Fusion under Apple Mac OS X. I have applied all the available Solaris patches as of 18/02/2010 (but not really needed). By the way, a pendrive of 4 GB is enough.
My pendrive has 8 Giga and seems good to boot on many systems because I could use it ti install Windows or Linux in the past.

note: be sure that VMWare USB interface is made available to your Virtual host. Give it a try by inserting your pendrive so you can select it within VMWare as available interface to your Solaris install. That way you can avoid Mac OS X to mount it first under your main desktop when VMWare is already launched.

Some ressources:

Comments:

http://osholes.blogspot.com/

We did this in Sun Labs using ZFS and OpenSolaris (Indiana and up)...works quite well

Posted by Anand Gupta on February 24, 2010 at 02:46 PM CET #

Thanks you Anand. This document is specific to Solaris 10, in order to create an install media e.g in case you have no dvd drive or want to install Solaris on a netbook etc... I have seen many documents about OpenSolaris pendrive hacks but in my case I needed to install a production server. I have updated my article by adding your very interesting blog. thanks you again.

Posted by Jimmy Andriambao on February 25, 2010 at 03:23 AM CET #

What if you don't already have Solaris installed and you want it to be installed from an USB stick because your machine doesn't have a CDROM drive? Is there a way to prepare such a thing from Linux, Windows or Mac?

Posted by Magherusan Cristian on March 05, 2010 at 07:48 AM CET #

Cristian,

I had to download the Solaris DVD iso, then install it in a virtual machine (VMWare Fusion for Mac or Virtual Box) so I could run some Solaris commands and extract the files from the ISO file. Their might be a different way but you still need a shell to do so. Installing Solaris 10 in a Virtual Machine is quite quick whatever the OS hosting it (from Windows or Linux you can get the virtualization softwares too)

Posted by Jimmy Andriambao on March 05, 2010 at 08:21 AM CET #

Post a Comment:
Comments are closed for this entry.
About

Principal Systems Technologist Engineer for Oracle Global IT. Sun Microsystems software and hardware specialist. I am based in Spain but currently manage projects and systems around the world. I am very often involved to mentor the new engineers joining the forces of Oracle. I come from the Linux sysadmin world... and will be definitively thankfulness for all the great things I've been learning the past 15 years...

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today