I am working on a C++ project using Code::Blocks. If I create a "hello world" executable in the /home/pi/bin/Debug tree all is good. However, I want to create it on a USB thumb drive. The path is "/media/8879-6109/bin/Debug/". My executable "test2" is created with "-rwxr-xr-x" when I create it in my home tree but -rw-r--r-- when I put it on my thumb drive. "/media" is drwxr-xr-x owned by root. 8879-6109,bin, and Debug are all drwx------ and owned by pi and I am logged in as pi. If I run "sudo chmod -v +x test2" it says "mode of 'test2' changed from 0644 (rw-r--r--) to 0755 (rwx-r-xr-x)" but if I do an "ls -l" it still shows permission as "rw-r--r--". If I copy the executable from my home tree to the thumb drive tree the executable permissions are lost.
Any guidance would be appreciated.