Run program on another disk

My pc has two disks, each set up for dual boot with Tumbleweed and Windows 10. My primary disk is an ssd with limited space. I have a program on the other (hdd) that I would like to run from my primary disk. To install on the ssd, I need a special java program (zulu8) which I can no longer find. So that’s another reason to run the existing install on the hdd. When I open a root dolphin and click on the desktop icon on the hdd, an error message pops up that says it can’t find the program. Since it resides on the hdd, I presume the computer is trying to find the program on the ssd.

I drill down to the location of the program on the hdd and try to execute it. I get an error message saying I need to update Oracle Java, which I presume is the zulu8 java and it fails to run. If I boot to TW on the hdd, this program runs normally. That is what I’ve been doing, but rebooting twice each time I want to use the program is annoying and time consuming. I contemplated copying the whole folder system for this program to the ssd but that defeats my goal of saving the limited space available.

Am I trying to do something that can’t be done? I thought a simple link could be set up on the ssd to run the program that resides on hdd.

Hi
Just use the full path to the binary from the mount point;


/run/media/some/mount/some/binary_location/my_binary /some/program/that/uses/my_binary

Else, create a script to be in the correct location to run said binary.

If you need libs either use LD_LIBRARY or add the location into /etc/ld.so.conf.d/ file and run ldconfig.

Trying to parse this for the right syntax. In all cases, the script should start with?

/run/media

Then, to locate the file?

/run/media/sda6 or /run/media/c9554cbb-f155-4e5b-aef5-51987573e0b1 (which is the UUID)

or more completely

/run/media/c9554cbb-f155-4e5b-aef5-51987573e0b1/home/prexy/programdirectory/program

When I look at fstab, that long UUID number refers to /home on the hdd. Is that what I should be using?

Hi
So is this device permanent or transient? If permanent and uses fstab and a mount point then that’s what you would use, if transient then what ever it calls itself down in /run/media.

This rather let’s me think the program needs a (specific) Java environment to run. I rather doubt that it can run remotely if it can’t find it’s environment. Could that be provided via LD_LIBRARY?

Well, I never knew there is official Java support for Linux - I mentally got stuck with icedtea… But apparently there is. I have “java-11-openjdk” installed. I didn’t even know. And it seems to be supported by Oracle:https://www.java.com/en/download/

Oracle also provides the latest OpenJDK release under the open source GPL License at jdk.java.net.

Maybe it’s worth to give it a try?

Azul is waiting for you. Try to install the version for SUSE Linux Enterprise Server: https://docs.azul.com/zulu/zuludocs/ZuluUserGuide/PrepareZuluPlatform/AttachYumRepositoryRHEL-SLES-OracleLinuxSys.htm

I went to the zulu website. It is Azul software product. Near the bottom of the page, it states “completely compatible with Oracle Java.” I suspect the program I am trying to run pulled that in on its own. I didn’t know about zulu prior. I looked for it in yast. It has a zulu repo and the files total about 100MB. After I sort out the script, I will try to run it from the ssd. If the java error message comes again, I will install either the Oracle or Zulu version to see if that resolves the issue of environment.

I’ve tried a lot of options with no success. I didn’t even get far enough to see the java failure. My hdd has zulu java installed from Azul. The sdd has openjdk installed, which I believe is the basis of both zulu and Oracle. But I didn’t get that far yet. I tried to write a script to run the program from the ssd that is installed on the hdd.

#!/bin/bash
# run program from hdd
#/run/media/prexy/c9554cbb-f155-4e5b-aef5-51987573e0b1/home/prexy/program/program.sh


/run/media/prexy/c9554cbb-f155-4e5b-aef5-51987573e0b1/prexy/Desktop/program.sh



I’ve commented out the first version of this script that I tried. When it failed, I located the desktop file on the hdd that ran the program and I adjusted. It also failed. Each variation I made failed with the same message that the file didn’t exist. The file does exist because I can boot to the ssd, click on the desktop icon and it runs. Some variations I tried by drilling down to the actual program, not the desktop link, also without success. Here are just some of the variations I tried:

prexy@linux:~/Desktop> chmod 755 newprogram.sh
prexy@linux:~/Desktop> ./newprogram.sh
./newprogram.sh: line 4: /run/media/prexy/sda7/home/prexy/program/program.sh: No such file or directory
prexy@linux:~/Desktop> chmod 755 newprogram.sh
prexy@linux:~/Desktop> ./newprogram.sh
./newprogram.sh: line 4: /run/media/prexy/sda6/home/prexy/program/program.sh: No such file or directory
prexy@linux:~/Desktop> chmod 755 newprogram.sh
prexy@linux:~/Desktop> ./newprogram.sh
./newprogram.sh: line 4: /run/media/sda6/home/prexy/program/program.sh: No such file or directory
prexy@linux:~/Desktop> ./newprogram.sh
./newprogram.sh: line 4: /run/media/sda6/home/prexy/program/program: No such file or directory
prexy@linux:~/Desktop> chmod 755 newprogram.sh
prexy@linux:~/Desktop> ./newprogram.sh
./newprogram.sh: line 5: /run/media/prexy/c9554cbb-f155-4e5b-aef5-51987573e0b1/prexy/Desktop/program: No such file or directory
prexy@linux:~/Desktop> chmod 755 newprogram.sh
prexy@linux:~/Desktop> ./newprogram.sh
./newprogram.sh: line 5: /run/media/prexy/c9554cbb-f155-4e5b-aef5-51987573e0b1/prexy/Desktop/program.sh: No such file or directory



The chmod you see is when I change a line in the script, I ran chmod again. As I said, I tried lots of variations of the script which I did not keep. Whenever I boot, I get a message to authorize the mount of a partition on the hdd. I varied sdaX to try to find the right one. None worked.Here is fstab on the ssd:

UUID=795d9510-a37b-422b-bfca-856cc4a68170  /                       btrfs  defaults                      0  0UUID=795d9510-a37b-422b-bfca-856cc4a68170  /var                    btrfs  subvol=/@/var                 0  0
UUID=795d9510-a37b-422b-bfca-856cc4a68170  /usr/local              btrfs  subvol=/@/usr/local           0  0
UUID=795d9510-a37b-422b-bfca-856cc4a68170  /srv                    btrfs  subvol=/@/srv                 0  0
UUID=795d9510-a37b-422b-bfca-856cc4a68170  /root                   btrfs  subvol=/@/root                0  0
UUID=795d9510-a37b-422b-bfca-856cc4a68170  /opt                    btrfs  subvol=/@/opt                 0  0
UUID=795d9510-a37b-422b-bfca-856cc4a68170  /home                   btrfs  subvol=/@/home                0  0
UUID=795d9510-a37b-422b-bfca-856cc4a68170  /boot/grub2/x86_64-efi  btrfs  subvol=/@/boot/grub2/x86_64-efi  0  0
UUID=795d9510-a37b-422b-bfca-856cc4a68170  /boot/grub2/i386-pc     btrfs  subvol=/@/boot/grub2/i386-pc  0  0
UUID=286def93-0f1c-44fb-8f95-31d65378248b  swap                    swap   defaults                      0  0
UUID=795d9510-a37b-422b-bfca-856cc4a68170  /.snapshots             btrfs  subvol=/@/.snapshots          0  0



Here is fstab on the hdd where the program resides:

UUID=286def93-0f1c-44fb-8f95-31d65378248b swap                 swap       defaults              0 0UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /                    btrfs      defaults              0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /boot/grub2/i386-pc  btrfs      subvol=@/boot/grub2/i386-pc 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /boot/grub2/x86_64-efi btrfs      subvol=@/boot/grub2/x86_64-efi 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /opt                 btrfs      subvol=@/opt          0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /srv                 btrfs      subvol=@/srv          0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /tmp                 btrfs      subvol=@/tmp          0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /usr/local           btrfs      subvol=@/usr/local    0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/cache           btrfs      subvol=@/var/cache    0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/crash           btrfs      subvol=@/var/crash    0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/lib/libvirt/images btrfs      subvol=@/var/lib/libvirt/images 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/lib/machines    btrfs      subvol=@/var/lib/machines 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/lib/mailman     btrfs      subvol=@/var/lib/mailman 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/lib/mariadb     btrfs      subvol=@/var/lib/mariadb 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/lib/mysql       btrfs      subvol=@/var/lib/mysql 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/lib/named       btrfs      subvol=@/var/lib/named 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/lib/pgsql       btrfs      subvol=@/var/lib/pgsql 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/log             btrfs      subvol=@/var/log      0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/opt             btrfs      subvol=@/var/opt      0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/spool           btrfs      subvol=@/var/spool    0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/tmp             btrfs      subvol=@/var/tmp      0 0
UUID=c9554cbb-f155-4e5b-aef5-51987573e0b1 /home                xfs        defaults              1 2



I hope someone can spot what I’m doing wrong.

Hi
Your not mounting the partition… if it’s not mounted somewhere it won’t work. Check via the mount command.

A typical invocation of a java application reads:

java -jar /home/karl/Downloads/jAlbum/JAlbum.jar

You may show the output of your version:

karl@erlangen:~> java -version 
openjdk version "14.0.1" 2020-04-14 
OpenJDK Runtime Environment (build 14.0.1+7) 
OpenJDK 64-Bit Server VM (build 14.0.1+7, mixed mode) 
karl@erlangen:~> 

Try to find the path to the jar file of your application. Then run it a konsole and post the output.

I tried using the mount command with /dev/sda6, tried it with just sda6 and tried with uuid. The error message is always the same:

mount c9554cbb-f155-4e5b-aef5-51987573e0b1
mount: c9554cbb-f155-4e5b-aef5-51987573e0b1: can't find in /etc/fstab.


I was going to add the uuid to fstab but don’t know what to call it. There is already / and /home in fstab. Wouldn’t the logical thing be to call it /home? But wouldn’t that confuse fstab?

Mount always needs device that is being mounted (“what”, “source”) and directory where this device will be mounted (“where”, “target”). If you omit one of the two mandatory parameters, it tries to find suitable line in /etc/fstab to fill in missing information. All of this is even extensively documented in manual page (man 8 mount).

This is confusing to me. I’m trying to post from the ssd, using dolphin to get to the working program on the hdd. java -version gives me this

openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+9-suse-1.3-x8664)
OpenJDK 64-Bit Server VM (build 11.0.10+9-suse-1.3-x8664, mixed mode)

I am certain that when I ran the same command while booted to the hdd, it listed a 10.0 something version with the word zulu substituted for suse. I ran the java -version command while in a terminal that showed me to be in the directory on the hdd of the program in question. In another terminal, in the /Desktop directory of the ssd, the version command gives identical output. Running the other command I get

java -jar launcher-second.jar
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.devexperts.jnlp.JavaLibraryPathUpdater 

There were two jar files in the program’s folder. The other was just launcher.jar with the identical output. There was also a error dialog pop-up.

Incompatibility issue. Oracle JRE 8 update 11 or later required to run application. Please update java and ensure it is the first JAVA available in your system path 

The program launcher must be looking elsewhere for java since, when booted to the hdd, I do not get this error and the program launches.

java uses update-alternatives. I added my version of java by performing the following steps:

Identify the package:

[b]erlangen:~ #[/b] zypper se --repo BellSoft -is      
Loading repository data... 
Reading installed packages... 

S  | Name                         | Type    | Version       | Arch   | Repository 
---+------------------------------+---------+---------------+--------+-------------------- 
i+ | bellsoft-java15-runtime-full | package | 2:15.0.2+10-1 | x86_64 | BellSoft Repository 
[b]erlangen:~ #[/b]

Get the path to its files:

[b]erlangen:~ #[/b] rpm -ql bellsoft-java15-runtime-full|less

Search for java in the installed package:

[b]erlangen:~ #[/b] find /usr/lib/jvm/ -name java 
/usr/lib/jvm/bellsoft-java15-runtime-full.x86_64/bin/java 
[b]erlangen:~ #[/b]

Add to alternatives:

[b]erlangen:~ #[/b] update-alternatives --install /usr/bin/java java /usr/lib/jvm/bellsoft-java15-runtime-full.x86_64/bin/java 1 
[b]erlangen:~ #[/b] update-alternatives --list java 
/usr/lib/jvm/bellsoft-java15-runtime-full.x86_64/bin/java 
/usr/lib64/jvm/jre-15-openjdk/bin/java 
[b]erlangen:~ #[/b]

Configure:

[b]erlangen:~ #[/b] update-alternatives --config java 
There are 2 choices for the alternative java (providing /usr/bin/java). 

  Selection    Path                                                       Priority   Status 
------------------------------------------------------------ 
  0            /usr/lib/jvm/bellsoft-java15-runtime-full.x86_64/bin/java   1         auto mode 
  1            /usr/lib/jvm/bellsoft-java15-runtime-full.x86_64/bin/java   1         manual mode 
  2            /usr/lib64/jvm/jre-15-openjdk/bin/java                      0         manual mode 

Press <enter> to keep the current choice
[li], or type selection number: 1 [/li]update-alternatives: using /usr/lib/jvm/bellsoft-java15-runtime-full.x86_64/bin/java to provide /usr/bin/java (java) in manual mode 
[b]erlangen:~ #[/b]

Are you recommending Bellsoft, or shall I just use it as a template for zulu or Oracle?

Use zulu and configure accordingly.

Sorry it took so long to get back to this. I’ve been fighting other fires. After reading the mount man pages and lots of trial and error, I got the partition to mount using this:

mount UUID=c9554cbb-f155-4e5b-aef5-51987573e0b1 /home

I have not resolved the java issue that karlmistelberger is trying to help me with. My original plan was to use the partition listed above as my /home (on the hdd) rather than using the normal /home on my smaller ssd which I boot from. This is the fstab from the hdd with the above partition:

UUID=286def93-0f1c-44fb-8f95-31d65378248b swap                 swap       defaults              0 0UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /                    btrfs      defaults              0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /boot/grub2/i386-pc  btrfs      subvol=@/boot/grub2/i386-pc 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /boot/grub2/x86_64-efi btrfs      subvol=@/boot/grub2/x86_64-efi 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /opt                 btrfs      subvol=@/opt          0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /srv                 btrfs      subvol=@/srv          0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /tmp                 btrfs      subvol=@/tmp          0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /usr/local           btrfs      subvol=@/usr/local    0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/cache           btrfs      subvol=@/var/cache    0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/crash           btrfs      subvol=@/var/crash    0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/lib/libvirt/images btrfs      subvol=@/var/lib/libvirt/images 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/lib/machines    btrfs      subvol=@/var/lib/machines 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/lib/mailman     btrfs      subvol=@/var/lib/mailman 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/lib/mariadb     btrfs      subvol=@/var/lib/mariadb 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/lib/mysql       btrfs      subvol=@/var/lib/mysql 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/lib/named       btrfs      subvol=@/var/lib/named 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/lib/pgsql       btrfs      subvol=@/var/lib/pgsql 0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/log             btrfs      subvol=@/var/log      0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/opt             btrfs      subvol=@/var/opt      0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/spool           btrfs      subvol=@/var/spool    0 0
UUID=50d1254f-cc8f-44dc-9a07-6d9df2324115 /var/tmp             btrfs      subvol=@/var/tmp      0 0
UUID=c9554cbb-f155-4e5b-aef5-51987573e0b1 /home                xfs        defaults              1 2



This is the fstab from the smaller ssd which I (prefer) to boot from:

UUID=4dd29ef6-8abe-40f1-8b6a-6021f6ef2e55  /                       btrfs  defaults                      0  0UUID=4dd29ef6-8abe-40f1-8b6a-6021f6ef2e55  /var                    btrfs  subvol=/@/var                 0  0
UUID=4dd29ef6-8abe-40f1-8b6a-6021f6ef2e55  /usr/local              btrfs  subvol=/@/usr/local           0  0
UUID=4dd29ef6-8abe-40f1-8b6a-6021f6ef2e55  /srv                    btrfs  subvol=/@/srv                 0  0
UUID=4dd29ef6-8abe-40f1-8b6a-6021f6ef2e55  /root                   btrfs  subvol=/@/root                0  0
UUID=4dd29ef6-8abe-40f1-8b6a-6021f6ef2e55  /opt                    btrfs  subvol=/@/opt                 0  0
UUID=4dd29ef6-8abe-40f1-8b6a-6021f6ef2e55  /home                   btrfs  subvol=/@/home                0  0
UUID=4dd29ef6-8abe-40f1-8b6a-6021f6ef2e55  /boot/grub2/x86_64-efi  btrfs  subvol=/@/boot/grub2/x86_64-efi  0  0
UUID=4dd29ef6-8abe-40f1-8b6a-6021f6ef2e55  /boot/grub2/i386-pc     btrfs  subvol=/@/boot/grub2/i386-pc  0  0
UUID=286def93-0f1c-44fb-8f95-31d65378248b  swap                    swap   defaults                      0  0
UUID=4dd29ef6-8abe-40f1-8b6a-6021f6ef2e55  /.snapshots             btrfs  subvol=/@/.snapshots          0  0

Having read the mount man pages, I assume it is not as simple as replacing the /home line in this second fstab. Do I need a separate mount command? and if so, where? Am I correct in assuming that the java issue will still need to be fixed if I use /home on the hdd, where the correct version of java resides because Tumbleweed will be trying to run the java installed on the ssd?

Let me save you the trouble of everything discussed to this point in this thread… Throw it all out.
The azul site says that zulu packages are just packages of openjdk, which is the default installed on openSUSE and “zulu 8” means that it’s providing the equivalent of openjdk 8.
The reference to Oracle Java in your earliest posts is because actually there are a number of different Javas from different manufacturers, although Oracle Java is pretty much the standard on PCs, and openjdk is the open sourced reverse engineered version of the proprietary Java from Oracle.

So…
The first thing to realize is that zulu is not an application.
It’s merely the java environment, more specifically the “runtime” environment(JRE) that java applications run in.
For the most part, all java including zulu, Oracle Java and openjdk are backwards compatible but every now and then you might find an app which is unnecessarily picky about running in the right java environment.

So,
Let’s say for example that you have an application that insists on “zulu 8” as a prerequisite and refuses to run in today’s openjdk 10 and 11.
Go to the opensuse software pages and install what you need
https://software.opensuse.org/package/java-1_8_0-openjdk

After the install, you’ll have 2 versions of openjdk installed on your system, now you need to switch to the one you want to use by running the following command and following instructions

update-alternatives --config java

Now, if you run something like the following, it should return the java version you’re running

which java

And now you can run whatever java app requires that version of java.
You can leave whatever version of java as the active selection or change back to the original… There’s nothing in a standard openSUSE that uses java.

HTH,
TSU

Path lookup can be confusing. Skip it. Try absolute path first. A sample invocation is:

/usr/lib/jalbum/jre64/bin/java -jar /usr/lib/jalbum/JAlbum.jar

The first absolute path points to the virtual machine, the second points to the application.

I did this…and it worked! Not that I can understand it. An older version worked on new application??? Well, it does.

update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                       Priority   Status
------------------------------------------------------------
* 0            /usr/lib64/jvm/jre-11-openjdk/bin/java      2105      auto mode
  1            /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java   1805      manual mode
  2            /usr/lib64/jvm/jre-11-openjdk/bin/java      2105      manual mode


I selected #1. I opened dolphin, selected (and mounted) the hdd disk, navigated to the desktop and clicked on the application. It opened and worked! Thank you for this solution. Next, I have to resolve how to get the /home on the hdd to open when I boot the ssd. I want to see if that will function smoothly and give me both speed and lots of disk space.