<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://dev1galaxy.org/extern.php?action=feed&amp;tid=4173&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Operating System Backups]]></title>
		<link>http://dev1galaxy.org/viewtopic.php?id=4173</link>
		<description><![CDATA[The most recent posts in Operating System Backups.]]></description>
		<lastBuildDate>Sat, 25 Sep 2021 04:07:36 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Operating System Backups]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=31725#p31725</link>
			<description><![CDATA[<p>I use fsarchiver to backup an operating system partition, rsync for a home directory.</p><p>It&#039;s all on an LVM so I can make a snapshot of a mounted partition and safely backup from that.</p>]]></description>
			<author><![CDATA[dummy@example.com (durham)]]></author>
			<pubDate>Sat, 25 Sep 2021 04:07:36 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=31725#p31725</guid>
		</item>
		<item>
			<title><![CDATA[Re: Operating System Backups]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=27932#p27932</link>
			<description><![CDATA[<p>thanks for the contributions all.</p>]]></description>
			<author><![CDATA[dummy@example.com (dice)]]></author>
			<pubDate>Sat, 06 Mar 2021 12:22:08 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=27932#p27932</guid>
		</item>
		<item>
			<title><![CDATA[Re: Operating System Backups]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=27928#p27928</link>
			<description><![CDATA[<p>I back up data with rsync, wrapped in a customized bash script.</p><p>I back up system partitions booting a different OS and using partclone from there.</p>]]></description>
			<author><![CDATA[dummy@example.com (PedroReina)]]></author>
			<pubDate>Sat, 06 Mar 2021 10:30:15 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=27928#p27928</guid>
		</item>
		<item>
			<title><![CDATA[Re: Operating System Backups]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=27922#p27922</link>
			<description><![CDATA[<p>I backup my personal data using </p><div class="codebox"><pre><code>rsync -avh &lt;source&gt; &lt;destination&gt;</code></pre></div><p> scripts (which are very basic bash commands)</p><p>I also use reverse instructions to restore. But I haven&#039;t had to do that in a long time, touch wood. :-)</p><p>I used to use &quot;simplebackup&quot; but it stopped working and support for it disappeared, but that was when I was still using Mageia/Mandriva (about ten years ago?).</p><p>Thankfully, Devuan Beowulf is more stable than any other OS I have ever used before.</p>]]></description>
			<author><![CDATA[dummy@example.com (GlennW)]]></author>
			<pubDate>Sat, 06 Mar 2021 01:51:14 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=27922#p27922</guid>
		</item>
		<item>
			<title><![CDATA[Re: Operating System Backups]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=27913#p27913</link>
			<description><![CDATA[<p>For my Debian bullseye system I have a systemd timer calling this simple rsync script every week to back up the system to the spare internal drive in my ThinkPad:</p><div class="codebox"><pre class="vscroll"><code>#!/usr/bin/env ksh

_date=&quot;$(date -I)&quot;
error_log=/var/log/backup_errors-&quot;$_date&quot;.log
uuid=ae1c7741-67e6-4919-b3d8-3d3626709ae1

function rsync_backup {
   /usr/bin/rsync -aAXq --delete --exclude={&#039;/dev/*&#039;,&#039;/proc/*&#039;,&#039;/sys/*&#039;,&#039;/tmp/*&#039;,&#039;/run/*&#039;,&#039;/mnt/*&#039;,&#039;/media/*&#039;,&#039;/lost+found&#039;,&#039;/efi/*&#039;,&#039;/home/empty/Music/*&#039;,&#039;/home/empty/Downloads/*&#039;} / /mnt/debian/ 2&gt;&quot;$error_log&quot;
   [ -a /mnt/backup-* ] &amp;&amp; rm /mnt/backup-*
   touch /mnt/backup-&quot;$_date&quot;
}

function clear_logs {
   if [ &quot;$(stat -c %s &quot;$error_log&quot;)&quot; = 0 ]
   then
      rm &quot;$error_log&quot;
      printf &#039;Empty error log deleted.\n&#039;
   else
      printf &#039;Errors in log, not deleting.\n&#039;
   fi
}

printf &#039;Mounting backup partition...\n&#039;
if mount /dev/disk/by-uuid/&quot;$uuid&quot; /mnt ; then
	printf &#039;Mounted backup partition.\n&#039;
	printf &#039;Beginning backup...\n&#039;
	rsync_backup
	printf &#039;Backup complete.\n&#039;
else
	printf &#039;Backup failed, partition not mounted correctly.\n&#039;
fi

printf &#039;Clearing empty error log files...\n&#039;
clear_logs

printf &#039;Un-mounting backup partition...\n&#039;
umount /mnt &amp;&amp; printf &#039;Un-mounted backup partition.\n&#039;

printf &#039;All done :-)\n&#039;</code></pre></div><p>I won&#039;t share the systemd .timer &amp; .service units because I&#039;m pretty sure nobody will find them of any use :-)</p><p>For my Alpine system I drop this script in /etc/periodic/daily/ to take a snapshot of the root filesystem every day and create a submenu listing the available snapshots in GRUB (five snapshots are kept at any one time with the excess being deleted by the script):</p><div class="codebox"><pre class="vscroll"><code>#!/bin/sh

PATH=/usr/sbin:/usr/bin:/sbin:/bin
time=$(date +&#039;%Y-%m-%d@%T&#039;)
grub_dir=/boot/grub
config_file=&quot;$grub_dir&quot;/alpine-snapshots.cfg
snapshot_dir=/snapshots
subvol_dir=&quot;$snapshot_dir&quot;/alpine
uuid=$(findmnt -o uuid -n /)
kernel=/boot/signed-vmlinuz-lts
parameters=&#039;rw quiet modules=btrfs&#039;
ucode=/boot/amd-ucode.img
initrd=/boot/initramfs-lts

get_snap_info() {
	snap_list=$(for snap in &quot;$snapshot_dir&quot;/* ; do printf &#039;%s &#039; &quot;$(basename -- &quot;$snap&quot;)&quot; ; done)
	snap_number=$(printf &#039;%s\n&#039; &quot;$snap_list&quot; | wc -w)
	old_snap=$(printf &#039;%s\n&#039; &quot;$snap_list&quot; | awk &#039;{print $1}&#039;)
}

if grep -q &#039; / .*snapshot.*&#039; /proc/self/mounts ; then
	printf &#039;Booted into snapshot, no action taken.\n&#039;
else
	printf &#039;Removing old configuration file...\n&#039;
	if [ -e &quot;$config_file&quot; ] ; then
		rm &quot;$config_file&quot;
	else
		printf &#039;No configuration file found.\n&#039;
	fi
	printf &#039;Creating new snapshot...\n&#039;
	btrfs subvolume snapshot / &quot;$snapshot_dir&quot;/&quot;$time&quot;
	get_snap_info
	while [ &quot;$snap_number&quot; -gt 5 ] ; do
		printf &#039;Removing excess snapshot...\n&#039;
		btrfs subvolume delete &quot;$snapshot_dir&quot;/&quot;$old_snap&quot;
		get_snap_info
	done
	printf &#039;Creating new configuration file...\n&#039;
	printf &#039;#\n&#039; &gt; &quot;$config_file&quot;
	for entry in &quot;$snapshot_dir&quot;/* ; do
		ed &quot;$config_file&quot; &gt; /dev/null &lt;&lt;!
1i
menuentry &#039;${entry##*/}&#039; {
	search --fs-uuid --set=root $uuid
	linux $subvol_dir/${entry##*/}$kernel root=UUID=$uuid rootflags=subvol=$subvol_dir/${entry##*/} $parameters
	initrd $subvol_dir/${entry##*/}$ucode $subvol_dir/${entry##*/}$initrd
}
.
w
!
	done
	printf &#039;All done!\n&#039;
fi</code></pre></div><p>Snapshots aren&#039;t really backups, as such, but I&#039;m tracking Alpine&#039;s <em>edge</em> version and the ability to rollback to a prior state is very useful with a rolling release distribution. I have a similar script in my Arch box that&#039;s called by another systemd timer unit.</p><p>For the family laptop I run rsync manually to a pair of separate stand-alone hard drives. Backups for that are too important to automate...</p><div class="quotebox"><cite>just wrote:</cite><blockquote><div><p>never backup/restore a mounted partition</p></div></blockquote></div><p>I always backup from a running system with all of the target partitions mounted. This is fine with rsync as long as you don&#039;t mind the stuff you&#039;re working on during the backup process not being saved.</p>]]></description>
			<author><![CDATA[dummy@example.com (Head_on_a_Stick)]]></author>
			<pubDate>Fri, 05 Mar 2021 17:03:58 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=27913#p27913</guid>
		</item>
		<item>
			<title><![CDATA[Re: Operating System Backups]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=27911#p27911</link>
			<description><![CDATA[<p>@ just, that sounds like a good idea per computer. The portable drive in my case is a nice option for having both storage media and backup media on the same disk. I can use the portable drive for many other computers if need be as long as i have the correct firmware and drivers installed. At the moment installed devuan to portable ssd drives is good, there is no lag like you would get from a spin drive and the speed of usb3 ports is good for this type of application. Technology has come far in this regard.</p>]]></description>
			<author><![CDATA[dummy@example.com (dice)]]></author>
			<pubDate>Fri, 05 Mar 2021 14:56:00 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=27911#p27911</guid>
		</item>
		<item>
			<title><![CDATA[Re: Operating System Backups]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=27910#p27910</link>
			<description><![CDATA[<p>Hello:</p><div class="quotebox"><cite>dice wrote:</cite><blockquote><div><p>What do you use for backups?</p></div></blockquote></div><p>I use two applications: <span class="bbc">Timeshift</span> and <span class="bbc">BackInTime</span>.<br /><span class="bbc">Timeshift</span> takes system snapshots and <span class="bbc">BackInTime</span> takes <span class="bbc">~/</span> snapshots.<br />Have always worked quite well.</p><p>All the snapshots get stored on a separate 300Gb SAS drive living inside the box.<br />This is quite obviously <strong>not</strong> the ideal solution and I&#039;ve been procrastinating for the longest while.</p><p>Cheers,</p><p>A.</p>]]></description>
			<author><![CDATA[dummy@example.com (Altoid)]]></author>
			<pubDate>Fri, 05 Mar 2021 14:53:47 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=27910#p27910</guid>
		</item>
		<item>
			<title><![CDATA[Re: Operating System Backups]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=27909#p27909</link>
			<description><![CDATA[<p>There&#039;s a number of different Linuxes, installed on each of my computers.&#160; Each Linux lives in its own partition and is totaly independent from any other one.&#160; A huge data partition with user data files in it is the only thing shared between them, used by all installed Linuxes.</p><p>FSArchiver is added to each installed Linux.</p><p>The simple thing is - never backup/restore a mounted partition.&#160; Nothing else.</p><p>For example, there are A, B, C, D Linuxes installed in their own partitions.&#160; I want to backup A and B ones.&#160; I simply boot into C or D, and run FSArchiver from them, backing up A and B either separately, in two separated archives, or put them both in a single archive.</p><p>To restore A or B, I boot again into C or D, and restore either A or B, or both.</p><p>The important thing to note here is that while C or D are running, A and B remain unmounted.&#160; So I can backup, restore, do whatever I want with partitions, corresponding to A and B.</p><p>FSArchiver archives are kept on an external USB disk.</p><p>Finally, I have a bootable USB flash stick with SystemRescueCD on it.&#160; FSArchiver is included in each and every SystemRescueCD release.&#160; In the worst case, when internal disk is totally damaged and computer doesn&#039;t boot from it, I boot from USB stick, fire up FSArchiver, and restore A, B, C, D partitions from the external disk.</p><p>SystemRescueCD with FSArchiver is an excellent disaster recovery tool.</p>]]></description>
			<author><![CDATA[dummy@example.com (just)]]></author>
			<pubDate>Fri, 05 Mar 2021 14:39:44 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=27909#p27909</guid>
		</item>
		<item>
			<title><![CDATA[Re: Operating System Backups]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=27908#p27908</link>
			<description><![CDATA[<p>Rsync for backing up <strong>data</strong>, not the OS.</p>]]></description>
			<author><![CDATA[dummy@example.com (Dutch_Master)]]></author>
			<pubDate>Fri, 05 Mar 2021 14:18:10 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=27908#p27908</guid>
		</item>
		<item>
			<title><![CDATA[Re: Operating System Backups]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=27907#p27907</link>
			<description><![CDATA[<div class="quotebox"><cite>just wrote:</cite><blockquote><div><p>FSArchiver here as well.&#160; For its unparagonable versatility, flexibility, reliability.</p></div></blockquote></div><p>How to do you backup? I have a portable drive ive set up a small devuan system with no X that i can archive from. So the portable drive has an operating system and ext4 partition to backup to. The hot backup or live backup is an option but it has stalled/failed on me in the past.</p><p>This is how i do it for the moment.</p><p>1. log into portable drive that has devuan installed on a 10GB partition.</p><p>2. mount the rest of the portable drive labeled backup from portable drives /etc/fstab</p><p>3. fsarchiver savefs&#160; /media/$USER/backup.fsa /dev/sda1 /dev/mapper/cryptroot -v -j4 -c xxxxxxx</p><p>With encrypted partitions they need to be opened first of course.</p>]]></description>
			<author><![CDATA[dummy@example.com (dice)]]></author>
			<pubDate>Fri, 05 Mar 2021 14:06:25 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=27907#p27907</guid>
		</item>
		<item>
			<title><![CDATA[Re: Operating System Backups]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=27906#p27906</link>
			<description><![CDATA[<p>FSArchiver here as well.&#160; For its unparagonable versatility, flexibility, reliability.</p>]]></description>
			<author><![CDATA[dummy@example.com (just)]]></author>
			<pubDate>Fri, 05 Mar 2021 13:49:00 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=27906#p27906</guid>
		</item>
		<item>
			<title><![CDATA[Operating System Backups]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=27902#p27902</link>
			<description><![CDATA[<p>What do you use for backups? </p><p>Im using fsarchiver as it is quick and you can secure the archive with blowfish encryption.</p><p><a href="https://www.fsarchiver.org/" rel="nofollow">https://www.fsarchiver.org/</a></p>]]></description>
			<author><![CDATA[dummy@example.com (dice)]]></author>
			<pubDate>Fri, 05 Mar 2021 12:20:11 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=27902#p27902</guid>
		</item>
	</channel>
</rss>
