Guest User

Untitled

a guest
Feb 16th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. ### Description
  2. This gist will cover mounting a network drive to your raspberry pi. This is being tested on a raspberry pi running Raspbian Stretch.
  3.  
  4. The process is assuming you have a windows network drive already setup on your network and the proper permissions configured. The following snippet shows our assumptions:
  5.  
  6. ```
  7. ip = 192.168.1.10
  8.  
  9. windowsUser = user1
  10. userPass = password
  11.  
  12. sharedDriveName = shared
  13. ```
  14.  
  15. ### Dependencies
  16. You will need to install `cifs-utils` from the raspbian package manager using the following command:
  17.  
  18. ```
  19. sudo apt-get install cifs-utils
  20. ```
  21.  
  22. Then create the directory you want the shared drive to mount in. In our case, this will be at `/mnt/shared`. We will also change the permissions so that our `pi` user has permission to modify this directory.
  23.  
  24. ```
  25. mkdir /mnt/shared
  26. ```
  27.  
  28. Now we will add an entry into our `/etc/fstab` to get the shared drive to mount whenever the raspberry pi boots. Use your preferred text editor to open up `/etc/fstab` and append the following entry to the bottom of the file.
  29.  
  30. ```
  31. sudo vim /etc/fstab
  32. ```
  33.  
  34. ```
  35. # /etc/fstab
  36.  
  37. //192.168.1.10/shared /mnt/shared cifs username=user1,password=password,iocharset=utf-8,sec=ntlm,vers=2.1,uid=1000,gid=1000,x-systemd.automount 0 0
  38. ```
  39.  
  40. Now, when your raspberry pi boots up, you should see the network drive contents at `/mnt/shared/`.
Add Comment
Please, Sign In to add comment