pixel
Auto-mount USB on a raspberry pi 2

Auto-mount USB on a raspberry pi

0
(0)

How to setup mount / auto-mount USB Hard Drive

Follow the simple steps in the order mentioned below to have your USB drive mounted on e.g.
your Raspberry Pi every time you boot it.

These steps are required especially if your are setting up a Samba share,

or a 24×7 torrent downloader,
or alike where your Raspberry Pi must have your external storage already mounted and ready for
access by the services / daemons.

Step 0.

Plug in your USB HDD / Drive to Raspberry Pi.

If you are using a NTFS formatted drive,

install the following:

sudo apt-get install ntfs-3g

Stsudo raspi-config, onlyep 1.

Log on RasPi using SSH terminal and execute:

ls -l /dev/disk/by-uuid/

You will see something like the following:

lrwxrwxrwx 1 root root 10 Jan 1 1970 0AC4D607C4D5F543 -> ../../sda1

Note down the value of the UUID –> 0AC4D607C4D5F543

Step 2.

Create a location for mount point:

sudo mkdir /media/NASDRIVE

Give proper permission:

sudo chmod 775 /media/NASDRIVE



Advertentie :


Step 3.

Mount the USB Drive and then check if it is accessible at /media/NASDRIVE

sudo mount -t ntfs-3g -o uid=,gid= /dev/sda1 /media/NASDRIVE

Note:
ntfs-3g for NTFS Drives = e.g. pi
vfat for FAT32 Drives
ext4 for ext4 Drives

Step 4.

Now, we will configure RasPi to do this after every reboot:

Take a backup of current fstab

sudo cp /etc/fstab /etc/fstab.backup

Add the mount information in the fstab file (sudo nano /etc/fstab):
UUID=0AC4D607C4D5F543 /media/NASDRIVE ntfs-3g rw,defaults 0 0

Step 5.

Reboot

Turn on the GUI mode by

sudo raspi-config,

only if required.

You should see your USB drive automatically mounted at /media/NASDRIVE

Wat vond je van deze post?

Klik op een ster om deze te beoordelen!

Gemiddelde score 0 / 5. Aantal stemmen: 0

Tot nu toe geen stemmen! Wees de eerste die dit bericht beoordeelt.

1 gedachte over “Auto-mount USB on a raspberry pi”

  1. blank

    Hier was ik naar op zoek. Dank! Even vraag : In jouw voorbeeld is NASDRIVE de (reeds gegeven) naam van de disk die op een desktop getoond wordt? Maw als mijn disk de naam ( of label oid) FREECOM heeft dan kan ik dat in jouw voorbeeld wijzigen in FREECOM? Ik zat er even mee te stuntelen , vandaar mijn vraag -:) De commando’s maakten wel een folder FREECOM aan in de home root maar geen mounting configuratie Dank alvast !

Laat een reactie achter

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *

Winkelwagen