Mapping a network drive to a Raspberry Pi (with automount)

Your Raspberry Pi microSD card can fill up quickly. Especially if you plan on turning it into a media server or torrent box. The best place to store your media files or downloads would be a Network Attached Storage (NAS). This could be in the form of a NAS like “WD My Cloud” or similar, or simply an external HDD connected via the USB port of your router. Doing this is very simple, follow along and you’ll be set up in no time.

Requirements

Instructions

1. Install Raspbian OS

First, you must install the Raspbian OS on your Raspberry Pi. Check out the official guide here .

2. Mount your Network Drive

Create a folder on your Raspberry Pi to mount the drive in.

I mounted mine at /home/pi/DRIVE/share

To do this, type these commands in your terminal (change ‘DRIVE’ and ‘share’ to whatever you want)

Now mount your drive to the directory you just created:

If you are using a external HDD connected to the USB port of your router, your username and password will be what you normally use to log in to your router settings. You can replace “NIGHTHAWK” with the gateway address of your router as well.

Otherwise, use the credentials you set up when you installed your NAS.

Now, navigate to your drive by browsing to its mount point

If your see your files there, it worked.

mount network share raspberry pi

Important: If you reboot now, your network share will not automatically mount itself. In order to automount your drive on each boot we will need to take a couple of extra steps.

To do this, we need to edit the /etc/fstab file, Run the following command to edit the /etc/fstab file:

User your arrow keys to navigate to the bottom of the file and add this (change as appropriate):

Now press CTRL+X then Y then ENTER. All done! Your share will automount at boot.

(Visited 5,300 times, 10 visits today)