<?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>[ t h e f r a g g l e . c o m ] &#187; unix</title>
	<atom:link href="http://www.thefraggle.com/tag/unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thefraggle.com</link>
	<description>technology, photography and anything else that springs to mind.</description>
	<lastBuildDate>Tue, 13 Sep 2011 09:37:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>cat can have some handy features too.</title>
		<link>http://www.thefraggle.com/2007/04/03/cat-can-have-some-handy-features-too/</link>
		<comments>http://www.thefraggle.com/2007/04/03/cat-can-have-some-handy-features-too/#comments</comments>
		<pubDate>Tue, 03 Apr 2007 21:56:11 +0000</pubDate>
		<dc:creator>Chris Ganderton</dc:creator>
				<category><![CDATA[General Life]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.thefraggle.com/wordpress/?p=34</guid>
		<description><![CDATA[Another nifty thing I figured out a while ago, whilst having to upload a script written by one of the guys we support, in a windows editor, was how to check quickley and easily with cat(1)whether it had silly windows CR/LF&#8217;s : cat -ev /path/to/file Would output something like the following if the file had [...]]]></description>
			<content:encoded><![CDATA[<p>Another nifty thing I figured out a while ago, whilst having to upload a script written by one of the guys we support, in a windows editor, was how to check quickley and easily with cat(1)whether it had silly windows CR/LF&#8217;s :</p>
<pre>cat -ev /path/to/file</pre>
<p>Would output something like the following if the file had silly line endings&#8230;</p>
<pre>
This is some text written in windaz^M$
And another line edited in windaz, woo^M$</pre>
<p>cat suffixes the end of line with a $ and shows any special characters that have been inserted, in our case here ^M is the windows special character for new line, so all you need to do is remove that, which is again pretty easy:</p>
<pre>sed -i.bak -sed -e "s/r//g" /path/to/file</pre>
<p>Should remove the windaz file endings from the file, copying the file with a .bak suffi as a backup.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thefraggle.com/2007/04/03/cat-can-have-some-handy-features-too/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sfdisk is quite handy</title>
		<link>http://www.thefraggle.com/2007/04/03/sfdisk-is-quite-handy/</link>
		<comments>http://www.thefraggle.com/2007/04/03/sfdisk-is-quite-handy/#comments</comments>
		<pubDate>Tue, 03 Apr 2007 21:41:49 +0000</pubDate>
		<dc:creator>Chris Ganderton</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.thefraggle.com/wordpress/?p=33</guid>
		<description><![CDATA[So today I had to basically clone a hard disk from a failing disk, to a new disk Sun had sent for one of the v20z&#8217;s at work&#8230; Haven&#8217;t not had to mess about with partition tables and other such things outside of the installer in linux for some time (last time I did this [...]]]></description>
			<content:encoded><![CDATA[<p>So today I had to basically clone a hard disk from a failing disk, to a new disk Sun had sent for one of the v20z&#8217;s at work&#8230;  Haven&#8217;t not had to mess about with partition tables and other such things outside of the installer in linux for some time (last time I did this kind of messing about was with freebsd which uses slices-&gt;partitions, unlike linux and it&#8217;s mad idea of partitions and extended partitions), so I had to take stock for a short while while I figured out the best way to go ahead.  Here&#8217;s what I started with :</p>
<blockquote><p>
/dev/sda &#8211; main scsi hard disk at scsi id 0<br />
/dev/sdb &#8211; new replacement disk at scsi id 1
</p></blockquote>
<p>Saving and restorring the partition table to the sdb was as easy as:  </p>
<p><code>sfdisk -d /dev/sda &gt; /tmp/sda-parttable.out</code>  </p>
<p>and then:  </p>
<p><code>cat /tmp/sda-parttable.out | sdisk /dev/sdb </code>  </p>
<p>I&#8217;d never realised sfdisk could do easy things like that, which saved me some time having to input partition boundries by hand <img src='http://www.thefraggle.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   What next was a bit of a pain was getting files over to the new filesystems (obviously once I had created new filesystems on them and mounted them somewhere easy to use &#8211; /mnt/newroot). I had looked at possibly using cpio to do this, and considered dd.  </p>
<p>It seemed the best in the end, to create tar archives of the data, so that if I made a mess of the new disk I could at least quickly extract the backups again without too much faff, to do this I simply archived up each partition using something along the lines of:  </p>
<p><code>tar --preserve --one-file-system -vcf /mnt/newroot/root.tar /</code></p>
<p>this archived the root into /mnt/newroot/root.tar, but diddn&#8217;t traverse into new directories, &#8211;one-file-system is a pretty handy feature of tar and I&#8217;m sure it&#8217;ll come in useful again sometime in the future.  Tomorrow I&#8217;ll update with how easy it was to install the new mbr to sdb and how removing the origional disk and moving sdb to sda&#8217;s slot, goes <img src='http://www.thefraggle.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thefraggle.com/2007/04/03/sfdisk-is-quite-handy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>About Me</title>
		<link>http://www.thefraggle.com/about-lil-old-me/</link>
		<comments>http://www.thefraggle.com/about-lil-old-me/#comments</comments>
		<pubDate>Sun, 23 Apr 2006 18:21:31 +0000</pubDate>
		<dc:creator>Chris Ganderton</dc:creator>
				<category><![CDATA[General Life]]></category>
		<category><![CDATA[gigs]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I&#8217;m 24, based in Germany and work as a UNIX sysadmin. I listen to all kinds of music and am generally interested in art. I paticularly like rock music and go to as many gigs as I can get to. I like photography, I&#8217;m not that good; but still try, my attempts are up at [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m 24, based in Germany and work as a UNIX sysadmin.</p>
<p>I listen to all kinds of music and am generally interested in art. I paticularly like rock music and go to as many gigs as I can get to.</p>
<p>I like photography, I&#8217;m not that good; but still try, my attempts are up at deviantart (see the links to the right).</p>
<p>This blog is mainly to help me remember random things I&#8217;ve done; but if it helps other folks then that&#8217;s alright <img src='http://www.thefraggle.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thefraggle.com/about-lil-old-me/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

