Before reading on, you may want to refer to this article, it explains the process of changing your UID, and draws attention on how to assign a new UID to your user the correct way.
"Please note that all files which are located in the user’s home
directory will have the file UID changed automatically as soon as you
type above two command. However, files outside user’s home directory
need to be changed manually."
With that said. Your UID will not be changed automatically for any files outside of your /home/USER
directory.
In order to regain access to your drive mounted in the users /media/USER
directory, once again, I recommend following the above article to make sure you correctly changed the UID of all your files both in and out of '/home/USER`, so naturally your drive should be plugged in.
Here is the code provided on the article mentioned above:
To assign a new UID to user called foo, enter:
# usermod -u NEWUIDHERE foo
To assign a new GID to group called foo, enter:
# groupmod -g NEWGIDHERE foo
To manually change files with old GID and UID respectively: (Outside of your home directory)
# find / -group NEWUIDHERE -exec chgrp -h foo {} \;
# find / -user NEWGIDHERE -exec chown -h foo {} \;
"The -exec command executes chgrp or chmod command on each file. The -h
option passed to the chgrp/chmod command affect each symbolic link
instead of any referenced file. Use the following command to verify
the same"
# ls -l /home/foo/
# id -u foo
# id -g foo
# grep foo /etc/passwd
# grep foo /etc/group
Thank you to Vivek Gite for this wonderful article! Hope this helps you.
cat /etc/fstab
(as an edit). Thank you!