From owner-freebsd-questions@freebsd.org Sun Apr 12 08:23:12 2020 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 397802B669D for ; Sun, 12 Apr 2020 08:23:12 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from holgerdanske.com (holgerdanske.com [IPv6:2001:470:0:19b::b869:801b]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "xray.he.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 490Prt1yB2z3Jy4 for ; Sun, 12 Apr 2020 08:23:10 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from 99.100.19.101 ([99.100.19.101]) by holgerdanske.com with ESMTPSA (ECDHE-RSA-AES128-GCM-SHA256:TLSv1.2:Kx=ECDH:Au=RSA:Enc=AESGCM(128):Mac=AEAD) (SMTP-AUTH username dpchrist@holgerdanske.com, mechanism PLAIN) for ; Sun, 12 Apr 2020 01:23:01 -0700 Subject: Re: Restoring and snapshots To: freebsd-questions@freebsd.org References: <56b4e678-0e66-e65b-b9d2-a2e79a5b7b6f@netfence.it> <2a0ee11a-eb32-7ae2-256f-ad1b00d1e49d@netfence.it> From: David Christensen Message-ID: Date: Sun, 12 Apr 2020 01:23:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <2a0ee11a-eb32-7ae2-256f-ad1b00d1e49d@netfence.it> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 490Prt1yB2z3Jy4 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 2001:470:0:19b::b869:801b) smtp.mailfrom=dpchrist@holgerdanske.com X-Spamd-Result: default: False [-2.82 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; IP_SCORE(-1.72)[ip: (-0.31), ipnet: 2001:470::/32(-4.66), asn: 6939(-3.60), country: US(-0.05)]; 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; DMARC_NA(0.00)[holgerdanske.com]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2020 08:23:12 -0000 On 2020-04-11 22:19, Andrea Venturoli wrote: > On 2020-04-12 00:18, David Christensen wrote: >> I am confused: >> *  What is the type of the filesystem that was the source of the backup? > ZFS in the example above, but I've got the same problem with UFS, as I > also use snapshot there. >> *  What tool(s) did you use to backup? > Sometimes Bacula, sometimes some custom scripts. >> *  What is the type of the filesystem that was the destination of the >> backup? > Could be UFS, bacula volumes, tapes, ZIPs, etc... >> *  What tool(s) are you using to restore? > Again either Bacula or some custom scripts. >> *  What is the type of the filesystem that is the destination of the >> restore? > Usually UFS or ZFS; could be something else. >> So, the backup source filesystem and the restore destination >> filesystems are both ZFS (?). > Possibly, but not always. >> The upper Unix filesystem path should be an empty directory. > Should, but not always is. > Sometimes I found "forgotten" files in the directory which is the target > of the nullfs mount. Of course those files are usually hidden and > probably useless, but must be taken into account. I would do the housekeeping -- unmount the filesystems that are overlaying the mount point directories containing forgotten files and move the forgotten files to wherever they belong, or delete them. There is nothing you can do about the copies that have already been snapshotted (other than destroying those snapshots). >> I believe it is a result of the 'mountpoint' properties of the two ZFS >> file systems and how ZFS represents filesystem snapshots in the Unix >> file system. > No, this can happen with UFS too. It sounds like you are using file- and directory-level backup tools for ZFS filesystems (?). I did that for a while and it works, but I knew I was doing it the wrong way. If you are using file- and directory-level backup tools to back up ZFS snapshots, that definitely sounds like you are barking up the wrong tree. That is what ZFS replication is for. Now I'm using ZFS snapshots and replication to backup ZFS filesystems to other ZFS pools. I still use rsync to backup non-ZFS filesystems, but the backup destinations are ZFS filesystems; which are fed into zfs-auto-snapshot and the rest of my backup processes. My tar/gzip archives are now sourced from ZFS snapshots rather than live filesystems. Life is good. :-) David