// Module included in the following assemblies:
//
// storage/persistent_storage/persistent-storage-local.adoc

:_mod-docs-content-type: PROCEDURE
[id="local-pod_{context}"]
= Attach the local claim

[role="_abstract"]
After a local volume has been mapped to a persistent volume claim (PVC), attach the claim to a pod by specifying it in the pod specification to make the local storage available to the application.

.Prerequisites
* A persistent volume claim exists in the same namespace.

.Procedure
. Include the defined claim in the resource spec. The following example declares the persistent volume claim inside a pod:
+
[source,yaml]
----
apiVersion: v1
kind: Pod
spec:
# ...
  containers:
    volumeMounts:
    - name: local-disks
      mountPath: /data
  volumes:
  - name: local-disks
    persistentVolumeClaim:
      claimName: local-pvc-name
# ...
----
+
* `spec...containers.volumeMounts.name`: Specifies the name of the volume to mount.
* `spec...containers.volumeMounts.mountPath`: Specifies the path inside the pod where the volume is mounted. Do not mount to the container root, `/`, or any path that is the same in the host and the container. This can corrupt your host system if the container is sufficiently privileged, such as the host `/dev/pts` files. It is safe to mount the host by using `/host`.
* `spec...volumes.persistentVolumeClaim.claimName`: Specifies the name of the existing persistent volume claim to use.

. Create the resource in the {product-title} cluster, specifying the file you just created, by running the following command:
+
[source,terminal]
----
$ oc create -f <local-pod>.yaml
----
