chown not working in mounted partition

13,719

The partition has a non-Unix file system without support for Unix permissions.

The fuse layer decides to give all files 0777 permissions and assigns the user and group of the user who mounted the filesystem to them.

You will not be able to change the permissions or ownership of these files for as long as they reside on that partition.

Share:
13,719

Related videos on Youtube

devil0150
Author by

devil0150

Updated on September 18, 2022

Comments

  • devil0150
    devil0150 almost 2 years

    I'm using Fedora 24 and I have two partitions. I login as user and mount the second partition by clicking on it on the file manager. A window pops up asking for my password so I'm assuming the mount is performed as root.

    However, all the files in the mounted partition have user as the owner, and chown doesn't work on them.

    [root@mypc Downloads]# chown root:root pointer2.txt 
    [root@mypc Downloads]# ls -la pointer2.txt 
    -rwxrwxrwx. 1 user user 945 Aug  2  2016 pointer2.txt
    

    What is the problem here? Is this normal? Can it be fixed?

    Here is the relevant output of cat /proc/mounts (line break added for clarity):

    /dev/sda2 /run/media/user/666EF0326EEFF8A7 fuseblk rw,nosuid,nodev,relatime,user_id=0,
    group_id=0,default_permissions,allow_other,blksize=4096 0 0
    
    • Admin
      Admin almost 7 years
      What type of filesystem is in use? Are you performing the chown as root?
    • Admin
      Admin almost 7 years
      @Kusalananda Yes, I'm running chown as root. The filesystem type shows up as fuseblk. I don't know what that means, but I'm dual booting, and this is the Windows partition.
    • Admin
      Admin almost 7 years
      This is probably a non-Unix filesystem like FAT. Add the output of cat /proc/mounts to your question.
  • devil0150
    devil0150 almost 7 years
    And I'm assuming there's no way to change the partition type while keeping the data, unless I backup first and then put the files back after formatting?
  • Kusalananda
    Kusalananda almost 7 years
    @devil0150 Reformatting the partition with a Unix native filesystem would work (back up files first!), but would likely make it unusable from Windows.