title: What are the return code values of linux `umount`?
body: <p>So I've been handed a python project in which there are a lot Linux system calls to mount/unmout/format/etc backup drives for a customized NAS.</p>
  
  <p>Right now I'd like to handle the output of the umount command and handle the case of an umounted path:</p>
  
  <pre><code>print subprocess.check_output(['umount', '/storage/backup'])
  </code></pre>
  
  <p>Which may return:</p>
  
  <pre><code>umount: /storage/backup: not mounted
  Command '['umount', '/storage/backup']' returned non-zero exit status 32
  </code></pre>
  
  <p>Now, I could just parse the output string and search for <code>not mounted</code>, but I'd prefer to process the exit status values (32 in this case). I've tried to find a list of exit codes for the umount command but have been unlucky so far.<br>
  Also, I've tried finding the source code for umount but haven't been able to find it (google keeps pointing me to manual pages for the umount command or the source code for <code>mount.c</code>)</p>
  
  <p><strong>Edit</strong></p>
  
  <p>The man pages for <code>umount</code> have a list of Errors (non numeric) like:</p>
  
  <ul>
  <li><strong>EBUSY</strong> - target could not be unmounted because it is busy.</li>
  <li><strong>EFAULT</strong> - target points outside the user address space.</li>
  </ul>
  
  <p>And then:
  <em>The error values given below result from file-system type independent errors. Each file system type may have its own special errors and its own special behavior. <strong>See the Linux kernel source code</strong> for details.</em></p>
  
  <p>Any pointers?</p>