{"id":231,"date":"2013-12-01T20:21:53","date_gmt":"2013-12-02T04:21:53","guid":{"rendered":"http:\/\/yootopia.com\/mystory\/wp\/?p=231"},"modified":"2013-12-02T21:01:59","modified_gmt":"2013-12-03T05:01:59","slug":"home-nas-netbsd","status":"publish","type":"post","link":"http:\/\/www.yootopia.com\/mystory\/wp\/?p=231","title":{"rendered":"Home NAS &#8211; NetBSD"},"content":{"rendered":"<p>I built a home NAS server running NetBSD 5.1 back in Sep. 2010 with Gigabyte D525(Atom) with 4GB RAM and 4*2TB HDs. I configured RAIDFrame with RAID5 on 3*2TB and one hot-standby. This provided me with 4TB total usable space.<\/p>\n<p>I had the root on RAID1(mirrored) raid partition and two(2) 2TB raid5 partions across 3 drives. This had worked very nicely for me hosting all of the data needed for home.<\/p>\n<p>This also been my NAT box running BIND9, sshd, httpd(apache), dhcpd, ntpd, smtpd, owncloud, samba and etc.<\/p>\n<p>Now it is end of 2013 and I am running out of the disk space and more importantly, I have not done any of the OS upgrade since NetBSD 5.1(now they have 6.2)<\/p>\n<p>I want to upgrade the disks with at least 3TBs or even 4TBs but more than anything, I would like to run zfs filesystems with snapshot capability&#8230;.<\/p>\n<p>For this, I do not think that staying with NetBSD is not a good idea and the choices that I have are now narrowed down to either FreeNAS or NAS4Free&#8230;.<\/p>\n<p>Let&#8217;s see what happens&#8230;.<\/p>\n<p>Here are some configurations that I would like to save for future references:<\/p>\n<pre><code>\r\n# atactl wd0 identify\r\nModel: ST2000DL003-9VT166, Rev: CC32, Serial #:             5YD2####\r\nDevice type: ATA, fixed\r\nCylinders: 16383, heads: 16, sec\/track: 63, total sectors: 268435455\r\nDevice supports command queue depth of 31\r\nDevice capabilities:\r\n        DMA\r\n        LBA\r\n        ATA standby timer values\r\n        IORDY operation\r\n        IORDY disabling\r\nDevice supports following standards:\r\nATA-4 ATA-5 ATA-6 ATA-7 \r\nCommand set support:\r\n        READ BUFFER command (enabled)\r\n        WRITE BUFFER command (enabled)\r\n        Host Protected Area feature set (enabled)\r\n        look-ahead (enabled)\r\n        write cache (enabled)\r\n        Power Management feature set (enabled)\r\n        Security Mode feature set (disabled)\r\n        SMART feature set (enabled)\r\n        FLUSH CACHE EXT command (enabled)\r\n        FLUSH CACHE command (enabled)\r\n        Device Configuration Overlay feature set (enabled)\r\n        48-bit Address feature set (enabled)\r\n        Automatic Acoustic Management feature set (enabled)\r\n        SET MAX security extension (disabled)\r\n        DOWNLOAD MICROCODE command (enabled)\r\n        World Wide name\r\n        WRITE DMA\/MULTIPLE FUA EXT commands\r\n        General Purpose Logging feature set\r\n        SMART self-test\r\n        SMART error logging\r\nSerial ATA capabilities:\r\n        1.5Gb\/s signaling\r\n        3.0Gb\/s signaling\r\n        Native Command Queuing\r\n        PHY Event Counters\r\nSerial ATA features:\r\n        Device-Initiated Interface Power Managment (disabled)\r\n        Software Settings Preservation (enabled)\r\n\r\n# fdisk \/dev\/rwd0d\r\nNetBSD disklabel disk geometry:\r\ncylinders: 3876021, heads: 16, sectors\/track: 63 (1008 sectors\/cylinder)\r\ntotal sectors: 3907029168\r\n \r\nBIOS disk geometry:\r\ncylinders: 1024, heads: 255, sectors\/track: 63 (16065 sectors\/cylinder)\r\ntotal sectors: 3907029167\r\n \r\nPartition table:\r\n0: NetBSD (sysid 169)\r\n    start 63, size 3907029105 (1907729 MB, Cyls 0-243201\/80\/63), Active\r\n1: <UNUSED>\r\n2: <UNUSED>\r\n3: <UNUSED>\r\nBootselector disabled.\r\nFirst active partition: 0\r\n\r\n# disklabel -r \/dev\/wd0\r\ntype: ESDI\r\ndisk: ST2000DL003-9VT1\r\nlabel: fictitious\r\nflags:\r\nbytes\/sector: 512\r\nsectors\/track: 63\r\ntracks\/cylinder: 16\r\nsectors\/cylinder: 1008\r\ncylinders: 3876021\r\ntotal sectors: 3907029168\r\nrpm: 3600\r\ninterleave: 1\r\ntrackskew: 0\r\ncylinderskew: 0\r\nheadswitch: 0           # microseconds\r\ntrack-to-track seek: 0  # microseconds\r\ndrivedata: 0 \r\n \r\n5 partitions:\r\n#        size    offset     fstype [fsize bsize cpg\/sgs]\r\n a:  16777216        63       RAID                     # (Cyl.      0*-  16644*)\r\n b: 1945125888  16777280       RAID                     # (Cyl.  16644*- 1946332*)\r\n c: 3907029105        63     unused      0     0        # (Cyl.      0*- 3876020)\r\n d: 3907029168         0     unused      0     0        # (Cyl.      0 - 3876020)\r\n e: 1945125888 1961903168       RAID                     # (Cyl. 1946332*- 3876020*)\r\n\r\n$ cat raid0.conf\r\n# raidctl config file for \/dev\/rraid0d\r\n \r\nSTART array\r\n# numRow numCol numSpare\r\n1 2 1\r\n \r\nSTART disks\r\n\/dev\/wd0a\r\n\/dev\/wd1a\r\n \r\nSTART spare\r\n\/dev\/wd4a\r\n \r\nSTART layout\r\n# sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_1\r\n128 1 1 1\r\n \r\nSTART queue\r\nfifo 100\r\n$ cat raid1.conf                                                                          \r\n# raidctl config file for \/dev\/rraid1d\r\n \r\nSTART array\r\n# numRow numCol numSpare\r\n1 3 1\r\n \r\nSTART disks\r\n\/dev\/wd0b\r\n\/dev\/wd1b\r\n\/dev\/wd3b\r\n \r\nSTART spare\r\n\/dev\/wd4b\r\n \r\nSTART layout\r\n# sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_5\r\n64 1 1 5\r\n \r\nSTART queue\r\nfifo 100\r\n\r\n$ cat raid0.addwedges  \r\nnewfs -O 1 -b 16k -f 4k\r\n$ cat raid1.addwedges                                                                     \r\n#gpt create raid1\r\n#gpt add -b 34 -i 1 -s 4294966973 -t ufs raid1\r\n#gpt label -i 1 -l \"raid1-export1\" raid1\r\n#dkctl raid1 addwedge raid1-export1 34 4294966973 ffs\r\n \r\n# newfs -O 2 -b 64k -f 8k \/dev\/rdk0\r\n\r\n\r\n\r\n\r\n\r\n$ cat notes\r\n# raidctl -v -C raid0.conf.start raid0\r\n# raidctl -v -I 2011041101 raid0\r\n# raidctl -v -i raid0\r\n \r\n \r\n<blockquote class=\"wp-embedded-content\" data-secret=\"b4I387bvEm\"><a href=\"https:\/\/zhadum.org.uk\/2008\/07\/25\/raid-and-file-system-performance-tuning\/\">RAID and file system performance tuning<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;RAID and file system performance tuning&#8221; &#8212; What Do You Want?\" src=\"https:\/\/zhadum.org.uk\/2008\/07\/25\/raid-and-file-system-performance-tuning\/embed\/#?secret=9qFv6gkrtR#?secret=b4I387bvEm\" data-secret=\"b4I387bvEm\" width=\"584\" height=\"329\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\r\n \r\nhttp:\/\/mail-index.netbsd.org\/current-users\/2008\/08\/26\/msg004155.html\r\n \r\nhttp:\/\/mail-index.netbsd.org\/netbsd-users\/2010\/04\/09\/msg006043.html\r\nhttp:\/\/mail-index.netbsd.org\/netbsd-users\/2010\/04\/09\/msg006047.html\r\nhttp:\/\/mail-index.netbsd.org\/netbsd-users\/2010\/04\/11\/msg006050.html\r\n \r\nhttp:\/\/mail-index.netbsd.org\/current-users\/2008\/08\/29\/msg004212.html\r\n64K stripe size + 64K bsize = Optimal performce\r\n32K stripe size + 32K bsize = very good\r\n32K stripe size + 64K bsize = very good\r\n \r\nBAD:\r\n64K stripe size + 16K block size + 2K frag size\r\n64K stripe size + 32K block size + 2K frag size\r\n32K stripe size + 16K block size + 2K frag size\r\n \r\nGOOD(3 disks RAID5):\r\n64K stripe size + 64K block size + 4K frag size\r\n32K stripe size + 32K block size + 4K frag size\r\n32K stripe size + 64K block size + 8K frag size\r\n \r\nraid1 stripe size w\/ 2 disks(128 1 1 1) : 64k\r\nraid5 stripe size w\/ 3 disks(128 1 1 5) : 128k  : bad\r\nraid5 stripe size w\/ 3 disks( 64 1 1 5) : 64k\r\nraid5 stripe size w\/ 3 disks( 32 1 1 5) : 32k\r\nraid5 stripe size w\/ 4 disks( 64 1 1 5) : 96k   : bad\r\nraid5 stripe size w\/ 4 disks( 32 1 1 5) : 48k\r\n \r\n64K MAXPHYS value - the largest amount RAIDframe will ever be handed for one IO\r\n \r\ndefault newfs parameter\r\n-b 16k -f 2k\r\n \r\nraid1 optimal parameter:\r\n(http:\/\/zhadum.org.uk\/2008\/07\/25\/raid-and-file-system-performance-tuning\/)\r\n64k(128 1 1 1) + 16k block size + 2k frag size\r\n \r\n3 disks RAID5:\r\n64K stripe size + 64K block size + 8K frag size\r\n32K stripe size + 32K block size + 4K frag size\r\n32K stripe size + 64K block size + 8K frag size\r\n\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I built a home NAS server running NetBSD 5.1 back in Sep. 2010 with Gigabyte D525(Atom) with 4GB RAM and 4*2TB HDs. I configured RAIDFrame with RAID5 on 3*2TB and one hot-standby. This provided me with 4TB total usable space. &hellip; <a href=\"http:\/\/www.yootopia.com\/mystory\/wp\/?p=231\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[58],"tags":[97,59],"class_list":["post-231","post","type-post","status-publish","format-standard","hentry","category-nas","tag-nas","tag-netbsd"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p48Rtg-3J","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=\/wp\/v2\/posts\/231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=231"}],"version-history":[{"count":0,"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=\/wp\/v2\/posts\/231\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=231"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}