<p>I have a container with an empty dir volume</p>
<pre class="lang-yaml prettyprint-override"><code> - volumes:
   emptyDir: {}
   name: someName
</code></pre>
<p>I would like to copy all data to my machine using <code>kubectl cp</code>.</p>
<p>I do not know where the <code>someName</code> volume is located. How can I find out and how can I copy the data from the volume to my local machine?</p>

User12547645
<p>You have to check in your pod where the volume is mounted. Check in the container sections, for a mount with the name <code>someName</code>, e.g:</p>
<pre><code>containers:
  volumeMounts:
  - name: someName
    mountPath: &quot;/mnt/path&quot;
</code></pre>
<p>So you know that the emptyDir is mounted at the given mountPath.</p>
<p>Afterwards you can copy the files via</p>
<pre><code>kubectl cp my-namespace/my-pod:/mnt/path /tmp/local/path
</code></pre>
