RSS feed
  • How to setup NTP on OpenSolaris

    NTP is one of the best utilities for any system. It automagically corrects your time according to the ntp time servers. Here’s how to enable it on OpenSolaris:

    I would recommend doing the following commands logged in via root (sudo su -):

    cp /etc/inet/ntp.client /etc/ntp.conf
    vi /etc/ntp.conf
    

    Append the following to ntp.conf:

    server 0.pool.ntp.org
    server 1.pool.ntp.org
    server 2.pool.ntp.org
    

    Then run the following commands:

    svcadm enable svc:/network/ntp:default
    svcadm restart svc:/network/ntp:default
    

    The ‘restart’ might not be absolutely necessary, but it’s done to check everything is in order.

    If you would like to check that everything is up and running:

    svcs -a | grep ntp
    

    It should give you something similar to the following:

    online         Feb_03   svc:/network/ntp:default
    

    Enjoy your auto-updated time :)

  • OpenSolaris bugs/new things I learned

    root@FSK-Backup:~# beadm
    Traceback (most recent call last):
      File "/usr/sbin/beadm", line 41, in ?
        from osol_install.beadm.BootEnvironment import *
    ImportError: No module named osol_install.beadm.BootEnvironment
    

    To fix this run the following:

    cp /usr/lib/python2.4/vendor-packages/osol_install/beadm/__init__.py /usr/lib/python2.4/vendor-packages/osol_install/__init__.py
    

    New comands I learned:

    pkg search 'string'
    beadm list
    zfs list -t snapshot
    svcs
    svcadm
    

    I’ve been using OpenSolaris more and more while I tweak my NAS server, and I’m quite happy with how it’s setup. I wish the package manager was a little more. I’m an avid user of pacman (Arch Linux) and it’s the king of all package managers, so there is a lot to be missed in pkg.

  • Remove Open Solaris GUI

    Since I never plan to use Open Solaris as a desktop, and only as a server I grepped around for a way to remove Gnome/Xorg, and all the other little complexities that I didn’t want. It’s kinda a pain that the install CD doesn’t allow you to choose not to install the GUI. Here’s the code that I found to achieve the task of removing the GUI.

    pkg uninstall -vr `pkg list | egrep '(aac|acc|atheros|audio|avahi|compiz|evolution|firefox|flac|gamin|gnome|ipp|ipw|iwi|iwk|musicbrainz|ogg|pkg-gui|print|thunderbird|tnetd|wlan|wlan|wpa|wpi|xcursor|xorg|xscreensaver)' | awk '{print $1}'`
    

    Resources:
    Removing Gnome on OpenSolaris

  • How to create zfs stripe (pool) [NAS]

    I recently (Last night to be exact) I installed Open Solaris as my NAS/Backup Server. Why you may ask? Well I love Arch Linux yet see the *need* to start using ZFS. ZFS is freakin-fan-tastic. It’s puts the S in simple, and allows you to have a filesystem that does much more than a common file system. Such as NFS, SMB, and Compression (did I mention that this is all built in :) I’m going to go through the simple process to setup a zfs striped pool, and setup a few datasets, and apple compression.

    OpenSolaris tools I’ll cover:
    format
    zfs(1M)
    zpool(1M)

    Lets start out by finding the disks that we would like to add to the pool:

    root@Nom:~# format < /dev/null
    

    Which will look like this:

    root@Nom:~# format < /dev/null
    Searching for disks...done
    
    AVAILABLE DISK SELECTIONS:
           0. c3d0 
              /pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0
           1. c4d1 
              /pci@0,0/pci-ide@1f,2/ide@0/cmdk@1,0
           2. c5d0 
              /pci@0,0/pci-ide@1f,2/ide@1/cmdk@0,0
    Specify disk (enter its number):
    

    This shows the three disks that are present in my system. I'll break it down a little. The number you see at the beginning is the number as per the format command. Then the information in the <>'s displays a disk ID, size of the disk, and some other little tidbits for the people that care.

    What you're looking for is "c4d1" & "c5d0" which are the two Western Digital 1TB disks that I'm going to make my pool with.

    To create the pool use the zpool command:

    root@Nom:~# zpool create nom c4d1 c5d0
    

    That's it, you've now created your first zfs pool. Just to sum up what I just did, I formatted the disks, set the mountpoints, mounted the device, and now have an active zfs pool.

    If you would like to see the zpools that you currently have do the following command:

    root@Nom:/nom# zpool list
    NAME    SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
    nom    1.81T  82.5K  1.81T     0%  ONLINE  -
    rpool   149G  3.36G   146G     2%  ONLINE  -
    

    I could go ahead and add a NFS share and Compression yet, why not stay organized :) I would rather create individual file systems to store the different data that I have.

    To show what I mean I'll show you what a zfs file system is:

    root@Nom:/nom# zfs list
    NAME                       USED  AVAIL  REFER  MOUNTPOINT
    nom                       70.5K  1.78T    18K  /nom
    rpool                     4.36G   142G    72K  /rpool
    rpool/ROOT                2.37G   142G    18K  legacy
    rpool/ROOT/opensolaris    2.37G   142G  2.24G  /
    rpool/dump                1019M   142G  1019M  -
    rpool/export                59K   142G    19K  /export
    rpool/export/home           40K   142G    19K  /export/home
    rpool/export/home/fsk141    21K   142G    21K  /export/home/fsk141
    rpool/swap                1019M   143G    16K  -
    

    This command shows pools/file systems. If you look you can see my two pools (nom, rpool) and the filesystems underneath the pools (ROOT, dump, export, swap)

    I would like to create subsets like the above (File Systems)

    root@Nom:/nom# zfs create nom/backup
    

    So now if I do a zfs list I get the following:

    root@Nom:/nom# zfs list
    NAME                       USED  AVAIL  REFER  MOUNTPOINT
    nom                       97.5K  1.78T    18K  /nom
    nom/backup                  18K  1.78T    18K  /nom/backup
    rpool                     4.36G   142G    72K  /rpool
    rpool/ROOT                2.37G   142G    18K  legacy
    rpool/ROOT/opensolaris    2.37G   142G  2.24G  /
    rpool/dump                1019M   142G  1019M  -
    rpool/export                59K   142G    19K  /export
    rpool/export/home           40K   142G    19K  /export/home
    rpool/export/home/fsk141    21K   142G    21K  /export/home/fsk141
    rpool/swap
    

    Since I'm going to be backing up to this file system I would like to turn on a couple little things... To get a listing of what zfs set can set then just type 'zfs set'

    root@Nom:/nom# zfs set compression=on nom/backup
    root@Nom:/nom# zfs set sharenfs=rw nom/backup
    

    I've just setup automagical compression, along with a read/write nfs share for '/nom/backup' Now all I need to do is setup nfs on my client machine to connect to the nfs server.

    Links:
    http://www.sun.com/bigadmin/features/articles/zfs_overview.jsp
    http://blogs.sun.com/timthomas/entry/creating_zfs_file_systems_from

  • OpenSolaris | Synergy

    Recently I’ve started using OpenSolaris 2008.11 for work and play. It’s kinda a pain to get used to cause I’m so used to the linux way of doing things.

    Such as:
    Basic list all with ps:

    Linux  |  OpenSolaris
    ---------------------
    ps ax  |  ps -Af
    

    Services in OpenSolaris:

    Linux     |  OpenSolaris
    ------------------------
    service   |  svcs -a (list all services running)
    init.d    |  svcadm (to start, stop, and restart)
    rc.d      |
    

    ——

    Since linux has been my primary OS for so long, and I love . It’s really easy to setup. I compiled it both on the OpenSolaris box, and my Arch Linux box, and put the following config on both of the machines:

    /etc/synergy.conf

    section: screens
            Osol:
            Macarch:
    end
    
    section: links
            Osol:
                    left = Macarch
            Macarch:
                    right = Osol
    end
    

    Then all I have to do is run ’synergys’ on the host computer (the one with the keyboard & mouse), and synergyc 10.200.2.10 (the ip address of the host)