Installing Samba on FreeBSD / GHostBSD systems
Samba Installation on BSD

  1. Create the Samba User: adduser nasuser
    Verify:
    1. id nasuser
    2. getent passwd nasuser

  2. Set Samba Password
    smbpasswd -a nasuser
    smbpasswd -e nasuser

    Verify:
    pdbedit -L

  3. Mount the NTFS Drive (Manual Test First) mkdir -p /mnt/20tb
    ntfs-3g -o allow_other,default_permissions,uid=1002,gid=1002,windows_names,rw /dev/da0p1 /mnt/20tb

    Verify:
    mount | grep 20tb
    ls -ld /mnt/20tb
    su - nasuser -c "ls /mnt/20tb" | head -5

  4. Auto-Mount on Boot (Add to fstab) File: /etc/fstab

    Add this line:
    /dev/da0p1 /mnt/20tb ntfs-3g rw,allow_other,default_permissions,uid=1002,gid=1002,windows_names,big_writes 0 0

    This is the only part that caused your boot problem.
    Change it to one of these on FreeBSD:Recommended safer version (noauto):

    /dev/da0p1 /mnt/20tb ntfs rw,allow_other,default_permissions,uid=1002,gid=1002,windows_names,big_writes,noauto,late,mountprog=/usr/local/bin/ntfs-3g 0 0

    Or automatic version (if you want it to mount every boot):

    /dev/da0p1 /mnt/20tb ntfs
    rw,allow_other,default_permissions,uid=1002,gid=1002,windows_names,big_writes,failok,late,mountprog=/usr/local/bin/ntfs-3g 0 0

    Verify & Apply:
    umount -f /mnt/20tb
    mount /mnt/20tb
    mount | grep 20tb

  5. Samba Configuration
    add these to File: /usr/local/etc/smb4.conf

    
    [global]
       workgroup = WORKGROUP
       server string = NAS-T15
       netbios name = NAS-T15
       security = user
       map to guest = Bad User
       guest account = nobody
       log level = 2
    
    
    [20tb]
       path = /mnt/20tb
       browsable = yes
       writable = yes
       guest ok = no
       read only = no
       create mask = 0666
       directory mask = 0777
       valid users = nasuser
       force user = nasuser
       force group = nasuser
       nt acl support = no
       ea support = no
    
    Verify:
    testparm

  6. Services + Firewall (rc.conf)
    File: /etc/rc.conf

    Add these lines:
    samba_server_enable="YES"
    firewall_enable="YES"
    firewall_type="workstation"
    firewall_myservices="80/tcp 22/tcp 139/tcp 445/tcp 137/udp 138/udp"
    firewall_allowservices="any"

    Verify:
    grep -E 'samba|firewall' /etc/rc.conf

  7. Start Everything
    service ipfw restart
    service samba_server restart

    Verify:
    ipfw list
    service samba_server status
    sockstat -4l | grep -E '445|139'

  8. Final Tests
    1. Local test:
      smbclient -L localhost -U nasuser
      smbclient //localhost/20tb -U nasuser (then type ls)

    2. Windows test: Clears the cache, now it should show up in "map network drive" in Windows
      net use * /delete /yes
      Map: \\192.168.1.250\20tb