Guest User

Untitled

a guest
May 25th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. # Raspberry Pi NAS
  2.  
  3. 1. Install NTFS and samba
  4. ```
  5. # apt install ntfs-g3 samba samba-common-bin
  6. ```
  7.  
  8. 2. Attach NAS drive to RasPi and get device name
  9. ```
  10. $ fdisk -l
  11. > Device Boot Start End Sectors Size Id Type
  12. > /dev/sda1 * 2048 60061695 60059648 28.7G c W95 FAT32 (LBA)
  13. ```
  14.  
  15. 3. Create mount path and mount drive
  16. ```
  17. # mkdir /media/hdd1
  18. # mount -t auto /dev/sda1 /media/hdd1
  19. ```
  20.  
  21. 4. Cretae copy of samba config and edit config
  22. ```
  23. # cp /etc/samba/smb.conf /etc/samba/smb.conf.save
  24. # nano /etc/samba/smb.conf
  25. ```
  26.  
  27. 5. Make shared directories writable
  28. ```
  29. #======================= Share Definitions =======================
  30.  
  31. ...
  32.  
  33. # By default, the home directories are exported read-only. Change the
  34. # next parameter to 'no' if you want to be able to write to them.
  35. read only = no
  36. # ^
  37. # Defaultly this is "yes", change it to "no"
  38. ```
  39.  
  40. 6. Add network drive at the end of the file
  41. ```
  42. [PINAS]
  43. comment = PINAS
  44. path = /media/hdd1/nas
  45. valid users = @users
  46. force group = users
  47. create mask = 0660
  48. directory mask = 0771
  49. read only = no
  50. ```
  51.  
  52. 7. Restart samba
  53. ```
  54. # /etc/init.d/samba restart
  55. ```
  56.  
  57. 8. Cretae nas user for authentication
  58. ```
  59. # useradd nas -m -G users
  60. # passwd nas
  61. ```
  62.  
  63. 9. Add user to samba
  64. ```
  65. # smbpasswd -a nas
  66. ```
  67.  
  68. 10. Add drive to auto mount on reboot
  69. ```
  70. # echo "/dev/sda1 /media/hdd1 auto noatime 0 0" >> /etc/fstab
  71. ```
Add Comment
Please, Sign In to add comment