0

I have an image mounted in the following way in fstab:

/home/fbence/ee_modbox.img /home/fbence/mounted/modbox lowntfs-3g windows_names,ignore_case,umask=007,uid=fbence 0 0

In a specific folder on the mounted image I have the following files with the following permissions:

fbence@localhost:~/mounted/modbox/bg2ee/game$ ls -l
total 38239
-rwxrwx--- 1 fbence root 11774908 dec   19  2017 baldursgateii
drwxrwx--- 1 fbence root     4096 dec   19  2017 characters
-rwxrwx--- 1 fbence root  1154176 dec   19  2017 chitin.key
drwxrwx--- 1 fbence root    57344 dec   19  2017 data
drwxrwx--- 1 fbence root     4096 jan   27  2018 eet
-rwxrwx--- 1 fbence root    29271 dec   19  2017 eet_end.tp2
-rwxrwx--- 1 fbence root      162 dec   19  2017 eet_gui.tp2
drwxrwx--- 1 fbence root     4096 dec   19  2017 eet_tweaks
-rwxrwx--- 1 fbence root      109 dec   19  2017 engine.lua
drwxrwx--- 1 fbence root        0 dec   19  2017 lang
lrwxrwxrwx 1 fbence root       14 nov    3 23:44 libjson.so.0 -> libjson-c.so.2
-rwxrwx--- 1 fbence root      255 jan   27  2018 list.txt
drwxrwx--- 1 fbence root        0 dec   19  2017 manuals
drwxrwx--- 1 fbence root     4096 dec   19  2017 movies
drwxrwx--- 1 fbence root    53248 dec   19  2017 music
drwxrwx--- 1 fbence root  3072000 jan   27  2018 override
drwxrwx--- 1 fbence root     4096 dec   19  2017 scripts
-rwxrwx--- 1 fbence root 17548975 dec   19  2017 setup-eet.debug
-rwxrwx--- 1 fbence root  1028264 dec   19  2017 setup-eet_end
-rwxrwx--- 1 fbence root  1028264 dec   19  2017 setup-eet_gui
-rwxrwx--- 1 fbence root  3361726 jan   27  2018 setup-eet_tweaks.debug
-rwxrwx--- 1 fbence root     3950 dec   19  2017 weidu-bgee.log
-rwxrwx--- 1 fbence root       17 dec   19  2017 weidu.conf
-rwxrwx--- 1 fbence root     1879 jan   27  2018 weidu.log
drwxrwx--- 1 fbence root        0 dec   19  2017 worldmap

When I try to execute the baldursgateii executable I get an error, and I totally can't understand how I can be getting this error:

fbence@localhost:~/mounted/modbox/bg2ee/game$ ./baldursgateii 
bash: ./baldursgateii: No such file or directory

The image and the setup was copied from another computer running the same Ubuntu 18.04 as the current computer. The file is clearly there, I actually use the bash tab autocomplete to type the filename yet it still says there's no such file ... What is wrong here?

EDIT

fbence@localhost:~/mounted/modbox/bg2ee/game$ ldd baldursgateii 
    not a dynamic executable
fbence
  • 234
  • There might be a protection against running programs from an external drive with a Microsoft file system. You can try to mount it with the exec option according to this link – sudodus Feb 16 '19 at 14:23
  • It's a binary file unfortunately. I'll try the exec option. – fbence Feb 16 '19 at 14:25
  • Upon second glance over the files, you are missing a lib file there as well. Also, do you know how it was installed on the other system? Did it require like Wine or PlayOnLinux or Steam? Everything I can see doesn't have a Linux port of the game. – Terrance Feb 16 '19 at 14:31
  • The exec option didn't help :( This is the gog linux version of the game, and the very same setup was running on a different laptop (the lib was also defunct there), that is why I am completely dumbfounded. I tried and I can run normal bash scripts from here. – fbence Feb 16 '19 at 14:36
  • Are you running the same version of Ubuntu or maybe a newer version in this computer? Is is an option to re-install the program (the game)? Could there be some protection against copying the game? – sudodus Feb 16 '19 at 14:39
  • No, they're both Ubuntu 18.04. And I could reinstall it, but it was super complicated, because it is heavily modded and the modding was designed for windows, so it was slightly a nightmare (that's why this would be the second time I'm moving the game with the image, instead of reinstalling), so I'd rather not :D – fbence Feb 16 '19 at 14:42
  • I'm thinking maybe the image is slightly off, because I copied it while it was mounted. I will unmount and copy it over again. – fbence Feb 16 '19 at 14:43
  • That is a good idea, it can create corruption, when you clone (or create an image) while a partition is mounted. – sudodus Feb 16 '19 at 14:46
  • In your mount statement, what is lowntfs-3g? – heynnema Feb 16 '19 at 15:33
  • Is this a 32-bit application that you are trying to execute on a 64-bit system? What is the output of ldd baldursgateii? – steeldriver Feb 16 '19 at 16:06
  • @heynnema It's a variant of ntfs-3g that can do the "ignore_cases" thing. https://linux.die.net/man/8/mount.lowntfs-3g – fbence Feb 16 '19 at 18:16
  • @steeldriver I added the output to the question. – fbence Feb 16 '19 at 18:18
  • @sudodus Unfortunately it didn't help. – fbence Feb 16 '19 at 18:18
  • Have you tried using ntfs-3g, instead of lowntfs-3g, and see if your problem goes away? Maybe baldursgateii really has some upper-case letters in it, and the lowntfs-3g isn't fully working? – heynnema Feb 16 '19 at 18:35
  • 2
    @fbence that is very suggestive that you are in fact trying to run a 32-bit binary on a 64-bit system, without the necessary 32-bit shared library support. Please install the 32-bit libc package (sudo apt install libc6-i386) and then try again. See for example ldd 32-bit exe / 64-bit OS . – steeldriver Feb 16 '19 at 18:38
  • Change your mount to use ntfs-3g, and remove "windows_names,ignore_case", and see what happens. Report back. – heynnema Feb 16 '19 at 19:03
  • @steeldriver You were right, that was the problem, after install libc6-i386 I started getting comprehensible errors of various missing libraries and after installing the i386 versions of them now everything is fine. I'm still quite baffled why the error message says no such file instead of something like I can't execute cause this is not 64-bit binary or something like that ... Anyway, if you care to write an answer I will mark it accepted! Thx! – fbence Feb 16 '19 at 19:17

1 Answers1

2

When a file that you know to be a binary executable fails to run, with a No such file or directory message, it's often because of issues with shared libraries.

In some cases, it's because one or more shared libraries is missing. Running

ldd ./baldursgateii

(for example) should help identify which one(s). On the other hand, if ldd itself fails with the unhelpful (and incorrect) message

not a dynamic executable

then that's likely a sign that you are trying to run a 32-bit executable on a system that lacks even the 32-bit dynamic loader, as discussed in ldd 32-bit exe / 64-bit OS

To obtain the missing 32-bit loader in a current multiarch 64-bit system, you should install the libc6-i386 package:

sudo apt install libc6-i386 

From apt show libc6-i386:

Description: GNU C Library: 32-bit shared libraries for AMD64 This package includes shared versions of the standard C library and the standard math library, as well as many others. This is the 32bit version of the library, meant for AMD64 systems.

As well as the 32-bit loader, this installs a minimal set of 32-bit libraries: if the program still does not execute, run ldd ./baldursgateii again to check for other specific unmet library dependencies.

steeldriver
  • 136,215
  • 21
  • 243
  • 336