<p>I am trying to deploy <a href="https://github.com/bitnami/charts/tree/master/bitnami/mongodb" rel="nofollow noreferrer">mongodb</a> to my kubernetes cluster. It automatically creates a pvc and pv based on the storage class name i specify. However the pod is stuck on <code>ContainerCreating</code> because of the following error:</p>
<blockquote>
<p>MountVolume.MountDevice failed for volume &quot;pvc-f88bdca6-7794-455a-872f-8230f1ce295d&quot; : mount failed: exit status 32 Mounting command: systemd-run Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03 --scope -- mount -t xfs -o debug,defaults /dev/xvdbq /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03 Output: Running scope as unit run-4113.scope. mount: /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03: wrong fs type, bad option, bad superblock on /dev/nvme1n1, missing codepage or helper program, or other error.</p>
</blockquote>
<p>I'm not sure what to do as this is pretty consistant no matter how many times i uninstall and resinstall the helm chart.</p>
<p><strong>kubectl version</strong></p>
<pre><code>Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;20&quot;, GitVersion:&quot;v1.20.4&quot;, GitCommit:&quot;e87da0bd6e03ec3fea7933c4b5263d151aafd07c&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2021-02-18T16:12:00Z&quot;, GoVersion:&quot;go1.15.8&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;19+&quot;, GitVersion:&quot;v1.19.6-eks-49a6c0&quot;, GitCommit:&quot;49a6c0bf091506e7bafcdb1b142351b69363355a&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-12-23T22:10:21Z&quot;, GoVersion:&quot;go1.15.5&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
</code></pre>
<p><strong>storage class</strong></p>
<pre><code>apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: mongodbstorage
provisioner: kubernetes.io/aws-ebs
parameters:
  type: gp2
  fsType: xfs
reclaimPolicy: Retain
allowVolumeExpansion: true
mountOptions:
  - debug
volumeBindingMode: WaitForFirstConsumer
</code></pre>
<p><strong>kubectl describe pod mongodb-prod-0 -n mongodb</strong></p>
<pre><code>Name:           mongodb-prod-0
Namespace:      mongodb
Priority:       0
Node:           ip-10-0-4-244.us-east-2.compute.internal/10.0.4.244
Start Time:     Sat, 24 Apr 2021 20:03:06 +0100
Labels:         app.kubernetes.io/component=mongodb
                app.kubernetes.io/instance=mongodb-prod
                app.kubernetes.io/managed-by=Helm
                app.kubernetes.io/name=mongodb
                controller-revision-hash=mongodb-prod-58c557d4fc
                helm.sh/chart=mongodb-10.12.5
                statefulset.kubernetes.io/pod-name=mongodb-prod-0
Annotations:    kubernetes.io/psp: eks.privileged
Status:         Pending
IP:             
IPs:            &lt;none&gt;
Controlled By:  StatefulSet/mongodb-prod
Containers:
  mongodb:
    Container ID:  
    Image:         docker.io/bitnami/mongodb:4.4.5-debian-10-r0
    Image ID:      
    Port:          27017/TCP
    Host Port:     0/TCP
    Command:
      /scripts/setup.sh
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Liveness:       exec [mongo --disableImplicitSessions --eval db.adminCommand('ping')] delay=30s timeout=5s period=10s #success=1 #failure=6
    Readiness:      exec [bash -ec mongo --disableImplicitSessions $TLS_OPTIONS --eval 'db.hello().isWritablePrimary || db.hello().secondary' | grep -q 'true'
] delay=5s timeout=5s period=10s #success=1 #failure=6
    Environment:
      BITNAMI_DEBUG:                    false
      MY_POD_NAME:                      mongodb-prod-0 (v1:metadata.name)
      MY_POD_NAMESPACE:                 mongodb (v1:metadata.namespace)
      K8S_SERVICE_NAME:                 mongodb-prod-headless
      MONGODB_INITIAL_PRIMARY_HOST:     mongodb-prod-0.$(K8S_SERVICE_NAME).$(MY_POD_NAMESPACE).svc.cluster.local
      MONGODB_REPLICA_SET_NAME:         rs0
      MONGODB_ROOT_PASSWORD:            &lt;set to the key 'mongodb-root-password' in secret 'mongodb-prod'&gt;    Optional: false
      MONGODB_REPLICA_SET_KEY:          &lt;set to the key 'mongodb-replica-set-key' in secret 'mongodb-prod'&gt;  Optional: false
      ALLOW_EMPTY_PASSWORD:             no
      MONGODB_SYSTEM_LOG_VERBOSITY:     0
      MONGODB_DISABLE_SYSTEM_LOG:       no
      MONGODB_DISABLE_JAVASCRIPT:       no
      MONGODB_ENABLE_IPV6:              no
      MONGODB_ENABLE_DIRECTORY_PER_DB:  no
    Mounts:
      /bitnami/mongodb from datadir (rw)
      /scripts/setup.sh from scripts (rw,path=&quot;setup.sh&quot;)
      /var/run/secrets/kubernetes.io/serviceaccount from mongodb-prod-token-4kjjm (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  datadir:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  datadir-mongodb-prod-0
    ReadOnly:   false
  scripts:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      mongodb-prod-scripts
    Optional:  false
  mongodb-prod-token-4kjjm:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  mongodb-prod-token-4kjjm
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  geeiq/node-type=ops
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason                  Age   From                     Message
  ----     ------                  ----  ----                     -------
  Normal   Scheduled               18m   default-scheduler        Successfully assigned mongodb/mongodb-prod-0 to ip-10-0-4-244.us-east-2.compute.internal
  Normal   SuccessfulAttachVolume  18m   attachdetach-controller  AttachVolume.Attach succeeded for volume &quot;pvc-f88bdca6-7794-455a-872f-8230f1ce295d&quot;
  Warning  FailedMount             18m   kubelet                  MountVolume.MountDevice failed for volume &quot;pvc-f88bdca6-7794-455a-872f-8230f1ce295d&quot; : mount failed: exit status 32
Mounting command: systemd-run
Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03 --scope -- mount -t xfs -o debug,defaults /dev/xvdbq /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03
Output: Running scope as unit run-4113.scope.
mount: /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03: wrong fs type, bad option, bad superblock on /dev/nvme1n1, missing codepage or helper program, or other error.
  Warning  FailedMount  18m  kubelet  MountVolume.MountDevice failed for volume &quot;pvc-f88bdca6-7794-455a-872f-8230f1ce295d&quot; : mount failed: exit status 32
Mounting command: systemd-run
Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03 --scope -- mount -t xfs -o debug,defaults /dev/xvdbq /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03
Output: Running scope as unit run-4182.scope.
mount: /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03: wrong fs type, bad option, bad superblock on /dev/nvme1n1, missing codepage or helper program, or other error.
  Warning  FailedMount  18m  kubelet  MountVolume.MountDevice failed for volume &quot;pvc-f88bdca6-7794-455a-872f-8230f1ce295d&quot; : mount failed: exit status 32
Mounting command: systemd-run
Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03 --scope -- mount -t xfs -o debug,defaults /dev/xvdbq /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03
Output: Running scope as unit run-4256.scope.
mount: /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03: wrong fs type, bad option, bad superblock on /dev/nvme1n1, missing codepage or helper program, or other error.
  Warning  FailedMount  18m  kubelet  MountVolume.MountDevice failed for volume &quot;pvc-f88bdca6-7794-455a-872f-8230f1ce295d&quot; : mount failed: exit status 32
Mounting command: systemd-run
Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03 --scope -- mount -t xfs -o debug,defaults /dev/xvdbq /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03
Output: Running scope as unit run-4297.scope.
mount: /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03: wrong fs type, bad option, bad superblock on /dev/nvme1n1, missing codepage or helper program, or other error.
  Warning  FailedMount  18m  kubelet  MountVolume.MountDevice failed for volume &quot;pvc-f88bdca6-7794-455a-872f-8230f1ce295d&quot; : mount failed: exit status 32
Mounting command: systemd-run
Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03 --scope -- mount -t xfs -o debug,defaults /dev/xvdbq /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03
Output: Running scope as unit run-4458.scope.
mount: /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03: wrong fs type, bad option, bad superblock on /dev/nvme1n1, missing codepage or helper program, or other error.
  Warning  FailedMount  18m  kubelet  MountVolume.MountDevice failed for volume &quot;pvc-f88bdca6-7794-455a-872f-8230f1ce295d&quot; : mount failed: exit status 32
Mounting command: systemd-run
Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03 --scope -- mount -t xfs -o debug,defaults /dev/xvdbq /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03
Output: Running scope as unit run-4562.scope.
mount: /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03: wrong fs type, bad option, bad superblock on /dev/nvme1n1, missing codepage or helper program, or other error.
  Warning  FailedMount  17m  kubelet  MountVolume.MountDevice failed for volume &quot;pvc-f88bdca6-7794-455a-872f-8230f1ce295d&quot; : mount failed: exit status 32
Mounting command: systemd-run
Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03 --scope -- mount -t xfs -o debug,defaults /dev/xvdbq /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03
Output: Running scope as unit run-4835.scope.
mount: /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03: wrong fs type, bad option, bad superblock on /dev/nvme1n1, missing codepage or helper program, or other error.
  Warning  FailedMount  17m  kubelet  MountVolume.MountDevice failed for volume &quot;pvc-f88bdca6-7794-455a-872f-8230f1ce295d&quot; : mount failed: exit status 32
Mounting command: systemd-run
Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03 --scope -- mount -t xfs -o debug,defaults /dev/xvdbq /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03
Output: Running scope as unit run-5281.scope.
mount: /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-2a/vol-087b3e95d1aa21e03: wrong fs type, bad option, bad superblock on /dev/nvme1n1, missing codepage or helper program, or other error.
  Warning  FailedMount  5m30s (x2 over 16m)  kubelet  Unable to attach or mount volumes: unmounted volumes=[datadir], unattached volumes=[scripts mongodb-prod-token-4kjjm datadir]: timed out waiting for the condition
  Warning  FailedMount  3m12s (x3 over 10m)  kubelet  Unable to attach or mount volumes: unmounted volumes=[datadir], unattached volumes=[datadir scripts mongodb-prod-token-4kjjm]: timed out waiting for the condition
  Warning  FailedMount  56s (x11 over 16m)   kubelet  (combined from similar events): Unable to attach or mount volumes: unmounted volumes=[datadir], unattached volumes=[datadir scripts mongodb-prod-token-4kjjm]: timed out waiting for the condition
</code></pre>
<p><strong>kubectl get pods,svc,pvc,pv -o wide --namespace mongodb</strong></p>
<pre><code>NAME                         READY   STATUS              RESTARTS   AGE   IP           NODE                                       NOMINATED NODE   READINESS GATES
pod/mongodb-prod-0           0/1     ContainerCreating   0          20m   &lt;none&gt;       ip-10-0-4-244.us-east-2.compute.internal   &lt;none&gt;           &lt;none&gt;
pod/mongodb-prod-arbiter-0   1/1     Running             5          20m   10.0.4.132   ip-10-0-4-244.us-east-2.compute.internal   &lt;none&gt;           &lt;none&gt;

NAME                                    TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)           AGE   SELECTOR
service/mongodb-prod-0-external         NodePort    172.20.91.18    &lt;none&gt;        27017:30001/TCP   20m   app.kubernetes.io/component=mongodb,app.kubernetes.io/instance=mongodb-prod,app.kubernetes.io/name=mongodb,statefulset.kubernetes.io/pod-name=mongodb-prod-0
service/mongodb-prod-1-external         NodePort    172.20.202.43   &lt;none&gt;        27017:30002/TCP   20m   app.kubernetes.io/component=mongodb,app.kubernetes.io/instance=mongodb-prod,app.kubernetes.io/name=mongodb,statefulset.kubernetes.io/pod-name=mongodb-prod-1
service/mongodb-prod-arbiter-headless   ClusterIP   None            &lt;none&gt;        27017/TCP         20m   app.kubernetes.io/component=arbiter,app.kubernetes.io/instance=mongodb-prod,app.kubernetes.io/name=mongodb
service/mongodb-prod-headless           ClusterIP   None            &lt;none&gt;        27017/TCP         20m   app.kubernetes.io/component=mongodb,app.kubernetes.io/instance=mongodb-prod,app.kubernetes.io/name=mongodb

NAME                                           STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS     AGE   VOLUMEMODE
persistentvolumeclaim/datadir-mongodb-prod-0   Bound    pvc-f88bdca6-7794-455a-872f-8230f1ce295d   100Gi      RWO            mongodbstorage   20m   Filesystem

NAME                                                        CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                            STORAGECLASS     REASON   AGE   VOLUMEMODE
persistentvolume/pvc-f88bdca6-7794-455a-872f-8230f1ce295d   100Gi      RWO            Retain           Bound    mongodb/datadir-mongodb-prod-0   mongodbstorage            20m   Filesystem
</code></pre>
<p>Update:</p>
<p><strong>kubectl describe pv pvc-30f3ca78-134b-4b4d-bac9-385a71a6f7e0</strong></p>
<pre><code>Name:              pvc-30f3ca78-134b-4b4d-bac9-385a71a6f7e0
Labels:            failure-domain.beta.kubernetes.io/region=us-east-2
                   failure-domain.beta.kubernetes.io/zone=us-east-2c
Annotations:       kubernetes.io/createdby: aws-ebs-dynamic-provisioner
                   pv.kubernetes.io/bound-by-controller: yes
                   pv.kubernetes.io/provisioned-by: kubernetes.io/aws-ebs
Finalizers:        [kubernetes.io/pv-protection]
StorageClass:      mongodbstorage
Status:            Bound
Claim:             mongodb/datadir-mongodb-prod-0
Reclaim Policy:    Retain
Access Modes:      RWO
VolumeMode:        Filesystem
Capacity:          100Gi
Node Affinity:     
  Required Terms:  
    Term 0:        failure-domain.beta.kubernetes.io/zone in [us-east-2c]
                   failure-domain.beta.kubernetes.io/region in [us-east-2]
Message:           
Source:
    Type:       AWSElasticBlockStore (a Persistent Disk resource in AWS)
    VolumeID:   aws://us-east-2c/vol-08aebae8e0d675c4d
    FSType:     xfs
    Partition:  0
    ReadOnly:   false
Events:         &lt;none&gt;

</code></pre>

<p>I found what the problem was, once i removed the mount options from the storage class and recreated it, it mounted properly.</p>
<pre><code>mountOptions:
 - debug
</code></pre>
<pre><code>apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: mongodbstorage
provisioner: kubernetes.io/aws-ebs
parameters:
  type: gp2
  fsType: xfs
reclaimPolicy: Retain
allowVolumeExpansion: true
volumeBindingMode: WaitForFirstConsumer
</code></pre>
