I have been having problems mounting a pendrive on two different machines (one with Lubuntu 13.04, another with Lubuntu 12.04, if that is relevant). I have to chown -R all the time, e.g, at home I copy data to, and then if I want to use it at work, I have to chown -R on that machine to be able to write on it, and then when I bring it home, I have to again chown -R it before I can write on it.
Asked
Active
Viewed 228 times
2 Answers
2
check uid for both, work and home users, regardless of what's your "username" is, filesystem permissions are based on uid. Make sure that both users (work and home) has the same uid and everything should be smooth.

rnglbd
- 471
- 3
- 6
-
How to check? I do not have any fstab entry for it. Should I create one to force both systems to mount it in the same way? I don't know how to do that, though. – sanjshakun May 27 '13 at 12:09
-
you have to "chown -R" because files belongs to a different user. Let's say "myuser", but permissions on linux are based on UID/GID (user ID and group ID), and not username. You can run something like "id myuser", to find out what UID and GID your user has on this system. Then it will says something like: – rnglbd May 27 '13 at 15:12
-
uid=2001(myuser) gid=2008(myuser) - on this example uid is 2001 and gid 2008. If uid/gid is different on both sides (work and home), then you will get problems with permissions to files/dirs, and you need to change owner (chown -R). – rnglbd May 27 '13 at 15:16
-
I checked that on my home machine the uid and gid are both 1000, and on my work machine, they are both 1001. I guess I can change them on one machine, but I would like to know if there is something I should be careful with. – sanjshakun May 27 '13 at 21:17
2
run:
id username
at work and at home to check what's your UID and GID. Then try to set same UID / GID on both sides, to make sure files belongs to same uid/gid. displayed name of your user doesn't really matter.

user2422437
- 21
- 2