{"id":461,"date":"2016-12-15T19:17:07","date_gmt":"2016-12-16T00:17:07","guid":{"rendered":"http:\/\/brian.digitalmaddox.com\/blog\/?p=461"},"modified":"2016-12-15T19:17:07","modified_gmt":"2016-12-16T00:17:07","slug":"creating-a-nas-using-a-raspberry-pi-3-part-1","status":"publish","type":"post","link":"https:\/\/brian.digitalmaddox.com\/blog\/?p=461","title":{"rendered":"Creating a NAS Using a Raspberry Pi 3 Part 1"},"content":{"rendered":"<p><i>Find yourself needing a lot of storage on your network and do not want to have something that requires a lot of attention? You can use a Raspberry Pi 3 and a hard drive enclosure to make a home or small office NAS to store files and keep them available.<\/i><\/p>\n<p>Recently I found myself wanting to upgrade my home network attached storage (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Network-attached_storage\">NAS<\/a>). It was basically an old laptop connected to a USB enclosure. It was stable, but had a few flaws. The first was that I had to periodically clean out the laptop since it seemed to be a magnet for dust. The second was that the hard drive was a single drive that I kept backed up, but it did not provide availability in case that drive should fail. Plus, the laptop drew more power than it needed to since it spent a lot of time just sitting around.<\/p>\n<p>What I wanted was something that used a small amount of power and was expandable. I wanted to be able to easily add more drives in as our family storage needs grew. My ideal solution would not need much fuss or maintenance. Most importantly, since I am cheap, the hardware solution needed to be low cost.<\/p>\n<p>I had been waiting to pick up a <a href=\"https:\/\/www.raspberrypi.org\/products\/raspberry-pi-3-model-b\/\">Raspberry Pi 3<\/a> until I had a project that actually needed one. If you search Google, you will find a lot of people using it for a file server. Owners also complain because not only does it just come with USB 2.0 ports, but the built-in Ethernet also shares bandwidth with the USB devices. However, I was not looking for something high-bandwidth as all the video I transfer over the network is already compressed. My home network is limited to 100 megabit Ethernet, so at best I only get around eight to nine megabytes a second transfer speed anyway. I ordered the <a href=\"https:\/\/www.amazon.com\/gp\/product\/B01D92SSX6\/ref=oh_aui_detailpage_o03_s00?ie=UTF8&amp;psc=1\">Vilros Raspberry Pi 3 Basic Starter Kit<\/a> off Amazon and picked up a 64 gigabyte class-10 SD card for the root file system.<\/p>\n<p><a name=\"productTitle\"><\/a><a name=\"title\"><\/a>Once I settled on the Pi 3, I needed an external USB enclosure. I ended up picking the <a href=\"https:\/\/www.amazon.com\/gp\/product\/B003X26VV4\/ref=oh_aui_detailpage_o09_s00?ie=UTF8&amp;psc=1\">Mediasonic ProBox HF2-SU3S2<\/a> four-bay enclosure. It has a standard-sized cooling fan in the back and controls on the front for things like setting the fan speed and so on. I had two four gigabyte drives ready for it and would still have room to expand.<\/p>\n<p>While waiting for everything to arrive, I then had to decide the <i>how<\/i> of setting the NAS up. There a lot of options out there, ranging from <a href=\"http:\/\/www.freenas.org\/\">FreeNAS<\/a> to rolling your own Linux distribution. You will see a huge amount of discussion of what types of file systems to use. Here it seems to be split into two camps: the \u201c<a href=\"https:\/\/en.wikipedia.org\/wiki\/ZFS\">ZFS<\/a> for everything\u201d camp, and everything else (<a href=\"https:\/\/en.wikipedia.org\/wiki\/XFS\">XFS<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Ext4\">EXT4<\/a>, and so on). ZFS is a great file system and I have used it for other things, but for a home NAS (especially one running off a Pi), it can be a bit of overkill. This is especially true since many of ZFS\u2019s best features require a lot of RAM.<\/p>\n<p>What I decided on is good old Linux software <a href=\"https:\/\/en.wikipedia.org\/wiki\/RAID\">RAID<\/a> 1 and the XFS file system. I have had a lot of success with <a href=\"https:\/\/en.wikipedia.org\/wiki\/Mdadm\">software RAID<\/a> over the years, and for my purposes it has been more flexible than a hardware RAID system. Linux software RAID can do things like convert in-place from a RAID-1 setup to RAID-5 with no data loss. This way, if I needed to expand past the four gigabyte RAID-1 system, I could add another drive and convert it to RAID-5. Linux software RAID-5 will let you grow it by adding hard drives, so in the end I could have a twelve gigabyte RAID-5 system if I needed one. I already back up the data with integrity checks, so instead of ZFS, XFS would satisfy all of my needs.<\/p>\n<p>Distribution-wise, I decided it would be either <a href=\"https:\/\/www.raspbian.org\/\">Raspbian<\/a> or Ubuntu <a href=\"https:\/\/ubuntu-mate.org\/raspberry-pi\/\">MATE<\/a>. Both are Debian-based, and both are solid operating systems for the Pi. Raspbian is the official distribution from the Raspberry Pi Foundation, and MATE is a distribution for the Pi built by Martin Wimpress and Rohith Madhavan. As I had never used a Pi before, I had no idea how either would work on the Pi 3. I used to use MATE for my desktop so I was at least familiar with it and knew it did not need a lot of resources to run.<\/p>\n<p>In Part 2 I will go over setting up the Pi 3 to serve out data. As a spoiler, I will also go into why I chose Ubuntu for my Pi 3 in the end over Raspbian.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Find yourself needing a lot of storage on your network and do not want to have something that requires a lot of attention? You can use a Raspberry Pi 3 and a hard drive enclosure to make a home or &hellip; <a href=\"https:\/\/brian.digitalmaddox.com\/blog\/?p=461\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-461","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/461","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=461"}],"version-history":[{"count":1,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/461\/revisions"}],"predecessor-version":[{"id":462,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/461\/revisions\/462"}],"wp:attachment":[{"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}