This is summed up, what at least since Ubuntu 20.04 is needed (for keeping to be able using Automounting, the change in Extended ACL permissions is needed):
I wanted to change a user id and group id for example from default (uid=) 1000 (and gid=1000) to (uid=) 5000 (and gid=5000), so access to mobile drives formatted with ext4 or similar capable systems with uid & gid) are no problem, if the files and archives have the same user id or group id 5000, no matter if another computer or operating system writes data to this (this enables sharing files easily between computers if all the own users have the same uid and gid).
First I created an additional user, logged as new user, changed in terminal with sudo su -
to the root and then I used the commands
find / -uid 1000 -exec chown -h 5000 {} +
for changing user id
and
find / -gid 1000 -exec chgrp -h 5000 {} +
for changing group ID.
(Take care: This changes the rights on all mounted devices. If not wanted, unmount all not desired or narrow the commands in the part find /
to find /home/<user>
or else.)
In Fedora this worked but not in Ubuntu totally. For example Automounting did not work. Then I read one has to fix also the extended ACL permissions, otherwise things like Automounting breaks (perhaps problem because of ACL permissions do not appear if no user had this UID & GID already but in my case this was the problem). The change of the Extended ACL permissions seems to be required since Ubuntu 14.04 and 14.10.
These are the commands which gave the possibility of Automounting back again:
sudo setfacl -m "u:<NEWUID>:r-x" /media/<USERNAME>
, which sets UID permissions to the own folder in 'media' and
sudo setfacl -x "u:<OLDUID>" /media/<USERNAME>
, which deletes permissions to the own user folder for the old UID (yes, this command is not needed for getting Automounting work again, but it ensures another user with the old UID has not access to the media, too).
BTW: A user says, usermod already changes all permissions in home folder since Ubuntu 18.04, but for Automounting at least until Ubuntu 20.04.4 this seems not to be enough yet.
source of information from where I got it and practically tested it since about a month:
Answers contain all I explain but a bit chaotically and only one advices to fix the Extended ACL permissions for keeping to be able of Automounting.
PS: If someone asks why I did not post this as a question with the solution, the I have to say, I do not have enough "karma" in this sites for doing this. So please vote this answer up.