tpyo kingg
Posts: 640
Joined: Mon Apr 09, 2018 5:26 pm
Location: N. Finland

MagPi 85, Build Your Own NAS

Tue Sep 17, 2019 9:37 am

I greatly enjoyed PJ Evans' article on pages 48 - 51, "Build your own NAS". Setting up a NAS was one of the first long term activities I had used a Raspberry Pi for and with much the same methods as outlined in the article. I still have a RPi 3 running as a NAS, though with a very different arrangement now.

A) SFTP via the file manager would be great for a beginner level follow up article. It is mentioned in Step 13 of the article. SFTP support is built into the file default manager, PCManFM, and is very convenient for file transfers from one Raspberry Pi to another. If OpenSSH is active on the other Raspberry Pi, then the client Pi just needs to open PCManFM and enter the URI in the location bar at the top of the window:

Code: Select all

sftp://pi@198.51.100.138/home/pi/
Then after authentication, it is just like working with local files even though some are on another machine either across the desk or across the planet.

B) An advanced follow up would be to set up the NAS using FreeBSD much like in the article, but with OpenZFS and RAIDZ instead of RAID-1

Andyroo

Re: MagPi 85, Build Your Own NAS

Tue Sep 17, 2019 11:40 am

Point A - never knew that. Most of my Pi work is still command line so I must spend time playing with the GUI...

Point B - Must agree with that.

I started to look at memory requirements for this when the Pi 4 came out but was put off with the number of posts stating 1GB per 1TB and a fair chunk for base memory :o

I did come across this thread on reddit where Hakker9 makes the statement
sure if you have no plans to go to the 30+ TB mark you can go far with 4 GB.
That puts it squarely in the area I need (12TB useable) but my only trial of RAID on a Pi (2x1TB) died spectacularly with a fix needed beyond my skill level.

Maybe some one here will try it?

tpyo kingg
Posts: 640
Joined: Mon Apr 09, 2018 5:26 pm
Location: N. Finland

Re: MagPi 85, Build Your Own NAS

Tue Sep 17, 2019 12:04 pm

Andyroo wrote:
Tue Sep 17, 2019 11:40 am
Maybe some one here will try it?
Here are my sparse notes from last autumn on that. It's easy enough to figure out from the official documentation though.

Code: Select all

get FreeBSD 12 for the Raspberry Pi:

ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/arm64/aarch64/ISO-IMAGES/12.0/

optional

# pkg install tmux

plug in drives and clear the MBR

# dd if=/dev/zero bs=512 count=1 of=/dev/da0
# dd if=/dev/zero bs=512 count=1 of=/dev/da1
# dd if=/dev/zero bs=512 count=1 of=/dev/da2
# dd if=/dev/zero bs=512 count=1 of=/dev/da3

Create the zpool and turn off deduplication to save RAM

?# zpool create storage /dev/da0 /dev/da1 /dev/da2 /dev/da3
# zpool create storage raidz /dev/da0 /dev/da1 /dev/da2 /dev/da3
# zfs dedup=off storage
# zfs create storage/home

Transfer existing home data to the zpool

# cp -rp /home/* /storage/home
# rm -rf /home /usr/home
# mkdir /home

Assign the zpool to under /home

# zfs set mountpoint=/home storage/home

# echo '/sbin/zfs mount -a' >> /etc/rc.local

[1] https://www.freebsd.org/doc/handbook/zfs-quickstart.html
Though now that a year has passed, 12.1 is out: ftp://ftp.freebsd.org/pub/FreeBSD/snaps ... AGES/12.1/

When I have to rebuild or replace the Raspberry Pi-based NAS which I have currently, then I will probably go that route -- if there's not an easy way to use OpenZFS with Raspbian by then.

Andyroo

Re: MagPi 85, Build Your Own NAS

Tue Sep 17, 2019 2:41 pm

Had to buy wallpaper rather than a Pi 4 but my birthday is in October :?: :lol: :!:

The biggest Pi I have free at the mo is my Zero (only because I've lost my case lid) and I am not even going to try that...

I may try on an old Shuttle PC I found under the bed (do not ask) so I'll happily take the notes as a starting point - thank you for them.

Return to “The MagPi”