I am fresh to the NAS building community and would like to share my account of stumbles and successes. My experience has been good so far and I didn't realize how much rust I would have to scrape off and how many new things I would learn about open source along the way. Right now my system is built from spare parts. It feels stable but it was a longer road to get there than I imagined.
My Linux background is medium and definitely not expert. I intend this journal to be for similar people that may run into the same questions (sometimes horribly basic ones). Perhaps even the experts can gleam some insight into how newbies like me think to help those who aspire to educate the masses that come here.
Before spending a lot of cash on a brand new DIY NAS I wanted to research the subject. After a lot of reading and refreshing I needed to spend time with a prototype built out of spare parts. I managed to scrounge up a P4, Asus P5AD2-E Deluxe, 2GB of ram, 500gb sata drive, 2 flash drives, case and power supply. I immediately had to spend some money on a cheap video card, cpu fan and case fan which didn't amount to much.
While waiting for items to ship I looked at OS choices and came up with Openfiler. After seeing a seemingly inactive community for Openfiler and the name FreeNAS coming up with frequency I decided to give it another look. Although there were things I preferred about the description of Openfiler, there is no substitute for an active community and I finally ended up with FreeNAS 8.0.2.
I followed these instructions to create a bootable usb drive:
http://forums.freenas.org/showthread.php?251-How-to-write-the-embedded-FreeNAS-8-image-under-Windows
I found the physdisk imaging software from this guide unappealing and unwieldy. In the comments of the instructions a user recommended win32diskimager which was free, faster and with a GUI. I now had a 4GB Kingston USB drive imaged and a spare one for troubleshooting or eventual cloning for disaster recovery.
The Asus board complained on boot which was likely the reason it was in the scrap pile however clearing the CMOS using the jumper got things in order. I had to set the SATA mode to AHCI and a couple of settings needed to be changed for USB boot. The boot order only showed an option for a generic external item until the hard drive listing was changed to have the USB as disk 1 and the sata as disk 2. Afterwards the USB drive brand even showed up in the boot order, however any time I unplugged the keyboard to move the unit to a new location I would have to re-enter these bios settings as they would get lost.
First boot was underway which took some time and I was given an IP address for my browser. In the top right corner a red icon alerted me to change the password which was done easily enough from the menus on the left side. From there I created my first volume following these instructions:
http://doc.freenas.org/index.php/Volumes
I had my first choice on how access to the unit would be handled and I chose the anonymous protocol found here:
http://doc.freenas.org/index.php/CIFS_Shares Which was done directly after I setup a CIFS share and CIFS was necessary due to windows and apple clients on the intended network.
I enabled SSH to login as root with a password and downloaded putty.exe (still free) in case I needed to troubleshoot in a shell.
I was off to the races and began copying 250GB of data. After about 150GB of smooth sailing I started receiving many errors. These errors all said 'kernel panic' which gave me a starting point for possible solutions. I first tried installing to another flash drive but ended up with the same issue. Next I came across a few threads suggesting that some builds need some RAM tuning. This can be hard set via 3 variables in a specific file.
Here is the link:
http://forums.freebsd.org/showthread.php?t=5135
I found this great instruction as well on how to do the tuning without having to edit the file every time, it just requires being at the console during boot (you'll have to press 6).
http://www.surlyjake.com/2009/12/freebsd-error-in-bootloader-conf/ Thank you crsd whoever you are.
Once I found tuning that made me stable, I edited the /boot/loader.conf to make those settings permanent.
A couple notes on editing this file, before starting this needs to be done,
mount -uw /
The filesystem is read only so what that command does is allows you to modify this and edit the loader.conf file (otherwise you'll get an access denied). When finished modifying the file one can set the filesystem back to read only by typing:
mount -ur /
Now, if you are like me and barely remember what editor you used in high school to program your small area allotted to you in a mud, just type:
ee /boot/loader.conf
ee stands for easy editor and is included with FreeNAS 8.0.2, this is the editor with all the <ctrl>+<letter> commands and <esc> to exit and give you a choice to save.
http://www.freebsd.org/doc/handbook/editors.html
If you remember how to echo that surely can be substituted, just remember use single quotes because these settings have double quotes. Also, if you're nervous around these files like me, copy the loader.conf file to loader.conf~ so you have a copy to edit and screw up the first time, or if you want to learn echo. Then copy it back to overwrite using cp or mv commands.
For my particular 2GB of ram in i386 I found the following settings stabilized all kernel panics during heavy copying. I did try to ramp up vm.kmem_size to 1024M however it failed on bootup. I did not attempt any in between 512M-1024M simply because 512M worked and I liked having the system stable. I chose 50% of 2GB for max and half that for arc if anyone cares.
echo 'vm.kmem_size="512M"' >> /boot/loader.conf
echo 'vm.kmem_size_max="1024M"' >> /boot/loader.conf
echo 'vfs.zfs.arc_max="512M"' >> /boot/loader.conf
Since then I have copied 250GB of data on gigabit which yielded speeds from 20MBit - 35MBit of various types of files from software to photos. No errors since those changes and I have been streaming videos fine, in fact my roommate's media pc seems to skip and jerk when videos are played locally and its smooth streaming from FreeNAS.
All in all not bad for used hardware and a used brain and I'm definitely going to use FreeNAS when I choose to build a silent and power efficient beast.
My Linux background is medium and definitely not expert. I intend this journal to be for similar people that may run into the same questions (sometimes horribly basic ones). Perhaps even the experts can gleam some insight into how newbies like me think to help those who aspire to educate the masses that come here.
Before spending a lot of cash on a brand new DIY NAS I wanted to research the subject. After a lot of reading and refreshing I needed to spend time with a prototype built out of spare parts. I managed to scrounge up a P4, Asus P5AD2-E Deluxe, 2GB of ram, 500gb sata drive, 2 flash drives, case and power supply. I immediately had to spend some money on a cheap video card, cpu fan and case fan which didn't amount to much.
While waiting for items to ship I looked at OS choices and came up with Openfiler. After seeing a seemingly inactive community for Openfiler and the name FreeNAS coming up with frequency I decided to give it another look. Although there were things I preferred about the description of Openfiler, there is no substitute for an active community and I finally ended up with FreeNAS 8.0.2.
I followed these instructions to create a bootable usb drive:
http://forums.freenas.org/showthread.php?251-How-to-write-the-embedded-FreeNAS-8-image-under-Windows
I found the physdisk imaging software from this guide unappealing and unwieldy. In the comments of the instructions a user recommended win32diskimager which was free, faster and with a GUI. I now had a 4GB Kingston USB drive imaged and a spare one for troubleshooting or eventual cloning for disaster recovery.
The Asus board complained on boot which was likely the reason it was in the scrap pile however clearing the CMOS using the jumper got things in order. I had to set the SATA mode to AHCI and a couple of settings needed to be changed for USB boot. The boot order only showed an option for a generic external item until the hard drive listing was changed to have the USB as disk 1 and the sata as disk 2. Afterwards the USB drive brand even showed up in the boot order, however any time I unplugged the keyboard to move the unit to a new location I would have to re-enter these bios settings as they would get lost.
First boot was underway which took some time and I was given an IP address for my browser. In the top right corner a red icon alerted me to change the password which was done easily enough from the menus on the left side. From there I created my first volume following these instructions:
http://doc.freenas.org/index.php/Volumes
I had my first choice on how access to the unit would be handled and I chose the anonymous protocol found here:
http://doc.freenas.org/index.php/CIFS_Shares Which was done directly after I setup a CIFS share and CIFS was necessary due to windows and apple clients on the intended network.
I enabled SSH to login as root with a password and downloaded putty.exe (still free) in case I needed to troubleshoot in a shell.
I was off to the races and began copying 250GB of data. After about 150GB of smooth sailing I started receiving many errors. These errors all said 'kernel panic' which gave me a starting point for possible solutions. I first tried installing to another flash drive but ended up with the same issue. Next I came across a few threads suggesting that some builds need some RAM tuning. This can be hard set via 3 variables in a specific file.
Here is the link:
http://forums.freebsd.org/showthread.php?t=5135
I found this great instruction as well on how to do the tuning without having to edit the file every time, it just requires being at the console during boot (you'll have to press 6).
http://www.surlyjake.com/2009/12/freebsd-error-in-bootloader-conf/ Thank you crsd whoever you are.
Once I found tuning that made me stable, I edited the /boot/loader.conf to make those settings permanent.
A couple notes on editing this file, before starting this needs to be done,
mount -uw /
The filesystem is read only so what that command does is allows you to modify this and edit the loader.conf file (otherwise you'll get an access denied). When finished modifying the file one can set the filesystem back to read only by typing:
mount -ur /
Now, if you are like me and barely remember what editor you used in high school to program your small area allotted to you in a mud, just type:
ee /boot/loader.conf
ee stands for easy editor and is included with FreeNAS 8.0.2, this is the editor with all the <ctrl>+<letter> commands and <esc> to exit and give you a choice to save.
http://www.freebsd.org/doc/handbook/editors.html
If you remember how to echo that surely can be substituted, just remember use single quotes because these settings have double quotes. Also, if you're nervous around these files like me, copy the loader.conf file to loader.conf~ so you have a copy to edit and screw up the first time, or if you want to learn echo. Then copy it back to overwrite using cp or mv commands.
For my particular 2GB of ram in i386 I found the following settings stabilized all kernel panics during heavy copying. I did try to ramp up vm.kmem_size to 1024M however it failed on bootup. I did not attempt any in between 512M-1024M simply because 512M worked and I liked having the system stable. I chose 50% of 2GB for max and half that for arc if anyone cares.
echo 'vm.kmem_size="512M"' >> /boot/loader.conf
echo 'vm.kmem_size_max="1024M"' >> /boot/loader.conf
echo 'vfs.zfs.arc_max="512M"' >> /boot/loader.conf
Since then I have copied 250GB of data on gigabit which yielded speeds from 20MBit - 35MBit of various types of files from software to photos. No errors since those changes and I have been streaming videos fine, in fact my roommate's media pc seems to skip and jerk when videos are played locally and its smooth streaming from FreeNAS.
All in all not bad for used hardware and a used brain and I'm definitely going to use FreeNAS when I choose to build a silent and power efficient beast.