Peter's Solaris Zone

Untangling the Solaris ISO Images

Sun make Solaris available for download as a set of CD ISO images. You could burn these images to CD and install from the CDs, but it's a lot easier to load the images on a server and use jumpstart to install from the network. However, this involves a little bit of work.

Here I explain how I do it. And I've done it a lot - every Solaris release (main release, updates, and beta) and Solaris Express release, for both sparc and x86. It's evolved over time, of course - downloadable iso images and lofiadm are relatively recent.

Note: While I've only just got the nv16 images, it appears that newboot no longer requires you to untangle the x86 CD1. The untangling is still required for earlier releases and for sparc, though.

This procedure requires that you already have a (recent - Solaris 9 or 10) Solaris machine of the same architecture (sparc or x86) as the target machine that you want to install, and that you've got enough space to store the ISO images and the combined jumpstart image.

You can use any Solaris machine as the install server, as long as it's got the bits needed by the installation (tftp and nfs server). But you need a sparc machine to unpack the sparc ISO, and an x86 machine to unpack the x86 ISO.

The procedure is to use lofi to turn the ISO image files into block devices, and then mount those. The snag is that the first CD has two slices on it - a regular hsfs slice, and a Solaris UFS slice. So you first need to be able to split it up into those two parts, and then mount the UFS slice. This last bit is the catch - you can only mount a Solaris UFS filesystem on a machine of the same architecture.

Splitting CD1

The first thing you need is a copy of scanufs. This is a nifty little program that reads through the ISO image looking for the signature of a UFS filesystem.

For example, I have the sparc CD1 of Nevada build 16. To find where the UFS filesystem starts, I go:

% scanufs.sparc sol-nv-b16-sparc-v1.iso 
Found ufs marker at block 495376(0x78f10)
FOUND ufs magic at block 495376
FS should start at block 495360
Found ufs marker at block 495392(0x78f20)
FOUND ufs magic at block 495392
FS should start at block 495376
^C

You'll get multiple locations reported. You only want the first one. OK, so the filesystem starts at block 495360 - this is the key number. So you then use dd to extract the ufs slice:

% dd if=sol-nv-b16-sparc-v1.iso of=sol-nv-b16-sparc-v1-s1.iso iseek=495360

There's a slight difference between the sparc and x86 layout. On sparc, the ufs filesystem is expected to be on slice 1; on x86 the ufs filesystem is on slice 0 so I would have caled the output sol-nv-b16-x86-v1-s0.iso.

Mounting up the images

Now that you have the images and have split out the ufs slice, you are ready to mount up the images.

Solaris (as of 10) comes on 4 CDs, so you need to do this for 4 CDs and for the ufs filesystem.

I have a little script dolofi that does this for me. It creates the lofi device, creates a mountpoint, mounts the filesystem, and shares it to the network. (And it prints what it does so you can do it manually if need be.) It autodetects the ufs partition assuming you use the -s1 or -s0 naming convention I mentioned earlier. It takes the (absolute path) name of the image as the first argument and a unique number as the second (this will be the lofi device number and get appended to /mnt to form the mountpoint).

root@server1# dolofi /export/SX/sol-nv-b16-sparc-v1.iso 1
mkdir /mnt1
/usr/sbin/lofiadm -a /export/SX/sol-nv-b16-sparc-v1.iso /dev/lofi/1
mount -F hsfs -o ro /dev/lofi/1 /mnt1
share -F nfs -o ro=unix_hosts,anon=0 /mnt1

root@server1# dolofi /export/SX/sol-nv-b16-sparc-v1-s1.iso 2
mkdir /mnt2
/usr/sbin/lofiadm -a /export/SX/sol-nv-b16-sparc-v1-s1.iso /dev/lofi/2
mount -F ufs -o ro /dev/lofi/2 /mnt2
share -F nfs -o ro=unix_hosts,anon=0 /mnt2

root@server1# dolofi /export/SX/sol-nv-b16-sparc-v2.iso 3
mkdir /mnt3
/usr/sbin/lofiadm -a /export/SX/sol-nv-b16-sparc-v2.iso /dev/lofi/3
mount -F hsfs -o ro /dev/lofi/3 /mnt3
share -F nfs -o ro=unix_hosts,anon=0 /mnt3

root@server1# dolofi /export/SX/sol-nv-b16-sparc-v3.iso 4
mkdir /mnt4
/usr/sbin/lofiadm -a /export/SX/sol-nv-b16-sparc-v3.iso /dev/lofi/4
mount -F hsfs -o ro /dev/lofi/4 /mnt4
share -F nfs -o ro=unix_hosts,anon=0 /mnt4

root@server1# dolofi /export/SX/sol-nv-b16-sparc-v4.iso 5
mkdir /mnt5
/usr/sbin/lofiadm -a /export/SX/sol-nv-b16-sparc-v4.iso /dev/lofi/5
mount -F hsfs -o ro /dev/lofi/5 /mnt5
share -F nfs -o ro=unix_hosts,anon=0 /mnt5

You should now have 4 hsfs filesystems and a ufs filesystem, ready to create a boot server.

Creating the install server

On my system, I download the images to my workstation, and do all the lofi tricks above there. Then I NFS mount the filesystems onto my jumpstart server (which is a Sun V65x) and run the following there.

root@server2# mkdir /mnt/s0
root@server2# mkdir /mnt/s1
root@server2# mount server1:/mnt1 /mnt/s0
root@server2# mount server1:/mnt2 /mnt/s1

This mounts the hsfs part of CD1 on /mnt/s0 and the ufs part on /mnt/s1.

If you look in the hsfs partition you'll see:

root@server2# ls -l /mnt/s0/Solaris_11/Tools/
total 208
lrwxrwxrwx   1 root     other         11 Jun  2 04:23 Boot -> ../../../s1
-rwxr-xr-x   2 root     bin        57606 May 28 00:33 add_install_client
-rwxr-xr-x   2 root     sys         1325 May 28 00:33 dial
-rwxr-xr-x   2 root     bin        19074 May 28 00:33 rm_install_client
-rwxr-xr-x   2 root     bin        27134 May 28 00:33 setup_install_server

Now you can see why we had to go through some of the hoops we have - the Boot symbolic link points off to the ufs slice.

Now create an empty directory. This (or its parent) needs to be shared readonly with root access. So, for example:

root@server2# mkdir /export/install/sx_nv16_sparc
root@server2# cd /mnt/s0/Solaris_11/Tools
root@server2# ./setup_install_server /export/install/sx_nv16_sparc

And wait a while. Then cd out and unmount the bits you've done so far.

root@server2# cd /
root@server2# umount /mnt/s0
root@server2# umount /mnt/s1

Now you can mount the other CDs and add them to the install image you're building:

root@server2# mount server1:/mnt3 /mnt
root@server2# cd /mnt/Solaris_11/Tools
root@server2# ./add_to_install_server /export/install/sx_nv16_sparc
root@server2# cd /
root@server2# umount /mnt

Then repeat this step for the 3rd and 4th image.

Once done, you should have a complete combined image of all 4 CDs.

Doing it on the local system.

The above explains the way I actually do it. For me to do the x86 image is a slightly different trick. I have to handle CD1 on the x86 server itself.

For sparc, I nfs mount the two bits of CD1 in the way they expect to be (and the way that vold mounts them if you insert a physical CD - again that only works on the right architecture). You don't have to - you can tell setup_install_server where you've put the ufs slice rather than let it follow the symbolic link. Like so:

root@server2# cd /mnt1/Solaris_11/Tools
root@server2# ./setup_install_server -s /mnt2 /export/install/sx_nv16_sparc

And then go through the other 3 CDs as before.

Setting up for net boot

For sparc systems, simply make sure the ethernet address of the machine you want to boot is in the appropriate nameservice, and:

root@server2# cd /export/install/sx_nv16_sparc/Solaris_11/Tools
root@server2# ./add_install_client client_name sun4u

(That is, unless you have something other than sun4u - older systems on older versions of Solaris might be sun4m or sun4d, while eventually you might get a sun4v system.)

Then 'boot net' at the OBP prompt on the sparc and away you go.

For x86/x64 systems you can do the same for older systems with i86pc instead of sun4u. This assumes you can boot off floppy or CD and you have older devices that have realmode drivers. Most modern systems (anything with gigabit ethernet, for example) requires PXE boot, which is slightly different.


Peter's Home | Zone Home