I tried:
final ProcessBuilder pb = new ProcessBuilder("umount", "foldername");
final Process p = pb.start();
Throws
umount: /home/user/foldername is not in the fstab (and you are not root)
I tried
final ProcessBuilder pb = new ProcessBuilder("sudo","umount", "foldername");
final Process p = pb.start();
Throws
sudo: sorry, you must have a tty to run sudo
I got the root password, but can't provide it to the ProcessBuilder
. Also I cannot edit fstab
(or whatever is needed to be edited), because it is remote virutal machine started on a remote server from saved OS image.
I just want to run the command as root.