From owner-freebsd-questions@freebsd.org Fri Jun 12 06:48:27 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 33972331023 for ; Fri, 12 Jun 2020 06:48:27 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from holgerdanske.com (holgerdanske.com [IPv6:2001:470:0:19b::b869:801b]) (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 "holgerdanske.com", Issuer "holgerdanske.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jrsP0qcKz42vv for ; Fri, 12 Jun 2020 06:48:24 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from 99.100.19.101 ([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 ; Thu, 11 Jun 2020 23:48:13 -0700 Subject: Re: Makin' backups -- questions To: freebsd-questions@freebsd.org References: <86752.1591920077@segfault.tristatelogic.com> From: David Christensen Message-ID: Date: Thu, 11 Jun 2020 23:48:12 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <86752.1591920077@segfault.tristatelogic.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49jrsP0qcKz42vv 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 [3.37 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.63)[0.633]; 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_SPAM_MEDIUM(0.94)[0.939]; DMARC_NA(0.00)[holgerdanske.com]; NEURAL_SPAM_LONG(0.90)[0.901]; 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:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 06:48:27 -0000 On 2020-06-11 17:01, Ronald F. Guilmette wrote: > I'm re-writing my backup scripts and could use a bit of advice. I have used rsync(1) for backup and restore of data files for many years. Similarly, I use cvs(1) to manage my system configuration files. But I very much doubt that an rsync(1) copy of a live system disk is going to be correct. Excluding anything makes me even more incredulous. AIUI the traditional Unix backup/ restore process is to shutdown the machine, boot a live USB stick or move the source drive into another computer, mount the source filesystem(s) read-only, and use dump(8) to serialize each filesystem to a file. Restoration consists of preparing a target device with a partitioning scheme, boot loader(s), slice(s), partition(s), and/or filesystem(s), and then using restore(8) to deserialize the files into the target filesystems. (See Clonezilla [1].) The simplest, but least efficient, backup method I have found for system drives is to copy the device raw sectors to a file with dd(1) ("take an image"). Restoration consists of copying an image file to a target device (no preparation necessary, but I typically wipe and test the target device first). This works for me because: 1. dd(1) is a lowest-common-denominator tool, available on most every install/ rescue/ live disc. 2. I use MBR partitioning, to avoid problems with the GPT backup partition table when the source and target device sizes differ. 3. I keep my system images "small" -- boot track (sectors 0-62), free space for 1 MiB alignment (sectors 63-2047), and ~14 GiB slice/ partitions for boot, swap, and root. This allows me to use "16 GB" or larger USB flash drives, SD card, SSD's, or HDD's for system drives, and two dozen images or more can fit into ~200 to ~300 GB. David [1] https://clonezilla.org/