adding read/write permissions when mounting Fat32 usb to raspberry pi

There is a more recent post on this subject at the below link which covers more detail of mounting a windows based NTFS storage device (flash drive or HDD etc) onto a Linux system.

Mounting NTFS to Raspberry Pi 3

Last year I was given a Raspberry Pi 3 Model B and to be honest at the time I wasn’t so sure what to do with it. A few days ago I decided I would create a small server with it.

Now I wont go into the whole process here as its available across the web, the guide I followed is wikiHow, raspberry pi server.

I also wanted to expand on the little pi’s storage and figured 64GB would do for now as I’m still in the early days of .html .js and .css so I got a sanDisk Cruzer Blade 64GB.

With the pi set up and using ssh and FileZilla I wanted to create and learn html, css and JavaScript then be able to transfer them to the pi and hey presto – website!

I had some trouble with this as I had mounted the usb drive to the correct directory but whenever I tried to transfer a file, errors. Sad times.

Now the line of code I needed and that was the MOST hidden line of code on the internet was this,

/dev/sda1       /media/usbhdd      vfat       auto,user,rw,uid=pi,gid=pi   0  0

in the above code, /dev/sda1 is the usb drive and /media/usbhdd is the location to mount the usb. The rest is somewhat foreign to me and if someone would like to explain it to me I’d like to know.

Ok so I went ahead and made this more permanent by adding the usb drive to the /etc/fstab.

To do this type the following,

sudo nano etc/fstab

then add the line and save and exit, use ‘ctrl+O’ then hit enter to save and then ‘ctrl+X’ to exit.

Thanks to this line of code which I found here I can now transfer files using FileZilla.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s