<?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>That Chris Brown's Blog</title>
	<atom:link href="http://www.thatchrisbrown.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thatchrisbrown.com</link>
	<description>Another Chris Brown &#38; another blog</description>
	<lastBuildDate>Wed, 03 Feb 2010 18:56:45 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Kernel 2.6.18-164.11.1.el5xen on xen.gz-3.4.1 needs dom0_mem</title>
		<link>http://www.thatchrisbrown.com/2010/kernel-2-6-18-164-11-1-el5xen-on-xen-gz-3-4-1-needs-dom0_mem/</link>
		<comments>http://www.thatchrisbrown.com/2010/kernel-2-6-18-164-11-1-el5xen-on-xen-gz-3-4-1-needs-dom0_mem/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 15:04:55 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[virtualisation]]></category>
		<category><![CDATA[bond]]></category>
		<category><![CDATA[dom0]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://www.thatchrisbrown.com/?p=136</guid>
		<description><![CDATA[
			
				
			
		
<p>My server runs CentOs 5.x, and uses the Gitco repo to provide later versions of Xen.  I&#8217;ve previously sorted out the issues (at least in earlier Xen and CentOS versions) around bridging guest vifs to a bonded interface (I replaced Xen entwork scripts with stock CentOS ones, which needed patching to bring bonds up [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2010%2Fkernel-2-6-18-164-11-1-el5xen-on-xen-gz-3-4-1-needs-dom0_mem%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2010%2Fkernel-2-6-18-164-11-1-el5xen-on-xen-gz-3-4-1-needs-dom0_mem%2F&amp;source=thatchrisbrown&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>My server runs CentOs 5.x, and uses the Gitco repo to provide later versions of Xen.  I&#8217;ve previously sorted out the issues (at least in earlier Xen and CentOS versions) around bridging guest vifs to a bonded interface (I replaced Xen entwork scripts with stock CentOS ones, which needed patching to bring bonds up before bridges).  Everything&#8217;s been fine with one small caveat &#8211; any time yum updates a kernel, before rebooting, I need to go check grub.conf to make sure that it&#8217;s using the xen version from gitco not the one matching the centOS kernel version.</p>
<p>So, with the Xen kernel 3.4.1 from Gitco, I did a yum update which included kernel 2.6.18-164.11.1.el5xen and somehow forgot to check grub.conf before rebooting.  I waited and waited, but got no response from my server.</p>
<p>Luckily, I have a remote console on my physical server, so I was able to investigate.  I found that the dom0 startup was hanging at &#8220;Bringing up interface bond0&#8243;.  I hit the virtual reset button and dropped into the grub menu.  I edited the kernel line to use xen.gz-3.4.1 and thought that would be it.</p>
<p>No, same problem.  Same thing booting kernel 2.6.18-164.10.1.el5xen as well, either on its matching Xen kernel version, or 3.4.1 from Gitco.  However, I could boot dom0 into 2.6.18-164.9.1.el5xen against Xen kernel 3.4.1, albeit with terribly slow network performance and &#8220;<strong>xen_net: Memory squeeze in netback driver</strong>&#8221; logged regularly in /var/log/messages, and network access to my guests was so slow that nearly everything timed out.</p>
<p>A bit of research on Google suggested that adding &#8220;<strong>dom0_mem=<em><something></em></strong>&#8221; to the kernel line in grub.conf might help.</p>
<p>Sure enough, it did &#8211; it cured the &#8220;memory squeeze&#8221; messages, and it&#8217;s let me boot dom0 into kernel 2.6.18-164.11.1.el5xen on top of Xen kernel 3.4.1 as well.</p>
<p>My guess is that kernels after 2.6.18-164.9.1.el5xen have some change that means without a restriction on dom0 memory, something somewhere breaks, and one of the side effects is terribly slow networking, possibly only when bonded?</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.thatchrisbrown.com%2F2010%2Fkernel-2-6-18-164-11-1-el5xen-on-xen-gz-3-4-1-needs-dom0_mem%2F&amp;linkname=Kernel%202.6.18-164.11.1.el5xen%20on%20xen.gz-3.4.1%20needs%20dom0_mem"><img src="http://www.thatchrisbrown.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.thatchrisbrown.com/2010/kernel-2-6-18-164-11-1-el5xen-on-xen-gz-3-4-1-needs-dom0_mem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xen vs KVM &#8211; horses for courses?</title>
		<link>http://www.thatchrisbrown.com/2009/xen-vs-kvm-horses-for-courses/</link>
		<comments>http://www.thatchrisbrown.com/2009/xen-vs-kvm-horses-for-courses/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 12:04:14 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[virtualisation]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://m.thatchrisbrown.com/?p=133</guid>
		<description><![CDATA[
			
				
			
		
<p>As anyone who&#8217;s read any of my previous posts will know, I&#8217;ve been considering Red Hat&#8217;s adoption of KVM over Xen and wondering if a move to KVM is the right thing to do.</p>
<p>I think &#8220;The right thing&#8221; depends a fair bit on where you are, and what your requirements are.  Obvious? Perhaps, but [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fxen-vs-kvm-horses-for-courses%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fxen-vs-kvm-horses-for-courses%2F&amp;source=thatchrisbrown&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>As anyone who&#8217;s read any of my previous posts will know, I&#8217;ve been considering Red Hat&#8217;s adoption of KVM over Xen and wondering if a move to KVM is the right thing to do.</p>
<p>I think &#8220;The right thing&#8221; depends a fair bit on where you are, and what your requirements are.  Obvious? Perhaps, but then sometimes it&#8217;s the obvious things we overlook.</p>
<p>I think there&#8217;s no pressing need to migrate my hosted server.  It works pretty well on Xen and now I&#8217;ve sorted out my mess of repo priorities, and I&#8217;m a bit less cavalier with updates, I don&#8217;t expect it to present me any significant problems.</p>
<p>My home server is a different thing.  It&#8217;s not currently commissioned so there&#8217;s no downtime to worry about, I&#8217;d like to be able to run PVM and HVM Windows and Linux guests, including possibly LinuxMCE one day, and carrying most weight for me at present, it&#8217;s going to also be my network gateway.</p>
<p>Now, purists might not think running VM services on my gateway is a smart idea, and I should put in a separate host for each, but it&#8217;s a model I&#8217;d like to try out as I have some work project ideas that might benefit.</p>
<p>My thinking is that if I&#8217;m doing security policy, NAT, bandwidth shaping and VPN on a machine that also runs guests, KVM might make sense &#8211; doing that work in a Xen dom0 would involve a bit more switching of network data in and out of the Hypervisor and guests. In theory, Linux being the hypervisor should mean it&#8217;s only doing that for network traffic to guests, which will only be anything I can&#8217;t sensibly run in the base Linux OS.</p>
<p>There may be some argument that my hosted server may benefit too, as in a bonded setup, the current state of Xen networking seems to suggest that the dom0 has to do all the work anyway &#8211; I have my dom0 using regular Linux networking (patched to fix an issue bridging a bonded interface) to get my guests on a bridge to a fully bonded interface.</p>
<p>KVM will be an interesting experience to compare with Xen. If the networking is faster, as long as performance of guests is good, it may make sense to choose it ultimately because Red Hat have, and out-of-the-box compatability is no bad thing.</p>
<p>For now, I&#8217;m happy to keep my hosted workhorse on Xen and try the new contender out on a home server first.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fxen-vs-kvm-horses-for-courses%2F&amp;linkname=Xen%20vs%20KVM%20%26%238211%3B%20horses%20for%20courses%3F"><img src="http://www.thatchrisbrown.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.thatchrisbrown.com/2009/xen-vs-kvm-horses-for-courses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updating BIOS on an Intel board without Windows</title>
		<link>http://www.thatchrisbrown.com/2009/updating-bios-on-an-intel-board-without-windows/</link>
		<comments>http://www.thatchrisbrown.com/2009/updating-bios-on-an-intel-board-without-windows/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 19:12:08 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[bios]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[intel]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.thatchrisbrown.com/?p=124</guid>
		<description><![CDATA[I have swapped out a Q8200 processor for a Q8400 processor in my home server, so I can play with KVM.  This means a BIOS update to give me the enable/disable option for Intel Virtualization [sic] Technology.  Now I've updated many a BIOS in my time, so it didn't even occur to me that it might be anything other than trivial.  How wrong I [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fupdating-bios-on-an-intel-board-without-windows%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fupdating-bios-on-an-intel-board-without-windows%2F&amp;source=thatchrisbrown&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I have swapped out a Q8200 processor for a Q8400 processor in my home server, so I can play with <a href="http://www.linux-kvm.org/" target="_blank">KVM</a>.  This means a BIOS update to give me the enable/disable option for Intel Virtualization <em>[sic]</em> Technology.  Now I&#8217;ve updated many a BIOS in my time, so it didn&#8217;t even occur to me that it might be anything other than trivial.</p>
<p>I hopped on Intel&#8217;s site and went to the downloads for the board.  Windows executable, raw BIOS file for a BIOS recovery function my board doesn&#8217;t even have or &#8220;OEM kit&#8221; with the BIOS file and a DOS flash utility.  Here&#8217;s where the fun starts.  The machine doesn&#8217;t have a floppy drive and didn&#8217;t (until today) have a CD/DVD drive either.  I have previously booted this machine from a &#8216;live&#8217; CentOS 5 USB <a href="http://www.thatchrisbrown.com/2009/usb-centos-to-the-rescue/" target="_blank">stick</a>.</p>
<p>So, I installed an IDE CD/DVD writer while I was in the case swapping CPUs.  This shoudl make it really easy, right?  Wrong.</p>
<p>First, I used CD Burner XP and a downloaded FreeDOS image to make a bootable CD with an emulated 2.88MB A: floppy and the flash imaging tool on C:, which would be the CD-ROM.  This didn&#8217;t even boot FreeDOS, it just did nothing.</p>
<p>Next I tried my CentOS USB stick, and hacked the syslinux boot menu to add a new FreeDOS item, using memdisk as kernel and a 1.44MB FreeDOS image as the initrd.  This gave me a working FreeDOS environment with C: on the USB stick.  Great!  So, I added the Intel flash tools and booted it up.  The Intel flash tool loaded, let me pick the BIOS image and then promptly told me the update had failed.  Trying to run the flash utility a second time hung the box.</p>
<p>Back to CD, this time with a CD-RW so I&#8217;m not making coasters.  I used InfraRecorder to make a bootable CD with the FreeDOS image that booted fine fron syslinux.  I added the flash utility and burnt the CD.  This started to boot FreeDOS but then threw an &#8220;Invalid Opcode&#8221; error and hung.</p>
<p>I thought I&#8217;d try a &#8216;real&#8217; MS-DOS 6.22 and found one on  bootdisk.com, which turned out to be a Windows executable that requires a floppy disk.</p>
<p>I found the <a href="http://www.coreboot.org/Flashrom" target="_blank">flashrom</a> project, which looks great, but no record of my board on the site, and this is just flashing a BIOS &#8211; surely it can be done simply?</p>
<p>Well, it can, sort of.  I went back to my trusty USB CentOS and downloaded the FreeDOS diskette image that had worked previously.  I mounted it up on a loopback and removed anything not needed to boot FreeDOS to make space for the Intel utility and BIOS file, which I then copied in.  I unmounted the floppy image, used mkisofs to make a bootable .iso image and used cdrecord to blank my CD-RW and burn the image to it.</p>
<p>Success!  A bootable FreeDOS CD, and a working flash utility!  All it took was buying a CD/DVD drive, having available a USB stick, a CentOS Live CD image, the Fedora Live USB creator, a FreeDOS image, the Intel FLASH files and several hours trying various combinations until one worked.</p>
<p>Intel used to also supply .iso file downloads once upon a time, so you could just download, burn and boot.  What happened to that?</p>
<p>Intel people &#8211; if you&#8217;re going to only provide a &#8216;bare&#8217; DOS flasher and a Windows application, and make life more difficult for non-Windows or DOS users, can I ask that you please, please give a little bit of software engineering time to help the flashrom team get more Intel flash updates supported, to make your boards more attractive to Linux users.  <strong><em>Please?</em></strong></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fupdating-bios-on-an-intel-board-without-windows%2F&amp;linkname=Updating%20BIOS%20on%20an%20Intel%20board%20without%20Windows"><img src="http://www.thatchrisbrown.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.thatchrisbrown.com/2009/updating-bios-on-an-intel-board-without-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>USB CentOS to the rescue!</title>
		<link>http://www.thatchrisbrown.com/2009/usb-centos-to-the-rescue/</link>
		<comments>http://www.thatchrisbrown.com/2009/usb-centos-to-the-rescue/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 22:44:07 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[recovery]]></category>

		<guid isPermaLink="false">http://www.thatchrisbrown.com/?p=115</guid>
		<description><![CDATA[I stupidly broke a host and managed to recover it with CentOS Live CD running from a USB stick, which was refreshingly easy to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fusb-centos-to-the-rescue%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fusb-centos-to-the-rescue%2F&amp;source=thatchrisbrown&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>OK, OK &#8211; I was stupid.</p>
<p>As part of my ongoing move from Xen to KVM for VM hosting, I fireed up a server that had been sitting about too long switched off under the desk, thinkig that it would make an ideal machine to try KVM out on.  A <strong>yum groupremove Virtualization</strong> seemed to produce no issues, so I was looking good to go with a bit fo repo cleanup and then an update before upgrading from CentOS 5.2 to 5.3 with yum.  Then I did something stupid.</p>
<p>I renamed the logical volume that / is mounted from, becuase I thought the name wasn&#8217;t descriptive enough.  Then I rebooted the box.  Oh yes.</p>
<p>Cue a kernel panic when grub couldn&#8217;t find the root partition.  Oh Chris, how SMRT!  The physical box doesn&#8217;t have a CD/DVD drive (it&#8217;s meant to be a headless box) but luckily it does have USB ports, and I had a spare screen and keyboard about, and I happeend to have a 4GB USB thumb drive in my laptop bag.  A quick Google search turned up Pendrivelinux.com and a handy <a href="http://www.pendrivelinux.com/usb-centos-5-live-install-via-windows/" target="_blank">guide</a> to getting CentOS 5 working on USB.  I already had a CentOS 5.2 Live CD image on my hard drive, so a quick upload of the thumb drive contents, a quick download of the <a href="https://fedorahosted.org/liveusb-creator/" target="_blank">Fedora LiveUSB Creator</a> and I was in business!</p>
<p>It was a pretty simple recovery.  I had to unmount and remount the LVs becuase CentOS Live CD mounted them read-only, but that was easy enough &#8211; the device mapper nodes were all there and sensibly named too, so it was pretty intuitive.  The I just had to edit the LV names in /boot/grub/grub.conf, /etc/fstab and /etc/mtab.  For good measure I removed the duplicate entry in /etc/blkid/blkid.tab too.</p>
<p>Reboot, pull out the USB drive at the BIOS screen and a few moment later, there was my host back in the land of the serving. Phew!</p>
<p>A lucky escape this time, but it shows the risk of unintended consequences.  The sooner I get KVM sorted out, and all the real work done in VM guests in LVs, the better, because at least then I&#8217;ll be able to make a snapshot before I try anything like a sysadmin task!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fusb-centos-to-the-rescue%2F&amp;linkname=USB%20CentOS%20to%20the%20rescue%21"><img src="http://www.thatchrisbrown.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.thatchrisbrown.com/2009/usb-centos-to-the-rescue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LVM saves the day, possibly&#8230;</title>
		<link>http://www.thatchrisbrown.com/2009/lvm-saves-the-day-possibly/</link>
		<comments>http://www.thatchrisbrown.com/2009/lvm-saves-the-day-possibly/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 18:53:42 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[virtualisation]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://www.thatchrisbrown.com/?p=112</guid>
		<description><![CDATA[Using LVM for Xen guests virtual disks might have made KVM migration easier than I first [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Flvm-saves-the-day-possibly%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Flvm-saves-the-day-possibly%2F&amp;source=thatchrisbrown&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>OK, so I&#8217;m mulling the move from <a href="http://www.thatchrisbrown.com/2009/in-theory-migrating-from-xen-to-kvm-under-centos-5-3/" target="_blank">Xen to KVM</a>.  This initially looked like I&#8217;d have to make duplicate virtual disks in KVM for my Xen guests, then shut the guests down, block copy content across and patch up MBR and boot my physical box into a stock kernel and hope KVM comes up with the goods.</p>
<p>Well, a little bit of experimentation with a rarely-used VM and I&#8217;ve found much to my joy that because I used LVM logical volumes to create my Xen guests virtual disks, I can use kpartx to add device mapping for them and (when the guest is safely shut down!) mount them up in my dom0 and read/write to them.  Thi sis good news because it means they have a full virtual disk setup, with a /boot partition, a root partition and a swap partition all living in a single logical volume.  This means KVM should pick them straight up and work with them unmodified.</p>
<p>Which hopefully means all I have to do is set a stock kernel to be the boot default in my guests, shut them down, set my dom0 to boot from a stock kernel, load up the KVM kernel module and add some guests from the logical volumes.</p>
<p>If it&#8217;s that easy, I&#8217;ll be a happy person indeed!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Flvm-saves-the-day-possibly%2F&amp;linkname=LVM%20saves%20the%20day%2C%20possibly%26%238230%3B"><img src="http://www.thatchrisbrown.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.thatchrisbrown.com/2009/lvm-saves-the-day-possibly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In theory &#8211; migrating from Xen to KVM under CentOS 5.3</title>
		<link>http://www.thatchrisbrown.com/2009/in-theory-migrating-from-xen-to-kvm-under-centos-5-3/</link>
		<comments>http://www.thatchrisbrown.com/2009/in-theory-migrating-from-xen-to-kvm-under-centos-5-3/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 14:56:59 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[virtualisation]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://www.thatchrisbrown.com/?p=107</guid>
		<description><![CDATA[I'm advance planning my migration of live services from Xen VMs to KVM VMs on the same physical box, with as little downtime as [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fin-theory-migrating-from-xen-to-kvm-under-centos-5-3%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fin-theory-migrating-from-xen-to-kvm-under-centos-5-3%2F&amp;source=thatchrisbrown&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I have a CentOS 5.3 (actually a CentOS 5.2 build upgraded in yum, but that&#8217;s not terribly important) x86_64 machine that is in fact a Xen hypervisor kernel with said CentOS 5.3 running as the dom0 (service VM), and currently four guest VMs also running CentOS 5.2 x86_64, upgraded to CentOS 5.3 with yum.  This was a kind of interesting project in itself, in that I used the Gitco repos in order to get Xen 3.3.1 on the CentOS build, and I had to do some hackery of the Xen and stock CentOS networking scripts to make things work.  The box doesn&#8217;t use Xen network scripts and xenbr0, because they broke pretty badly with bonded dual NICs.  It has a fairly standard Ethernet bond setup going, then a patched RH network script so bridges don&#8217;t init before the bond, a standard Linux bridge br0, which all my Xen vifs attach to, and a virbr0 which doesn&#8217;t have any physical NICs attached, but does have an IP address and dhcpd running against it, so I have a place to quickly fire up new VM guests without having to assign network addresses.</p>
<p>This complexity lead to a few problems, partly during installation, when I ended up temporarily having to go wiht a non-Xen kernel in order to update bits and ipeces and set up repos so I could go back to a Xen kernel, and when yum wanted to update to kernel-xen-2.6.18-128.1.10.el5 and like a trusting fool I let it, and promptly had no running VMs on the next reboot.  Hacking grub back to 2.6.18-128.1.6.el5xen seemed to sort it, and it never got changed from there.</p>
<p>Actually, to tell the trust, I also have another machine built a similar way, <em>sans</em> CentOS 5.3 upgrade.  This one was meant to potentially be a home to a windows machine, or most likely a Linux MCE installation running in  a non-PV guest.  That one didn&#8217;t get installed yet, and has been sitting under my desk for many a month, waiting for cabling.  Oops.</p>
<p>My guest DomUs are living in Xen virtual disks which are inside LVM logical volumes as far as the dom0 is concerned.  If I&#8217;d been smarter, I might have set up three LVs for each domU &#8211; one for /boot, one swap and one for /, so that I cold more easily manage them from not only the guest domU, but also the dom0 if the domU was offline for any reason.</p>
<p>The increased exposure KVM is getting in RHEL 5.4 is making me wonder if all this Xen tinkering is worth it.  My machine only runs Linux guests, and then only really for a bit of process separation security.  Given that the dom0 has to do a bit of service work for guest domUs anyway, and it seems that this involves a bit of context switching overhead, I don&#8217;t see that doing the hypervisor function in the kernel is going to be a problem for me, especially on that currently unused box, which is going to be a home all-in-one media, file/print, NATting, caching and bandwidth arbitrating machine.  As I was going to just accept doing all the networking for that (including the firewall/NAT/bandwidth and some VPN stuff) in the dom0 instead of making the Xen networking even more complicated with dual virtual NICs and a virtual firewall box, I guess just making all that work in plain old Linux and then loading up a kernel module when I want a media centre guest VM (yes, I know I could just be less lazy and make all the bits of Linux MCE work under CentOS natively, but starting a VM and installing an OS-up image for LMCE seems like a good thing) installing makes a bit of sense.</p>
<p>The currently unused machine isn&#8217;t so bad &#8211; as it currently has no VMs and didn&#8217;t get the 5.2/5.3/Gitco hybrid horror treatment, I could just strip Gitco repo, group uninstall Virtualisation (sorry Virtuali<strong>z</strong>ation), and boot it as a regular Linux kernel, do the networkingy bits (and make better use of my rather rubbish 1.5Mb/s of patchy ADSL) and then worry about that media server when the time is right.  The dual-NIC networkign will be far easier &#8211; one outside one inside, attach a separate bridge to each and I could then attach VMs to the &#8220;public&#8221; or &#8220;private&#8221; bridges and the host OS will iptables them like any other hosts.  Great!</p>
<p>It&#8217;s that first server that is going to be &#8216;interesting&#8217;.  Fedora&#8217;s virt-v2v is a ways off yet, so I&#8217;ve got to think of smart ways of moving painlessly from Xen to KVM without losing services for long.  The current outline plan goes something like:</p>
<ol>
<li>Install a plain old Linux kernel into each VM guest</li>
<li>Install a plain old Linux kernel into the current dom0</li>
<li>Make new LVM logical volumes for guest VMs &#8211; <em>possibly three each for /boot, swap and /</em></li>
<li>Modify guest VM grub config to default the plain old Linux kernel</li>
<li>Shutdown guest VMs</li>
<li>Reboot dom0 as a plain old Linux kernel, albeit with KVM support loaded</li>
<li>Make any networking changes required</li>
<li>Create new KVM virtual machine images in the logival volumes</li>
<li>Stop the new KVM guests</li>
<li>Mount guests Xen virtual &#8216;disks&#8217; (actually just some partitions I think, not full bootable disk images) on loopback in the dom0</li>
<li>dd the contents of the Xen partitions into the new LVM logical volumes, overwriting the guest images created at step 7</li>
<li>Start the KVM guests</li>
<li>Panic when it goes wrong (had to be step 13, didn&#8217;t it?)</li>
</ol>
<p>I&#8217;m hoping that the fact I already do the networking outside of Xen, and just use standard Linux bridging on and the libvirt virbr0, will mean a slightly easier migration &#8211; all I have to do is get my instances booting off a standard kernel instead of a Xenified one, and inside a different virtual disk format.</p>
<p>I&#8217;ll still need my standard-breaking networking patch to enable bonds before bridges though.  Hopefully RH fix that one in RHEL 5.4 so CentOS picks it up in the next release.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fin-theory-migrating-from-xen-to-kvm-under-centos-5-3%2F&amp;linkname=In%20theory%20%26%238211%3B%20migrating%20from%20Xen%20to%20KVM%20under%20CentOS%205.3"><img src="http://www.thatchrisbrown.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.thatchrisbrown.com/2009/in-theory-migrating-from-xen-to-kvm-under-centos-5-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress backups with bash scripts</title>
		<link>http://www.thatchrisbrown.com/2009/wordpress-backups-with-bash-scripts/</link>
		<comments>http://www.thatchrisbrown.com/2009/wordpress-backups-with-bash-scripts/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 11:29:10 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.thatchrisbrown.com/?p=93</guid>
		<description><![CDATA[In memory of WordPress Backup Week four years ago, I thought I'd knock up a little script to backup my WordPress database and file content.  It's rough and untidy, but it seems ot [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fwordpress-backups-with-bash-scripts%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fwordpress-backups-with-bash-scripts%2F&amp;source=thatchrisbrown&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In memory of <a href="http://codex.wordpress.org/User:Lorelle/Backup_Week" target="_blank">WordPress Backup Week</a> four years ago, I thought I&#8217;d knock up a little script to backup my WordPress database and file content.</p>
<p>You might be wondering why I&#8217;d want to script it, seeing as there&#8217;s plenty of Wordpress plugins to backup your Wordpress content from the safe confines of WordPress administration. </p>
<p>Well, my thinking was that anything that is activated by a plugin in WordPress is fine if WordPress is working.  If it is completely out-of-action, you&#8217;re going to have to recover your backup from the command line.  I&#8217;m comfortable with the command line and a bit of (low quality) shell scripting, so why not roll my own simple backup that grabs all the file and database content and makes a backup file out of it?  Besides, while the Wordpress Mobile Pack gives you the administration essentials, it&#8217;s not great at handling plugins, and I quite like the idea of being able to perform an emergency restore with nothing but a Smartphone or PDA with a copy of <a href="http://www.pocketputty.net/" target="_blank">Pocket PuTTY</a> installed on it.</p>
<p>There&#8217;s advice on WordPress backups on the <a href="http://codex.wordpress.org/WordPress_Backups" target="_blank">Codex</a>, which makes a good starting point.  I also found some old script examples <a href="http://ocaoimh.ie/simple-mysql-backup/" target="_blank">here</a>.  Time to do a bit of modifying!  I liked the original idea of having a 7-day rolling backup set to prevent disk space being overrun, but I also liked the idea of backups stamped with the date they were taken, to ease any restore.  So, I decided that it would be simple to adjust the script to still create 7 day-of-week folders and just store the backed-up content in a compressed tar archive using the date taken as the filename.</p>
<p>There were a few more changes I made to the code.  While I appreciate the &#8216;clean&#8217; approach of putting usernames and passwords in a separate file, anyone finding the script would soon see where to look to find those details, so it&#8217;s not adding much in the way of security.  I also made a few tweaks to the MySQL commands used to get the table listing.</p>
<p>Here&#8217;s the code I got to:</p>
<pre class="brush:bash">#!/bin/bash # MYSQL Backup Script
# Contains portions of code and ideas from http://blogs.linux.ie/xeer/2005/06/28/simple-mysql-backup/
# and http://ocaoimh.ie/simple-mysql-backup/
# Get day of week to keep 7 rolling backups sequence, and date to name tgz files for ease of identification export d=$(date +%Y-%m-%d) export s=$(date +%u)
# Set up the paths that we're going to use for source and backup
export wppath=/var/www/html
export savepath=/var/www/backup
export tmppath=/tmp/wpback-$s-$d
# The wp database to backup
export db=wp_myblog
# Username and password for the wp database - SUGGEST A READ-ONLY USER IS USED!
export wpuser=wp_backupuser
export wppass=MyP4sswordG0esH3re
# Tell syslog and any interative user that we're running
logger "Wordpress backup script backing up $wppath to $savepath/$s/$d.tgz"
echo "Wordpress backup script backing up $wppath to $savepath/$s/$d.tgz"
# Make the temporary backup path
mkdir -p $tmppath
echo "Dumping database: $db..."
for tab in `mysql --user=$wpuser --password=$wppass -s -e "show tables;" $db`;
do
echo "Dumping table: $tab"        
mysqldump --user=$wpuser --password=$wppass --add-drop-table --allow-keywords -q -a -c $db $tab &gt; $tmppath/$tab.sql
done
echo "Archiving Wordpress file content..."
tar -cpf $tmppath/wp-files.tar $wppath/
# Clear and remake the backup path
rm -rf $savepath/$s
mkdir -p $savepath/$s
echo "Compressing database and files into $savepath/$s/$d.tgz"
tar -czf $savepath/$s/$d.tgz $tmppath/*
echo "Deleting temporary files"
rm -rf $tmppath
echo "Wordpress backup complete"</pre>
<p> So, what does the code do?  Well, first the date tool is used to obtain the day of week and date string, then a few user-modifiable strings define where to back up Wordpress content from, where to make temporary files and where to save the backup archive.  The script quickly informs any interative user, and the system log, that it is running then we get to the important bit.</p>
<p>The MySQL command-line client is called, specifying the username and password, using the -s parameter to tell the client to output a simple listing with one result per line, and the -e parameter with the command to execute, in this case &#8220;show tables&#8221; and finally the database to execute the command against.  This fills the tab script variable with a list of tables to back up.</p>
<p>A temporary location is created to store the database tables and files until the final backup file is created.</p>
<p>Next, the MySQL dump client is called once for each table, again supplying username and password, and with parameters indicating that the dump should create a file that deletes any existing table before inserting data, and ignores any reserved words it sees, and stores the results for each table in a text file in the temporary location.</p>
<p>Then, the Wordpress content directory is archived using the tar utility, specifying to preserve premissions attributes.  This backup is not compressed, as the script then goes on to clear any existing day-of-week directory, and creates the final backup archive in there as a compressed tar archive containing all the SQL table dumps and the single WordPress file archive just created.</p>
<p>Finally, the script clears out the temporary location it created.</p>
<p>To use the script, it needs to be downloaded to a place outside of your WordPress content area (so it can&#8217;t be viewed by visitors to your web site), and given suitable permissions to run, with a command such as such as &#8220;chmod 744 wp_backup.sh&#8221;.</p>
<p>The lines at the top of the script that define wppath (WordPress files location), savepath (place to put the day-of-week directories), tmppath (place to put temporary files), db (MySQL database to backup), wpuser (MySQL user account for backing up) and finally wppass (MySQL user password) will need to be edited to suit the local WordPress and MySQL installations.</p>
<p>Next the MySQL user account needs to be created.  For a little bit of extra security, I recommend using a dedicated user account with read-only access to the database.  This is easy to create.  Simply start the MySQL client with the -p parameter (type <strong>mysql -p</strong> from a shell prompt) and enter you MySQL root password when prompted.  Next create a user account and grant read rights with the command <strong>GRANT SELECT, LOCK TABLES on wp_myblog.* TO </strong><a href="mailto:'wp_backupuser'@'localhost'"><strong>&#8216;wp_backupuser&#8217;@'localhost&#8217;</strong></a><strong> IDENTIFIED BY &#8221;MyP4sswordG0esH3re&#8221;;</strong></p>
<p>The script will execute from the shell, and will display some progress as it goes.</p>
<p>To automate the process with cron, simply type crontab -e to edit the cron table, and add a line like this:</p>
<pre>1 0 * * * /var/www/domains/thatchrisbrown.com/www/backup/wp_backup.sh</pre>
<p>This tells cron to call the script at one minute past midnight every day.  You can verify the script has run my looking in the /var/log/messages file for the script announcing itself when run.</p>
<p><em>Disclaimer: This was written on a CentOS 5.3 box using fairly standard installs of Apache, PHP, MySQL and Wordpress.  Your environment may vary, so some elements may need adjusting to suit.  This script and its author makes no claims to fitness, usability, suitability for any specific purpose, safety or neatness, ingenuity, tidiness or prettiness of code.  You use it at your own risk.</em></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fwordpress-backups-with-bash-scripts%2F&amp;linkname=WordPress%20backups%20with%20bash%20scripts"><img src="http://www.thatchrisbrown.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.thatchrisbrown.com/2009/wordpress-backups-with-bash-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>And I thought Microsoft Word could be frustrating!</title>
		<link>http://www.thatchrisbrown.com/2009/and-i-thought-microsoft-word-could-be-frustrating/</link>
		<comments>http://www.thatchrisbrown.com/2009/and-i-thought-microsoft-word-could-be-frustrating/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 14:50:50 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.thatchrisbrown.com/?p=81</guid>
		<description><![CDATA[
			
				
			
		
<p>You know when Word does stupid things, like changing the formatting of a whole paragraph when you simply edit a tiny piece of content, like a single word or sentence?  Well, it seems the Wordpress editor is just as bad.  I&#8217;ve just had to flip dozens of revisions and manually edit the HTML content to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fand-i-thought-microsoft-word-could-be-frustrating%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fand-i-thought-microsoft-word-could-be-frustrating%2F&amp;source=thatchrisbrown&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>You know when Word does stupid things, like changing the formatting of a whole paragraph when you simply edit a tiny piece of content, like a single word or sentence?  Well, it seems the Wordpress editor is just as bad.  I&#8217;ve just had to flip dozens of revisions and manually edit the HTML content to fix an issue that started when embedding an image, then editing its properties afterwards.  Wordpress started sticking post body text into the picture caption, almost randomly.</p>
<p>I <em>think</em> I&#8217;ve got it right now.  If the previous post looks odd (missing pictures, blocks of text in captions etc), do let me know and I&#8217;ll try to sort it out.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fand-i-thought-microsoft-word-could-be-frustrating%2F&amp;linkname=And%20I%20thought%20Microsoft%20Word%20could%20be%20frustrating%21"><img src="http://www.thatchrisbrown.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.thatchrisbrown.com/2009/and-i-thought-microsoft-word-could-be-frustrating/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Missed photos: When opportunity knocks and you&#8217;re not home</title>
		<link>http://www.thatchrisbrown.com/2009/missed-photos-when-opportunity-knocks-and-youre-not-home/</link>
		<comments>http://www.thatchrisbrown.com/2009/missed-photos-when-opportunity-knocks-and-youre-not-home/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 20:37:15 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://m.thatchrisbrown.com/2009/missed-photos-when-opportunity-knocks-and-youre-not-home/</guid>
		<description><![CDATA[Sometimes you just can't capitalise on an opportunity.  I was working in the garden and spotted a potential opportunity that I now regret not [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fmissed-photos-when-opportunity-knocks-and-youre-not-home%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fmissed-photos-when-opportunity-knocks-and-youre-not-home%2F&amp;source=thatchrisbrown&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Sometimes you just can&#8217;t capitalise on an opportunity.</p>
<p>I&#8217;ve been working in the garden, and had a skip outside the front of the house, which had dug up turf thrown in it. I was going to photograph it under the caption &#8220;I don&#8217;t like football&#8221;.</p>
<p>However, I was muddy, sweaty and had dirty great boots on &#8211; not suitable for nipping in and fetching the camera! Besides, my digging assistants might have thrown me in the skip if I&#8217;d stopped to &#8220;<em>Prat about with cameras</em>&#8221; while they were working.</p>
<p>By the time we&#8217;d finished for the day, the turf was buried and the shot was lost.</p>
<p>The moral of the story? I&#8217;m not entirely sure &#8211; perhaps it is that you should choose helpers that understand the sudden urge to stop everything and pick up a camera!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fmissed-photos-when-opportunity-knocks-and-youre-not-home%2F&amp;linkname=Missed%20photos%3A%20When%20opportunity%20knocks%20and%20you%26%238217%3Bre%20not%20home"><img src="http://www.thatchrisbrown.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.thatchrisbrown.com/2009/missed-photos-when-opportunity-knocks-and-youre-not-home/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protecting photography displayed online through branding</title>
		<link>http://www.thatchrisbrown.com/2009/protecting-photography-displayed-online-through-branding/</link>
		<comments>http://www.thatchrisbrown.com/2009/protecting-photography-displayed-online-through-branding/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 21:53:58 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[branding]]></category>
		<category><![CDATA[copyright]]></category>

		<guid isPermaLink="false">http://www.thatchrisbrown.com/?p=25</guid>
		<description><![CDATA[Some thoughts prompted by an article in Layers Magazine, on preventing copyright theft of images displayed [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fprotecting-photography-displayed-online-through-branding%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fprotecting-photography-displayed-online-through-branding%2F&amp;source=thatchrisbrown&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>A quick post prompted by an article in Layers magazine <a title="Protecting What’s Yours" href="http://www.layersmagazine.com/protecting-whats-yours.html" target="_blank">online</a>.  While I agree with the spirit of the article, and applaud the use of a high-profile site to remind artists and photographers to take steps to protect their work from copyright theft, I think some of the suggested protections are counterproductive, as even the article sort of admits in places.</p>
<p>Take  image sizes displayed online as an example.  Average screen sizes and display resolutions are getting bigger, and an 800 x 600 picture is no longer going to fill many viewer&#8217;s displays.  While sites like <a title="Flickr" href="http://www.flickr.com/" target="_blank">Flickr</a> will upscale a small image in the slideshow function, that upsizing is going to introduce some loss of quality.  Do you want to show your work off in a way that will likely decrease the perceived quality?</p>
<p>Speaking of which, over-compressing the JPEG file as an anti-theft mesaure?  Call me an old cynic if you like, but have you been to retailers like Next in the UK and had a close look at the images they sell ready-framed up as ready-to-hang artwork?  OK, they may only be £30 or so, but all the same, there&#8217;s some pretty nasty JPEG and/or upscaling artifacting going on in all of the ones I&#8217;ve seen.</p>
<p>So, keeping a small image size and adding JPEG compression artifacts isn&#8217;t going to put people off, not if they&#8217;ye already paying £30 for a badly-printed, poor-quality image in a wooden frame made in some cheap third-world factory.  Sad though it is, is you want some protection from abuse of your images that you put online, I think branding is the only way to add a modicum of security.</p>
<p>Years ago, I started branding with a small, discreet footer added to my pictures.  This started off as plain white text, in a rather nasty font, and later got slightly neater with a sans-serif font in white on a trasparent black bar, so it blended in the bottom of the image slightly more.  However, seeing examples where footers had just been cropped out by the abusers, I decided it was time to do something more difficult to erase.</p>
<p>I now have a Photoshop action that adds a white text footer on a 50% opaque black bar, and another that adds large 10% opaque white text right across the middle of an image.  It&#8217;s not often that an image is useful without the middle, so it&#8217;s pretty crop-proof.  This lets me still save at up to 1024 pixels, and fairly good quality levels; I tend to use Photoshop quality level 10 or the Lightroom equivalent for the web.  I&#8217;ve automated these using a droplet so I can invoke as a post-export action from Lightroom, which hopefully I&#8217;ll expand on a bit a future post. Ideally I&#8217;d like to set it up using ActionScript, so it can look at the metadata and stamp the right year on the file itself, and accomodate wildly differing image sizes automatically; another future post topic, should I ever get that working!</p>
<p>See some examples of this branding approach on my Flickr <a title="My Flickr photostream" href="http://www.flickr.com/photos/seebrown99/" target="_blank">Photostream</a>.  I don&#8217;t think it&#8217;s terribly intrusive, nor do I think it spoils the picture too badly.  I&#8217;d be interested to see any comments from other photographers and digital artists.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fprotecting-photography-displayed-online-through-branding%2F&amp;linkname=Protecting%20photography%20displayed%20online%20through%20branding"><img src="http://www.thatchrisbrown.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.thatchrisbrown.com/2009/protecting-photography-displayed-online-through-branding/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
