embeddedart / embeddedart.github.io

Embedded Art website https://www.embeddedart.in
0 stars 0 forks source link

NAS on raspbery pi #7

Open embeddedart opened 2 years ago

embeddedart commented 2 years ago

Raspberry Pi Update

sudo apt update

To change default password, optional command

passwd 

install hard disk format supported packages

sudo apt install exfat-utils exfat-fuse ntfs-3g

Samba Server Installation:

sudo apt-get install samba samba-common-bin

select "Yes" in installation when dialog box occur

to list all connected drive

lsblk

unmount drive

sudo umount -R /media/pi/backup

create directory, to mount drive to that path

sudo mkdir /home/pi/nas

To mount external drive to specified path.

sudo mount /dev/sda1 /home/pi/nas

open samba server configuration file

sudo nano /etc/samba/smb.conf

Add these lines at the bottom :

[RaspberryPi - Server1] comment = "Pi3_B" read only = no writeable = yes browsable = yes path = /external # set path according to your path create mask = 0777 directory mask = 0777 public = no valid users = brijesh

Method 1 : create user as per in samba configuration file to Access NAS Server

sudo adduser brijesh

Method 2 : another method to create user

sudo useradd -m -G users brijesh

create password for above created user

sudo passwd brijesh

Add user to samba

sudo smbpasswd -a brijesh

Restart below both samba service

sudo service smbd restart
sudo service nmbd restart

To Auto mount Drives upon Rebooting

sudo nano /etc/fstab

add below line to above open file

/dev/sda1       /home/pi/nas    auto    defaults,nofail         0       2
embeddedart commented 2 years ago

To add another drive, create directory, to mount drive to that path

sudo mkdir /home/pi/nas_pub

To mount external drive to specified path. (before mount you need to unmount that drive)

sudo mount /dev/sda1 /home/pi/nas

configure samba config file

also config auto mount config file etc/fstab file