1

I am very new to Linux, and thus have very noob questions. I currently have Ubuntu 14.04 LTS installed on my hard disk. However, my biggest issue is with flash drives. I have all of my .cpp files on my flash drive, but when I go to compile them in the terminal, I am presented with:

bash./ permission denied

And through some research, I have found out that this is because my flash drive has not been manually mounted, leaving me without permission to access these files. Now I have a few questions:

1) What is the purpose of manually mounting a flash drive

2) And how can I go about mounting my flash drive so that I have the permission to write new .cpp files, and also compile them.

Thank you!

1 Answers1

1

Read this article if you are unfamiliar with mounting filesytems in linux.

In Linux, if you, or any other program (CodeBlocks in this case) has to run a file, the file should have executable permissions. These functionalities are not supported by the fat32 filesystem. Normally if it was a filesystem that supports this feature, you could have give the file executable permission by using chmod (do a man chmod to know more about it).

But in your case, since it is FAT32, you will have mount the partition manually allowing programs to be run from the flash drives.

We need to first unmount the partition:

sudo umount /path/to/mount/point

Then we remount the partition again:

sudo mount -t vfat -o rw,auto,user,fmask=0022,dmask=0000 /dev/sdx1 /path/to/mount/point

where /dev/sdx1 refers to the partition you want to mount and /path/to/mount/point refers to the folder to which you want to mount it.

You can get information about the devices that are currently mounted by typing mount in the terminal. The mount command will give you the path/to/mount/point and also the partition you now have to mount (/dev/sdx1).

In the output of mount, a line starting with /dev/sdb1 on /boot ... indicates that the partition /dev/sdb1 is mounted at /boot (mount point).

daltonfury42
  • 5,559