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.