This example works when the automounter is disabled on Solaris 10.
Alternatively, you can enable it or better: use HAL which replaces the automounter on Solaris Express build 47 and newer.
With the automounter, you may have to restart the daemon if the disk isn't detected when inserted (/etc/init.d/volmgt stop; /etc/init.d/volmgt start).
With HAL, just plug the disk in and it will be mounted on /media/<disk name> , much simpler.
In all cases, don't forget to unmount the disk before unplugging it with the "eject" command, especially if you have written something on it.