Not able to mount USB drive in Ubuntu Linux 14.04 after change of UID and GID

After changing the UID and GID (User ID and Group ID numbers), I was not able to mount and USB pen drives or hard drives. This issue can be resolved by entering following commands in a Linux terminal:
$ cd /media <enter>
$ sudo chown -R user.group user <enter>

where user is the user name and the group is the user name. Now insert a USB drive and you will find that it mounts correctly.