Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Assumes Pi is setup and running sshd.
- Note: how to shutdown the RPi, "sudo shutdown -h now"
- Assumes you have an external USB drive formatted to NTFS and know the LABEL of it.
- (allows you to also connect the USB drive to a Windows PC, much more convenient)
- sudo apt-get install ntfs-3g
- sudo fdisk -l <-- will show connected drives, ext USB drive should show as /dev/sda1
- make a place to mount it under '/media'
- sudo mkdir /media/1TB <-- my USB 1 Tb drive label = "1TB"
- for right now, manually mount the USB drive
- sudo mount -t auto /dev/sda1 /media/1TB <-- we will redo this later to automount
- see if the drive is there (assumes there's something on the drive!)
- ls -al /media/1TB
- see section: automount USB drive
- We need Samba so that Windows can see the Pi on your Network. Note that samba is case insensitive, WORKGROUP and workgroup are the same to samba.
- sudo apt-get install samba
- sudo apt-get install samba-common-bin
- At this point on your Windows PC you should be able to see the Pi. Actually "RPi" in my case.
- In Windows, Double-click Computer, single-click "Network" (bottom left)
- (or type in address bar "\\<ip of raspi>" or try "\\<name of raspi" like this "\\RPi"
- --------------- Samba Config
- Now we need to share the USB drive. Note: this will share the entire drive to anyone.
- If you only want to share one directory, just add directory to line in smb.config "path = /media/1TB/Videos"
- sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak <-- make a backup just in case
- sudo nano /etc/samba/smb.conf <-- johnm uses vi instead of nano
- - note: My smb.conf config file is appended to the end of this file
- sudo /etc/init.d/samba restart
- ---------------- automount USB drive
- All users will have read/write permission
- "sudo vi /etc/fstab", add at bottom
- # mount USB Drives here
- LABEL=1TB /media/1TB ntfs-3g defaults 0 0
- save it!
- (in case you have power switched off on USB drive at startup)
- sudo mount -a <-- will mount all drives it sees
- -------------------------------- My samba config file "/etc/samba/smb.conf"
- #======================= Global Settings =======================
- [global]
- workgroup = WORKGROUP
- server string = Media Server
- # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
- # wins server = w.x.y.z
- dns proxy = no
- name resolve order = bcast host
- #### Networking ####
- # interfaces = 127.0.0.0/8 eth0
- # bind interfaces only = yes
- log file = /var/log/samba/log.%m
- max log size = 50
- syslog = 0
- panic action = /usr/share/samba/panic-action %d
- security = share
- map to guest = Bad user
- usershare allow guests = yes
- [Media]
- comment = media access
- path = /media/1TB
- public = yes
- only guest = yes
- writeable = yes
- browseable = yes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement