lazydays
Posts: 7
Joined: Sat Apr 02, 2016 10:45 pm

Write permissions for external HDD

Sat Apr 16, 2016 9:14 am

Hi guys,

I'm very new to the Pi.

I have a Pi 3 running Raspbian Jessie.
I can see the drive at /media/pi/[my drive name] but I can't create a folder and I've tried to chown to 775 and 777. Neither worked.

I'm logged into terminal as pi.

Any help you can offer would be gratefully received. :)

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Write permissions for external HDD

Sat Apr 16, 2016 11:24 am

What's the filesystem on the external HD?

If it's FAT, FAT32, exFAT or NTFS then the security stops at the mount command. Mount it with -o uid=pi,gid=pi,umask=0022
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

lazydays
Posts: 7
Joined: Sat Apr 02, 2016 10:45 pm

Re: Write permissions for external HDD

Sat Apr 16, 2016 12:38 pm

Hiya and thanks for replying :)

Sorry - HDD is NTFS.

I added this to /etc/fstab - presume that is correct?

Code: Select all

/dev/sda2  /mnt  -o  uid=pi,gid=pi,umask-0022  0  2
I haven't formatted the HDD - just plug and play. It shows up with sda1 partitioned to Windows specific and sda2 is the main partition.

When I add the code to fstab it stops the system booting. The only way to get the pi to reboot is to remove or comment out the line above.

Thanks :)

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Write permissions for external HDD

Sat Apr 16, 2016 3:52 pm

You need umask=0022 not umask-0022
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

lazydays
Posts: 7
Joined: Sat Apr 02, 2016 10:45 pm

Re: Write permissions for external HDD

Sat Apr 16, 2016 3:56 pm

Oops - just checked the file and I've used umask=0022
Just a typo in the post.

lazydays
Posts: 7
Joined: Sat Apr 02, 2016 10:45 pm

Re: Write permissions for external HDD

Tue May 03, 2016 3:29 pm

Hi guys,

I'm still having trouble with this - everytime I change fstab it stops the pi from booting up until I remove the line.

Can anyone offer any help?

I'm using a pi3 and Raspbian Jessie.

Thanks!
Sandra

beta-tester
Posts: 1385
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: Write permissions for external HDD

Tue May 03, 2016 4:41 pm

lazydays wrote:

Code: Select all

/dev/sda2  /mnt  -o  uid=pi,gid=pi,umask-0022  0  2
I'm still having trouble with this - everytime I change fstab it stops the pi from booting up until I remove the line.
is there an other typo in your post or is it in your fstab...?
the "-o" is a syntax error for fstab it is only a command line option.
try this in your fstab

Code: Select all

/dev/sda2  /mnt  auto  uid=pi,gid=pi,umask=0022  0  0
EDIT: i am not entirely sure, but somewhere i read, that the default ntfs driver will mount only as readonly. to have full access to ntfs you have to install and use ntfs-3g
to install:

Code: Select all

sudo apt-get -y install ntfs-3g
and then your fstab entry:

Code: Select all

/dev/sda2  /mnt  ntfs-3g  uid=pi,gid=pi,umask=0022  0  0
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

Return to “Beginners”