title: Mount K8s PVC to hidden container directory
body: <p>I am struggeling to mount a PVC to /root/.guacamole in my pod. Mounting to /root/extensions works, but .guacamole doesn't let the pod boot. Basically, I would like to include the file guacamole-auth-totp-1.1.0.jar to the existing containers location /root/.guacamole/extensions (dont replace; even though kubernetes does not support that too well):</p>
  <p><strong>Works</strong></p>
  <pre><code>        volumeMounts:
        - mountPath: &quot;/root/extensions&quot;
          name: vol-guacamole
          subPath: guacamole-auth-totp-1.1.0.jar
    volumes:
      - name: vol-guacamole
        persistentVolumeClaim: 
          claimName: guacamole-app-pvc
  </code></pre>
  <p><strong>Fails</strong></p>
  <pre><code>        volumeMounts:
        - mountPath: &quot;/root/.guacamole/extensions&quot;
          name: vol-guacamole
          subPath: guacamole-auth-totp-1.1.0.jar
    volumes:
      - name: vol-guacamole
        persistentVolumeClaim: 
          claimName: guacamole-app-pvc
  </code></pre>
  <p><a href="https://i.stack.imgur.com/knt85.png" rel="nofollow noreferrer">Kubectl get all -o wide</a></p>
  <p><a href="https://i.stack.imgur.com/S1RyV.png" rel="nofollow noreferrer">kubectl describe pod</a></p>
  <pre><code>kubectl logs pod
  rm: cannot remove '/root/.guacamole/extensions': Device or resource busy
  </code></pre>
  <p><strong>Kubernetes Version</strong></p>
  <pre><code>kubectl version
  Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;17&quot;, GitVersion:&quot;v1.17.0&quot;, GitCommit:&quot;70132b0f130acc0bed193d9ba59dd186f0e634cf&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2019-12-07T21:20:10Z&quot;, GoVersion:&quot;go1.13.4&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
  Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;17&quot;, GitVersion:&quot;v1.17.0&quot;, GitCommit:&quot;70132b0f130acc0bed193d9ba59dd186f0e634cf&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2019-12-07T21:12:17Z&quot;, GoVersion:&quot;go1.13.4&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
  </code></pre>
  <p><strong>PV and PVC (without file mount)</strong></p>
  <pre><code>kubectl get pv,pvc -n guacamole
  NAME                                             CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                      STORAGECLASS   REASON   AGE
  [...]
  persistentvolume/guacamole-app-pv                10Gi       RWO            Retain           Bound    guacamole/guacamole-app-pvc                manual                  4d15h
  [...]
  
  NAME                                      STATUS   VOLUME             CAPACITY   ACCESS MODES   STORAGECLASS   AGE
  persistentvolumeclaim/guacamole-app-pvc   Bound    guacamole-app-pv   10Gi       RWO            manual         4d15h
  </code></pre>
  <p><strong>PV and PVC (with file mount)</strong></p>
  <pre><code>kubectl get pv,pvc -n guacamole
  NAME                                             CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                      STORAGECLASS   REASON   AGE
  [...]
  persistentvolume/guacamole-app-pv                10Gi       RWO            Retain           Bound    guacamole/guacamole-app-pvc                manual                  39s
  [...]
  
  NAME                                      STATUS   VOLUME             CAPACITY   ACCESS MODES   STORAGECLASS   AGE
  persistentvolumeclaim/guacamole-app-pvc   Bound    guacamole-app-pv   10Gi       RWO            manual         39s
  </code></pre>