26th February 2010

OpenSolaris on Asus P5Q-E

I installed OpenSolaris after trying Solaris. As expected, the driver support is far better in OpenSolaris, and all my devices were immediately usable, including my network port -the only device not working on my bare bones Solaris installation-. Please have a look to my post on the Solaris installation (specially the introduction and preparation) to see my hardware description and to follow some of the explanations below.

The distribution I have installed is a preview of the next version of Solaris, named Indiana, downloaded from Genunix: more specifically, I opted for the USB Universal download for the OpenSolaris preview based on build 133, the most updated download by the end of February 2010. Please note: to be able to install OpenSolaris from USB, it is needed a running Solaris installation! If you lack such an installation, you can use some of the live CDs, like Milax, or just use the DVD installation instead.

For this installation, I will use a 640Gb hard disk, formatted in 4 partitions, as it will also hold Kubuntu and Microsoft Vista. The installation will be done from a 2 Gb USB stick. The usual wisdom is to always install Solaris last, at least, before Windows. However, I will just restore a copy of Vista from a separate partition, so I will directly install OpenSolaris first.

Partition the hard disk

My target is to divide the 640Gb hard disk in 3 fdisk partitions of the same size. Under Solaris, it will look like:

             Total disk size is 38912 cylinders
             Cylinder size is 32130 (512 byte) blocks

                                               Cylinders
      Partition   Status    Type           Start   End   Length    %
      =========   ======    ============   =====   ===   ======   ===
          1       Active    Solaris2           0  13373   13374    34
          2                 IFS: NTFS      13373  25981   12609    32
          3                 Linux native   25982  26746     765     2
          4                 Linux native   26747  38912   12166    31

(Ok, there are here 4 partitions, but the 3rd one is the swap partition for Linux, to be installed on the 4th partition)

To achieve this state, use under Solaris the command format, and let the last 3 partitions unformatted. Or better, if you can use a Linux distribution, get the previous state using cfdisk. With cfdisk, the partitions should look like:

             Size: 640135028736 bytes, 640.1 GB
    Heads: 255   Sectors per Track: 63   Cylinders: 77825

    Name   Flags   Part Type  FS Type   [Label]  Size (MB)
 -----------------------------------------------------------
    sdb1   Boot     Primary   Solaris            220001.57
    sdb2            Primary   NTFS      []       207416.89
    sdb3            Primary   Linux               12584.68
    sdb4            Primary   Linux              200129.29

Prepare the USB stick

This step requires a Solaris (or OpenSolaris) installation. No, unetbootin will not help here.

A 1 Gb USB stick is enough to hold the OpenSolaris distribution, and I used a 2 Gb stick here. The information here comes mostly from this post: OpenSolaris and Linux on One USB Stick for Dual Usage, although I used the whole USB stick to contain exclusively the Solaris distribution.

Start Solaris, and deactivate the volume management that would mount automatically the USB filesystems:

/etc/init.d/volmgt stop

Plug now the target USB stick. To see the device name associated, do:

rmformat -l

It will list something like /dev/rdsk/c3t0d0p0, associated to USB Flash Memory. This is the device name that I will use from this moment. If yours differ, change accordingly the commands below. Let's start by assigning the whole disk to solaris, and naming it (as usb-sol, for example):

fdisk -B /dev/rdsk/c3t0d0p0
rmformat -b usb-sol /dev/rdsk/c3t0d0p0

Now, it is time to create the Solaris partitions, do:

format -e

And choose the disk associated to the USB stick. The target is to reach a partitioning as:

Current partition table (original):
Total disk cylinders available: 963 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders       Size            Blocks
  0 unassigned    wm       3 - 962        1.88GB    (960/0/0) 3932160
  1 unassigned    wm       0              0         (0/0/0)         0
  2     backup    wu       0 - 962        1.88GB    (963/0/0) 3944448
  3 unassigned    wm       0              0         (0/0/0)         0
  4 unassigned    wm       0              0         (0/0/0)         0
  5 unassigned    wm       0              0         (0/0/0)         0
  6 unassigned    wm       0              0         (0/0/0)         0
  7 unassigned    wm       0              0         (0/0/0)         0
  8       boot    wu       0 -   0        2.00MB    (1/0/0)      4096
  9 unassigned    wm       0              0         (0/0/0)         0

This can be achieved with the following list of commands:

p
0
[enter]
wm
3
1.0 gb [or whichever size you prefer]
label
0
y
quit
quit

Now, the USB contains a partition ready to hold the Solaris OS distribution. We copy now the downloaded USB distribution (in my case, the file is called osol-dev-133-x86.usb) and install grub to be able to boot from the USB stick:

dd if=./osol-dev-133-x86.usb of=/dev/rdsk/c3t0d0s0 bs=16384
growfs /dev/rdsk/c3t0d0s2
installgrub -mf /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c3t0d0s0

Install OpenSolaris

Boot now using the USB stick, it will start OpenSolaris, after asking some questions about the keyboard to use. A Live OpenSolaris installation is then ready: it is possible to use it before installing it on the target drive. Among other things, it is possible to check whether the devices are supported or not. In the case of the P5Q-E motherboard + Nvidia 9800GT, everything is available, except the secondary Gigabit ethernet port (88E8001) -which could be downloaded from Marvell.

Install then the distribution into hard disk, into the first available partition. Installation goes pretty fast, less than 10 minutes in total.

Unfortunately, after reboot, GRUB reports no such partition: grub is missing. If this is the case, boot again from USB stick, open a terminal and do:

su - root

Not that the default password is opensolaris. It is needed to know the device associated to the hard disk. One way is to invoke format, just to see the available disks. In my case, it is c5t3d0, so the first partition will be c5t3d0s0. Do then:

installgrub -mf /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c5t0d0s0

Reboot without the USB stick, it should work well now.

Sleep support

My main intention after the OpenSolaris installation was to enable suspend / sleep / resume, but after the installation, OpenSolaris still won't be able to suspend. Going to the shutdown option in the Gnome menu will not show any option for suspend, and doing on a terminal:

sys-suspend

Produces the error: Suspend is not supported. Fortunately, the solution is fast, as described in this post: from the command line, do:

pfexec gedit /etc/power.conf

And include a new line:

S3-support enable

Time now to invoke the power management configuration, again from the command line:

pfexec pmconfig

Ready; we can try again:

sys-suspend

Works, great! And after rebooting, the shutdown window will have a new option suspend. However, there are still problems: after suspend, the system resumes . . . almost: the monitor does not wake up. The solution is to remove the screen saver (but still enabling monitor suspend).

Finally, to merely suspend the computer when the power button is pressed, go to the power management preferences and setup this option.

Sudo

sudo is directly available, but the required group does not exist -and the created user obviously does not belong to the unexisting group:

Edit /etc/sudoers and uncomment the line

%wheel ALL=(ALL) SETENV: ALL

Any user can now be sudoed if it is included in the wheel group. This group does not exist, let's create it:

groupadd wheel

To add a user to this group, just do (using larry as example here):

usermod -G wheel larry

It will be now needed to reboot the system.