12

I have this problem: I'm used to compile and run .c files with CodeBlocks. If I do that from my Desktop (ext4 partition) it works without problems, but doing this from my secondary hard drive (NTFS partition) makes CodeBlocks to say permission denied while running a .c file.

I have read it's because of the partition type is it correct? But I don't know how to solve it. I tried to edit fstab (sudo gedit /etc/fstab) adding this line:

/dev/sda /media/Dati ntfs user,exec 0 1

but after rebooting Ubuntu I had a warning on boot about a problem mounting a drive, that's because I set KDE to auto mount my Dati drive on boot.

So I should auto mount my NTFS drive with execute permission? How can I do that?

5
  • You can read but not write the file, Am I right?
    – Lucio
    Jan 19, 2013 at 22:56
  • 1
    I can read it but I can't execute it I think and I can't write as well. I can't also set permissions nor from dolphin with the "sudo" option
    – Frank
    Jan 19, 2013 at 23:13
  • Well, that means that you only have read permissions over that partition. That partition is from the same HDD that Ubuntu or is an external drive?
    – Lucio
    Jan 19, 2013 at 23:19
  • 2
    Have you reviewed this question?
    – Lucio
    Jan 19, 2013 at 23:43
  • I have just solved it, I have posted the answer
    – Frank
    Jan 20, 2013 at 9:01

2 Answers 2

11

Follow these steps to make a NTFS partition executable:

  1. Open a terminal and type sudo blkid -c /dev/null
    This command allow you to identify your NTFS drive and your UUID number. Example:

    /dev/sdb1: LABEL="my_label" UUID="xxx" TYPE="ntfs"
    
  2. Open the /etc/fstab file from terminal typing sudo -H gedit /etc/fstab

  3. Don’t edit the existing lines, but add new one at the end like this example:

    UUID=xxx /media/my_label ntfs-3g defaults,auto,uid=1000,gid=1000,umask=002 0 0
    

    NOTE: Replace the UUID number and the mounting point /media/my_label according to your situation!

  4. Save the file and close the text editor.

  5. Enter the next command in the terminal: sudo mount -a

  6. And restart Ubuntu. Done

Now, every time you mount your NTFS partition, you will be able to run executable files.

3
  • Please tell us if that partition is of the same HDD that Ubuntu or is of an external drive?
    – Lucio
    Jan 20, 2013 at 19:01
  • it's an external drive
    – Frank
    Jan 20, 2013 at 20:48
  • I can't change files' permissions after making this change, even if I add users,permissions after defaults,auto. My line is currently like this: /dev/sdb4 /path/to/mount ntfs-3g defaults,auto,users,permissions,uid=1000,gid=1000,umask=002 0 0 Do you have any suggestions?
    – ldavid
    Apr 5, 2017 at 10:32
1

I tried above solutions but didn’t work for me. This worked.

UUID=xxx /media/ny ntfs-3g auto,users,permissions,exec,big_writes,windows_names 0 0

Ref - https://wiki.archlinux.org/index.php/NTFS-3G

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .