# Speed up mv command in pod

**URL:** <https://discuss.kubernetes.io/t/speed-up-mv-command-in-pod/20589>\
**Category:** General Discussions\
**Created:** [July 12, 2022, 7:51am UTC](https://discuss.kubernetes.io/t/speed-up-mv-command-in-pod/20589 "2022-07-12T07:51:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yuanhao](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/yuanhao/32/10423_2.png) [@Yuanhao](https://discuss.kubernetes.io/u/Yuanhao)\
**Post date:** [July 12, 2022, 7:51am UTC](https://discuss.kubernetes.io/t/speed-up-mv-command-in-pod/20589/1 "2022-07-12T07:51:23Z")

</div>

Current my entrypoint inside my docker is doing a mv on a folder which is 5GB.  
In kubernetes, the command become a copy and it take up to around 5min for the mv command to complete.  
Previously in Vsphere Integrated Container (VIC), the command take 1 sec to complete as it really a move command.

Please let me know if anyone know some setting which i can so that kubernetes will do a mv instead of a copy.

### Cluster information:

Kubernetes version: NA  
Cloud being used: Private Cloud  
Installation method: NA  
Host OS: Linux  
CNI and version: NA  
CRI and version: NA

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

---

<div class="post-metadata">

**Author:** ![thockin](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/thockin/32/2457_2.png) [@thockin](https://discuss.kubernetes.io/u/thockin)\
**Post date:** [July 12, 2022, 3:02pm UTC](https://discuss.kubernetes.io/t/speed-up-mv-command-in-pod/20589/2 "2022-07-12T15:02:42Z")

</div>

This is entirely about what kind of volume you are using and how your node mounts. If you are copying between different mounts, the move has to become a copy plus delete.

If it is on the same filesystem it SHOULD optimize to a rename(). If it isn’t you might have to peek at whatever tool you are using (e.g. strace) to see why it is deciding it can’t

---

<div class="post-metadata">

**Author:** ![Yuanhao](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/yuanhao/32/10423_2.png) [@Yuanhao](https://discuss.kubernetes.io/u/Yuanhao)\
**Post date:** [July 13, 2022, 6:42am UTC](https://discuss.kubernetes.io/t/speed-up-mv-command-in-pod/20589/3 "2022-07-13T06:42:31Z")

</div>

Any idea how can I force to the same mount? Cause I really just doing a simple mv command and it will be up to system to decide. When i did strace on mv command, it is showing up as a cp command.

---

<div class="post-metadata">

**Author:** ![thockin](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/thockin/32/2457_2.png) [@thockin](https://discuss.kubernetes.io/u/thockin)\
**Post date:** [July 13, 2022, 3:18pm UTC](https://discuss.kubernetes.io/t/speed-up-mv-command-in-pod/20589/4 "2022-07-13T15:18:26Z")

</div>

You have not provided nearly enough information to hazard a guess on this. We would need to know what kind of volumes, how they are provisioned, where they are mounted, whether the move op crossed volumes, etc.

---

<div class="post-metadata">

**Author:** ![Yuanhao](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/yuanhao/32/10423_2.png) [@Yuanhao](https://discuss.kubernetes.io/u/Yuanhao)\
**Post date:** [August 2, 2022, 7:40am UTC](https://discuss.kubernetes.io/t/speed-up-mv-command-in-pod/20589/5 "2022-08-02T07:40:35Z")

</div>

(post deleted by author)

---

<div class="post-metadata">

**Author:** ![Yuanhao](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/yuanhao/32/10423_2.png) [@Yuanhao](https://discuss.kubernetes.io/u/Yuanhao)\
**Post date:** [August 2, 2022, 7:42am UTC](https://discuss.kubernetes.io/t/speed-up-mv-command-in-pod/20589/6 "2022-08-02T07:42:15Z")

</div>

(post deleted by author)
