We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

Wilson32
Posts: 1
Joined: Thu Sep 10, 2020 9:54 pm

Permission denied

Thu Sep 10, 2020 9:57 pm

Hello,

I am a newbie with the Pi, but I added a external drive to my Pi3 and when I try to move a file from my downloads folder to the new drive, I get the error cant be completed permission denied. I was trying to move a video file to the new drive, and again I am brand new to this so any help would be appreciated! Thanks!

Moonmarch
Posts: 894
Joined: Thu Mar 07, 2019 1:34 am

Re: Permission denied

Sat Sep 12, 2020 5:57 pm

Run a command in the terminal to verify the file type of each storage drive connected to the Raspberry Pi computer. Use this command in the terminal:

Code: Select all

sudo fdisk -l
File types FAT16/FAT32, and EXT4 will be usable out of the box. These file types does not require elevated user permissions to access the connected storage drives. File type NTFS I would say will require elevated user permissions. I haven't connected a NTFS drive to a Raspberry Pi computer in a long time. USB drives will use the FAT16/FAT32 file types. Boot media USB drives will use the FAT16/FAT32 file types. You will need to know how to use the command line to access the NTFS storage drive on the Raspberry Pi computer. From what I remember, you can install these 2 utilities to access the NTFS file system on a Linux computer. Run this command in the terminal:

Code: Select all

sudo apt install ntfs-3g-dev libfuse3-dev
Reboot the computer:

Code: Select all

sudo reboot
Check to see if you can access the external drive using the file manager. If you see the permission denied error when moving files to the storage drive. You will need to elevate user permissions. Here is a link to a guide that will show you how to access EXT4 partitions in Ubuntu:

How To Set Write Permission On ext4 Partition In Ubuntu Linux
https://itsfoss.com/set-write-permissio ... ntu-linux/

LTolledo
Posts: 6657
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Permission denied

Sat Sep 12, 2020 6:18 pm

new drive is most likely "owned" by root

to verify run the command

Code: Select all

ls -la <drive mount point>
on desktop versions of RPiOS the <drive mount point> is usually /media/pi/<usb drive label>
if not desktop version and you've specified the mount point via any method then use that

if its root then you need to change ownership of that mount point
run the command

Code: Select all

sudo chown -R <user:group> <drive mount point>
then check again

Code: Select all

ls -la <drive mount point>
after that try doing the file copy process again....
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

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

Re: Permission denied

Sat Sep 12, 2020 7:19 pm

It's nowt to do with the permissions of the mount point before you mount the drive. The NTFS driver has to compromise with the unix owner/group/world permission bits and will allow the mounter to have all permissions. If root mounts the drive for the pi user, you need to pass some extra options.

sudo mount /dev/sda1 /mnt -t ntfs-3g -o uid=pi,gid=pi
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on Bluesky or by LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

Return to “General discussion”