Re: Prevent owner:group From Changing?
Run the command id from a shell on both your Pi and your other system you use the drive on (I'm guessing an Ubuntu system since you're posting here)
On one you'll probably see something like:
Code:
uid=1000(derek) gid=1000(derek)...
And on the other you'll see something like:
Code:
uid=1001(derek) gid=1001(derek)...
You may be derek:derek on both systems but their uid/gid is different. If you look at the file /etc/passwd on both systems, you'll see the users and their uids. There are ways to change your UID, but it gets a little involved. You'd have to edit /etc/passwd, /etc/group, /etc/shadow, and chown your home directory and the files/directories on the external drive. It gets a little more complicated if uid 1001 and 1000 are both in use on both systems.
On Ubuntu, you can create a user with a specific UID by using adduser --uid XXXX YYYY where XXXX is the uid and YYYY is the username. You could create a new user on both systems with the same UID this way (use something like 2000 to ensure it's not taken, or check /etc/passwd on both systems first). I don't know if this command is supported on the Pi's version of Linux, but there is probably something similar like useradd that would work.
Last edited by kpatz; June 30th, 2019 at 10:30 PM.
Current 'buntu systems: multiple systems running Server or Desktop 22.04 LTS / Retired or Upgraded: 18.04.2 LTS, Mythbuntu 16.04 LTS, Ubuntu 16.04.1 LTS, 14.04 LTS, 10.04 LTS, 8.04 LTS
Been using ubuntu since 6.04 (16 years!)
Bookmarks