Last year, I tried running Belenix OpenSolaris Live USB and have been wondering how to run Solaris from a live USB. I just haven't had time to play with it, but with the recent announcement of the OpenSolaris Developer Preview, I thought I'd give it a try again. Thanks, to Alan for providing me with various links on how to get the USB flash image (see here for one way), I was on my way.
I got an internal copy of a flash image and downloaded it to my Acer 3400 laptop running Solaris 10. I first tried the usbdump.sh script from Belenix, but my flash image was not an ISO image. Fortunately, a fellow blogger posted instructions on using a command called usbcopy. Unfortunately, I didn't have usbcopy on my Solaris 10 machine. So, the instructions said to use mercurial. But, I didn't have that either...
Fortunately, I could download mercurial from blastwave and after an hour or so of fiddling and downloading dependent packages (mostly due to the fact that I had run out of disk space in "/") I was able to run usbcopy.
Finally, I ran it and got:
Found the following USB devices:
Enter the number of your choice:
There were no devices listed! D'oh!
I took a look at the usbcopy command and it was parsing the output of rmformat. I ran that command by hand and it showed my Kingston 1.0 Gb USB stick:
3. Logical Node: /dev/rdsk/c4t0d0p0
Physical Node: /pci@0,0/pci1025,57@10,3/storage@3/disk@0,0
Connected Device: Kingston DataTraveler 2.0 PMAP
Device Type: Removable
But the size and bus type were missing. Hm... Now what? Well, I looked closely at the usbcopy script and found that it was just getting the logical device name and then running fdisk and format on the drive. Then, it copied the contents using dd and finally added the boot sectors with installgrub. So, I did all that by hand (I had to disable volume management first):
# svcadm disable volfs
# fdisk -B /dev/rdsk/c4t0d0p0
# format -e /dev/rdsk/c4t0d0p0
I partitioned the drive as a single root partition using the entire disk from starting cylinder 1. This is what the usbcopy script was doing, so I just copied that.
Then, I ran the dd command and about 20 minutes later it was done. I forgot to save the output of the command, but for future use, the output device was /dev/rdsk/c4t0d0s0. Then I ran the installgrub as in the usbcopy script. And I was done, but "will it blend?"
Amazingly, "YES!". I was so happy that I even attempted to explain this to my wife whose eyes began to glaze over and she immediately changed the subject... Ok. So, maybe my son is right. I am a nerd (or at least a geek).
BTW, to boot off the USB drive on an Acer 3400, you have to insert the drive before powering on the computer. Then, press the F2 key for the setup screen and select the hard drive as the boot disk. The hard drive will contain two entries: one for the hard drive and one for the flash drive. Move the flash drive above the hard drive using the F5 or F6 key. Then save and boot up.
Also, don't forget to read the release notes to get the default user and root passwords...
So, OpenSolaris booted up fine from the Live USB drive and I was surprised at how usable the performance was even running from a USB drive. It connected automatically to my router (hardwired) and I was able to get to my work email using Thunderbird. Firefox 188.8.131.52 works great. Infact, I'm typing this blog from it. Although, I noticed that the fan on my laptop keeps running. I guess there's still some issues with power, but this is a developer preview after all. I don't want to upgrade my Solaris 10 image to it just yet, but maybe soon!
Now to take this USB stick to some other laptops and see how it runs there...