I have a directory structure owned by a certain group, and I am a member of the group that owns these directories. I am able to create files in one directory, but not in another, even though the permissions are the same.

alan@bricky:/mnt/storage/media$ stat Music Music\ \(Lossy\)/
  File: `Music'
  Size: 34          Blocks: 8          IO Block: 4096   directory
Device: fb00h/64256d    Inode: 4215424     Links: 3
Access: (2775/drwxrwsr-x)  Uid: ( 1001/   media)   Gid: ( 1001/   media)
Access: 2011-08-19 11:45:03.182586898 -0700
Modify: 2011-08-19 11:44:01.412840027 -0700
Change: 2011-08-19 11:45:02.734603240 -0700
  File: `Music (Lossy)/'
  Size: 6           Blocks: 8          IO Block: 4096   directory
Device: fb00h/64256d    Inode: 1512056832  Links: 2
Access: (2775/drwxrwsr-x)  Uid: ( 1001/   media)   Gid: ( 1001/   media)
Access: 2011-08-19 11:45:03.190586606 -0700
Modify: 2011-08-19 10:34:46.526530313 -0700
Change: 2011-08-19 11:45:02.738603094 -0700
alan@bricky:/mnt/storage/media$ touch Music/test
alan@bricky:/mnt/storage/media$ touch Music\ \(Lossy\)/test
touch: cannot touch `Music (Lossy)/test': Permission denied
  • Is it mounted read-only? mount command will show you. – Paul Aug 19 '11 at 21:39
  • Both directories are part of the same mount point, so that is not the issue. If I use sudo to touch the file as root or media, it creates it just fine. – Alan Berndt Aug 19 '11 at 23:36
  • What happens if you do 'newgrp media' and write into those directories? – Matthew Ife Jul 2 '12 at 0:49
  • Do you have any ACLs on either directory (getfacl to check)? Does either directory have any extended attributes (lsattr to check)? Oh, just noticed this question is almost a year old... – Patrick Jul 2 '12 at 2:50

Wild guess:

  1. Music/test already exists (with perms, or similar, that allow the touch to succeed).
  2. Music\ \(Lossy\)/test does not exist (or has perms that do not allow a successful touch).
  3. Your user is not in the media group (or you haven't invoked a login shell since you became a member).
  • 1. Neither file already existed, but the "Music Lossy" directory was completely empty while the Music directory has several subdirectories. 2. This file didn't exist, and apparently there are some permissions blocking the touch, but what permissions they are is the point of this question. 3. My user is in the media group and this shell was invoked after my user was added. – Alan Berndt Aug 22 '11 at 16:14
  • From what you've posted it would appear that 'Music' has only one real sub-directory (with several of its own, perhaps). I think you'll need to supply more information about your system before you get an answer that's anything beyond a wild guess. The fstab entry for the mount point in question, or at least some description of the filesystem type and mount options, would be a good start. The output of groups as run by your troubled user. Also ls -ld Music/ Music\ \(Lossy\)/ would hurt fewer eyeballs, and might provide a better response. And, anything else you think might be relevant. – Marty Aug 22 '11 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.