<?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/"
	>

<channel>
	<title>linux instead</title>
	<atom:link href="http://www.linuxinstead.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.linuxinstead.com/blog</link>
	<description>Kevs IT related ramblings</description>
	<pubDate>Sat, 12 Jun 2010 12:04:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Convert video files to DVD format using mencoder</title>
		<link>http://www.linuxinstead.com/blog/?p=245</link>
		<comments>http://www.linuxinstead.com/blog/?p=245#comments</comments>
		<pubDate>Sat, 27 Feb 2010 20:12:34 +0000</pubDate>
		<dc:creator>Kev</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.linuxinstead.com/blog/?p=245</guid>
		<description><![CDATA[To convert most video files into DVD compatible mpg files, mencoder is a good option.
The following will convert to PAL widescreen format.
mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=16/9:acodec=ac3:abitrate=192 -ofps 25 -o "OUTPUT.mpg" "INPUT.avi"
]]></description>
			<content:encoded><![CDATA[<p>To convert most video files into DVD compatible mpg files, mencoder is a good option.</p>
<p>The following will convert to PAL widescreen format.</p>
<p><code>mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=16/9:acodec=ac3:abitrate=192 -ofps 25 -o "OUTPUT.mpg" "INPUT.avi"</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxinstead.com/blog/?feed=rss2&amp;p=245</wfw:commentRss>
		</item>
		<item>
		<title>Rooting the T Mobile Pulse phone</title>
		<link>http://www.linuxinstead.com/blog/?p=219</link>
		<comments>http://www.linuxinstead.com/blog/?p=219#comments</comments>
		<pubDate>Sun, 13 Dec 2009 19:00:06 +0000</pubDate>
		<dc:creator>Kev</dc:creator>
		
		<category><![CDATA[Android]]></category>

		<category><![CDATA[phone]]></category>

		<category><![CDATA[rooting]]></category>

		<category><![CDATA[t mobile]]></category>

		<guid isPermaLink="false">http://www.linuxinstead.com/blog/?p=219</guid>
		<description><![CDATA[I decided it was time to change my mobile phone. Being a Linux nerd I decided to opt for an Android based phone.
There are quite a number to choose from. The HTC Hero being the most popular, but at the time this would have cost me £360 of my hard earned cash.
T-Mobile have released an [...]]]></description>
			<content:encoded><![CDATA[<p>I decided it was time to change my mobile phone. Being a Linux nerd I decided to opt for an Android based phone.<br />
There are quite a number to choose from. The HTC Hero being the most popular, but at the time this would have cost me £360 of my hard earned cash.<br />
T-Mobile have released an &#8216;own brand&#8217; phone, the pulse, manufactured by Huawei. At the time of writing you can get one for under £150.</p>
<p>The pulses spec is very similar to that of the hero, but with slightly less memory, leaving just 60mb left to install new apps into. For reasons best known to google, android apps cannot be installed onto the SD card which is a real shame not least for the apps market in general.<span id="more-219"></span></p>
<p>Please note that rooting a phone will not, by itself, allow you to install apps onto the SD card. For that you also need to modify the ROM, or replace it with a custom ROM.</p>
<p><span style="color: #ff0000;"><strong>BIG FAT WARNING<br />
Rooting your phone will almost certainly invalidate your warranty.</strong><strong><br />
It is also possible that you could brick your phone.<br />
The instructions below are simply a blog of what I did to <em>my</em> phone. There are no guarantees that they will work on <em>your</em> phone. So if you follow these instructions and bad things happen to your phone, don&#8217;t blame me!<br />
Remember, the risk of making your phone completely useless is <em>yours</em> not mine.<br />
END OF BIG FAT WARNING</strong></span></p>
<p>Getting root access on the phone is fairly simple.</p>
<p>First download <a href="http://android.modaco.com/content/t-mobile-pulse-pulse-modaco-com/294178/11-12-1-4-rooting-the-pulse-introducing-superboot/" target="_blank">superboot</a> and <a href="http://android.modaco.com/content/t-mobile-pulse-pulse-modaco-com/294290/14-12-1-5-2-installing-the-patched-recovery-image-on-your-device/" target="_blank">Amon RA</a> from the <a href="http://android.modaco.com/">modaco website</a>.</p>
<p>Unzip the two files into separate folders and chmod the files install-superboot-linux.sh and install-recovery-linux.sh to make them executable (e.g. chmod u+x filename).</p>
<p>Switch the phone off (&#8221;power off&#8221;)</p>
<p>Hold Volume Down and the red button and switch the phone on.</p>
<p>This should bring you to the USB FastBoot screen. Now attach the USB cable to the phone and PC.</p>
<p>As root run install-superboot-linux.sh (e.g. in ubuntu cd to the folder containing the superboot files and type sudo ./install-superboot-linux.sh)</p>
<p>This is enough to give you root access. However, if you also want the ability to make backups of your phone and/or install custom roms then you can also install the recovery image:</p>
<p>As root run install-recovery-linux.sh (e.g. in ubuntu cd to the folder containing the superboot files and type sudo ./install-recovery-linux.sh)</p>
<p>Once you get the successful message you can restart the phone. I waited a couple of mins, &#8220;just in case&#8221;. The only way I could find to get out of the fastboot screen was to remove the battery.</p>
<p>And that&#8217;s about it.</p>
<p>To test that you have root access you need to install a ssh client, such as ConnectBot and shell onto localhost. When you do an su to gain root access, a pop-up window should ask you if you want to allow root access or not.</p>
<p>If you&#8217;ve also installed the recover image then you use the quickboot icon that should now be in your apps list. This will re-boot your phone into the recovery menu where you can backup and restore images as well as a few other options.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxinstead.com/blog/?feed=rss2&amp;p=219</wfw:commentRss>
		</item>
		<item>
		<title>HP Deskjet F2180 stops after printing half of a page</title>
		<link>http://www.linuxinstead.com/blog/?p=212</link>
		<comments>http://www.linuxinstead.com/blog/?p=212#comments</comments>
		<pubDate>Sun, 30 Aug 2009 16:30:59 +0000</pubDate>
		<dc:creator>Kev</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.linuxinstead.com/blog/?p=212</guid>
		<description><![CDATA[I&#8217;ve just installed the 64bit version of Ubuntu 9.04 onto my main desktop PC. Everything was going well until I wanted to print a document.
No, my printer was correctly detected and when I clicked &#8216;print&#8217; the printer burst into life as expected. But after printing about half of the first page the printer just stopped. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just installed the 64bit version of Ubuntu 9.04 onto my main desktop PC. Everything was going well until I wanted to print a document.<br />
No, my printer was correctly detected and when I clicked &#8216;print&#8217; the printer burst into life as expected. But after printing about half of the first page the printer just stopped. My printer is a HP Deskjet F2100 series (F2180 to be precise).</p>
<p>I tried everything, google didn&#8217;t throw up anything useful, I installed later HP drivers but noting fixed it.</p>
<p>After a lot of head scratching ad experimenting I did notice something odd. The USB device as owned by a user I did not have permissions for. I wasn&#8217;t expecting this to be the cause of the problem because if it was due to permissions then surely the printer would not print at all?!? </p>
<p>I was wrong, and adding myself to the group that owned the USB device has fixed it. As this seemed quite off the wall I thought I&#8217;d share&#8230;<br />
<span id="more-212"></span><br />
So, first, see where the printer is connected:</p>
<pre class="brush: bash;">lsusb
Bus 001 Device 003: ID 0dda:2027 Integrated Circuit Solution, Inc. USB 2.0 Card Reader
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 03f0:7d04 Hewlett-Packard Deskjet F2100 Printer series
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</pre>
<p>So its bus 002, device 003.</p>
<p>Next lets have a look at that device:</p>
<pre class="brush: bash;">ls -l /dev/bus/usb/002/003
crw-rw----+ 1 lp lp 189, 130 2009-08-30 17:25 /dev/bus/usb/002/003</pre>
<p>So the group is lp<br />
Next add the group lp to any users that need access to the printer. Remember to user the -a switch to append to the existing group list.</p>
<pre class="brush: bash;">usermod -aG lp userid</pre>
<p>You&#8217;ll then need to log off and back on for the permissions to take effect.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxinstead.com/blog/?feed=rss2&amp;p=212</wfw:commentRss>
		</item>
		<item>
		<title>Converting a XEN DOMU from HVM to PV</title>
		<link>http://www.linuxinstead.com/blog/?p=170</link>
		<comments>http://www.linuxinstead.com/blog/?p=170#comments</comments>
		<pubDate>Sat, 27 Jun 2009 17:11:25 +0000</pubDate>
		<dc:creator>Kev</dc:creator>
		
		<category><![CDATA[Xen virtualisation]]></category>

		<category><![CDATA[hvm]]></category>

		<category><![CDATA[paravirtual]]></category>

		<category><![CDATA[pv]]></category>

		<guid isPermaLink="false">http://www.linuxinstead.com/blog/?p=170</guid>
		<description><![CDATA[For distros that don&#8217;t support XEN compatible installers the easiest way to create a PV (ParaVirtual) DOMU is to install as a HVM (see my other article entry for this) ad then once installed, convert it to a PV DOMU.
There are several reasons why you might want to go with PV instead of HVM. The [...]]]></description>
			<content:encoded><![CDATA[<p>For distros that don&#8217;t support XEN compatible installers the easiest way to create a PV (ParaVirtual) DOMU is to install as a HVM (see my other article entry for this) ad then once installed, convert it to a PV DOMU.</p>
<p>There are several reasons why you might want to go with PV instead of HVM. The main two that spring to mind are PV&#8217;s offer better performance/lower overhead and PV DOMU&#8217;s allow PCI passthrough. Although apparently XEN 3.4 can now do PCI passthrough with HVM, as long as you have an Intel chip with vt-d.</p>
<p>This article will start off where my previous &#8220;Installing a XEN hvm DOMU&#8221; left off&#8230;<br />
<span id="more-170"></span><br />
The description below uses Ubuntu 9.04. If your using a different distro your mileage may vary.</p>
<p>Most modern kernels will already support XEN PV, but without PCI passthrough. If you don&#8217;t need to pass any PCI devices directly to the DOMU then you can skip this next bit&#8230;</p>
<p>To install a full xen compatible kernel, taken from Debian:<br />
With the DOMU booted as a HVM, add the following lines to the end of <code>/etc/apt/sources.list</code></p>
<pre><code># Added for Debian xen kernel
deb http://ftp.debian.org/debian/ lenny main
deb-src http://ftp.debian.org/debian/ lenny main
deb http://ftp.debian.org/debian/ lenny-proposed-updates main</code></pre>
<p>Now start synaptic from the system/administration menu, and click on the <strong>reload</strong> button to refresh the package lists. Ignore the warning about the new Debian repositories not being verified.<br />
Now hit search and enter <code>linux-image-2.6.26-2-xen</code> and click to install it (it will also install the modules automatically).</p>
<p>Now we need to edit the boot menu, to add a disk option so that pvgrub can find the disk. If you&#8217;ve installed the XEN specific kernel as above then we&#8217;ll also add an entry for that too.<br />
Edit <code>/boot/grub/menu.lst</code><br />
To convert the standard kernel copy the code block for the first boot option and then add the root (hd0,0) line (dont just copy the whole lot below, as your uuids will differ)</p>
<pre><code>title           Ubuntu 9.04, kernel 2.6.28-11-generic<strong>-PV</strong>
uuid            265b80ca-0896-48a7-913a-6f5df64776bc
<strong>root (hd0,0)</strong>
kernel          /boot/vmlinuz-2.6.28-11-generic root=UUID=265b80ca-0896-48a7-913a-6f5df64776bc ro quiet splash
initrd          /boot/initrd.img-2.6.28-11-generic
quiet</code></pre>
<p>And for the Debian XEN kernel:</p>
<pre><code>title           Ubuntu 9.04, kernel 2.6.26-2<strong>-xen</strong>
uuid            265b80ca-0896-48a7-913a-6f5df64776bc
<strong>root (hd0,0)</strong>
kernel          /boot/<strong>vmlinuz-2.6.26-2-xen-amd64</strong> root=UUID=265b80ca-0896-48a7-913a-6f5df64776bc ro quiet splash
initrd          /boot/<strong>initrd.img-2.6.26-2-xen-amd64</strong>
quiet</code></pre>
<p>Note that the above xen kernel and initrd are for the 64bit version, use 2.6.26-2-686 for 32bit.</p>
<p>While you at it you might want to install <code>openssh-server</code> so that you can shell onto the DOMU later.<br />
You may also consider going with a fixed IP address so that you can find your DOMU when you want to shell onto it!<br />
edit <code>/etc/network/interfaces</code></p>
<pre><code># The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.xxx
netmask 255.255.255.0
gateway 192.168.1.1</code></pre>
<p>Now we&#8217;re ready to change the config file on the DOM0, so shut down the DOMU.</p>
<p>Edit you XEN DOMU config file and replace:</p>
<pre><code>kernel = "/usr/lib/xen/boot/hvmloader"
builder='hvm' </code></pre>
<p>with:</p>
<pre><code>kernel = "/usr/lib/xen/boot/pv-grub-x86_64.gz"
extra = "(hd0,0)/boot/grub/menu.lst"</code></pre>
<p>Restart your DOMU and it should boot into a PV kernel. Now you can do neat things like PCI passthrough! (I&#8217;ll knock up another blog for that&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxinstead.com/blog/?feed=rss2&amp;p=170</wfw:commentRss>
		</item>
		<item>
		<title>Installing a XEN hvm DOMU</title>
		<link>http://www.linuxinstead.com/blog/?p=149</link>
		<comments>http://www.linuxinstead.com/blog/?p=149#comments</comments>
		<pubDate>Sun, 14 Jun 2009 19:22:44 +0000</pubDate>
		<dc:creator>Kev</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Xen virtualisation]]></category>

		<category><![CDATA[domu]]></category>

		<category><![CDATA[hvm]]></category>

		<guid isPermaLink="false">http://www.linuxinstead.com/blog/?p=149</guid>
		<description><![CDATA[For this to work your CPU and motherboard needs to support vt (intel) or amd-v. You can check this by looking at the flags in /proc/cpuinfo. Your looking for either vmx or svm on the flags line.
If you&#8217;re doing this from your DOM0 then these flags may not actually show up. Instead type xm info [...]]]></description>
			<content:encoded><![CDATA[<p>For this to work your CPU and motherboard needs to support vt (intel) or amd-v. You can check this by looking at the flags in /proc/cpuinfo. Your looking for either vmx or svm on the flags line.</p>
<p>If you&#8217;re doing this from your DOM0 then these flags may not actually show up. Instead type <code>xm info</code> and look for &#8216;hvm&#8217; on the virt_caps line.</p>
<p>For my hvm install, i&#8217;ll be installing Ubuntu 9.04 Desktop Linux.<br />
I have copied the live CD ISO onto my XEN DOM0 and will be installing directly from the iso rather than burning the CD. I have also created a 10GB LVM logical volume to act as the disk for my new DOMU.<br />
<span id="more-149"></span><br />
The following config file is used to boot the live cd (iso image). It lives in /etc/xen and as this is to become a myth frontend i&#8217;ve rather imaginatively called it mythfronted!<br />
/etc/xen/mythfrontend:</p>
<pre><code>kernel = "/usr/lib/xen/boot/hvmloader"
builder='hvm'
memory = 512
name = "mythfrontend"
vif = [ 'type=ioemu, bridge=eth0' ]
disk = ['file:/xenimages/ISO/ubuntu-9.04-desktop-i386.iso,hda:cdrom,r', 'phy:/dev/mapper/datavg-mythfrontendlv,sda,w', ]
boot="d"

sdl=0
vnc=1
vnclisten="0.0.0.0"
vncpasswd='password'
stdvga=0
serial='pty'
usbdevice='tablet'</code></pre>
<p>I find that setting usbdevice to tablet rather than mouse gives better results with a mouse than setting it to mouse.</p>
<p>Once you have your config file created and matching your system (i.e. pointing to the cd or iso, and file of lvm for hard disk) then we&#8217;re good to boot it:<br />
<code>xm create mythfrontend</code></p>
<p>If all went well then we should see it running in <code>xm list</code></p>
<p>Now we need to connect to it&#8217;s display with vnc.<br />
If this is the first DOMU to use vmc as a framebuffer then you should be able to run <code>vnc </code> to get access to the display. In the config above I have defined a password to be entered.</p>
<p>If you need to specify the port, then typing <code>netstat -tap</code> should let you see which port (probably 5900 ish).</p>
<p>Once you have connected to via VNC you will then be able to run the installer as usual. This should work for installing Windows as well as Linux.</p>
<p><img src="http://www.linuxinstead.com/blog/wp-content/images/ubuntu_installing.png" alt="Screenshot of vnc window" /></p>
<p>After the install has completed, shutdown the new DOMU, because we need to edit the config file to remove the cd iso image and allow it to boot from it&#8217;s hard disk.</p>
<p>This basically means removing the cd-rom/iso section in the disk= parameter, change the device name for the hard disk from sda to xvda and removing boot=&#8221;d&#8221; completely. This should leave our config looking something like this:</p>
<pre><code>kernel = "/usr/lib/xen/boot/hvmloader"
builder='hvm'
memory = 512
name = "mythfrontend"
vif = [ 'type=ioemu, bridge=eth0' ]
disk = [ 'phy:/dev/mapper/datavg-mythfrontendlv,xvda,w', ]

sdl=0
vnc=1
vnclisten="0.0.0.0"
vncpasswd='password'
stdvga=0
serial='pty'
usbdevice='tablet'</code></pre>
<p>Now just start the DOMU with <code>xm create mythfrontend</code><br />
And that&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxinstead.com/blog/?feed=rss2&amp;p=149</wfw:commentRss>
		</item>
		<item>
		<title>How to set up a Linux RAID mirror</title>
		<link>http://www.linuxinstead.com/blog/?p=129</link>
		<comments>http://www.linuxinstead.com/blog/?p=129#comments</comments>
		<pubDate>Tue, 28 Apr 2009 19:47:07 +0000</pubDate>
		<dc:creator>Kev</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[raid]]></category>

		<category><![CDATA[raid 1]]></category>

		<category><![CDATA[software raid]]></category>

		<guid isPermaLink="false">http://www.linuxinstead.com/blog/?p=129</guid>
		<description><![CDATA[This is a quick guide to setting up a Linux software RAID mirror (aka RAID 1).
There are a couple of toolsets for managing raid on Linux, raidtools and mdadm. This guide will use mdadm because imho it has better commands and features for monitoring.
Right, first you&#8217;ll need a couple of disk partitions of about the [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quick guide to setting up a Linux software RAID mirror (aka RAID 1).</p>
<p>There are a couple of toolsets for managing raid on Linux, raidtools and mdadm. This guide will use mdadm because imho it has better commands and features for monitoring.</p>
<p>Right, first you&#8217;ll need a couple of disk partitions of about the same size. These should be on separate disks or you&#8217;ll be defeating the point of raid mirroring <img src='http://www.linuxinstead.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br />
<span id="more-129"></span><br />
Raid disks appear under /dev as md0, md1 etc.<br />
A quick way to check the status of your raid devices is to type <code>cat /proc/mdstat</code></p>
<p>On my system this shows:<br />
md1 : active raid1 sda2[0] sdb2[1]<br />
96320 blocks [2/2] [UU]</p>
<p>md0 : active raid1 sda1[0] sdb1[1]<br />
29294400 blocks [2/2] [UU]</p>
<p>Because on my system md0 and md1 are already in use, I will create this new raid as md2.</p>
<p>So lets assume that you have 2 partitions; /dev/sda3 and /dev/sdb3. The following command will create a raid device as /dev/md2.<br />
<code>mdadm --create --verbose /dev/md2 --level=mirror --raid-devices=2 /dev/sda3 /dev/sdb3</code></p>
<p>If all went well you can confirm the size/details of your new raid device:<br />
<code>mdadm --detail /dev/md2</code><br />
/dev/md2:<br />
        Version : 00.90<br />
  Creation Time : Wed Apr 22 21:34:44 2009<br />
     Raid Level : raid1<br />
     Array Size : 458993024 (437.73 GiB 470.01 GB)<br />
  Used Dev Size : 458993024 (437.73 GiB 470.01 GB)<br />
   Raid Devices : 2<br />
  Total Devices : 2<br />
Preferred Minor : 2<br />
    Persistence : Superblock is persistent</p>
<p>    Update Time : Wed Apr 22 21:34:44 2009<br />
          State : clean<br />
 Active Devices : 2<br />
Working Devices : 2<br />
 Failed Devices : 0<br />
  Spare Devices : 0</p>
<p>           UUID : e893056a:5de3d066:4bca1532:59cc93a2 (local to host xenmaster)<br />
         Events : 0.1</p>
<p>    Number   Major   Minor   RaidDevice State<br />
       0       8        3        0      active sync   /dev/sda3<br />
       1       8       19        1      active sync   /dev/sdb3</p>
<p>And you cat check that it is running:<br />
<code>cat /proc/mdstat</code><br />
md2 : active (auto-read-only) raid1 sdb3[1] sda3[0]<br />
      458993024 blocks [2/2] [UU]<br />
        resync=PENDING</p>
<p>md1 : active raid1 sda2[0] sdb2[1]<br />
      96320 blocks [2/2] [UU]</p>
<p>md0 : active raid1 sda1[0] sdb1[1]<br />
      29294400 blocks [2/2] [UU]</p>
<p>In my case you can see that the raid pair is not synced yet. After about 10 minutes or so re-issuing the command shows that the raid pair are now syncing (alternatively you can try running the raid to kick start the sync by issuing <code>mdadm --run /dev/md2</code>):<br />
<code>cat /proc/mdstat</code><br />
md2 : active raid1 sdb3[1] sda3[0]<br />
      458993024 blocks [2/2] [UU]<br />
      [=&gt;...................]  resync =  7.6% (35247744/458993024) finish=73.2min speed=96456K/sec</p>
<p>and <code>mdadm -detail /dev/md2</code><br />
/dev/md2:<br />
        Version : 00.90<br />
  Creation Time : Wed Apr 22 21:34:44 2009<br />
     Raid Level : raid1<br />
     Array Size : 458993024 (437.73 GiB 470.01 GB)<br />
  Used Dev Size : 458993024 (437.73 GiB 470.01 GB)<br />
   Raid Devices : 2<br />
  Total Devices : 2<br />
Preferred Minor : 2<br />
    Persistence : Superblock is persistent</p>
<p>    Update Time : Wed Apr 22 22:10:29 2009<br />
          State : active, resyncing<br />
 Active Devices : 2<br />
Working Devices : 2<br />
 Failed Devices : 0<br />
  Spare Devices : 0</p>
<p> <strong>Rebuild Status : 9% complete</strong></p>
<p>           UUID : e893056a:5de3d066:4bca1532:59cc93a2 (local to host xenmaster)<br />
         Events : 0.3</p>
<p>    Number   Major   Minor   RaidDevice State<br />
       0       8        3        0      active sync   /dev/sda3<br />
       1       8       19        1      active sync   /dev/sdb3</p>
<p>At this point is should be possible to mount and use the raid device and even format it while it is being rebuilt. However, I want to put LVM on it so I&#8217;ll wait until the sync is complete&#8230;</p>
<p>Please note that the new raid device will most likely sow in /proc/mdstat as active (auto-read-only) until you either mount it or create an LVM volume on it (i.e. use it).</p>
<p>And that&#8217;s it really. You use /dev/md2 as you would any disk partition such as /dev/sda1 to format, mount or use as a PV for LVM.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxinstead.com/blog/?feed=rss2&amp;p=129</wfw:commentRss>
		</item>
		<item>
		<title>Using vi as a hex editor</title>
		<link>http://www.linuxinstead.com/blog/?p=126</link>
		<comments>http://www.linuxinstead.com/blog/?p=126#comments</comments>
		<pubDate>Tue, 21 Apr 2009 11:20:23 +0000</pubDate>
		<dc:creator>Kev</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[hex]]></category>

		<category><![CDATA[vi]]></category>

		<guid isPermaLink="false">http://www.linuxinstead.com/blog/?p=126</guid>
		<description><![CDATA[Sometimes I find it useful to switch to hex mode when editing a file in vi. The command for switching is not very obvious so thought I&#8217;d share&#8230;
So, open a file in vi as usual, hit escape and type:
:%!xxd to switch into hex mode
And when your done hit escape again and type:
:%!xxd -r to exit [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I find it useful to switch to hex mode when editing a file in vi. The command for switching is not very obvious so thought I&#8217;d share&#8230;</p>
<p>So, open a file in vi as usual, hit escape and type:<br />
<code>:%!xxd</code> to switch into hex mode</p>
<p>And when your done hit escape again and type:<br />
<code>:%!xxd -r</code> to exit from hex mode.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxinstead.com/blog/?feed=rss2&amp;p=126</wfw:commentRss>
		</item>
		<item>
		<title>Manually creating a Xen DOMU instance</title>
		<link>http://www.linuxinstead.com/blog/?p=97</link>
		<comments>http://www.linuxinstead.com/blog/?p=97#comments</comments>
		<pubDate>Mon, 13 Apr 2009 18:52:45 +0000</pubDate>
		<dc:creator>Kev</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Xen virtualisation]]></category>

		<category><![CDATA[domu]]></category>

		<guid isPermaLink="false">http://www.linuxinstead.com/blog/?p=97</guid>
		<description><![CDATA[If you&#8217;ve followed my guide to installing xen from source then you might now be wondering how to create your first VM.
This guide will show you how to manually create and install a VM (known as a DOMU instance in Xen) without any additional tools such as virt-manager, virt-install or virsh. These tools can help [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve followed my guide to installing xen from source then you might now be wondering how to create your first VM.<br />
This guide will show you how to manually create and install a VM (known as a DOMU instance in Xen) without any additional tools such as virt-manager, virt-install or virsh. These tools can help the novice, but are quite limiting when it comes to the advance features of xen.</p>
<p>For this example I&#8217;ll be installing CentOS5, but this should work for any red-hat based distro (please note there is a bug in fedora10 that stops it booting under xen). This example also uses the paravirtual kernel so it will work even if your CPU does not support AMD-V or intel-VT.</p>
<p>Right, down to business. The first thing we need to do is create a file to user as the hard disk for the DOMU. There are other options for providing hard disks to a DOMU, and I&#8217;ll cover some of them in a later guide but for this install I&#8217;ll be using a file.</p>
<p>The command below will create an 8GB file that will be used as an 8GB drive. The whole file will be written to disk in one go so may take a short while to complete.<br />
<code>dd if=/dev/zero of=/xenimages/test01/disk1.img oflag=direct bs=1M count=8192</code><br />
<span id="more-97"></span><br />
Alternatively, you can use the command below to create the same size file as a sparse file. What this does is create the file, but only take up disk space as the file is used. In this case the file will only really take about 1mb of disk initially and grow as you use it.<br />
<code>dd if=/dev/zero of=/xenimages/test01/disk1.img oflag=direct bs=1M seek=8191 count=1</code><br />
There are pros and cons of using sparse files. On one hand they only take as much disk as is actually used, on the other hand the file can become fragmented and you could run out of real disk if you overcommit space.</p>
<p>Next up we&#8217;ll mount the install CD and export it over nfs so that xen can use it as a network install.<br />
<code>mkdir /tmp/centos52<br />
mount /dev/hda /tmp/centos52 -o loop,ro</code><br />
Just to check the mount went OK: <code>ls /tmp/centos52</code> should show the files.<br />
Now run the export:<br />
<code>exportfs *:/tmp/centos5</code></p>
<p>Now we&#8217;ll create the xen config file for our new instance. The default location for xen config files is /var/xen so that&#8217;s where ours will go.<br />
I&#8217;m going to call my VM test01, so I&#8217;ll create a file /var/xen/test01 that contains the following initial configuration:</p>
<pre><code>kernel = "/tmp/centos52/images/xen/vmlinuz"
ramdisk = "/tmp/centos52/images/xen/initrd.img"
name = "test01"
memory = "256"
## disk = [ 'tap:aio:/xenimages/test01/disk1.img,xvda,w', ]
disk = [ 'file:/xenimages/test01/disk1.img,xvda,w', ]
vif = [ 'bridge=eth0', ]
vcpus=1
on_reboot = "destroy"
on_crash = "destroy"</code></pre>
<p>Note that if you are installing from a different machine from your xen machine the you will need to nfs mount the install disk in order for the above config to kick off the installer. e.g.<br />
<code>mount IP address:/tmp/centos52 /tmp/centos52</code></p>
<p>So, lets boot the new instance and start the installer.<br />
<code>xm create test01</code><br />
After a moment or two the console should return with something like &#8220;Started domain test01&#8243;.</p>
<p>Now lets connect to the console and proceed with the install:<br />
<code>xm console test01</code></p>
<p>Or if you prefer the previous two commands can be combined into one: <code>xm create test01 -c</code>.</p>
<p>From here on you should work through the standard text mode installer.<br />
The points to note are:</p>
<ul>
<li><strong> For installation image select &#8220;NFS image&#8221;.</strong> Then in the later nfs panel enter your PC&#8217;s IP address for the servername and /tmp/centos52 (or wherever you mounted the cd) as the directory.</li>
<li> I also specified a manual IP address for my VM. I selected my routers IP for the gateway and dns server, so that I can access the internet from the VM later.</li>
<li>The hard drive is named <strong>xvda</strong>, as specified in the config file. This will need to be partitioned and formatted by the installer.</li>
</ul>
<p>The rest of the install is fairly straight forward. If in doubt just go with the defaults, although it&#8217;s probably a good idea to set a manual IP address in your subnet range so that you can easily ssh onto the VM.<br />
Note that to release the console from your VM hold down <strong>Ctlr</strong> and press the <strong>]</strong> key.</p>
<p>When the install is complete the new domain will need to be shut down (you&#8217;ll be prompted to &#8216;restart&#8217; by the installer, this will in fact shut down the VM because we set the on_reboot option to destroy), and then the xen config file must be modified to allow the new VM to boot.<br />
So, edit the config file that we created earlier and comment out the kernel and ramdisk lines. You should also change the on_crash and on_reboot actions to restart.<br />
So the edited config file now looks like this:</p>
<pre><code><strong>## kernel = "/tmp/centos52/images/xen/vmlinuz"
## ramdisk = "/tmp/centos52/images/xen/initrd.img"</strong>
name = "test01"
memory = "256"
## disk = [ 'tap:aio:/xenimages/test01/disk1.img,xvda,w', ]
disk = [ 'file:/xenimages/test01/disk1.img,xvda,w', ]
vif = [ 'bridge=eth0', ]
vcpus=1
<strong>on_reboot = "restart"
on_crash = "restart"</strong></code></pre>
<p>Finally we can boot the new VM instance:<br />
<code>xm create test01 -c</code><br />
and log in as root. You should also be able to ssh onto it from your network.</p>
<p>And that&#8217;s about it!<br />
One last note. If you want the VM to start and stop with your xen server, just move the config file into the auto sub folder (or create a symbolic link to it).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxinstead.com/blog/?feed=rss2&amp;p=97</wfw:commentRss>
		</item>
		<item>
		<title>LVM how to</title>
		<link>http://www.linuxinstead.com/blog/?p=75</link>
		<comments>http://www.linuxinstead.com/blog/?p=75#comments</comments>
		<pubDate>Tue, 07 Apr 2009 19:30:27 +0000</pubDate>
		<dc:creator>Kev</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[create volume]]></category>

		<category><![CDATA[logical volume manager]]></category>

		<category><![CDATA[LVM]]></category>

		<category><![CDATA[LVM2]]></category>

		<guid isPermaLink="false">http://www.linuxinstead.com/blog/?p=75</guid>
		<description><![CDATA[This is a quick and dirty guide to setting up an LVM based filesystem.
First create some disk partitions. In this example I&#8217;ve got two identical unformatted partitions on a couple of hard drives. These appear in /dev as sda4 and sdb4. Please note your partition number will most likely be different.
Also note that it&#8217;s easy [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quick and dirty guide to setting up an LVM based filesystem.</p>
<p>First create some disk partitions. In this example I&#8217;ve got two identical unformatted partitions on a couple of hard drives. These appear in /dev as sda4 and sdb4. Please note your partition number will most likely be different.<br />
Also note that it&#8217;s easy to break your system with some of these commands. <strong>You have been warned, so don&#8217;t blame me if you wipe your system out!</strong></p>
<p>First make the partitions available to LVM:<br />
<code>pvcreate /dev/sda4</code><br />
Physical volume &#8220;/dev/sda4&#8243; successfully created<br />
<span id="more-75"></span><br />
<code>pvcreate /dev/sdb4</code><br />
Physical volume &#8220;/dev/sdb4&#8243; successfully created</p>
<p>Next create a volume group:<br />
<code>vgcreate xenimagesvg /dev/sda4 /dev/sdb4</code><br />
Volume group &#8220;xenimagesvg&#8221; successfully created</p>
<p>We can check the size etc of the new volume group with vgdisplay:</p>
<p><code>vgdisplay xenimagesvg</code><br />
&#8212; Volume group &#8212;<br />
VG Name               xenimagesvg<br />
System ID<br />
Format                lvm2<br />
Metadata Areas        2<br />
Metadata Sequence No  1<br />
VG Access             read/write<br />
VG Status             resizable<br />
MAX LV                0<br />
Cur LV                0<br />
Open LV               0<br />
Max PV                0<br />
Cur PV                2<br />
Act PV                2<br />
VG Size               289.52 GB<br />
PE Size               4.00 MB<br />
Total PE              74116<br />
Alloc PE / Size       0 / 0<br />
Free  PE / Size       74116 / 289.52 GB<br />
VG UUID               m408F0-77d6-WXwU-ykD9-5OCB-pIkG-cSbIDP</p>
<p>Next, we need to create a logical volume in our new volume group:<br />
<code>lvcreate -n xenimageslv -L 250G xenimagesvg</code></p>
<p>The above will create a logical volume called xenimages<strong>lv</strong> in volume group xenimages<strong>vg</strong></p>
<p>Now we need to format the logical volume so that it can be used as a filesystem.<br />
I&#8217;m going to format to ext3 using mke2fs with -j (for journalling, aka ext3):<br />
<code>mke2fs -j /dev/mapper/xenimagesvg-xenimageslv</code><br />
mke2fs 1.41.3 (12-Oct-2008)<br />
Filesystem label=<br />
OS type: Linux<br />
Block size=4096 (log=2)<br />
Fragment size=4096 (log=2)<br />
16384000 inodes, 65536000 blocks<br />
3276800 blocks (5.00%) reserved for the super user<br />
First data block=0<br />
Maximum filesystem blocks=4294967296<br />
2000 block groups<br />
32768 blocks per group, 32768 fragments per group<br />
8192 inodes per group<br />
Superblock backups stored on blocks:<br />
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,<br />
4096000, 7962624, 11239424, 20480000, 23887872</p>
<p>Writing inode tables: done<br />
Creating journal (32768 blocks): done<br />
Writing superblocks and filesystem accounting information: done</p>
<p>This filesystem will be automatically checked every 32 mounts or<br />
180 days, whichever comes first.  Use tune2fs -c or -i to override.</p>
<p>And finally we need to mount our new filesystem so that we can actually use it. Here I&#8217;ll add the entry into fstab so that it mounts on system startup.</p>
<p>Create a folder to mount the filesystem into:<br />
<code>mkdir xenimages</code></p>
<p>edit fstab and add the following line to mount our new lvm filesystem at system startup&#8230;<br />
<code>/dev/mapper/xenimagesvg-xenimageslv /xenimages   ext3    errors=remount-ro 0       0</code></p>
<p>Now run <code>mount-a</code> to re-run fstab mounts and mount the new filesystem</p>
<p>Check it&#8217;s mounted with df -h:<br />
<code>df -h</code><br />
Filesystem            Size  Used Avail Use% Mounted on<br />
/dev/mapper/rootvg-rootlv<br />
21G  4.5G   15G  24% /<br />
tmpfs                 1.9G     0  1.9G   0% /lib/init/rw<br />
udev                   10M  124K  9.9M   2% /dev<br />
tmpfs                 1.9G     0  1.9G   0% /dev/shm<br />
/dev/md1               92M   51M   36M  59% /boot<br />
/dev/mapper/xenimagesvg-xenimageslv<br />
247G  188M  234G   1% /xenimages</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxinstead.com/blog/?feed=rss2&amp;p=75</wfw:commentRss>
		</item>
		<item>
		<title>Installing Xen 3.3.1 from source on Debian 5.0 (Lenny)</title>
		<link>http://www.linuxinstead.com/blog/?p=63</link>
		<comments>http://www.linuxinstead.com/blog/?p=63#comments</comments>
		<pubDate>Tue, 07 Apr 2009 19:20:13 +0000</pubDate>
		<dc:creator>Kev</dc:creator>
		
		<category><![CDATA[Xen virtualisation]]></category>

		<category><![CDATA[debian]]></category>

		<category><![CDATA[lenny]]></category>

		<category><![CDATA[xen 3.3.1]]></category>

		<category><![CDATA[xen compile]]></category>

		<guid isPermaLink="false">http://www.linuxinstead.com/blog/?p=63</guid>
		<description><![CDATA[This is how I built my Xen server.
First install Debian 5.0 (Lenny). This should also work on 4 (Etch) too.
Everything is done on the command line as root.
To build Xen from source you&#8217;ll need as fair number of dependencies. The easiest way to install them is by using the apt-get install command as below:
apt-get install [...]]]></description>
			<content:encoded><![CDATA[<p>This is how I built my Xen server.</p>
<p>First install Debian 5.0 (Lenny). This should also work on 4 (Etch) too.</p>
<p>Everything is done on the command line as root.</p>
<p>To build Xen from source you&#8217;ll need as fair number of dependencies. The easiest way to install them is by using the apt-get install command as below:<br />
<code>apt-get install bcc bin86 gawk bridge-utils iproute libcurl3 libcurl4-openssl-dev bzip2 module-init-tools transfig tgif texinfo pciutils-dev mercurial build-essential make gcc libc6-dev zlib1g-dev python python-dev python-twisted libncurses5-dev patch libvncserver-dev libsdl-dev libjpeg62-dev</code></p>
<p>If you installed the 64bit version of Debian then you&#8217;ll also need gcc-multilib for the compile to work:<br />
<code>apt-get install gcc-multilib</code><br />
<span id="more-63"></span><br />
Next create a temporary folder and download the Xen source code:<br />
<code>mkdir xentemp<br />
cd xentemp<br />
wget http://bits.xensource.com/oss-xen/release/3.3.1/xen-3.3.1.tar.gz</code></p>
<p>Now extract the soucecode from the downloaded archive:<br />
<code>tar -xzf xen-3.3.1.tar.gz<br />
cd xen-3.3.1</code></p>
<p>Right, now on with the compile (this will take a while&#8230;):<br />
<code>make world</code><br />
<em>Note,  if you want USB and PCI passthrough to answer Y when prompted.</em></p>
<p>Assuming that the above compile went ok:<br />
<code>make dist</code></p>
<p>And now install the newly compiled kernel and tools into the system:<br />
<code>./install.sh</code></p>
<p>Ensure the xen deamon starts and stops with the rest of the system:<br />
<code>update-rc.d xend defaults 20 21<br />
update-rc.d xendomains defaults 21 20</code></p>
<p>Create the module dependencies stuff:<br />
<code>depmod 2.6.18.8-xen</code></p>
<p>Update/create initramfs for the new kernel:<br />
<code>update-initramfs -c -k 2.6.18.8-xen </code></p>
<p>Add the new kernel to your grub boot menu:<br />
<code>update-grub</code></p>
<p>Reboot the system and hope that it works!<br />
<code>reboot</code></p>
<p>Now have a xen kernel:<br />
<code>uname-a</code><br />
Should show a xen kernel at version 2.6.18</p>
<p>However on my gigabyte motherboard I was getting some boot time errors:<br />
<em>2.6.18 exception Emask 0&#215;40 SAct 0&#215;0 SErr 0&#215;800 action 0&#215;2</em></p>
<p>A quick google confirmed that this was due to the old kernel version, 2.6.18 and my motherboard.<br />
So to fix the error I used synaptic to install latest xen kernel from lenny repositories&#8230;</p>
<p><code>uname -a</code><br />
2.6.26-1-xen-amd64 #1 SMP Fri Mar 13 21:39:38 UTC 2009 x86_64 GNU/Linux<br />
This resolved the error and still leaves me with xen 3.3.1</p>
<p>Type <code>xm info</code> to confirm xen version</p>
<p>And that&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxinstead.com/blog/?feed=rss2&amp;p=63</wfw:commentRss>
		</item>
	</channel>
</rss>
