Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Description
- This gist will cover mounting a network drive to your raspberry pi. This is being tested on a raspberry pi running Raspbian Stretch.
- 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:
- ```
- ip = 192.168.1.10
- windowsUser = user1
- userPass = password
- sharedDriveName = shared
- ```
- ### Dependencies
- You will need to install `cifs-utils` from the raspbian package manager using the following command:
- ```
- sudo apt-get install cifs-utils
- ```
- 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.
- ```
- mkdir /mnt/shared
- ```
- 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.
- ```
- sudo vim /etc/fstab
- ```
- ```
- # /etc/fstab
- //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
- ```
- 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