5

if I format my usb key with an extX file system, copy some files on it and then give it to a friend for him to add files or modify existing one on this key, then he is rejected by its own system. Because its User ID (UID) nor GID are the same as mine on my machine.

How to get rid of this limitation? Is it possible to disable user rights on a ext2/ext3 partition?

Of course, I would really like not to rely on any other file system.

3
  • just curios but why do you want ext2/ext3? sure i agree that fat fs is junk but it do work better for sharing? Jul 24, 2009 at 9:54
  • I'made the same reflexion as yours, a fat-like file system better suits on an usb key. But it is a propietary file system AFAIK (MS one?). And I guess that linux addict people might propose a better solution for that ? Just wondering because I would really like to do without it me too. Jul 24, 2009 at 18:30
  • 1
    Another reason for using extx2/3 is support for symbolic links. Doesn't matter for the odd file but if you want an untar'd collection of files that use these it can be important.
    – mas
    Aug 4, 2009 at 7:14

5 Answers 5

7
+100

you can chmod 777 all of the files, to remove all of the restrictions.

3
  • cha ching! hit the jackpot! :D
    – RCIX
    Jul 24, 2009 at 11:36
  • glad to hear it helped
    – Babu
    Jul 24, 2009 at 15:44
  • chmod 777: nonononono! Never ever run chmod 777. It is practically never required! Not even for "testing purposes". If the file is readable, then it's readable. If it's writable by the user or group that need to write to it, then it's writable. There is absolutely zero need to give everyone write permissions, and forgetting to chmod it back to something sane is exactly how multinationals get hacked. Just don't do it. Ever. I wrote an introduction of Unix permissions. Please read it! Mar 13, 2016 at 6:07
9

Mount the drive with an option of umask=000. This tells the system to give every file newly created/copied on the system permissions of 777, unless told otherwise(such as via cp -p).

4
  • This solution is much better than the chmod suggestion, lay yier votes hire dear folks!
    – Deleted
    Aug 1, 2009 at 19:13
  • oooh, I was entirely unaware of this. That's very useful!
    – Babu
    Aug 1, 2009 at 19:16
  • 2
    I can't find that option for ext2/ext3 fs .. sigh ... Why ? I don't have any linux box at hand. Does they forget that in man page? linux.die.net/man/8/mount Aug 6, 2009 at 18:47
  • 1
    That's a vfat/ntfs/hfs/hpfs mount option, not an xfs/ext2/ext3/ext4/reiserfs option! Stop confusing people!
    – user62017
    Jan 8, 2011 at 22:05
5

Funnily enough a kernel patch to do some sort of UID remapping on ext mounts "to make them actually useful on removable media" turned up very recently. Doesn't seem to be too controversial in the subsequent discussion so it should make it into your favourite distro at some point.

BTW, I've used ext2/3 on removable media myself for years but it's almost entirely for rsynced backups where the whole point is to preserve all the file metadata.

1
  • very instersting link .. I wonder why anyone make that before . I will check it out when having some free time . thanx! Aug 3, 2009 at 17:27
3

"Is it possible to disable user rights on a ext2/ext3 partition?" It is not but as more or less said before:

standing in the filesystem root (/media/<name>/) and doing chmod -R 777 . will set permission to allow anything on all filesystem.

4
  • Why not just chmod -R 777 /media/<name>/? Jul 24, 2009 at 8:54
  • The chmod won't have any effect on newly created files though - permissions are not inherited in ext3. (Setting all directories to setgid may help a little.) Jul 24, 2009 at 8:55
  • nothing wrong with doing it directly on /media/<name>, works too ofc Jul 24, 2009 at 9:38
  • just though the answer more generic as '/media/<name>' is just an example mountpoint (most likely correct in this case but...) Jul 24, 2009 at 9:45
1

You would want to use

chmod -R 777 /dev/sdc1/

In order to give permission for someone else to create in the root directory, as well.

3
  • 2
    this sets premission on the device entry, not the filesystem Jul 23, 2009 at 23:43
  • I think you actually want to set the mount point to 777 not the device entry. Jul 24, 2009 at 0:54
  • Since a specific distro wasn't mentioned, I tried to do a generic, but, you're right, of course. Jul 24, 2009 at 12:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .