Page 1 of 1

Cant write to external drive

Posted: Tue Sep 27, 2016 8:47 am
by YodaVonBeck
Hi

Im setting up a timelapse have the code read for that.
Now I am trying to attached an external USB HD (FAT32) and I can mount it for boot using fstab - so far so good.
However when I try to write to it, I get an access denied.

This is the fstab code:
/dev/sda1 /mnt /vfat defaults 0 0

What am I missing?

Re: Cant write to external drive

Posted: Tue Sep 27, 2016 9:00 am
by RaTTuS
ls -la /mnt/vfat

I assume you have not got a space in /mnt/vfat in your fstab

in general fat does not have permissions correctly setup so you could write via sudo
however you can change the ownership of the mount to be the user pi and that will work

Re: Cant write to external drive

Posted: Tue Sep 27, 2016 9:25 am
by YodaVonBeck
In the fstab I have matched it to the other entries so I had to use some spaces. Is that a problem?

The drive is accessed via a Python script triggered via crontab . Do I need to find a way to use sudo

Re: Cant write to external drive

Posted: Tue Sep 27, 2016 12:54 pm
by YodaVonBeck
I found a way to make it work.

The crontab I had used so far was the pi crontab (I new to this, so I assumed theres was only one).
Instead I edited the roo/sudo crontab so the code would run as such. That meant that the right permissions were in place :)

Works like a charm now

Re: Cant write to external drive

Posted: Tue Sep 27, 2016 6:57 pm
by rpdom
YodaVonBeck wrote:Hi

Im setting up a timelapse have the code read for that.
Now I am trying to attached an external USB HD (FAT32) and I can mount it for boot using fstab - so far so good.
However when I try to write to it, I get an access denied.

This is the fstab code:
/dev/sda1 /mnt /vfat defaults 0 0

What am I missing?
That looks wrong. The filesystem type (third field) should be "vfat", not "/vfat".

Code: Select all

/dev/sda1 /mnt vfat defaults 0 0