RSS feed
  • Static IP OpenSolaris

    Posted on November 23rd, 2009 Jonny Gerold No comments

    Setting a static IP in OpenSolaris is similar to Linux, but yet again; differences arise…

    vi /etc/resolve.conf (make sure dns is correct [nameserver 10.0.0.1]
    vi /etc/nwam/llp [change 'gani0 dhcp' to 'gani0 static 10.0.0.100' where gani0 is your interface, and 10.0.0.100 is the ip address you would like to assign]
    # restart network
    vi /etc/defaultrouter (add your router '10.0.0.1')
    svcadm enable svc:/network/physical:default
    svcadm restart svc:/network/physical:nwam
    

    This is a quickie but a goodie…

    Resources:

    http://briancline.org/read/file_server_3_tweaking_opensolaris

  • Install VirtualBox in OpenSolaris

    Posted on November 23rd, 2009 Jonny Gerold No comments

    Virtualbox is awesome, and I think I might go with an all inclusive OpenSolaris server in the future. One that runs zfs, and all my NFS storage needs, but also has virtual machines for the other servers that I would like to run.

    Here is how to install VirtualBox on Opensolaris:

    Get the latest version from here: http://www.virtualbox.org/wiki/Downloads

    wget http://download.virtualbox.org/virtualbox/3.0.12/VirtualBox-3.0.12-54655-SunOS.tar.gz
    tar -xzf VirtualBox-3.0.12-54655-SunOS.tar.gz
    pkgadd -d VirtualBoxKern-3.0.12-54655.pkg</pre>
    pkgadd -d VirtualBox-3.0.12-54655.pkg
    
  • Twitter Weekly Updates for 2009-11-22

    Posted on November 22nd, 2009 Jonny Gerold No comments
    • just finished Robinson Crusoe, it was a good book. #
    • damn, working on NAS, and forgot to label the drives when I moved them to a new case. Now I have to figure out which drive goes where… Meh #
    • meh, that took forever (zpool export & import) cleared the errors… #
    • CLICK<CLICK>CLICK<CLICK> The sound of data moving rapidly. I'm moving to my new NAS, have like 2.4TB's left to transfer :) #
    • screw rge0, gani ftw http://homepage2.nifty.com/mrym3/taiyodo/eng/ #
    • root@FSK-Backup:/ambry/Media/Backups/minifsk# rm -r .wine
      has been running for about 20 minutes now, because I recursed my home dir in it :( #
  • Gani Network Driver

    Posted on November 22nd, 2009 Jonny Gerold No comments

    Earlier today I came across a giant snag with my new NAS. After about 3GB of network throughput (under high load), the network stack would quit, and meh…
    So I went to my trusty friend Google (how did people ever live without this), and ended up finding out that Masayuki Murayama’s ‘gani’ driver works great, and have had my network at heavy load for the past 6 or so hours with no problems what-so-ever…

    You can get all his drivers here: http://homepage2.nifty.com/mrym3/taiyodo/eng/

    This is a valuable link, I have used his drivers before for my first board in this ever stressful NAS setup. Anywho the install was very straightforward (make, make install, reboot), and everything is working wonderfully ever since.

  • ZFS Dedup | OpenSolaris repos | beadm

    Posted on November 22nd, 2009 Jonny Gerold No comments

    DEDUP IS AMAZING. Can’t wait to try it out, but I’m waiting for my system to upgrade from the dev repository, err, I might just hold off cause it’s taking forever. Maybe I’ll play with it in a VM, instead of my Home NAS :*
    Anywho please read up on it here: http://blogs.sun.com/bonwick/entry/zfs_dedup

    It’s an amazing technology, and I’m super happy that it’s finally out.

    ——

    Just in case you want to upgrade 111b to 127, or just have the most up to date packages try the following:

    pkg set-publisher -O http://pkg.opensolaris.org/dev "opensolaris.dev"
    pkg set-publisher -P opensolaris.dev
    

    Now when you look at your repos, dev is default or ‘preferred’

    fsk141@TrayNAS:/mnt$ pkg publisher
    PUBLISHER                             TYPE     STATUS   URI
    opensolaris.dev          (preferred)  origin   online   http://pkg.opensolaris.org/dev/
    opensolaris.org                       origin   online   http://pkg.opensolaris.org/release/
    

    ——

    As I work with OpenSolaris I am continually amazed, and pissed off at the same time. Where some things are insanely simple and straightforward. Other things are tedious, and hard because of my Linux background. Another thing that I am letdown is the lack of community like Arch Linux. There is a very large OpenSolaris community, but not in the sense of packages, and a lot is left to you (as in manually compile)
    ——

    One of the difficult concepts to grasp is the boot environment concept. It’s kinda like a snapshot of sorts for your boot environment. Since OpenSolaris isn’t a rolling distro like Arch Linux, there are different revisions. Well instead of forcing some difficult reinstall you can simply ‘pkg image-update’ and upon your next reboot you have your new environment. You also have the ability to easily revert.

    fsk141@TrayNAS:/mnt$ beadm list
    BE             Active Mountpoint Space   Policy Created
    --             ------ ---------- -----   ------ -------
    TrayNAS_Nov_21 -      -          304.15M static 2009-11-21 15:53
    opensolaris    -      -          7.57M   static 2009-10-16 08:19
    opensolaris-1  NR     /          3.62G   static 2009-11-22 01:44
    
    fsk141@TrayNAS:/mnt$ beadm destroy TrayNAS_Nov_21
    Are you sure you want to destroy TrayNAS_Nov_21? This action cannot be undone(y/[n]): y
    

    beadm is a great tool to modify your BE, and I love the simplicity in the BE scheme.

  • Speed up Open Solaris Boot (Fix Slow Boot)

    Posted on November 22nd, 2009 Jonny Gerold No comments

    It’s so annoying to wait 5+ minutes for Open Solaris to boot. Come to find out it’s because of the stupid graphical boot on startup. Damn gui’ness

    1) Fix Grub menu.lst

    • Edit /rpool/boot/grub/menu.lst
    • Comment the following
    splashimage
    foreground
    background
    
    • Remove ‘console=graphics’ from the ‘kernel’ line

    You should end up with something like this:

    
    splashimage /boot/grub/splash.xpm.gz
    background 215ECA
    timeout 30
    default 2
    #---------- ADDED BY BOOTADM - DO NOT EDIT ----------
    title OpenSolaris 2009.06
    findroot (pool_rpool,0,a)
    bootfs rpool/ROOT/opensolaris
    #splashimage /boot/solaris.xpm
    #foreground d25f00
    #background 115d93
    #kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics
    kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
    module$ /platform/i86pc/$ISADIR/boot_archive
    #---------------------END BOOTADM--------------------
    title TrayNAS_Nov_21
    findroot (pool_rpool,0,a)
    bootfs rpool/ROOT/TrayNAS_Nov_21
    kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
    module$ /platform/i86pc/$ISADIR/boot_archive
    #============ End of LIBBE entry =============
    title opensolaris-1
    findroot (pool_rpool,0,a)
    bootfs rpool/ROOT/opensolaris-1
    #splashimage /boot/solaris.xpm
    #foreground d25f00
    #background 115d93
    #kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics
    kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
    module$ /platform/i86pc/$ISADIR/boot_archive
    #============ End of LIBBE entry =============
    

    Resources:

  • ZFS Pool (Setup & Configure)

    Posted on November 21st, 2009 Jonny Gerold No comments

    ZFS is the best option for a NAS system. It makes for a super simple home NAS, and does away with a lot of config hassles. This is due to the fact that a lot of core services are built into zfs, or into the zfs stack rather. To setup any “extra” of zfs, all you need is a one line zfs command. (zfs set sharenfs=on <pool> == instant nfs share)

    1) Create the Pool

    We need to fetch the disk ID’s (the number after the disk number)

    format &amp;lt;/dev/null
    

    So if we run that command I can pull out (c8d0 c8d1 c9d0 c9d1) as shown below:

    root@TrayNAS:~# format &amp;lt;/dev/null
    
    Searching for disks...done
    
    AVAILABLE DISK SELECTIONS:
    0. c7d0 &amp;lt;DEFAULT cyl 3904 alt 2 hd 128 sec 32&amp;gt;
    /pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0
    1. c8d0 &amp;lt;DEFAULT cyl 60797 alt 2 hd 255 sec 252&amp;gt;
    /pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0
    2. c8d1 &amp;lt;DEFAULT cyl 60798 alt 2 hd 255 sec 189&amp;gt;
    /pci@0,0/pci-ide@1f,2/ide@0/cmdk@1,0
    3. c9d0 &amp;lt;DEFAULT cyl 60798 alt 2 hd 255 sec 189&amp;gt;
    /pci@0,0/pci-ide@1f,2/ide@1/cmdk@0,0
    4. c9d1 &amp;lt;DEFAULT cyl 60798 alt 2 hd 255 sec 189&amp;gt;
    /pci@0,0/pci-ide@1f,2/ide@1/cmdk@1,0
    Specify disk (enter its number):
    

    Take the extracted disk ID’s (c8d0 c8d1 c9d0 c9d1) and apply them to the next command. Edit accordingly depending on what pool type you would like. (mirror, raidz1, raidz2)

    
    zpool create -f ambry raidz1 c8d0 c8d1 c9d0 c9d1
    

    I had to use -f because I have 3x 1.5TB drives, and one 2TB drive…

    Now that we have the pool created, lets marvel at what we accomplished:

    
    root@TrayNAS:~# zpool list ambry
    NAME    SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
    ambry  5.44T   137K  5.44T     0%  ONLINE  -
    root@TrayNAS:~# zfs list ambry
    NAME    USED  AVAIL  REFER  MOUNTPOINT
    ambry  95.8K  4.00T  28.4K  /ambry
    

    The difference in size is just one of those little quirks (zpool == raw disks, zfs == real space)

    Another check just to make sure were all good, and using raidz1 (1 parity disk)

    root@TrayNAS:~# zpool status ambry
      pool: ambry
     state: ONLINE
     scrub: none requested
    config:
    
    	NAME        STATE     READ WRITE CKSUM
    	ambry       ONLINE       0     0     0
    	  raidz1    ONLINE       0     0     0
    	    c8d0    ONLINE       0     0     0
    	    c8d1    ONLINE       0     0     0
    	    c9d0    ONLINE       0     0     0
    	    c9d1    ONLINE       0     0     0
    
    errors: No known data errors
    

    Everything looks good, lets setup some filesystems, sharing, compression, and copy over our data…

    For the rest of the write up, I’ll just output the commands I used to create my environment:

    root@TrayNAS:~# zfs create ambry/Media
    root@TrayNAS:~# zfs create ambry/Downloads
    root@TrayNAS:~# zfs list | grep ambry
    ambry                       176K  4.00T  31.4K  /ambry
    ambry/Downloads            28.4K  4.00T  28.4K  /ambry/Downloads
    ambry/Media                28.4K  4.00T  28.4K  /ambry/Media
    root@TrayNAS:~# zfs get all ambry
    NAME   PROPERTY              VALUE                  SOURCE
    ambry  type                  filesystem             -
    ambry  creation              Sat Nov 21 12:48 2009  -
    ambry  used                  176K                   -
    ambry  available             4.00T                  -
    ambry  referenced            31.4K                  -
    ambry  compressratio         1.00x                  -
    ambry  mounted               yes                    -
    ambry  quota                 none                   default
    ambry  reservation           none                   default
    ambry  recordsize            128K                   default
    ambry  mountpoint            /ambry                 default
    ambry  sharenfs              off                    default
    ambry  checksum              on                     default
    ambry  compression           off                    default
    ambry  atime                 on                     default
    ambry  devices               on                     default
    ambry  exec                  on                     default
    ambry  setuid                on                     default
    ambry  readonly              off                    default
    ambry  zoned                 off                    default
    ambry  snapdir               hidden                 default
    ambry  aclmode               groupmask              default
    ambry  aclinherit            restricted             default
    ambry  canmount              on                     default
    ambry  shareiscsi            off                    default
    ambry  xattr                 on                     default
    ambry  copies                1                      default
    ambry  version               3                      -
    ambry  utf8only              off                    -
    ambry  normalization         none                   -
    ambry  casesensitivity       sensitive              -
    ambry  vscan                 off                    default
    ambry  nbmand                off                    default
    ambry  sharesmb              off                    default
    ambry  refquota              none                   default
    ambry  refreservation        none                   default
    ambry  primarycache          all                    default
    ambry  secondarycache        all                    default
    ambry  usedbysnapshots       0                      -
    ambry  usedbydataset         31.4K                  -
    ambry  usedbychildren        144K                   -
    ambry  usedbyrefreservation  0                      -
    

    I just created two filesystems to store my data, and then listed the zfs attributes available to me. I would like to take advantage of a few attributes, namely (compression, nfs, snapshots)

    root@TrayNAS:~# zfs set sharenfs=rw,anon=0 ambry #allows root access from all hosts
    root@TrayNAS:/# zfs set compression=on ambry/Media
    root@TrayNAS:/# zfs set compression=on ambry/Downloads
    ^^^ I could set compression on for the whole ambry device, but want a little more fine grained control. ^^^
    mkdir -p /old_ambry/Media
    mkdir /old_ambry/Downloads
    mount 10.0.0.100:/ambry/Media /old_ambry/Media
    mount 10.0.0.100:/ambry/Downloads /old_ambry/Downloads
    --- copied all my date over ---
    

    I set compression on before moving data since it doesn’t activate recursively. Also I could have used zfs cloning, yet I have no need for my previous snapshots, so it’s not necessary…

    More to come soon, but at this point you should be able to have a fully functioning NAS, with nfs. Enjoy

  • NTP Open Solaris (Setup & Configure)

    Posted on November 21st, 2009 Jonny Gerold No comments

    NTP is awesome, it’s been around forever, and it’s one of the first things I setup on any new machine. This is an especially important service for a NAS device, since sync times are crucial, and there are many important services that are time dependent (snapshots for example).

    1) Set the Time

    ntpdate 0.pool.ntp.org
    

    — Output —

    root@TrayNAS:/etc/inet# ntpdate 0.pool.ntp.org
    21 Nov 12:21:19 ntpdate[1296]: adjust time server 66.96.96.29 offset -0.000521 sec
    

    2) Configure

    cp /etc/inet/ntp.server /etc/inet/ntp.conf
    echo "server 0.pool.ntp.org\nserver 1.pool.ntp.org\nserver 2.pool.ntp.org" >> /etc/inet/ntp.conf
    svcadm enable ntp
    svcs ntp
    

    — Output —

    root@TrayNAS:/etc/inet# svcs ntp
    STATE          STIME    FMRI
    online         12:12:57 svc:/network/ntp:default
    

    Woot, time is setup. Enjoy synchronized time…

    Resources:

  • Opensolaris blast on the way.

    Posted on November 21st, 2009 Jonny Gerold No comments

    I was planning to put one giant post on how to setup a NAS with Open Solaris & NAS. Yet I think it would be nice to have a few key posts, and then group them together in the end. I just installed Open Solaris on my new machine. And am starting the setup… More to come soon.

  • Twitter Weekly Updates for 2009-11-15

    Posted on November 15th, 2009 Jonny Gerold No comments
    • CANT WAIT TILL 12:30! RAWR… Metal!!! #
    • Metalocalype; Manager; alive; METAL! #