coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mv: move files across bind mounts using the rename syscall


From: Milan Hauth
Subject: mv: move files across bind mounts using the rename syscall
Date: Fri, 6 Dec 2024 13:07:07 +0100

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

related:
https://serverfault.com/questions/327447
https://unix.stackexchange.com/questions/406351
https://unix.stackexchange.com/questions/380025



reply via email to

[Prev in Thread] Current Thread [Next in Thread]