title: mkdir /mnt/data: read-only file system Back-off restarting failed postgres container
body: <p>I'm new to Kubernetes, I tried to apply yaml file to create Postgres in GKE, I'm getting error as &quot;Error: failed to start container &quot;postgres&quot;: Error response from daemon: error while creating mount source path '/mnt/data': <strong>mkdir /mnt/data: read-only</strong> file system Back-off restarting failed container.</p>
  <p>I thinki need to give permsions as RWX , when i tried to Login to pod i.e  inside container..It is not allowing to login.
  <a href="https://i.stack.imgur.com/9km0M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9km0M.png" alt="This is error image" /></a>
  ANyone please help me !!.</p>
  <p>This is my Yaml file for Postgres:</p>
  <pre><code>    apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: postgres
      spec:
        selector:
         matchLabels:
          app: postgres
        replicas: 1
        template:
          metadata:
            labels:
              app: postgres
          spec:
            containers:
              - name: postgres
                image: postgres:latest
                imagePullPolicy: &quot;IfNotPresent&quot;
                envFrom:
                  - configMapRef:
                      name: postgres-config
                volumeMounts:
                  - mountPath: /var/lib/postgresql/data
                    name: postgredb
            volumes:
              - name: postgredb
                persistentVolumeClaim:
                  claimName: postgres-pv-claim
  
  ---
      kind: PersistentVolume
      apiVersion: v1
      metadata:
        name: postgres-pv-volume
        labels:
          type: local
          app: postgres
      spec:
        storageClassName: manual
        capacity:
          storage: 5Gi
        accessModes:
          - ReadWriteMany
        hostPath:
          path: &quot;/mnt/data&quot;
  ---
     
  
       kind: PersistentVolumeClaim
          apiVersion: v1
          metadata:
            name: postgres-pv-claim
            labels:
              app: postgres
          spec:
            storageClassName: manual
            accessModes:
              - ReadWriteMany
            resources:
              requests:
                storage: 5Gi
          
      ---
          apiVersion: v1
          kind: ConfigMap
          metadata:
            name: postgres-config
            labels:
              app: postgres
          data:
            POSTGRES_DB: postgresdb
            POSTGRES_USER: postgres
            POSTGRES_PASSWORD: root
      ---
          apiVersion: v1
          kind: Service
          metadata:
            name: postgres
            labels:
              app: postgres
          spec:
             ports:
              - name: postgres
                port: 5432
                nodePort: 30432
             type: NodePort
             selector:
              app: postgres
  </code></pre>