From owner-freebsd-bugs@FreeBSD.ORG Sat Apr 20 04:40:00 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B0E96706 for ; Sat, 20 Apr 2013 04:40:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 92089E64 for ; Sat, 20 Apr 2013 04:40:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K4e0Io017686 for ; Sat, 20 Apr 2013 04:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r3K4e0Y6017685; Sat, 20 Apr 2013 04:40:00 GMT (envelope-from gnats) Resent-Date: Sat, 20 Apr 2013 04:40:00 GMT Resent-Message-Id: <201304200440.r3K4e0Y6017685@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jon Valliere Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8BF046E4 for ; Sat, 20 Apr 2013 04:35:27 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 7BAFFE53 for ; Sat, 20 Apr 2013 04:35:27 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r3K4ZRgt037318 for ; Sat, 20 Apr 2013 04:35:27 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id r3K4ZRlj037317; Sat, 20 Apr 2013 04:35:27 GMT (envelope-from nobody) Message-Id: <201304200435.r3K4ZRlj037317@red.freebsd.org> Date: Sat, 20 Apr 2013 04:35:27 GMT From: Jon Valliere To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: misc/177985: disk usage problem when copying from one zfs dataset to another on the same pool using mv command X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 04:40:00 -0000 >Number: 177985 >Category: misc >Synopsis: disk usage problem when copying from one zfs dataset to another on the same pool using mv command >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Apr 20 04:40:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Jon Valliere >Release: 8.3 < FreeNAS variant >Organization: >Environment: FreeBSD freenas.local 8.3-RELEASE-p6 FreeBSD 8.3-RELEASE-p6 #0 r248141M: Sun Mar 10 16:35:05 PDT 2013 root@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 >Description: 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. >How-To-Repeat: 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. >Fix: delete individual files after they are copied during the mv >Release-Note: >Audit-Trail: >Unformatted: