Advertisement
Guest User

Rpi_NAS_things.txt

a guest
May 16th, 2015
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1.  
  2.  
  3.  
  4. Assumes Pi is setup and running sshd.
  5.  
  6. Note: how to shutdown the RPi, "sudo shutdown -h now"
  7.  
  8. Assumes you have an external USB drive formatted to NTFS and know the LABEL of it.
  9. (allows you to also connect the USB drive to a Windows PC, much more convenient)
  10.  
  11. sudo apt-get install ntfs-3g
  12.  
  13. sudo fdisk -l <-- will show connected drives, ext USB drive should show as /dev/sda1
  14.  
  15. make a place to mount it under '/media'
  16. sudo mkdir /media/1TB <-- my USB 1 Tb drive label = "1TB"
  17. for right now, manually mount the USB drive
  18. sudo mount -t auto /dev/sda1 /media/1TB <-- we will redo this later to automount
  19.  
  20. see if the drive is there (assumes there's something on the drive!)
  21. ls -al /media/1TB
  22. see section: automount USB drive
  23.  
  24. 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.
  25. sudo apt-get install samba
  26. sudo apt-get install samba-common-bin
  27.  
  28. At this point on your Windows PC you should be able to see the Pi. Actually "RPi" in my case.
  29. In Windows, Double-click Computer, single-click "Network" (bottom left)
  30. (or type in address bar "\\<ip of raspi>" or try "\\<name of raspi" like this "\\RPi"
  31.  
  32. --------------- Samba Config
  33. Now we need to share the USB drive. Note: this will share the entire drive to anyone.
  34. If you only want to share one directory, just add directory to line in smb.config "path = /media/1TB/Videos"
  35.  
  36. sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak <-- make a backup just in case
  37. sudo nano /etc/samba/smb.conf <-- johnm uses vi instead of nano
  38. - note: My smb.conf config file is appended to the end of this file
  39.  
  40. sudo /etc/init.d/samba restart
  41.  
  42. ---------------- automount USB drive
  43. All users will have read/write permission
  44.  
  45. "sudo vi /etc/fstab", add at bottom
  46.  
  47. # mount USB Drives here
  48. LABEL=1TB /media/1TB ntfs-3g defaults 0 0
  49.  
  50. save it!
  51.  
  52. (in case you have power switched off on USB drive at startup)
  53. sudo mount -a <-- will mount all drives it sees
  54.  
  55.  
  56. -------------------------------- My samba config file "/etc/samba/smb.conf"
  57. #======================= Global Settings =======================
  58. [global]
  59.  
  60. workgroup = WORKGROUP
  61.  
  62. server string = Media Server
  63.  
  64. # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
  65. # wins server = w.x.y.z
  66.  
  67. dns proxy = no
  68.  
  69. name resolve order = bcast host
  70.  
  71. #### Networking ####
  72.  
  73. # interfaces = 127.0.0.0/8 eth0
  74.  
  75. # bind interfaces only = yes
  76.  
  77. log file = /var/log/samba/log.%m
  78.  
  79. max log size = 50
  80.  
  81. syslog = 0
  82.  
  83. panic action = /usr/share/samba/panic-action %d
  84.  
  85. security = share
  86. map to guest = Bad user
  87.  
  88. usershare allow guests = yes
  89.  
  90. [Media]
  91. comment = media access
  92. path = /media/1TB
  93. public = yes
  94. only guest = yes
  95. writeable = yes
  96. browseable = yes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement