From owner-freebsd-questions@freebsd.org Wed Mar 3 20:58:12 2021 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25B34550D25 for ; Wed, 3 Mar 2021 20:58:12 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from holgerdanske.com (holgerdanske.com [184.105.128.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "www.holgerdanske.com", Issuer "www.holgerdanske.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrRD3045tz3K9D for ; Wed, 3 Mar 2021 20:58:10 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from 99.100.19.101 (99-100-19-101.lightspeed.frokca.sbcglobal.net [99.100.19.101]) by holgerdanske.com with ESMTPSA (TLS_AES_128_GCM_SHA256:TLSv1.3:Kx=any:Au=any:Enc=AESGCM(128):Mac=AEAD) (SMTP-AUTH username dpchrist@holgerdanske.com, mechanism PLAIN) for ; Wed, 3 Mar 2021 12:58:01 -0800 Subject: Re: zfs out of space To: freebsd-questions@freebsd.org References: <19e7598f-ed3b-75a6-8e98-2900fe1a828c@holgerdanske.com> From: David Christensen Message-ID: Date: Wed, 3 Mar 2021 12:58:00 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DrRD3045tz3K9D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of dpchrist@holgerdanske.com has no SPF policy when checking 184.105.128.27) smtp.mailfrom=dpchrist@holgerdanske.com X-Spamd-Result: default: False [-2.10 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[184.105.128.27:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; RBL_SENDERSCORE_FAIL(0.00)[184.105.128.27:server fail]; SPAMHAUS_ZRD(0.00)[184.105.128.27:from:127.0.2.255]; ARC_NA(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_NA(0.00)[holgerdanske.com]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:184.104.0.0/15, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-questions] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 20:58:12 -0000 On 3/3/21 7:01 AM, Tomasz CEDRO wrote: > On Tue, Mar 2, 2021 at 4:28 AM David Christensen > wrote: >> I would try discarding the checkpoint: >> # zpool checkpoint --discard pool > > Thank you David! That helped :-) YW. > In addition to that I have created sub volumes to obtain more granular > control over snapshots, that required moving old directories into new > mount point locations, and mv did not delete all moved files thus > space exhaustion. That explains it. > I can now run snapshots in cron everytday for > critical data, every week for less important data, and once per month > for general use data :-) I do the same. > Is there any way to create a zfs volume from an existing directory? > Not to move all the files? :-) I have not found a way to convert a directory into a ZFS filesystem directly. I would create the new ZFS filesystem with a temporary mountpoint, move the files, remove the directory, and set the mountpoint of the dataset. If I'm feeling paranoid, I would copy, rather than move, and I would validate before removing the directory and its contents. Checkpointing is another option. But, the latter two require enough free space in the pool to hold a second copy of the content. My pools are HDD's. SSD caches are a big help. I need to try mirrored SSD intent logs. lz4 compression saves space, and I have not seen any performance penalty. deduplication is a double-edged sword. I have seen HDD throughput drop by two orders of magnitude without an SSD cache, and by one order of magnitude with. But for repetitive snapshots of bulk data with small changes, such as daily backups, the space savings can be considerable. I keep logs of my ZFS administration console sessions, and convert frequently used commands into shell scripts to save typing and to get consistency. David