0

I have two external harddrives that i want to read/write to so i used chmod 777 -R "the folder" but nothing happend so i look abit and saw that the user for the harddrives is root and not my use. Then i used chown -R "username_youwant" path_to_folder/folder_name and only get Operation not permitted then i use the su command so i become root and do the same chown as befor but get the same operation not premitted. the weird part that makes so i dont understad is that i have read/write permission in one of the harddrives but not the one that i want to add som files to. And now i dont know what to try next. to sum up what i have done:

  • chmod 777 -R "the folder"
  • chown -R "username_youwant" path_to_folder/folder_name
  • su + chown -R "username_youwant" path_to_folder/folder_name

1 Answers1

0

See how path_to_folder is mounted via mount | grep path_to_folder.

Read man 8 mount. It says, in part:

 The non-superuser mounts.
              Normally, only the superuser can  mount  filesystems.   However,
              when fstab contains the user option on a line, anybody can mount
              the corresponding filesystem.

              Thus, given a line

                     /dev/cdrom  /cd  iso9660  ro,user,noauto,unhide

              any user can mount the iso9660 filesystem found on  an  inserted
              CDROM using the command

                     mount /dev/cdrom

              or

                     mount /cd

              For  more  details,  see fstab(5).  Only the user that mounted a
              filesystem can unmount it again.  If any user should be able  to
              unmount  it,  then  use users instead of user in the fstab line.
              The owner option  is  similar  to  the  user  option,  with  the
              restriction that the user must be the owner of the special file.
              This may be useful e.g. for /dev/fd if a login script makes  the
              console user owner of this device.  The group option is similar,
              with the restriction that the user must be member of  the  group
              of the special file.

Also look at the remount option.

waltinator
  • 36,399
  • Permissions not work if it is a VFAT partition. And non-root users can mount removable partitions and users can mount partitions depending on fstab so your answer is not saying much. – Panther Dec 05 '16 at 19:56
  • whit the mount | grep path_to_folder i get the awnser: /dev/sdb1 on /media/chronus/VERBATIM HD type vfat (rw,nosuid,nodev,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

    /dev/sdc1 on /media/chronus/Elements type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)

    im new to linux and ubuntu so the man 8 mount is sadly not saying me so mutch :/

    – romaswe Dec 05 '16 at 20:02
  • fat does not support linux permissions. See https://help.ubuntu.com/community/MountingWindowsPartitions – Panther Dec 05 '16 at 20:18