Re: ZFS and mv utility



On Thu, Apr 26, 2007 at 12:56:50AM +0400, Alexey Tarasov wrote:
Hello Pawel.

I have a question about ZFS and mv utility. I have the following pool configuration:

NAME USED AVAIL REFER MOUNTPOINT
storage 62,1G 121G 26K /storage
storage/music 7,95G 121G 7,95G /storage/music
storage/oldhome 47,5G 121G 47,5G /storage/oldhome

I made the following operation: mv /storage/oldhome/lexa/music/* /storage/music and that operation took a very long time. It seems that MV copies files first from
storage/oldhome/lexa/musc to storage/music and then deletes them from old location. But I move files within one storage pool and it should work as fast, as it works on UFS
partition. Does it need to be modified for compatibility with ZFS?

From mv(1) manual page:

As the rename(2) call does not work across file systems, mv uses cp(1)
and rm(1) to accomplish the move. The effect is equivalent to:

rm -f destination_path && \
cp -pRP source_file destination && \
rm -rf source_file

ZFS pool is not a file system. Look at mount(8) output. It would be
possible in theory to move data faster within one pool and this was
discussed on zfs-discuss@xxxxxxxxxxxxxxx, you may want to search the
archives.

--
Pawel Jakub Dawidek http://www.wheel.pl
pjd@xxxxxxxxxxx http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!

Attachment: pgp3MZNDxIb4R.pgp
Description: PGP signature



Relevant Pages

  • Re: ZFS: amd64, devd, root file system.
    ... I even performed a "boot -v" but did not see anything useful. ... replicas for the pool to continue functioning. ... It seems that ZFS "legacy" mounts are not supported under FreeBSD, ... no other way to mount it since we do not have a "mount_zfs", ...
    (freebsd-current)
  • Re: ZFS: amd64, devd, root file system.
    ... There after the pool could be mounted and I could manually set up the ... loaded with the kernel and the zfs module. ... It appears, that a zpool can be manually mounted if it resides on ad0s2, ... made me suspicious and I prepared a ZFS root in test2. ...
    (freebsd-current)
  • Re: ZFS: amd64, devd, root file system.
    ... There after the pool could be mounted and I could manually set up the ... tests) unused swap partition on my "normal" UFS system disk (which I ... or does ZFS mount them automatically when the pool "test" is mounted? ... I assume that "zfs mount -a" will ignore file systems that are ...
    (freebsd-current)
  • Re: Cant wait for Leopards Time Machine!
    ... ZFS has "pools" that can span several volumes. ... given pool. ... This thing about having multiple file systems per pool is not ...
    (comp.sys.mac.system)
  • Re: Encrypted zfs?
    ... Afterwards they remove all of them, shuffle them, ... ZFS has no trouble ... If you don't export the pool before ... ATA disks. ...
    (freebsd-current)