Tuesday Jun 23, 2009

How to share ZFS over NFS in OpenSolaris 2009.06

It might be strange, but sharing a ZFS file system over NFS in OpenSolaris can be tricky. The reason is that not all mechanisms that one might expect to work  actually work on ZFS file systems in all cases.

There are many ways to share a file system over NFS:

  1. System -> Administration -> Shared Folders - starts a graphical tool to create a share (Note: if you install OSOLvpanels-sharemgr package, the started application will be very different and more advanced)
  2. share command (see share(1M) man page)
  3. zfs command (see zfs(1M) man page) - works only on zfs datasets

Now to explain the tricky part. When I share a zfs dataset using 1) or 2) it works only if I don't specify any security attributes. As an example let's share /test directory that is backed up by a pool/test ZFS dataset. The share command now returns:

# share 
-               /test   rw   "Test"

All is fine and the /test directory is mountable by the remote hosts. Now for security reasons, I want to restrict the access to my private network subnet. If I do that using the 1) or 2) the output of the share commands get changed to following:

# share
-               /test   sec=sys,rw=@ "Test"

While the output seems to be correct, none of the hosts on the subnet can mount the /test folder with a message saying permission denied by server. This doesn't seem right. So let's try to share the /test using method 3) the zfs command:

# zfs set sharenfs=rw=@ pool/test
# share
-@pool/test    /test    sec=sys,rw=@   ""

Notice the difference in the share outputs, it now contains the @pool/test and surprisingly hosts can again mount /test and the access is restricted only to my private subnet. I've enter an OpenSolaris bug for that. Let's see when it gets some attention.

For now share ZFS filesystems over NFS with the zfs command.

Friday Jun 19, 2009

Adobe Acrobat Reader 9.1.1 for OpenSolaris (x86)

Well, just found out there is an Adobe Acrobat Reader for OpenSolaris. Go to http://get.adobe.com/reader/  and it should offer you a Solaris version, if you are using Solaris 10/OpenSolaris. Alternatively, you can get more different packaging types at ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.1.1/enu

Wednesday Mar 04, 2009

Joining a Hidden WPA2 Secured Wireless Network Using OpenSolaris 2008.11

Couple days ago I setup my new wireless router (hidden and secured by WPA2). The problem I had was that OpenSolaris 2008.11 was not able to join it. It offers to specify a network using the NWAM GUI, but strangely not the password. However there is a way, let's use dladm command.

 First you need to setup a password and then you may join the network using this password.

 # pfexec dladm create-secobj -c wpa private_key1
 # pfexec dladm connect-wifi -k private_key1 -e private_wifi iwk0

Where private_key1 is the key object (you'll be interactively asked to provide the password), private_wifi is the name of my router (ESSID), iwk0 is my wireless interface (like bge0 for ethernet). Note that the driver (iwk in my case) must support WPA2 otherwise this will not work.

Once the connect_wifi command is started the NWAM kicks in and network is configured and can be used later automatically, without typing the above commands ever again.

Worth mentioning are also show-wifi, disconnect-wifi and delete-secobj sub-commands of the dladm. For a complete reference type man dladm.

Monday Aug 11, 2008

Updating OpenSolaris (snv_86) to snv_94 Problematic

Today I tried to update OpenSolaris 2008.05 (snv_86) to the latest build snv_94. Everything went smoothly except after the reboot the gnome did not start.

I got an error message on the console that gdm service is in maintainance. Message suggested that gdm dumped core, but in fact it was Xorg. Following the issue on the opensolaris mailing list, it seems like there's something wrong with the packaging system and it might happen that incomplete files get installed. In my case Xorg amd64 binary was only 1.1MB while it should be around 2.4MB!

BTW: snv_94 includes Firefox 3, so if you're an adventurer like me, try it out right now :-)

UPDATE (Aug 14th): Now there's a script that will check and fix any corrupted packages. You can find it at http://www.opensolaris.org/os/project/pkg/pkgfix

To verify all packages do (I used '...' to shorten the output):

> pfexec pkg verify -f
PACKAGE                                             STATUS 
pkg:/SUNWPython                                      ERROR
    file: usr/lib/python2.4/ConfigParser.pyc
        Group: 'root' should be 'bin'
        Hash: e5d8daa86c36cf9c7ec51124317a7c742e059486 should be 22bf2aab02829e3f10e9e20a3552c0272b79d0a8
        file: usr/lib/python2.4/warnings.pyc
        Group: 'root' should be 'bin'
        Hash: 4babb3430440dc5232e371fe21e505cfbc5b58e5 should be 46dbc23e42c5502fcbf98b32f425f3906d4f6766
pkg:/SUNWafe                                         ERROR 
    driver: afe
        extra minor node permission '\* 0666 root sys' found in etc/minor_perm
pkg:/SUNWcs                                          ERROR 
    hardlink: etc/rc2.d/S82mkdtab
        No such path etc/rc2.d/S82mkdtab
pkg:/SUNWgnome-python-libs                           ERROR 
    file: usr/lib/python2.4/vendor-packages/cairo/__init__.pyc
pkg:/SUNWgrub                                        ERROR 
pkg:/SUNWintgige                                     ERROR 
pkg:/SUNWipkg                                        ERROR 
pkg:/SUNWipkg-gui                                    ERROR 
pkg:/SUNWmlib                                        ERROR 
    file: usr/lib/amd64/libmlib.so.2
        Unexpected Exception: failed to load dynamic section
pkg:/SUNWnge                                         ERROR 
    driver: nge
        extra minor node permission '\* 0666 root sys' found in etc/minor_perm
pkg:/SUNWpsdcr                                       ERROR 
    driver: asy
        extra minor node permission '\*,cu 0600 uucp uucp' found in etc/minor_perm
pkg:/SUNWxorg-mesa                                   ERROR 
    file: usr/X11/lib/modules/dri/amd64/r300_dri.so
        Unexpected Exception: failed to load dynamic section
pkg:/SUNWxorg-server                                 ERROR 
    file: usr/X11/bin/amd64/Xorg
        Unexpected Exception: failed to load dynamic section

As you can see several packages were corrupted, mostly python. However corrupted \*.pyc files are not really corrupted, so I've been told.

Now to fix the corrupted packages do:

  1. Download the pkgfix script
  2. Make it executable: chmod 755 pkgfix
  3. Fix corrupted packages: pfexec ./pkgfix
This might fix the problem for you, however it was not my case, since the scripts does not yet handle corrupted ELF files. I've successfully updated to snv_95 today, which resolved my problems.

Saturday Jun 28, 2008

Disabling touchpad in OpenSolaris

Well, one thing drove me crazy on the OSDEVCON when using the ASUS M50SV laptop was that both touchpad and mouse were enabled and I sometimes unintentionally moved the mouse cursor using the touchpad. That meant I suddenly continued typing on a different line. I decided to turn the touchpad off.

I first tried to see what mouse drivers do I have:

> modinfo | grep mouse
113 fffffffff7a075b8    c50 116   1  mouse8042 (PS/2 Mouse 1.48, 05/10/25)
114 fffffffff8106000   2410   -   1  vuid3ps2 (mouse events to vuid events)
136 fffffffff8284000   2e08   -   1  usbms (USB mouse streams 1.26)

Since I don't have any PS/2 ports and my mouse is USB, mouse8042 must have been the driver I wanted to get rid of. As user with root role call:

> pfexec modunload -i 113

And indeed after unloading the driver touchpad is no longer working. Cool!

This got me thinking if I can enable the touchpad again by loading the driver back in. And seems like I can:

> pfexec modload /kernel/drv/amd64/mouse8042

Touchpad works again. Unfortunately if I do unload/load again the touchpad does not start working the second time (on svn91). Nevertheless it's OK with me since I always use USB mouse.

UPDATE (Dec 1st 2008):

I was told that this only worked due to a bug. Normally the driver should be automatically reloaded when unloaded. Probably only way in later OpenSolaris builds is to prevent the driver to be loaded in the first place.

Adding following line to /etc/system file:

exclude  mouse8042

will prevent the driver named mouse8042 from being loaded when system is starting.

Tuesday Jun 24, 2008

OpenSolaris 2008.05 runs on ASUS M50SV in dual boot with Windows Vista

Today I got ASUS M50SV-AS160C laptop. Here's what it has:

  • Intel Core 2 Duo 2.4GHz
  • 4GB DDR2
  • 320GB sata HDD
  • NVIDIA GeForce 9500M GS graphics card
  • Blu-ray combo drive (reads DVDs as well)

It came with 32-bit Windows Vista. Once the Vista started it displayed only 3GB of memory! Either 32-bit Vista cannot address whole 4GBs or the graphics card takes 1GB of the memory.

Anyway nobody is interested in running Vista on it right. So I tried to get a dual boot with OpenSolaris 2008.05 working. After looking over the web for some more information of the dual boot, I found few tips and here's how I've done it:

  • Install the Windows Vista
  • From Vista click Computer->Manage, select the 320GB hdd, remove the empty DATA partition (around 150GB) and right click on the VISTA partition (around 144GB), select shrink and shrink the Vista partition as much as you want and Vista allows (in my case it was down to around 78GB). Now you should have around 216GB unallocated.
  • Go to Marvell website to download the network driver for Solaris 10 (will work in OpenSolaris) and save it for example on your USB stick.
  • Insert OpenSolaris 2008.05 liveCD and reboot
  • Once it boots and you are in the liveCD, start the installation. Create a new Solaris partition using the installer (I chose 16GBs) and finish the installation.
  • Once the installation completes. Reboot. Insert the USB stick with the network driver. Extract the archive to /tmp and as root run pkgadd -d /tmp. This should detect the uncompressed YukonX package. Answer the questions and you should get your driver working. Another reboot is needed.
  • Now you should have dual boot already working OpenSolaris listed as first and 2 windows entries. Boot to OpenSolaris and modify the menu.lst for grub to remote the second windows entry (it points to windows installation image)
  • Don't forget you still have around 200GB unallocated. Feel free to create a new ZFS partition on it :-)

That was pretty easy, right!

I encountered some minor problems, but I'll guess they'll be clarified during the OpenSolaris Developer Conference.

OpenSolaris Developer Conference 2008

Second OpenSolaris developer conference starts tomorrow in Prague, Czech Republic. For more information visit http://www.osdevcon.org/2008/


Lubomir Petrik


« April 2014