bug-coreutils
[Top][All Lists]
Advanced

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

bug#25930: optimize mv for multiple bind mounts


From: Ruediger Meier
Subject: bug#25930: optimize mv for multiple bind mounts
Date: Thu, 2 Mar 2017 10:51:40 +0100
User-agent: KMail/1.9.10

Hi,

I have two bind mounts of the same filesystem

$ grep "/tmp"  /etc/fstab
/dev/vg0/tmpdirs     /mnt/tmpdirs         ext4       
acl,user_xattr,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0  1 2
/mnt/tmpdirs/tmp     /tmp                 none       bind                  0 0
/mnt/tmpdirs/var/tmp /var/tmp             none       bind                  0 0


Using mv to move files between the bind mounts makes a slow copy:

$ time mv /var/tmp/BIGFILE  /tmp/

real    0m0.622s
user    0m0.001s
sys     0m0.621s


In theory mv could know somehow that's the same filesystem
and do it like this:

$ time mv /mnt/tmpdirs/tmp/BIGFILE /mnt/tmpdirs/var/tmp/

real    0m0.004s
user    0m0.001s
sys     0m0.003s


Would it be possible to optimize mv regarding bind mounts? Or perhaps
are there other filesystems which do this better than ext4? Specially
the case that the original whole filesystem (/mnt/tmpdirs) is umounted
should work too somewhow.

cu,
Rudi





reply via email to

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