Skip to content

Instantly share code, notes, and snippets.

@jamesls
Created December 4, 2018 20:40
Show Gist options
  • Save jamesls/1df5d5ddbd855671f338a130c4db75bb to your computer and use it in GitHub Desktop.
Save jamesls/1df5d5ddbd855671f338a130c4db75bb to your computer and use it in GitHub Desktop.

Mount with noauto_da_alloc

# mount | grep ' / '
/dev/nvme0n1p1 on / type ext4 (rw,relatime,discard,noauto_da_alloc,data=ordered)

root@ip-10-0-0-127:~/slow-mv# cat empty-file.sh
#!/bin/bash
echo "Copy time:"
time cp 5GB 5GB.copy
echo "Move time:"
time mv 5GB.copy 5GB


# ./empty-file.sh
Copy time:

real    0m31.431s
user    0m0.023s
sys     0m3.386s
Move time:

real    0m0.301s
user    0m0.000s
sys     0m0.258s

Previously the mv would take almost 11 seconds on this system, now it's only .3 seconds with noauto_da_alloc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment