Mounting hard-drives with incorrect owner and group

Can you explain how to do that then? It would be helpful i’m sure.

1 Like

I’m getting ready to change my UID and GID to 1000 from 1001 tonight. I’ll let everyone know how it goes. In theory it shouldn’t be that hard. Worst case I’ll reinstall if I goof up too badly.

1 Like

Ok here’s what I did to change my UID and GID from 1001 to 1000. I couldn’t figure out how to change them when logged in to my account as ben, so I created a dummy user named dummy and deleted it when I was finished. I’m ben and SGT2T and WDC2T are my archive data and backup drives.

Create user dummy
Reboot and login as dummy
Open terminal session
su
# usermod -u 1000 ben
# groupmod -g 1000 ben
# chown -R ben:ben /home/ben
reboot
login as ben
id ben (do UID, GID, groups all look ok)
Mount the harddrives that do not contain my system and home partitions. I used dolphin and mount points in /run/media/ben.
Open terminal session
su
# chown -R ben:ben /run/media/ben/SGT2T
# chown -R ben:ben /run/media/ben/WDC2T
# userdel -r dummy
# exit su
reboot (just for the fun of it)
login as ben

Note: Once you have changed the UID and GID these may be safer commands for changing UID and GID of all files.
# find / -group 1001 -exec chgrp -h ben {} \;
# find / -user 1001 -exec chown -h ben {} \;

Also, How to Change a USER and GROUP ID on Linux For All Owned Files
is a nice concise method that may be better and easier to follow than my above ramblings.

1 Like

Nice work!

I have had a related problem before, and this is what I did:

  • create the first user (that has sudoers rights) and use it only for maintenance stuff
  • create a second user (that is used for all “normal” things like browsing the net, playing videos, etc.)
  • login as the first user, and modify the uid of the second user to some clearly larger number, e.g. 2000 or more: usermod -u 2000 "username"

Now if you do this (or some variation of it) with all your different systems, then the shared files will be readily usable in all systems.

2 Likes