Search content for your interest. If you want to get more answers or contribute, click one of the buttons below!

Sign In Register

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to connect and mount a NTFS USB drive to Raspberry Pi 3

edited September 2016 in Plex

Typically a plethora of information is covered in the "How to install Plex Media Server on Raspberry Pi 2 / 3" eBook that is for sale on our website.
USB drives, CIFS shares (network shares), NAS, for NTFS,EXT4 etc. etc partition types, network design considerations and configuration options, 3G/4G configurations, IPV4 forwading, masquerading NAT'ting etc. etc.and much, much more. If you want to really tweak what you have I do recommend giving our eBook a try.

Make sure you have a # prompt. if you have a $ prompt please proceed each command with sudo to ensure you have sufficient rights when running the commands for e.g. command reboot becomes sudo reboot. (sudo = "super user do").
Keyboard commands ocurr in parenthasis [ENTER] means press enter on your keyboard.

This guide makes the assumption the external USB drive is a 2.5" , 3.5" powered externally or even a Flash (Pen) Drive but all have a NTFS partition. If it is other type partitions please refer to the eBook mentioned above.
Use console or remote Shell session using a SSH client like puTTY. Be sure to login as root user with raspberry as password. If you did not purchase an image from and are using a Raspbian OS then you will either login as user pi and raspberry as password and proceed all the commands with sudo or assign a password to root user using the commands below then login as root. Please note that in the example below password raspberry is assigned to root user, you can make the password anything you like.

sudo passwd root
Now login again using console or shell session as root user raspberry as password.

Shutdown your Raspberry Pi
shutdown -h now

Connect your USB drive, if it is an external drive ensure it is powered from a different source other that the USB port of the raspberry Pi. Power up your USB drive first.If it is a Pen drive or flash stick then just proceed to the next step.
Now power up your raspberry Pi by unplugging and re-plugging the power connector.

Once your Pi has booted you need to locate your USB drive. It will be mapped as a device.
Run this command to list your drives.

fdisk -l

Typically it is /dev/sda or /dev/sda1 or could be /dev/sdb or sdb1 depending on how the partitions are setup.
Look at the sizes of your drives to assist you identify the correct drive and its mapping. use this command to show disk free information in human readable format.

df -h

Look for the size of the mapped device matching that of your external drive and you will now know which device it is.
If you pruchased an image from then all the latest firmware and drivers will already be installed thus there is no need to load any packages or run any linux updates. However, if you didn't purchase an image from us then then you will need to first install the read/write NTFS driver for Linux.

apt-get update
apt-get install ntfs-3g -y

We just need to create a mount point. a mount point is a folder that maps to your drive once your drive is mounted. thus everything on your external drive (once mounted) will appear under that folder when acessed from Linux.
Now we will create the mount point and add the mount to the fstab to make it persistent across reboots.
The example uses the folder named plex_library but you can name it whatever you prefer.

mkdir -p /plex_library
nano /etc/fstab

Add this line to the bottom of the fstab replacing /dev/sda with your device mapping

/dev/sda /plex_library ntfs-3g defaults 0 0

Like this

Now save and exit the editor [CTRL]+[X], [Y], [ENTER]

Now mount the drive.

mount -a

If there is an error check the device mapping or your entries in the /etc/fstab file and keep repeating the above steps untill your drive mounts. Typically device mapping or syntax are common issues.
If you did this correctly the command will not produce an error but return to the command prompt. Access and list your drive contents.

cd /plex_library
ls -l

Reboot your Pi init 6 and repeat acessing and listing the folder content steps to check that the mount survives reboots.

If you did not get an error and can access your drive content and it survives reboots then you can now use FileZilla FTP client or a FTP client of your choice to transfer media etc. to your external drive by placing subfolders and content in the /plex_library folder. If you did not purchase an image from us you will first need to install FTP services and configure FTP users on your Raspberry Pi, the step by step guide is included in our eBook mentioned above. If you did pruchase an image from us then all the setups have already been done, please use root user with raspberry as password.

You can now add the libraries in plex, make sure your Raspberry Pi has internet access otherwise it will not download the fanfare and metadata for the media content you are adding in the libraries.
Also, ensure you have run the command raspi-config and expanded the file system on the Micro SD card else transcoding and a few other functions will not work due to limited space.
Also, check who (user) plex is running as cat /etc/default/plexmediaserver if the last line says =root then you are OK. if it says =plex then change it to =root like this.

nano /etc/default/plexmediaserver

Now save and exit the editor [CTRL]+[X], [Y], [ENTER] , and reboot your Raspberry Pi

init 6
Best wishes.
The iIot online team.

Sign In or Register to comment.

Contact us

Get In Touch