On 12/6/24 06:07, Milan Hauth wrote:
currently mv fails to detect an identical filesystem
of source and destination file across bind mounts

instead of using the rename syscall
mv copies the file (to the same filesystem)
and then deletes the source file

obviously, this is not ideal:

- slow
- waste of disk space
- change of inode number
- unnecessary disk write operations (destructive)

currently mv fails to detect an identical filesystem
of source and destination file across bind mounts

this is possible using /proc/self/mountinfo
proof of concept:
https://github.com/milahu/move-files-across-bind-mounts

Is there a downside to always trying rename() first and doing the copy if it fails? That's approximately what toybox's mv does...

Rob

Reply via email to