Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Latest commit

 

History

History

rpi-samba

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Raspberry Pi Samba Server

Integration video link

Introduction

With a Raspberry Pi, Samba and CORTX, this integration lets you create your NAS server (to serve network-wide files) cheaply, and automatically syncs with your CORTX storage.

What is NAS?:

Network attached storage allows you to share files from one, always-on device throughout your house. With a NAS on your network, you can use it to store your movies and play them from multiple Kodi boxes, store backups on it from your PC, or use it as a BitTorrent box that seeds your files 24/7.

Architecture

Setup

  1. Setup RPi

Download RPI OS and BalenaEtcher.

Run sudo apt-get update && sudo apt-get upgrade

  1. Setup Samba

Run sudo apt install samba samba-common-bin -y

  1. Create folders for NAS sharing
sudo mkdir -p /home/shared/public
sudo chown -R root:users /home/shared/public
sudo chmod -R ug=rwx,o=rx /home/shared/public
  1. Update Samba config files

Run sudo nano /etc/samba/smb.conf, then insert:

[your-storage-name]
path = /home/shared/public
writeable = yes
create mask = 0775
directory mask = 0775
public = no
  1. Password lock your server

Run sudo smbpasswd -a pi and configure your password

  1. Restart Samba service

Run sudo /etc/init.d/smbd restart

  1. Mount your USB/HDD/etc - it is usually SDA1

E.g. Run umount dev/sda1

  1. Configure AWS
pip install awscli
aws configure
  1. Sync NAS storage with CORTX
aws --endpoint-url http://uvo1djqlaa0iveuluux.vm.cld.sr s3 sync s3://testbucket .

Note: If you encouter error [SSL: CERTIFICATE_VERIFY_FAILED] when you use development Cortx S3 server, add --no-verify-ssl to avoid the error. For example, aws --endpoint-url your_endpoint_url s3 sync s3://your_bucket . --no-verify-ssl.

If you want to not only sync new files from S3 Server, but also delete outdated files in your NAS server, you can use --delete. For example, aws --endpoint-url your_endpoint_url s3 sync s3://your_bucket . --no-verify-ssl --delete.

If you make changes in your NAS server and want to update them into your S3 Server bucket, you can swap the source and destination of the sync. For example, aws --endpoint-url your_endpoint_url s3 sync . s3://your_bucket --no-verify-ssl --delete.

Final Product

Our simple setup:

Files on network storage:

Files on CORTX storage:

Tested by: