Mounting Solaris CDROMs

So you've shelled out $20 for downloading the solaris ISO images... and you suddenly realize you dont have a CDROM burner. You now have a slight problem, because using the normal "mount a file as a filesystem" trick, only works for the first filesystem in that file.

Happily, there is a workaround that you can try.

To turn a solaris 9 "cd 1 of 1" into two mountable filesystems, do the following:

 [first make sure you have 500 megs free in /tmp, or adjust dd command
     below to somewhere with more space. Then...]
 mkdir /mnt/s0 /mnt/s1
 lofiadm -a cd1.iso
 mount -o ro -F hsfs /dev/lofi/1 /mnt/s0
 df -k /dev/lofi/1 |tail -1 |awk '{print $2}'
 dd if=cd1.iso of=/tmp/cd1.s1.img bs=1k iseek=(number from prev line)
 lofiadm -a /tmp/cd1.s1.img
 mount -o ro -F ufs /dev/lofi/2 /mnt/s1 
 
Note that because the filesystem type is ufs made on sparc, you can only mount it directly on a sparc. You can now run /mnt/s0/Solaris_9/Tools/setup_install_server. This has been shown to work with sol9 FCS, but not neccessarily later releases.

An alternate method, that only works on the SAME ARCHITECTURE OF THE CDROM IMAGE (sparc for sparc, x86 for x86), will be:

 [first, download and compile scanufs.c]
 scanufs cd1.iso
 [Note which block it says the filesystem starts at]
 dd if=cd1.iso of=/tmp/cd1.s1.img iseek=(number from prev command)
 lofiadm -a /tmp/cd1.s1.img
 mount -o ro -F ufs /dev/lofi/2 /mnt/s1 
Use the FIRST location reported. Following locations will be phantoms because of backup copies of the filesystem "superblock".

Note on mounting the DVD: you may want to have
set hsfs:nhsnode=7256
in /etc/system to work around a filesystem driver bug.

Update for Solaris 10 !!

I have been informed that the latest Solaris 10 DVDs.. are at last (once again?!) a single hsfs filesystem. So there is no longer a need for the above tricks for current versions of Solaris. Hopefully, Sun will stick to the nice simple formula again from here on in :-)
However... "cdrom" images for Solaris 10,update2, still need this trick. The sparc offset would appear to be block 528640
# Sample of what to do with newer images...
lofiadm -a /path/to/sol10dvd.iso
mount -o ro -F hsfs -o ro /dev/lofi/1 /mnt/cdrom


Written by: Philip Brown
Bolthole Top - Solaris Top - Search Bolthole.com