Device Works learn. build.

How to NAS on debian

Add smb support in kernel

KERNEL Enable CIFS
File Systems --->
    [*] Network File Systems --->
        [*] CIFS support (advanced network filesystem, SMBFS successor)--->
            [*] CIFS Statistics
                [*] Extended Statistics
            [*] CIFS Extended Attributes
                [*] CIFS POSIX Extentions
Optional: Make sure to enable the filesystems you want to mount later on 
KERNEL SMB2 and SMB3 Support
File Systems --->
    [*] Network File Systems --->
        [*] CIFS support (advanced network filesystem, SMBFS successor)--->
            [*] SMB2 and SMB3 network file system support

Install samba:

apt-get install samba samba-common-bin

Edit the config file: vi /etc/samba/smb.conf For OSX:

[global]
strict locking = no

Then add the share, it works best to mount an external drive directly here:

[NAS-USB]
comment = NAS Folder
path = /media/u
valid users = @users
force group = users
create mask = 0777
directory mask = 0777
read only = no
writeable = Yes

Format your external drive with fdisk /dev/sda and make it all al linux parition. Then make an ext4 filesystem with mkfs -t ext4 /dev/sda1

Now make the mount point and mount it:

mkdir /media/u
mount /dev/sda1 /media/u

Now set up a user:

useradd nas -m -G users
passwd nas
chown -R nas /media
chgrp -R nas /media

Finally start smbd

smbd
smbpasswd -a nas