doubleudee1
Posts: 158
Joined: Fri Nov 30, 2018 2:39 pm
Location: Wales

how do I give pi ownership of this folder?

Tue Sep 17, 2019 9:05 am

Code: Select all

[email protected]:~ $ ls -lh
total 40K
lrwxrwxrwx 1 pi   pi     16 Sep 16 16:30 '~CCTV_In' -> /home/pi/CCTV_In
drwxrwxrwx 1 root root 4.0K Sep 17 09:09  CCTV_In
drwxr-xr-x 2 pi   pi   4.0K Jul 10 01:42  Desktop
drwxr-xr-x 2 pi   pi   4.0K Jul 10 01:42  Documents
drwxr-xr-x 2 pi   pi   4.0K Jul 10 01:42  Downloads
drwxr-xr-x 2 pi   pi   4.0K Jul 10 01:15  MagPi
drwxr-xr-x 2 pi   pi   4.0K Jul 10 01:42  Music
drwxr-xr-x 2 pi   pi   4.0K Jul 10 01:42  Pictures
drwxr-xr-x 2 pi   pi   4.0K Jul 10 01:42  Public
drwxr-xr-x 2 pi   pi   4.0K Jul 10 01:42  Templates
drwxr-xr-x 2 pi   pi   4.0K Jul 10 01:42  Videos
pi owns everything here except for the directory 'CCTV_In'?
I've tried these commands:-

Code: Select all

[email protected]:~ $ sudo chown pi:pi -R /usr/CCTV_In
chown: cannot access '/usr/CCTV_In': No such file or directory
[email protected]:~ $ sudo chown pi:pi -R /CCTV_In
chown: cannot access '/CCTV_In': No such file or directory
[email protected]:~ $ sudo chown pi:pi -R /home/pi/CCTV_In
Although I don't get a fault reurned on the last command 'sudo chown pi:pi -R /home/pi/CCTV_In', it still shows up as being owned by 'roor'?

Any ideas?
Make the most of your family and friends , your children grow up too quickly and you don't notice yourself ageing, friends dissapearing, moving on. You make plans for your future, but they can all be smashed in an instant, live life and enjoy. :)

jbudd
Posts: 1018
Joined: Mon Dec 16, 2013 10:23 am

Re: how do I give pi ownership of this folder?

Tue Sep 17, 2019 10:24 am

You seem to have a poor understanding of Linux pathnames.

Your command sudo chown -R pi:pi /home/pi/CCTV_In should work. Perhaps it doesn't because the directory is in use by another program.

Try stopping your CCTV program then changing ownership. Or rename the directory and create a new one.

doubleudee1
Posts: 158
Joined: Fri Nov 30, 2018 2:39 pm
Location: Wales

Re: how do I give pi ownership of this folder?

Tue Sep 17, 2019 11:00 am

sorry, CCTV_In isn't a directory, it's an external HDD, also the '~CCTV_In' is a symlink'
Make the most of your family and friends , your children grow up too quickly and you don't notice yourself ageing, friends dissapearing, moving on. You make plans for your future, but they can all be smashed in an instant, live life and enjoy. :)

jbudd
Posts: 1018
Joined: Mon Dec 16, 2013 10:23 am

Re: how do I give pi ownership of this folder?

Tue Sep 17, 2019 11:09 am

sorry, CCTV_In isn't a directory, it's an external HDD
Ummm it's a directory, upon which an external disk is mounted?

I don't think you can change the ownership of a mount point, you have to change the ownership of the file mounted on it. But if that's an external hard disk I have no idea.

Andyroo

Re: how do I give pi ownership of this folder?

Tue Sep 17, 2019 12:19 pm

You can try adding

Code: Select all

uid=pi,gid=pi
to the mount in fstab

I think the change owner only works when the folder is not being used at the time, so you have to dismount (unmount sounds better :?: ),change then mount it the drive again.

User avatar
Roken
Posts: 307
Joined: Sun Dec 31, 2017 4:35 pm
Location: UK

Re: how do I give pi ownership of this folder?

Tue Sep 17, 2019 7:16 pm

chown the mountpoint before mounting - works on my desktop (Arch)
Headless PI. OMG, someone cut it's head off. Oh, hang on. it didn't have one to start with.

Return to “Beginners”