LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-29-2015, 04:07 PM   #1
makem
LQ Newbie
 
Registered: Nov 2013
Posts: 16

Rep: Reputation: Disabled
Permissions Permissions Permissions!


Hi,

I have a directory which I am unable to change the permissions, owner, goup, anything!

Code:
pi@OpenVPN-Server /media $ ls -la
total 20
drwxr-xr-x  5 root root 4096 Jul 27 18:42 .
drwxr-xr-x 22 root root 4096 Jul 26 19:04 ..
drwxrwxrwx  1 root root 4096 Jul 27 23:24 128gb
drwxrwxrwx  2 pi   pi   4096 Jul 21 13:48 13d368bf-6dbf-4751-8ba1-88bed06bef77
drwxrwxr-x  4 pi   pi   4096 Jul 27 00:34 pi2Data
pi@OpenVPN-Server /media $

pi@OpenVPN-Server /media $ sudo chmod 775 -R 128gb
pi@OpenVPN-Server /media $ ls -la
total 20
drwxr-xr-x  5 root root 4096 Jul 27 18:42 .
drwxr-xr-x 22 root root 4096 Jul 26 19:04 ..
drwxrwxrwx  1 root root 4096 Jul 27 23:24 128gb
drwxrwxrwx  2 pi   pi   4096 Jul 21 13:48 13d368bf-6dbf-4751-8ba1-88bed06bef77
drwxrwxr-x  4 pi   pi   4096 Jul 27 00:34 pi2Data
pi@OpenVPN-Server /media $

pi@OpenVPN-Server /media $ sudo chown pi:pi 128gb
pi@OpenVPN-Server /media $ ls -la
total 20
drwxr-xr-x  5 root root 4096 Jul 27 18:42 .
drwxr-xr-x 22 root root 4096 Jul 26 19:04 ..
drwxrwxrwx  1 root root 4096 Jul 27 23:24 128gb
drwxrwxrwx  2 pi   pi   4096 Jul 21 13:48 13d368bf-6dbf-4751-8ba1-88bed06bef77
drwxrwxr-x  4 pi   pi   4096 Jul 27 00:34 pi2Data
pi@OpenVPN-Server /media $
Assistance?

[edit] Forgot to mention the diretory is a NTFS formatted USB stick attached to a Raspberry Pi2 running Raspbian if that makes a difference.

Last edited by makem; 07-29-2015 at 04:11 PM. Reason: Forgot to mention the diretory is a NTFS formatted USB stick
 
Old 07-29-2015, 04:23 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
What's the output of "mount"?
 
1 members found this post helpful.
Old 07-29-2015, 04:23 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 3,876
Blog Entries: 1

Rep: Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998
Quote:
Originally Posted by makem View Post
Code:
drwxrwxrwx  1 root root 4096 Jul 27 23:24 128gb
The "1" is suspicious - all directories on a *nix filesystem will show at least 2 links - itself and "." inside itself.

What filesystem type is this? What filesystem and perms is the media/ parent directory?

*** UPDATED

I see you updated while I was typ-o-ing... NTFS makes the difference.

As suicidaleggroll asked, what does mount say?

Last edited by astrogeek; 07-29-2015 at 04:37 PM. Reason: typo.s.s.s 3,4,5 times a charm
 
1 members found this post helpful.
Old 07-29-2015, 05:00 PM   #4
makem
LQ Newbie
 
Registered: Nov 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
What's the output of "mount"?
Code:
pi@OpenVPN-Server / $ mount
/dev/root on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=372880k,nr_inodes=93220,mode=755)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=75436k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=150860k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/sdb1 on /media/pi2Data type ext4 (rw,relatime,data=ordered)
/dev/sdc1 on /media/128gb type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
/dev/mmcblk0p2 on /media/13d368bf-6dbf-4751-8ba1-88bed06bef77 type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks)
pi@OpenVPN-Server / $
 
Old 07-29-2015, 05:02 PM   #5
makem
LQ Newbie
 
Registered: Nov 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by astrogeek View Post
The "1" is suspicious - all directories on a *nix filesystem will show at least 2 links - itself and "." inside itself.

What filesystem type is this? What filesystem and perms is the media/ parent directory?

*** UPDATED

I see you updated while I was typ-o-ing... NTFS makes the difference.

As suicidaleggroll asked, what does mount say?
Yes, I also saw the '1' and knew it was unusual.

Code:
pi@OpenVPN-Server / $ ls -la
total 96
drwxr-xr-x  22 root root  4096 Jul 26 19:04 .
drwxr-xr-x  22 root root  4096 Jul 26 19:04 ..
drwxr-xr-x   2 root root  4096 Jul 27 16:15 bin
drwxr-xr-x   4 root root 16384 Jan  1  1970 boot
drwxr-xr-x  13 root root  3360 Jul 27 18:42 dev
drwxr-xr-x 107 root root  4096 Jul 27 17:21 etc
drwxr-xr-x   3 root root  4096 May  6 23:20 home
drwxr-xr-x  14 root root  4096 May  7 00:15 lib
drwx------   2 root root 16384 May  6 23:10 lost+found
drwxr-xr-x   5 root root  4096 Jul 27 18:42 media
drwxr-xr-x   2 root root  4096 Jul 21 00:27 mnt
drwxr-xr-x   6 root root  4096 May  7 00:24 opt
dr-xr-xr-x 137 root root     0 Jan  1  1970 proc
drwx------   7 root root  4096 Jul 20 16:17 root
drwxr-xr-x  20 root root   780 Jul 27 18:42 run
drwxr-xr-x   2 root root  4096 Jul 27 16:15 sbin
drwxr-xr-x   2 root root  4096 Jun 20  2012 selinux
drwxr-xr-x   2 root root  4096 May  6 23:12 srv
dr-xr-xr-x  11 root root     0 Jul 29 20:36 sys
drwxrwxrwt   5 root root  4096 Jul 29 21:17 tmp
drwxr-xr-x  10 root root  4096 May  6 23:12 usr
drwxr-xr-x  12 root root  4096 Jun 29 22:58 var
pi@OpenVPN-Server / $
'media' is on another USB stick which has the Raspbian filesystem on it, formatted ext4. The SD card now only has the boot files and an empty filesystem directory which I must stop mounting at some time.

Last edited by makem; 07-29-2015 at 05:14 PM. Reason: forgot to answer a question
 
Old 07-29-2015, 05:21 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Quote:
Originally Posted by makem View Post
Code:
pi@OpenVPN-Server / $ mount
/dev/sdc1 on /media/128gb type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
Looks like you're forcing the user:group to root in the mount, probably why you can't chown it. I'm not sure about the permissions, but it may have something to do with it being ntfs. I don't have a lot of experience with ntfs support on Linux.
 
1 members found this post helpful.
Old 07-29-2015, 05:35 PM   #7
makem
LQ Newbie
 
Registered: Nov 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
Looks like you're forcing the user:group to root in the mount, probably why you can't chown it. I'm not sure about the permissions, but it may have something to do with it being ntfs. I don't have a lot of experience with ntfs support on Linux.
Yes, something is certainly wrong there because:

Code:
pi@OpenVPN-Server / $ sudo nano /etc/fstab

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
#/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
/dev/disk/by-uuid/6757d089-fec5-4ddd-89bd-8c5a0b56cd0c  / ext4 defaults,noatime$
# a swapfile is not a swap partition, so no using swapon|off from here on, use $

#tmpfs /tmp tmpfs defaults,noatime,nosuid,size=100m 0 0

#tmpfs /var/tmp tmpfs defaults,noatime,nosuid,size=30m 0 0

#tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=100m 0 0

#tmpfs /var/run tmpfs defaults,noatime,nosuid,mode=0755,size=2m 0 0

#ln -s /media/pi2Data   /media/pi2Data  autoddefaults 0 2

#/dev/sdb1 /media/pi2Data auto noatime 0 0

UUID=81a7719a-9e86-45a9-bf71-947f67562f49 /media/pi2Data auto defaults 1 2

UUID=E2EC725DEC722C43 /media/128gb ntfs-3g defaults 1 2

Last edited by makem; 07-29-2015 at 05:53 PM.
 
Old 07-29-2015, 06:40 PM   #8
makem
LQ Newbie
 
Registered: Nov 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Tried this fstab:


Code:
proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
#/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
/dev/disk/by-uuid/6757d089-fec5-4ddd-89bd-8c5a0b56cd0c  / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, so no using swapon|off from here on, use  dphys-swapfile swap[on|off$


UUID=81a7719a-9e86-45a9-bf71-947f67562f49 /media/pi2Data auto defaults 1 2

#UUID=E2EC725DEC722C43 /media/128gb ntfs-3g defaults 1 2
UUID=E2EC725DEC722C43 /media/128gb ntfs-3g defaults,auto,umask=000,users,rw 0 0
Check it works:

Code:
pi@OpenVPN-Server ~ $ sudo mount -a
pi@OpenVPN-Server ~ $ sudo mount
/dev/root on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=372880k,nr_inodes=93220,mode=755)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=75436k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=150860k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/sdb1 on /media/pi2Data type ext4 (rw,relatime,data=ordered)
/dev/sdc1 on /media/128gb type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
/dev/mmcblk0p2 on /media/13d368bf-6dbf-4751-8ba1-88bed06bef77 type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks)
pi@OpenVPN-Server ~ $
No change:

Code:
/dev/sdc1 on /media/128gb type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
Also this fstab:


Code:
proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
#/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
/dev/disk/by-uuid/6757d089-fec5-4ddd-89bd-8c5a0b56cd0c  / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, so no using swapon|off from here on, use  dphys-swapfile swap[on|off]  for that


UUID=81a7719a-9e86-45a9-bf71-947f67562f49 /media/pi2Data auto defaults 1 2

#UUID=E2EC725DEC722C43 /media/128gb ntfs-3g defaults 1 2
#UUID=E2EC725DEC722C43 /media/128gb ntfs-3g defaults,auto,umask=000,users,rw 0 0
UUID=E2EC725DEC722C43 /media/128gb ntfs-3g uid=1000,gid=1000,umask=007 0 0
Check it works:
Code:
pi@OpenVPN-Server ~ $ sudo mount -a
pi@OpenVPN-Server ~ $ sudo mount
/dev/root on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=372880k,nr_inodes=93220,mode=755)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=75436k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=150860k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/sdb1 on /media/pi2Data type ext4 (rw,relatime,data=ordered)
/dev/sdc1 on /media/128gb type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
/dev/mmcblk0p2 on /media/13d368bf-6dbf-4751-8ba1-88bed06bef77 type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks)
pi@OpenVPN-Server ~ $
Same result - still have no control over permission etc. maybe I should be looking at Windows 8.1 permissions.

The aim of this exercise is to access the Pi data remotely via a VPN server on my router.
 
Old 07-29-2015, 06:58 PM   #9
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
It may have to do with the ntfs driver on the Pi. Is there a reason you need the drive formatted as ntfs? Unless you absolutely need ntfs, you'll be much better off with a native Linux filesystem.
 
Old 07-29-2015, 07:13 PM   #10
SpudMan13
LQ Newbie
 
Registered: Jul 2015
Posts: 8

Rep: Reputation: Disabled
What happens if you create another mount point (e.g. /mnt2), unmount the memory stick from /media/128GB, and then mount it on /mnt2 with the same mounting parameters?
 
Old 07-29-2015, 07:22 PM   #11
makem
LQ Newbie
 
Registered: Nov 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
It seems that if the drive is NTFS chown and chmod will not work and are in fact not needed to access the data as pi even though all are root:root.

I think I must have made an error in setting this up and thought I needed to change the owner etc. to correct the error. I did not.

Thanks for the help and suggestions, they were informative.

I will mark this as solved. (If I can see how lol)
 
Old 07-29-2015, 07:32 PM   #12
makem
LQ Newbie
 
Registered: Nov 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
It may have to do with the ntfs driver on the Pi. Is there a reason you need the drive formatted as ntfs? Unless you absolutely need ntfs, you'll be much better off with a native Linux filesystem.
I use the Pi2 among other things, for watching Chinese streamed movies from the internet and movie files which my smart tv cannot show subs. Omxplayer can do both with settings from kweb.

I obtain quite a few movies via Windows and as some are 10gb in size I find it easier and much quicker to just move the USB stick to a Windows machine.

I agree a native Linux system would be far better and with the advent of Windows 10 I am in the process of changing all machines over to Linux - just a few bits of software I need first (mainly finance related). I have a dual boot Windows 7 and Ubuntu as a tester.
 
Old 07-29-2015, 07:34 PM   #13
makem
LQ Newbie
 
Registered: Nov 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by SpudMan13 View Post
What happens if you create another mount point (e.g. /mnt2), unmount the memory stick from /media/128GB, and then mount it on /mnt2 with the same mounting parameters?
I will try that in the morning thanks.
 
Old 07-30-2015, 12:54 PM   #14
makem
LQ Newbie
 
Registered: Nov 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by SpudMan13 View Post
What happens if you create another mount point (e.g. /mnt2), unmount the memory stick from /media/128GB, and then mount it on /mnt2 with the same mounting parameters?
Here we go:

Code:
pi@OpenVPN-Server ~ $ sudo mkdir /media/mnt2
pi@OpenVPN-Server ~ $ sudo umount /media/128gb
pi@OpenVPN-Server ~ $ sudo nano /etc/fstab
pi@OpenVPN-Server ~ $ sudo nano /etc/fstab
pi@OpenVPN-Server ~ $ sudo mount -a
pi@OpenVPN-Server ~ $ sudo mount
/dev/root on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=372880k,nr_inodes=93220,mode=755)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=75436k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=150860k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/sdb1 on /media/pi2Data type ext4 (rw,noatime,data=ordered)
/dev/mmcblk0p2 on /media/13d368bf-6dbf-4751-8ba1-88bed06bef77 type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks)
/dev/sdc1 on /media/mnt2 type fuseblk (rw,nosuid,nodev,noatime,user_id=0,group_id=0,allow_other,blksize=4096)
The fstab was:

Code:
proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
#/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
/dev/disk/by-uuid/6757d089-fec5-4ddd-89bd-8c5a0b56cd0c  / ext4 defaults,noatime$
# a swapfile is not a swap partition, so no using swapon|off from here on, use $


#UUID=81a7719a-9e86-45a9-bf71-947f67562f49 /media/pi2Data auto defaults 1 2
UUID=81a7719a-9e86-45a9-bf71-947f67562f49 /media/pi2Data auto noatime 0 0


#UUID=E2EC725DEC722C43 /media/128gb ntfs-3g defaults 1 2
#UUID=E2EC725DEC722C43 /media/128gb ntfs-3g defaults,auto,umask=000,users,rw 0 0

#UUID=E2EC725DEC722C43 /media/128gb ntfs-3g uid=1000,gid=1000,umask=007 0 0
##UUID=E2EC725DEC722C43 /media/128gb auto noatime 0 0
UUID=E2EC725DEC722C43 /media/mnt2 auto noatime 0 0
Any further thoughts?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Samba and permissions ( permissions seems ok but wont work anyway ) spooksman Linux - Networking 1 04-10-2014 10:58 AM
setfacl changes group permissions; giving another user rw permissions secretlydead Linux - Server 4 09-23-2012 12:12 AM
relation between programs permissions and permissions of the files they use rblampain Linux - Security 1 07-10-2011 09:40 PM
[SOLVED] filesystem permissions question - making so user can't change permissions? c0pe Linux - Security 4 07-12-2010 10:06 AM
[SOLVED] Lack basic understanding of permissions(apache permissions problem) cK` Linux - Newbie 7 04-09-2010 12:49 AM


All times are GMT -5. The time now is 02:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration