logo

PiMoroni Base Duo - The Ultimate Raspberry Pi NAS with RAID

time1 yr agoview30 views

#raspberrypi #diy #technology Setting up a Raspberry Pi as a Network Attached Storage device or NAS using the PiMoroni Base Duo and RAID. This will give us the ability to add two NVME drives to the Raspberry Pi. We will use Webmin, mDadM, and Samba to handle the management of the Pi, raiding the Raspberry Pi and Sharing it on the network. Full Build Guide here - https://youtu.be/azpHeEXtEFY Directions Housekeeping

  1. Verify your disks are attached - lsblk
  2. After first boot, run update and upgrade sudo apt update && sudo apt upgrade -y 3.Enable fastest PCI speeds - sudo nano /boot/firmware/config.txt now add dtparam=pciex1_gen=3 the very bottom, ctrl x, y, enter to save
  3. Run clean up - sudo apt autoremove && sudo apt clean
  4. Reboot your Raspberry Pi - sudo reboot Install Webmin
  5. Install webmin dependencies - sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions shared-mime-info
  6. Get Webmin - wget http://prdownloads.sourceforge.net/webadmin/webmin_1.994_all.deb
  7. Install Webmin package - dpkg --install webmin_1.994_all.deb
  8. Open webmin from the IP address of you pi plus port 10000 ex 192.168.1.20:10000 - Use your username and password you set up during the PI OS installing, default is user PI password raspberry if you did not change it from PI OS set up. verify it is working then minimize it. Verify it is working and you can log in, then minimize it. Install MDadM or Linux RAID and GParted
  9. sudo apt-get --no-install-recommends install mdadm
  10. Install Gparted - sudo apt-get install Gparted
  11. Open Gparted - Pi menu, system tools, Gparted
  12. Find NVME drives and add partition tables to each if needed. Be sure to click green check to save changes Use FDISK to partition drives
  13. sudo fdisk /dev/name of your first nvme ( you can get name by running fdisk again) n # create new partition p # primary (default option) 1 # partition 1 (default option) 2048 # First sector (default option) 468862127 # Last sector (default option) w # write new partition table REPEAT for second drive Setting up RAID with Webmin
  14. Create a Mount Point for the drives - sudo mkdir -p /mnt/xxxx example would sudo mkdir -p /mnt/raid (you can name it something other than raid if you would like) replace raid with what you named it)
  15. Open your webmin install in browser
  16. Navigate to Hardware on the left hand side. NOTE: if you do not see LINUX RAID as an option go to bottom and click "Refresh Modules" then refresh the page. 18 Click Hardware then Linux Raid. Here select RAID -1, hit create Raid Device level once you select RAID -1
  17. Select your drives, keep the defaults, and hit create, and please not the device ID should be md0 and at declared at the top This will take a LONG time to create if you have large drives, please let this finish before moving on to the next steps Verifying Raid, Formatting Raid Drive to EXT 4 and make it persistent
  18. Run lsblk to verify you see the drives and they both attach to your raid, in my case md0
    1. Format Raid Device to EXT -4 - sudo mkfs.ext4 /dev/md0
  19. Mout the Raid Device - sudo mount /dev/md0 /mnt/raid (note you may have named it something other than rad)
  20. Set Permission sudo chmod -R 777 /mnt/raid
  21. Update FSTAB so it mounts on boot - sudo nano /etc/fstab - add /dev/md0 /mnt/raid/ ext4 defaults,noatime 0 1
    to bottom of this list, again you may have named your mount something other than raid, ctrl x, y, enter to save Setting Up Samba for Network Share
  22. Install Samba - sudo apt install samba samba-common-bin
  23. Edit smb.conf - sudo nano /etc/samba/smb.conf
  24. Scroll to bottom of page, add (again you may have named it something other than raid) [shared] path=/mnt/raid
    writeable=Yes create mask=0777 directory mask=0777 public=no Ctrl, X, Y, Enter to save
  25. Restart Samba - sudo systemctl restart smbd
  26. Set up Samba User and PW - sudo smbpasswd -a pi
    (you may have different user than pi, use whatever you set up when you install the Pi OS)
  27. Enter in a password for the SMB share
  28. Restart Samba - sudo systemctl restart smbd 33 Verify share by going to Windows - Network - then in top toolbar place the IP address of your pi, log in, test share back on Pi 34 run lsblk again -here you should see both drives, formatted as EXT 4, set as RAID and attached to raid drive md0 That's it you just set up your new RAID Raspberry Pi NAS! Chapters 00:20 - Introduction 00:40 - Differences between PiMoroni Base vs Duo 02:15 - Why the Raspberry Pi 03:00 - What this will cover 03:15 - Building the Pimoroni Base Duo 03:38 - Setting Up the Raspberry Pi 04:00 - Overview of software 04:38 - Update and Prepare Pi 06:23 - Install Webmin 08:15 - Install MdadM 08:35 - Install G Parted 09:55 - FDisk 11:16 - Set Up Raid 11:16 - Set Up Samba
Loading comments...