Unable to change file permission on Linux

This is a very simple question, but I cannot change the resolution of a file in Linux.

I am a root user, I can change the permission of a file if I copy the same file in the File System of my installed Linux. I cannot change the permissions on files / folder that are stored on a different partition.

Please give me a term, at least how to start debugging, I also don't see any errors. No sticky bits installed. Please help me by pointing out the steps I can follow to debug this issue.

This is the output of df -h

Filesystem                                              Size  Used Avail Use% Mounted on
rootfs                                                   46G   22G   22G  50% /
udev                                                     10M     0   10M   0% /dev
tmpfs                                                   393M  1.9M  391M   1% /run
/dev/disk/by-uuid/49c0f59c-9bb3-4755-8c1f-06da6159865e   46G   22G   22G  50% /
tmpfs                                                   5.0M     0  5.0M   0% /run/lock
tmpfs                                                   786M  944K  785M   1% /run/shm
/dev/sda2                                                46G   43G  1.3G  98% /home
/dev/sda6                                               278G  122G  157G  44% /media/056AFEAB51156F3F___
/dev/sda3                                                92G   16G   72G  18% /media/3a7cb05d-b822-4f3e-a330-da91013b605c_

      


Output for ls -al

drwx------ 1 prasenjit prasenjit     0 Oct 21 15:08 abi
drwx------ 1 prasenjit prasenjit  4096 Oct 21 15:08 art
drwx------ 1 prasenjit prasenjit  4096 Oct 21 15:08 bionic
drwx------ 1 prasenjit prasenjit     0 Oct 21 15:08 bootable
drwx------ 1 prasenjit prasenjit  4096 Oct 21 15:08 build
drwx------ 1 prasenjit prasenjit  4096 Oct 21 15:08 cts
drwx------ 1 prasenjit prasenjit  4096 Oct 21 15:08 dalvik
drwx------ 1 prasenjit prasenjit     0 Oct 21 15:08 developers
drwx------ 1 prasenjit prasenjit  4096 Oct 21 15:08 development
drwx------ 1 prasenjit prasenjit  4096 Oct 21 15:09 device
drwx------ 1 prasenjit prasenjit     0 Oct 21 15:09 docs
drwx------ 1 prasenjit prasenjit 36864 Oct 21 15:17 external

      


output for lsattr:

lsattr: Inappropriate ioctl for device While reading flags on ./abi
lsattr: Inappropriate ioctl for device While reading flags on ./art
lsattr: Inappropriate ioctl for device While reading flags on ./bionic
lsattr: Inappropriate ioctl for device While reading flags on ./bootable
lsattr: Inappropriate ioctl for device While reading flags on ./build
lsattr: Inappropriate ioctl for device While reading flags on ./cts
lsattr: Inappropriate ioctl for device While reading flags on ./dalvik
lsattr: Inappropriate ioctl for device While reading flags on ./developers
lsattr: Inappropriate ioctl for device While reading flags on ./development
lsattr: Inappropriate ioctl for device While reading flags on ./device
lsattr: Inappropriate ioctl for device While reading flags on ./docs
lsattr: Inappropriate ioctl for device While reading flags on ./external

      


Mount output

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=210750,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=401948k,mode=755)
/dev/disk/by-uuid/49c0f59c-9bb3-4755-8c1f-06da6159865e on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=803880k)
/dev/sda2 on /home type ext4 (rw,relatime,data=ordered)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/sda6 on /media/056AFEAB51156F3F___ type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
/dev/sda3 on /media/3a7cb05d-b822-4f3e-a330-da91013b605c_ type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks)

      


Let me know other commands that can help me debug. Any help is appreciated.

Thank you in advance

+3


source to share


2 answers


Section

ntfs does not support linux file permissions. Therefore, you cannot change the permissions. Alternatively, you can mount the drive with the required set of permissions.

Example:

mount -t ntfs -o rw,auto,user,fmask=0022,dmask=0022 /dev/sda6 /mnt/ntfsDrive/

      

Here my partition format was ntfs, so I mentioned this, rw is read / write permission, fmask and dmask are default file and directory permission when creating any file or folder and existing folders. Suppose you mentioned 0022, this means the file will be created from 755 and also for the folder. The other 2 fields: "/ dev / sda6" - my device, which is mounted in a folder named "/ mnt / ntfsDrive /".



You still won't be able to change the file / folder permission and it will be the same as you mentioned when installing the drive (fmask and dmask).

Please correct if something is wrong.

Please refer to: https://askubuntu.com/questions/11840/how-do-i-use-chmod-on-an-ntfs-or-fat32-partition

+3


source


try using the lsattr and chattr commands



it is possible that for some files / directories the chattr + file I was executed so that you do not undo it to change them even as root.

+1


source







All Articles