Results 1 to 7 of 7

Thread: Run C++ executable from External HardDisk

  1. #1
    Join Date
    Jul 2013
    Beans
    3

    Run C++ executable from External HardDisk

    I am new at linux and trying to run a C code on some large data files placed on my external hard disk.
    I cannot attribute the executable permission to C output file when I copy and compile it on external disk. It works fine if I bring the data file to PC, but due to limited space, I prefer to run it directly from external disk.

    I tried some ways found on net, but mostly they only work for bash executables.

    Thanks,

  2. #2
    Join Date
    Aug 2011
    Location
    52° N 6° E
    Beans
    2,194
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Run C++ executable from External HardDisk

    Is it an ntfs of fat32 drive? In that case it doesn't support linux permissions, so you can't make the file executable. But is there any reason not to keep the executable on your internal Linux drive, whilst keeping the data files on the external drive?

  3. #3
    Join Date
    May 2012
    Beans
    26

    Re: Run C++ executable from External HardDisk

    I've never faced such a problem, but have you tried using 'sudo' or giving permissions with 'chmod' commands?

  4. #4
    Join Date
    Jul 2013
    Beans
    3

    Re: Run C++ executable from External HardDisk

    Quote Originally Posted by Peptid View Post
    I've never faced such a problem, but have you tried using 'sudo' or giving permissions with 'chmod' commands?
    I had tried too change the permission and ownership. didn't help

  5. #5
    Join Date
    Jul 2013
    Beans
    3

    Re: Run C++ executable from External HardDisk

    Quote Originally Posted by Impavidus View Post
    Is it an ntfs of fat32 drive? In that case it doesn't support linux permissions, so you can't make the file executable. But is there any reason not to keep the executable on your internal Linux drive, whilst keeping the data files on the external drive?
    It's NTFS.
    I need to use the executable for parallel calculation. I haven't try this yet, maybe I give it a shot!
    Another idea I just had, maybe creating a link instead of actual executable may help. I try this tomorrow at work and then let you know.

    Thanks

  6. #6
    Join Date
    Jun 2013
    Location
    Great Britain
    Beans
    65
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: Run C++ executable from External HardDisk

    NTFS is supported only by Windows, not Linux. That's probably the reason why you are having trouble. The best way to solve this is by putting the relevant programming files on a USB (or using DropBox) and then transferring them to your Linux machine then.

    I'm curious, why are you running programs from an external hard drive? It's hardly efficient, imo.

  7. #7
    Join Date
    Jun 2007
    Beans
    12,926

    Re: Run C++ executable from External HardDisk

    This is a bit of an old story, you could find numerous threads from a couple of years ago or so.
    At that time changes where made to how both vfat & ntfs are mounted, the end result is that both executable binaries & executable text files cannot be run. Has really nothing to do with setting perm on the files after the fact (mounted), you can't, but how they're default mounted.
    Ex.
    *ntfs_defaults[] = { "uid=", "gid=", "dmask=0077", "fmask=0177", NULL }
    The red prevents any file on ntfs from being run

    *vfat_defaults[] = { "uid=", "gid=", "shortname=mixed", "dmask=0077", "utf8=1", "showexec", "flush", NULL };
    red on vfat the same
    There are various workarounds for both, all have some downsides.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •