1

I.e. I want the permissions to be 1000, so I can rsync to it without needing sudo.

I tried sudo mount -o nofail,uid=1000,gid=1000,umask=007 /dev/sda1 /mnt/sda1 but that fails with EXT4-fs (sda1): Unrecognized mount option "uid=1000" or missing value.

According to https://askubuntu.com/a/432160/676 you cannot use uid=1000,gid=1000... why? A later thread suggest running sudo chmod g+s -R /mnt/sda1/. Is this really the right approach to get my drive mounted as 1000 instead of "nobody"??

3
  • 3
    The ext4 filesystem supports file ownership/permissions natively. You can set the ownership/permissions on the directory to which you're trying to sync to whatever values you want. Feb 22, 2021 at 3:51
  • 1
    Use sudo chown 1000:1000 /mnt/sda1/whatever to change ownerships, add option -R to do this recursively (chmod g+s is really something else).
    – Freddy
    Feb 22, 2021 at 4:03
  • @hendry I understand your bewilderment. In order to mount a non UNIX-like filesystem (e.g., FAT32) with a certain user, we have a simpler syntax—just a uid option—than when we use a UNIX-like (e.g., ext4)—then we must add an extra chown command: It is annoying. I suggest to the UNIX developers adding the uid option to mount for UNIX-like systems, by executing automatically the chown command. :) Apr 8, 2021 at 8:28

1 Answer 1

3

uid=1000,gid=1000 options are used when mounting filesystem type that do not use unix scheme for users, such as windows share (know as cifs, smbfs or samba) or legacy fat (vfat).

This allow user 1000 to read, write and delete files.

ext4 (and xfs, brtfs, and many more) use unix ID mapping and do not use these, nor can they change user id on mount options. (root can change owner once filesystem is mounted)

nfs4 allow some kind of mapping (local user 1000 is "onwer" of distant user 1664).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.