Date: Thu, 11 Jun 2020 23:48:12 -0700 From: David Christensen <dpchrist@holgerdanske.com> To: freebsd-questions@freebsd.org Subject: Re: Makin' backups -- questions Message-ID: <ef3ebee8-a3f1-8caf-040d-d9483afc5c15@holgerdanske.com> In-Reply-To: <86752.1591920077@segfault.tristatelogic.com> References: <86752.1591920077@segfault.tristatelogic.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2020-06-11 17:01, Ronald F. Guilmette wrote: > I'm re-writing my backup scripts and could use a bit of advice. <snip> 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/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ef3ebee8-a3f1-8caf-040d-d9483afc5c15>