misc/177985: disk usage problem when copying from one zfs dataset to another on the same pool using mv command
sybersnake at gmail.com
Sat Apr 20 04:40:00 UTC 2013
>Synopsis: disk usage problem when copying from one zfs dataset to another on the same pool using mv command
>Arrival-Date: Sat Apr 20 04:40:00 UTC 2013
>Originator: Jon Valliere
>Release: 8.3 < FreeNAS variant
FreeBSD freenas.local 8.3-RELEASE-p6 FreeBSD 8.3-RELEASE-p6 #0 r248141M: Sun Mar 10 16:35:05 PDT 2013 root at build.ixsystems.com:/home/jpaetzel/8.3.1-RELEASE/os-base/amd64/tank/home/jpaetzel/8.3.1-RELEASE/FreeBSD/src/sys/FREENAS.amd64 amd64
the mv command performs a copy then delete operation when moving a file from one filesystem to another.
in freebsd zfs datasets are handled as independent file systems even tho they share the same logical disk pool much like dynamic partitioning, if you would.
for this given example I have a pool called array_0; array_0 has a total capacity of 4tb.
I have two datasets on array_0; stor and public.
stor has a folder FooBar which contains 3tb worth of files.
mv array_0/stor/FooBar array_0/public/FooBar
because these are different file systems it will copy then delete.
here is the problem.
there is only 1tb of space available on the pool. there isn't enough space for a full copy.
today mv copied 1tb of data until the pool ran out of space then went kind of crazy.
obviously it was not deleting files after it had already copied as it went along. if it had been deleting files as it was copying then it never would have totally consumed all disk space.
create a pool with two datasets
create a some directory structure that represents 75% of total capacity.
mv that folder from one dataset to another on the same pool.
delete individual files after they are copied during the mv
More information about the freebsd-bugs