Results 1 to 7 of 7

Thread: Run C++ executable from External HardDisk

Hybrid View

  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.5° N 6.4° E
    Beans
    6,821
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    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
    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

  4. #4
    Join Date
    Jun 2013
    Beans
    Hidden!

    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.

  5. #5
    Join Date
    Jun 2007
    Beans
    17,337

    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.

  6. #6
    Join Date
    May 2012
    Beans
    39

    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?

  7. #7
    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

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
  •