<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Musings of a techie &#187; Uncategorized</title>
	<atom:link href="http://ivan.dreamtime.org/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://ivan.dreamtime.org</link>
	<description></description>
	<lastBuildDate>Sat, 06 Jan 2024 01:00:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>LVM, backups and snapshots</title>
		<link>http://ivan.dreamtime.org/2023/03/09/lvm-backups-and-snapshots/</link>
		<comments>http://ivan.dreamtime.org/2023/03/09/lvm-backups-and-snapshots/#comments</comments>
		<pubDate>Thu, 09 Mar 2023 12:56:02 +0000</pubDate>
		<dc:creator>ivan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ivan.dreamtime.org/?p=232</guid>
		<description><![CDATA[When replacing (and upgrading) disks, pre-failure, I prefer backing up the original data first. Although the original disks are in a RAID0 (mirror) array, where available, I prefer to make a backup despite the fact I should be able to swap the old disk for a newer (and larger) disk without impact. This covers the [...]]]></description>
			<content:encoded><![CDATA[<p>When replacing (and upgrading) disks, pre-failure, I prefer backing up the original data first. Although the original disks are in a RAID0 (mirror) array, where available, I prefer to make a backup despite the fact I should be able to swap the old disk for a newer (and larger) disk without impact. This covers the case where the RAID0 array is able to read the data while both disks have failures in different locations, but removing a disk to upgrade would ultimately cause data-loss.</p>
<p>I have made use of LVM under Linux for decades. Segregating files onto separate logical-volumes (partitions) means that smaller filesystems can be repaired more quickly, while restricting the impact of data affected (or services down on a server), and the ability to extend logical-volumes has been a lifesaver. However, I haven&#8217;t made much use of <a href="https://tldp.org/HOWTO/LVM-HOWTO/snapshotintro.html">LVM snapshots</a>. LVM snapshots allow one to take an instant snapshot/copy (static, like a photo) of a logical-volume, and allow the original LV to continue being used/changed while one mounts and takes a backup of the snapshot. This is of most benefit when backing up volumes containing database files where consistency is necessary. Without such a snapshot (or stopping the database) individual DB files are likely to be changing as they are backed up, meaning a restored database will either be corrupt, or inconsistent.</p>
<p>In this particular case I want to make a copy of an LV (logical-volume) containing rsnapshot backups of multiple servers. rsnapshot runs every ~2 hours, and I know this backup will take a couple of days (2d4h30m) for 1.6TB of backups. </p>
<p>Rsnapshot gratuitously uses hard-links to reduce utilisation, so a copy needs to maintain hard-links. I would normally use <strong>rsync -H</strong> but, in this case, there is a large number of files/directories (19.5 million inodes) and rsync would uses a lot of RAM to complete the sync. This server has a small amount of RAM (2GB), and rsync crashed after 1-2 days with an out-of-memory error. The alternative is <strong>cp -a</strong> which doesn&#8217;t have the same RAM requirements.</p>
<p><code><br />
root@stor01:~# lvcreate -L100G -s -n bkp_rsnapshot /dev/stor01_vg/rsnapshot_lv<br />
  Using default stripesize 64.00 KiB.<br />
  Logical volume "bkp_rsnapshot" created.<br />
root@stor01:~# mount -r /dev/stor01_vg/bkp_rsnapshot /mnt/bkp</p>
<p>root@stor01:~# lvs<br />
  LV             VG        Attr       LSize   Pool Origin       Data%  Meta%  Move Log Cpy%Sync Convert<br />
  bkp_rsnapshot  stor01_vg swi-aos--- 100.00g      rsnapshot_lv 10.74<br />
  rsnapshot_lv   stor01_vg owi-aos---  &lt;1.60t<br />
root@stor01:~# date ; time cp -a /mnt/bkp/ /mnt/dest/BACKUPS/rsnapshot/ ; date<br />
Sun  5 Mar 21:19:43 GMT 2023</p>
<p>real    3142m7.637s<br />
user    20m10.877s<br />
sys     381m17.791s<br />
Wed  8 Mar 01:41:51 GMT 2023<br />
root@stor01:~# umount /mnt/bkp<br />
root@stor01:~# lvremove /dev/stor01_vg/bkp_rsnapshot<br />
Do you really want to remove and DISCARD active logical volume stor01_vg/bkp_rsnapshot? [y/n]: y<br />
  Logical volume "bkp_rsnapshot" successfully removed<br />
root@stor01:~#<br />
</code></p>
<p>The source of an example is always useful, this from the <a href="https://tldp.org/HOWTO/LVM-HOWTO/snapshots_backup.html">LVM HOWTO</a> on <a href="http://tldp.org">The Linux Documentation Project</a> website.</p>
<p>Now that is done, I can be comfortable I have backups (albeit a couple of days old) to get me out of a hole if the disk replacement causes a volume failure.</p>
]]></content:encoded>
			<wfw:commentRss>http://ivan.dreamtime.org/2023/03/09/lvm-backups-and-snapshots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(We)blog starter</title>
		<link>http://ivan.dreamtime.org/2008/10/18/weblog-starter/</link>
		<comments>http://ivan.dreamtime.org/2008/10/18/weblog-starter/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 19:10:01 +0000</pubDate>
		<dc:creator>ivan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ivan.dreamtime.org/?p=5</guid>
		<description><![CDATA[From back when (we)blogs started I had considered writing one. That thought didn&#8217;t last too long when I saw what rubbish most people wrote, and considered what pearls of wisdom I had to offer the Internet community (in short, not much). I consider blogs to be like a diary &#8211; documentation about point-in-time thoughts or [...]]]></description>
			<content:encoded><![CDATA[<p>From back when (we)blogs started I had considered writing one. That thought didn&#8217;t last too long when I saw what rubbish most people wrote, and considered what pearls of wisdom I had to offer the Internet community (in short, not much). I consider blogs to be like a diary &#8211; documentation about point-in-time thoughts or actions rather than being for procedures, reviews, etc.</p>
<p>From time to time I have reconsidered and come away with the same answer as above, even when my brother asked me to set up a <a href="http://mark.dreamtime.org/blog/" title="Mark's blog">blog on his website</a>. I&#8217;ve generally preferred to document stuff on a wiki, as that seems a more logical way to organise and provide my information for people.</p>
<p>Sometimes, however, there have been times when I&#8217;ve considered the best software or hardware to use for something (eg what mobile &#8216;phone to get), or noted down a procedure thinking it was a one-off .. and then, months or more later I&#8217;ve wondered why I made that particular decision.</p>
<p>This is the reason I am starting this blog .. for me as a personal reference. If others gain use from it (aside from abusers) then fine.</p>
<p>Let&#8217;s see where this takes me &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://ivan.dreamtime.org/2008/10/18/weblog-starter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
