Not allowed to change mode even with root privileges

5,716

Solution 1

The reason this was happening was because the data wasn't actually stored in folder/, it was stored in a different location and was mounted to folder/. I had to find the real location of the data and change the mode there, which allowed me to remove the folder afterwords.

Solution 2

Before you can delete the folder, you need to unmount it with fusermount (encfs is a fuse-based filesystem):

fusermount -uz folder

The u flag tells fuse to unmount, and the z flag tells it to do it lazily (when no other operations are pending; usually works if normal unmount doesn't).

Solution 3

At first guess, I would say the file system you mounted and are extracting to has some issues. The mounted drive might be mounted read only? Or some other permissions issues related to the system you mounted. But I'm out of practice on telling you precisely what to do. Just pointing you in that direction. :) Hope it helps.

Share:
5,716

Related videos on Youtube

Nug U
Author by

Nug U

Updated on September 18, 2022

Comments

  • Nug U
    Nug U over 1 year
    sudo chmod a+rwx folder/
    [sudo] password for user:
    chmod: cannot access 'folder/': Permission denied
    

    All I'm trying to do is delete the folder, but I can't figure out how to. I'm certain my password is fine.

    I'll give what I think might be relevant but let me know if you have any questions.

    • This folder is in another folder which I 'mounted' using encfs
    • My account is the only account on this computer.
    • This folder was originally in a zip file. I moved the zip file into the mounted drive and extracted it, and then deleted the zip file. (The extraction failed and the folder didn't come out how it should have, so I want to delete it.)
    • lsatr folder/ lsattr: Inappropriate ioctl for device While reading flags on subfolder/
    • Ayush Gupta
      Ayush Gupta over 7 years
      post result of lsattr folder/
    • Zanna
      Zanna over 7 years
      does encfs support Linux file permissions?
    • Nug U
      Nug U over 7 years
      lsattr: Inappropriate ioctl for device While reading flags on folder/subfolder1 lsattr: Inappropriate ioctl for device While reading flags on folder/subfolder2
    • Ayush Gupta
      Ayush Gupta over 7 years
      do a simple lsattr then, while in the directory containing folder
    • Zanna
      Zanna over 7 years
      that error means the filesystem doesn't support extended permission attributes.
    • Ayush Gupta
      Ayush Gupta over 7 years
      post result of cat /proc/mounts
    • Nug U
      Nug U over 7 years
      It's very long. What's the best way to post it? I'll post the line that mentions the folder in question below
    • Nug U
      Nug U over 7 years
      encfs /home/nug/Documents/top/folder/ fuse.encfs rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
    • Nug U
      Nug U over 7 years
      Got it. I'll post the solution
  • Nug U
    Nug U over 7 years
    Perfect. You helped me figure it out