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