Is moving a file via the
mv command between two filesystems an atomic operation?
See the EXDEV error (in man 2 rename):
EXDEV oldpath and newpath are not on the same mounted filesystem. (Linux permits a filesystem to be mounted at multiple points, but rename() does not work across different mount points, even if the same filesystem is mounted on both.)
You can't move between file-systems with a system call, so what mv does is a user-space copy and delete, which is never atomic.
This depends on what you understand by "atomically".
rename() syscall, copying files bewteen two filesystems is usually not atomically. Since the copy routine in
mv does not call
fsync(2), there may be late filesystem errors that are not detected.