• sales

    +86-0755-88291180

Auto Mount an NTFS USB Drive on Raspberry Pi User Guide

Auto Mount an NTFS USB Drive on Raspberry Pi

From the Command Line, we need to first make sure Raspbian is completely up to date and install the neccesary package to make NTFS work which is called NTFS-3G. Once that’s done, we will do a quick reboot to make sure everything sticks in place.

sudo apt update
sudo apt upgrade
sudo apt install ntfs-3g -y
reboot

Next we need to create a directory on the Raspberry Pi that will act as the mount point for the USB Hard Drive. To keep it organised, we will create this in the directory mnt and we will call the folder usbhdd to keep it simple.

sudo mkdir /mnt/usbhdd

Now that we have the folder ready, we need to figure out what the hard drive partition is that we want to mount. To do this, we need to check out fdisk and see which partition is the one we want to mount. It should be the last in the long list. This could be sda2, sda1 or even sdb2 so look at the size and whichever is bigger should be the correct one. Mine shows 1.8T as the biggest partion so I know that sda1 is the one that I want.

sudo fdisk -l

Now we know our device partition, we need to get what is know as the Partition ID. This will let us mount the USB Hard Drive even if the device changes from sda1 to say sdb1. It has happened to me before and caused my whole Raspberry Pi to fail at boot up so this step is important. You should see a section called PARTUUID=”000xxxxx-00″ on the device line. My particular one was 770bcbdc-01 and that’s what you would need to write down.

sudo blkid

With our Partition ID, we can now add some information to the FSTAB so our drive will automatically boot each time, but first we want to figure out the ID of our current logged in user. This will be important I promise. It will probably be uid=1000 and gid=1000. We need to take note of both the uid and the gid numbers.

id

FSTAB is our next step. Here we need to add the information we have gathered so far and before we reboot, we are going to test that it worked so we don’t cause the raspberry pi to fail at boot up. So the following string needs to be inserted on a new line under the exisiting ones, replacing the following with your details. PARTUUID, Mount Point, GID and UID.

This opens the FSTAB so we can edit it with the auto mounting information.

sudo nano /etc/fstab

This is the code you need to put into the file. Once you are done, press Control X then Y then ENTER to save the file.

PARTUUID=770bcbdc-01 /mnt/usbhdd ntfs auto,exec,rw,user,dmask=002,fmask=113,uid=1000,gid=1000 0 0

Broken down a little, here’s what that all means

file system - PARTUUID=770bcbdc-01 - This is the partition id for in my case /dev/sda1
mount point - /mnt/usbhdd - This is the folder we created for mounting the USB Hard Drive
type - ntfs - This is the format the hard drive is in. It could be HFS+ for Apple, EXT4 for Linux of FAT32 for DOS
options - auto,exec,rw,user,dmask=002,fmask=113,uid=1000,gid=1000 - Long Story short, this gives all the permissions
dump - 0 - This means we don't want to create a dump
pass - 0 - This means we don't want to do a file system check everytime

With the file now saved, we need to check that there’s no errors in the file before we reboot. To do that, we need to try and mount the partition from the FSTAB file.

sudo mount -a

If no errors come up, then we can check that the device is mounted correctly

sudo df -h

If you see your device in the list, then we are safe to do a reboot of the Raspberry Pi.

reboot

Once we are rebooted, log in to the raspberry pi and check you USB Hard Drive has mounted by going to that folder.

cd /mnt/usbhdd

And then we can check what’s in the folder by listing it’s contents

ls -la
TAG: Raspberry Pi Pico 2 RP2350B 2.41 inch AMOLED Development Board QSPI Display TouchScreen 450x600 RM690BO FT6336 QMI8658 Raspberry Pi 5 DSI Bookworm ESP32 MLX90640 ESP32-S3 ETH Camera Development Board PoE RJ45 / OV2640 OV5640 Port / W5500 / Micro-SD Compatible With Raspberry Pi Pico Size Raspberry Pi PCF8591 expansion board LED GPIO IO test ADC/DCA Sensor Beginner board Industrial RS232 to RS485 ESP32-C3-Ornament-Trinket-LVGL-Astronaut-Clock-Watch-MINI-TV-1.69inch-Round-LCD-TouchScreen-ST7789-240x280 ESP32 S3 AI 1.85 inch Development Board with 1.85inch LCD Touchscreen Round Screen Electronic Badge Deepseek Raspberry Pi Pico 2 RP2350 With 0.96 inch LCD Display 0.96inch Screen 160×80 Onboard RP2350A Jetson RTL8822CE 5GHz WiFi Wireless Bluetooth5 Card NGFF-M.2 RTL8822CE-CG Core Raspberry Pi RTC Luckfox Pico SPI LCD ESP32 C3 1.44inch LCD Sensor Industrial Hybrid relay module RS485 Modbus RTU rail with isolation protection Raspberry Pi Pico Basics User Guide Power Raspberry Pi 5 5V5A Raspberry Pi 5 LIR2032 ESP32 C3