Steps for setting up a linux server using a samba shared directory and a connected drive. The steps below assume you already have a linux operating system installed on your Raspberry Pi and a drive connected that you want to share on your network.
Configuration used to create these steps:
sudo mkdir /mnt/ssd
blkid
If the drive is already mounted use the line below to unmount, so you can remount to another directory
sudo umount /dev/sda1
sudo apt-get install ntfs-3g
sudo apt-get install exfat-fuse
sudo apt-get install exfat-utils
sudo mount -t ntfs-3g /dev/sda1 /mnt/ssd/
sudo mount -t exfat /dev/sda1 /mnt/ssd/
sudo nano /etc/fstab
Add this line to the fstab file at the very end. Replace the X's with the UUID that you found using blkid. If using an exFAT formatted drive, replace ntfs with exfat.
UUID=XXXXXXXXXXXXXXXX /mnt/ssd ntfs defaults 0 2
sudo apt-get install samba
sudo nano /etc/samba/smb.conf
[share]
comment = pi share
public = yes
writeable = yes
browseable = yes
path = /mnt/ssd
create mask = 0777
directory mask = 0777
guest ok = yes
only guest = no
This is the password you will use when connecting to your server from another device
sudo smbpasswd -a pi
sudo reboot
ifconfig -a