Page 1 of 1

MagPi 85, Build Your Own NAS

Posted: Tue Sep 17, 2019 9:37 am
by tpyo kingg
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

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

Re: MagPi 85, Build Your Own NAS

Posted: Tue Sep 17, 2019 11:40 am
by Andyroo
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?

Re: MagPi 85, Build Your Own NAS

Posted: Tue Sep 17, 2019 12:04 pm
by tpyo kingg
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:


# 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

Though now that a year has passed, 12.1 is out: ... 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.

Re: MagPi 85, Build Your Own NAS

Posted: Tue Sep 17, 2019 2:41 pm
by Andyroo
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.

Re: MagPi 85, Build Your Own NAS

Posted: Fri Jan 24, 2020 7:22 pm
by input
I also tried to installing NAS from the magpi85 but I receive the error:
sudo mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 /dev/sdc1 /dev/sda5
mdadm: super1.x cannot open /dev/sdc1: Device or resource busy
mdadm: ddf: Cannot use /dev/sdc1: Device or resource busy
mdadm: Cannot use /dev/sdc1: It is busy
mdadm: cannot open /dev/sdc1: Device or resource busy

I also foloow the tutorial here: ... spberry_Pi
But then I also receive errors

Can someone help me out with this. I use Raspian Buster.