chown command returning Operation not permitted [closed] chown command returning Operation not permitted [closed] linux linux

chown command returning Operation not permitted [closed]


The reason is because the ownership and permissions are defined at mount time for the vfat FS.

Manual page mount(8):

Mount options for fat ..

   uid=value and gid=value          Set the owner and group of all files.  (Default: the uid and gid          of the current process.)   umask=value          Set the umask (the bitmask  of  the  permissions  that  are  not          present).  The default is the umask of the current process.  The          value is given in octal.

There are at least three things you can do:

(1) Give pi:pi access to the entire /media/USBHDD1 mount:

mount -o remount,gid=<pi's gid>,uid=<pi's uid> /media/USBHDD1

To determine pi's uid:

cat /etc/passwd |grep pi

To determine pi's gid:

cat /etc/group |grep pi

(2) Give everyone access to /media/USBHDD1 by changing the umask and dmask (not recommended):

mount -o remount,umask=000,dmask=000 /media/USBHDD1

(3) Change the partition to a different file system. Only do this if you're not accessing the the external hard drive from a windows computer:

You won't be able to convert the file system from VFAT to a Unix-compatible FS, so you'll have to backup the contents of the drive, format as EXT3+ or reiserfs, then copy the contents back. You can find tutorials for doing this on the web.