From owner-freebsd-questions@FreeBSD.ORG Mon Dec 29 13:37:10 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 379A039B for ; Mon, 29 Dec 2014 13:37:10 +0000 (UTC) Received: from lb3-smtp-cloud3.xs4all.net (lb3-smtp-cloud3.xs4all.net [194.109.24.30]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client CN "Bizanga Labs SMTP Client Certificate", Issuer "Bizanga Labs CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B94D264E1C for ; Mon, 29 Dec 2014 13:37:09 +0000 (UTC) Received: from slackbox.erewhon.home ([83.162.243.5]) by smtp-cloud3.xs4all.net with ESMTP id ZRcz1p00F07iGuj01Rd0ph; Mon, 29 Dec 2014 14:37:00 +0100 Received: by slackbox.erewhon.home (Postfix, from userid 1001) id 537DA123DB; Mon, 29 Dec 2014 14:36:59 +0100 (CET) Date: Mon, 29 Dec 2014 14:36:59 +0100 From: Roland Smith To: Odhiambo Washington Subject: Re: Backing Up a journaled FS Message-ID: <20141229133659.GA99537@slackbox.erewhon.home> Mail-Followup-To: Odhiambo Washington , User Questions References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.23 (2014-03-12) Cc: User Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2014 13:37:10 -0000 On Mon, Dec 29, 2014 at 11:29:13AM +0300, Odhiambo Washington wrote: > I hope everyone enjoyed their foods & drinks during Christmas:) Of course. :-) > I have a server I installed with two identical disks. I used BSD labels > instead of GPT and I had it a little rough creating my slices, because I = am > used to a situation where I only created / amd swap for such servers > because it made life easy for me during backup. I would completely wipe a= ll > data on the second disk every Saturday, via a cron, and write it with data > from the primary/running/active disk as a means of backup. Not so dandy b= ut > works quite fine anyway. > Now I have gotten to a point where I am stopped in my tracks because I > cannot do dump/restore on a journaled fs: My solution to this problem was to manually create the similar partitions on the second disk. These partitions are also listed in /etc/fstab as /mnt/bk/ with the =E2=80=9Cnoauto=E2=80=9D option. Every night a cron job running rsync mounts the partitions on the spare disk and syncronizes them with the primary. This works something like this; FLAGS=3D"-axq -H --delete" LOG=3D"logger -t 'backup-local'" # This script assumes that the backups are not mounted. mount /mnt/bk/root if df|grep /mnt/bk/root >/dev/null; then #echo "/ is good to go!" rsync $FLAGS / /mnt/bk/root && $LOG "/ successfully backed-up." umount /mnt/bk/root else echo "Backup for / not mounted! Not backed up." fi (Similar for other partitions). You can find the complete script on my website: http://rsmith.home.xs4all.nl/freebsd/automated-local-backups.html Due to the use of logger(1) and the && operator which makes sure that it on= ly logs when rsync was succesful, I can check if the backup actually worked in /var/log/messages; Dec 29 04:00:00 mybox 'backup-local': / successfully backed-up. Dec 29 04:03:03 mybox 'backup-local': /usr successfully backed-up. Dec 29 04:03:56 mybox 'backup-local': /home successfully backed-up. Dec 29 04:04:01 mybox 'backup-local': /var successfully backed-up. Because it uses rsync, this backup is generally relatively fast. But it only saves a single copy. So this is basically just a primary defense against e.= g. a disk dying. For saving data I generally rsync to a USB disk that is stored off-site. And just like dump/restore, this doesn't back up boot blocks. But you can e= =2Eg. boot from a CD or memstick to restore those. Hope this helps, Roland --=20 R.F.Smith http://rsmith.home.xs4all.nl/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 5753 3324 1661 B0FE 8D93 FCED 40F6 D5DC A38A 33E0 (keyID: A38A33E0)