Archive for the ‘OpenSolaris’ Category

Home ZFS NAS Upgrade

Friday, August 8th, 2008

Ever since I put together my low budget NAS, I have been wanting to upgrade it. Initially it was a proof of concept, now it needs to be low power and functional. The old NAS was a 32-bit system (32-bit makes ZFS crawl). I wanted a low power and cheap 64 bit system and so I ended up getting a atom 230 based mini-itx system from Intel… The D945GCLF. I fitted 1GB of RAM and used a 4GB CF card as the hard disk (via a CF-IDE adapter). For the OS I used ncp 2.0 alpha 1 (based on Ubuntu Hardy).

I had a few problems with Nexenta on this board:

  • The installation of Nexenta went fine on the CF card, but come time to reboot, I received a “GRUB stage2 read error”. I spent a couple of days trying to figure out what was wrong but as I did not succeed, I am using an old HDD for now.
  • The 2nd issue is that Nexenta kept booting up into 32 bit. This was due to grub not recognizing the atom as 64-bit. This was solved by hard coding ”amd64” in place of ”$ISADIR” in the menu.lst file of grub. Full details of this bug can be found here and here. Use isainfo -vk to make sure
  • The last issue is that the onboard LAN chip is not supported. The chip is a Realtek 8136 and shows up as ”pciex10ec,8136”. For now I have installed an old Netgear PCI card
  • Once I get me NAS up and running, I will then spend some more time trying to fix the CF card issue. The onboard LAN issue will solve itself in time. Until then, I can wait.

    menu.lst issue with Nexenta and ZFS root

    Saturday, February 23rd, 2008

    The grub menu in Nexenta is modified thought editing the menu.lst file. However the menu.lst file in question resides in the syspool file system (the root file system is syspool/rootfs-nmu-000. This is accomplished by:

    mount -F zfs syspool /media/temp
    vi /media/temp/boot/grub/menu.lst
    umount /media/temp/

    Nexenta SATA ACPI woes

    Saturday, February 23rd, 2008

    About 2 weeks a go I bought my self a Syba 4 port PCI SATA controller based on the sil3144 chip. I then spent a week trying to figure out why, while working perfectly in Linux and FreeBSD, I couldn’t get it to work in Nexenta. After flashing the card with the non-raid version and a lot of googling, I decided to try a different flavor of opensolaris just in case. I downloaded BeleniX and gave it a go only to have the same problem. The BeleniX CD has a “no acpi” option which I tried just for the sake of it. I was very pleased of course when the controller actually worked. The no acpi option is passed to the opensolaris kernel via a “-B apci-user-options=2″ more info here

    NAS based on Nexenta and ZFS

    Wednesday, January 30th, 2008

    For some time now I have been flirting with the idea of getting myself a Network Attached Storage (NAS). I get excited about the idea of having all my important files and stuff on a single device that supports raid 1. I can then reinstall Ubuntu on my laptop as many times as I want without having to worry about moving data somewhere safe first. I will not have to give up my laptop to my wife because that is where we keep all our personal digital photos and videos and she really wants to send the latest snapshots of our daughter to her mother… NOW.

    If you look at what is available on the market you can see that the cost of these devices are tremendous. The much cheaper alternative is to build something myself. I had a dual PIII 800MHz machine but I thought that was an over kill. I want this to consume the least possible amount of power and to run as cool as possible. When I found a old celeron machine at Uni I decided that I would put something together. I attached 3x 14GB IDE hard disks and a CD drive and had myself an ugly but functional machine.

    I looked at FreeNAS which is based on monowall which in turn is a based on a minimal FreeBSD system. What is really cool about FreeNAS that it easily fits on a USB or CF disk and moves your machine towards being an appliance with all the benefits that include less heat and better reliability.

    Being a bit paranoid I decided I would not accept anything less than ZFS for my data. I believe it is the only file system that detects silent data corruption. It also has a lot of hype surrounding it and I have being wanting to play around with it for a while. The current versions of FreeNAS do not have ZFS support, but when FreeBSD 7.0 comes out it will have native ZFS support. This means that FreeNAS will gain ZFS support at some stage. I, however do not want to wait.

    Enter Nexenta, a distribution based on opensolaris with a GNU userland. I wasn’t completely at home, coming from a Linux background and I noticed that some of the command line tools support different command line options, but here is the best thing about Nexenta… It uses apt for its package management. I truly believe that apt is the best tool out there and is what drew me to Debian in the first place. It also has some nifty features like support for ZFS root file system and a tool called apt-clone that takes a ZFS snapshot of the system before major upgrades and allows you to revert if the upgrade goes wrong. All this without rebooting so no downtime. To summarize Nexenta is an interesting project and I will use it to build my NAS.

    I installed Nexenta Alpha7 and created a zpool out of 2 of the disks changed the mount point to /mydata and shared it via NFS (ZFS has built in NFS/NFS4)

    zpool create mydata mirror c0d1 c1d0
    zfs set mountpoint=/mydata mydata
    zfs set sharenfs=on mydata

    After a while I realized that the Alpha7 version was not the latest and I wasn’t able to upgrade to the latest via apt! I installed Nexenta 1.0 RC3 and was able to import my old (mydata) ZFS pool. running zpool import will show all available pools that can be imported.

    root@sun:~# zpool import
      pool: home
        id: 14253621109838762705
     state: ONLINE
    status: The pool is formatted using an older on-disk version.
    action: The pool can be imported using its name or numeric identifier, though
            some features will not be available without an explicit 'zpool upgrade'.
    config:
     
            home        ONLINE
              c0d0s1    ONLINE
     
      pool: mydata
        id: 7749473723610951541
     state: ONLINE
    status: The pool is formatted using an older on-disk version.
    action: The pool can be imported using its name or numeric identifier, though
            some features will not be available without an explicit 'zpool upgrade'.
    config:
     
            mydata      ONLINE
              mirror    ONLINE
                c0d1    ONLINE
                c1d0    ONLINE

    I had to use -f (force) to import my previous pool

    root@sun:~# zpool import mydata
    cannot import 'mydata': pool may be in use from other system
    use '-f' to import anyway
    root@sun:~# zpool import -f mydata

    I was then able to upgrade the ZFS pool

    root@sun:~# zpool upgrade
    This system is currently running ZFS pool version 10.
     
    The following pools are out of date, and can be upgraded.  After being
    upgraded, these pools will no longer be accessible by older software versions.
     
    VER  POOL
    ---  ------------
     3   mydata
     
    Use 'zpool upgrade -v' for a list of available versions and their associated
    features.
    root@sun:~# zpool upgrade mydata
    This system is currently running ZFS pool version 10.
     
    Successfully upgraded 'mydata' from version 3 to version 10

    And finaly I get to see my pool up and running

    root@sun:~# zpool list mydata
    NAME     SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
    mydata  12.6G  9.30G  3.33G    73%  ONLINE  -
    root@sun:~# zfs list mydata
    NAME     USED  AVAIL  REFER  MOUNTPOINT
    mydata  9.30G  3.13G  9.30G  /mydata

    I must say I am happy with my NAS. All I need is to get some large disks in there and I am good to go. I also look forward to get some experience with Nexenta and ZFS. I wonder if you can fit Nexenta onto a 128MB or 256MB CF card?