<?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>Helm&#039;s Technology Blog &#187; linux</title>
	<atom:link href="http://www.ihelm.org.uk/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ihelm.org.uk</link>
	<description>Linux Servers, Cpanel and Mysql along with my own tech thoughts</description>
	<lastBuildDate>Sun, 11 Jul 2010 10:50:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Webmail not working in Cpanel</title>
		<link>http://www.ihelm.org.uk/2010/05/webmail-not-working-in-cpanel/</link>
		<comments>http://www.ihelm.org.uk/2010/05/webmail-not-working-in-cpanel/#comments</comments>
		<pubDate>Mon, 10 May 2010 20:59:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[CSF]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.ihelm.org.uk/?p=130</guid>
		<description><![CDATA[Had a problem earlier this week, webmail couldn't always send e-mail.  It was coming back with the following error:

SMTP Error: SMTP error: Connection failed: Failed to connect socket: Connection timed out.]]></description>
			<content:encoded><![CDATA[<p>Had a problem earlier this week, webmail couldn&#8217;t always send e-mail.  It was coming back with the following error:</p>
<p>SMTP Error: SMTP error: Connection failed: Failed to connect socket: Connection timed out.</p>
<p>After reading a few things  I turned on the SMTP tweak..  things appeared to work for a few hours, then it started failing again.</p>
<p>Searching online said to trying telnet on the command line &#8211; so did that, connected to port 25 &#8211; all fine&#8230; hmm odd &#8211; tried webmail again &#8211; failed&#8230;..</p>
<p>After a more indepth search I found a forum which gave me a hint &#8211; apparently other people have had the same problem when using the firewall for cpanel &#8211; CSF.  CSF is definately one of the best firewalls around for linux and works really well with Cpanel &#8211; however every now and again the amount of options can cause you to miss out something obvious:</p>
<p># If SMTP_BLOCK is enabled but you want to allow local connections to port 25<br />
# on the server (e.g. for webmail or web scripts) then enable this option to<br />
# allow outgoing SMTP connections to 127.0.0.1<br />
SMTP_ALLOWLOCAL = 0</p>
<p>The SMTP_ALLOWLOCAL set to 0 stops webmail etc&#8230; not sure when this appeared (the server has been working fine for about 4 months) but change it to 1 &#8211; restart CSF and there we go it&#8217;s working fine <img src='http://www.ihelm.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ihelm.org.uk/2010/05/webmail-not-working-in-cpanel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Can&#8217;t create or edit a file &#8211; Linux &#8211; but have diskspace?</title>
		<link>http://www.ihelm.org.uk/2010/05/cant-create-or-edit-a-file-linux-but-have-diskspace/</link>
		<comments>http://www.ihelm.org.uk/2010/05/cant-create-or-edit-a-file-linux-but-have-diskspace/#comments</comments>
		<pubDate>Tue, 04 May 2010 21:05:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[disks]]></category>
		<category><![CDATA[inode]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.ihelm.org.uk/?p=127</guid>
		<description><![CDATA[Have you ever had a linux server or desktop which all of a sudden couldn't create a file - running "df -h" shows you your disk partitions aren't full?

You've logged in as root to check - and yup you still can't write any files - even a "touch test.txt" fails with a message saying can't write file - disk or partition full?]]></description>
			<content:encoded><![CDATA[<p>Have you ever had a linux server or desktop which all of a sudden couldn&#8217;t create a file &#8211; running &#8220;df -h&#8221; shows you your disk partitions aren&#8217;t full?</p>
<p>You&#8217;ve logged in as root to check &#8211; and yup you still can&#8217;t write any files &#8211; even a &#8220;touch test.txt&#8221; fails with a message saying can&#8217;t write file &#8211; disk or partition full?</p>
<p>You could be out of inodes! Linux stores file address information in inodes &#8211; and if you have a lot of very small files (or quite an oddly setup filesystem) you could be out of inodes&#8230;</p>
<p>How do you find out though?</p>
<p>just type in</p>
<p>&#8220;df -i&#8221; &#8211; same as the normal diskfree space command except it tells you inodes, if you have none left (or very few) you may not be able to create a new file (or edit it if your editor creates temporary lockfiles).</p>
<p>In a future blog I&#8217;ll go through how to resize the number of inodes available (primarily aimed at your temporary dev/shm space as this can suffer from the inode problem if you allocate more to it from a small size &#8211; the number of inodes is not increased so you can run out).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ihelm.org.uk/2010/05/cant-create-or-edit-a-file-linux-but-have-diskspace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux &#8211; Calculating Diskspace free</title>
		<link>http://www.ihelm.org.uk/2010/05/linux-calculating-diskspace-free/</link>
		<comments>http://www.ihelm.org.uk/2010/05/linux-calculating-diskspace-free/#comments</comments>
		<pubDate>Mon, 03 May 2010 21:29:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[df]]></category>
		<category><![CDATA[diskspace]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[watch]]></category>

		<guid isPermaLink="false">http://www.ihelm.org.uk/?p=124</guid>
		<description><![CDATA[With linux servers a couple of things can take up disk-space unexpectedly. Log files is the usual culprit, but if your server is a rented one you might be stuck with a bit of a weird partition setup.

For some reason some hosts will give little storage to partitions which then get filled up unexpectedly.  ]]></description>
			<content:encoded><![CDATA[<p>With linux servers a couple of things can take up disk-space unexpectedly. Log files is the usual culprit, but if your server is a rented one you might be stuck with a bit of a weird partition setup.</p>
<p>For some reason some hosts will give little storage to partitions which then get filled up unexpectedly.</p>
<p>To find out how much space you have just use the following command.</p>
<p>df</p>
<p>- want to make it more readable?</p>
<p>Use df-h</p>
<p>Also if you want to see your diskspace changing over time the you can use the watch command. For example</p>
<p>watch -n 1 &#8220;df&#8221;</p>
<p>This will run the disk space command each second and you can view it&#8217;s output on the commandline &#8211; useful if you want to monitor some specific activity in real time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ihelm.org.uk/2010/05/linux-calculating-diskspace-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Re-mounting linux filesystems on the fly.</title>
		<link>http://www.ihelm.org.uk/2010/04/re-mounting-linux-filesystems-on-the-fly/</link>
		<comments>http://www.ihelm.org.uk/2010/04/re-mounting-linux-filesystems-on-the-fly/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 21:28:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[partitions]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[umount]]></category>

		<guid isPermaLink="false">http://www.ihelm.org.uk/?p=121</guid>
		<description><![CDATA[You can remount a linux system on the fly like this:-

umount tmpfs]]></description>
			<content:encoded><![CDATA[<p>You can remount a linux system on the fly like this:-</p>
<p>umount tmpfs</p>
<p>The above command will ask the OS to unmount the filesystem identified by tmpfs in the fstab file.</p>
<p>This may return an error if you are actively using it &#8211; i.e. you have an ssh session open and are in the filesystem or open files exist. &#8211; Exit any of these and try again <img src='http://www.ihelm.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>mount tmpfs</p>
<p>The above command will attempt to re-mount the drive.</p>
<p>When would you use this?  Normally if you have done some dynamic re-sizing of a partition  - for example the tmpfs partition &#8211; see post:</p>
<p><a href="http://www.ihelm.org.uk/2010/04/resizing-ram-disk-in-linux-devshm/">http://www.ihelm.org.uk/2010/04/resizing-ram-disk-in-linux-devshm/</a></p>
<p>for more info on how to do that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ihelm.org.uk/2010/04/re-mounting-linux-filesystems-on-the-fly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resizing Ram disk in Linux (/dev/shm)</title>
		<link>http://www.ihelm.org.uk/2010/04/resizing-ram-disk-in-linux-devshm/</link>
		<comments>http://www.ihelm.org.uk/2010/04/resizing-ram-disk-in-linux-devshm/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 08:52:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[fstab]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[shm]]></category>

		<guid isPermaLink="false">http://www.ihelm.org.uk/?p=117</guid>
		<description><![CDATA[As many people know linux has a built in ramdisk - this is temporary memory and is very very fast (as it's in ram).  AS standard linux allocates 50% of your ram to this (don't worry if you don't use it linux uses all your ram anyway).

However sometimes you may decide the 50% is not enough (or is too much) ]]></description>
			<content:encoded><![CDATA[<p>As many people know linux has a built in ramdisk &#8211; this is temporary memory and is very very fast (as it&#8217;s in ram).  AS standard linux allocates 50% of your ram to this (don&#8217;t worry if you don&#8217;t use it linux uses all your ram anyway).</p>
<p>However sometimes you may decide the 50% is not enough (or is too much) &#8211; especially if the server is upgradeable you may decide you would want to manage the percentage.</p>
<p>Below is an example default entry from /etc/fstab</p>
<pre>tmpfs                           /dev/shm        tmpfs   defaults        0 0
</pre>
<p>This just creates the temporary system using default settings &#8211; nothing fancy &#8211; however if you want it to take 75%  of your ram (or any other percentage) just change it to the code below</p>
<p>- reboot (or remount) and your done.</p>
<pre>tmpfs                           /dev/shm                        tmpfs   size=75%                                0 0

How to unmount the tmpfs

umount tmpfs

To remount it with the new settings

mount tmpfs
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ihelm.org.uk/2010/04/resizing-ram-disk-in-linux-devshm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Migrating Cpanel accounts to  new Cpanel Server &#8211; by command line.</title>
		<link>http://www.ihelm.org.uk/2010/03/migrating-cpanel-accounts-to-new-cpanel-server-by-command-line/</link>
		<comments>http://www.ihelm.org.uk/2010/03/migrating-cpanel-accounts-to-new-cpanel-server-by-command-line/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 21:26:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.ihelm.org.uk/?p=112</guid>
		<description><![CDATA[The Cpanel system has a feature to migrate accounts from another server - be it Cpanel or another webhosting panel - this often works, recently though I've had a problem with using it for Cpanel to Cpanel where it would connect but fail to transfer the backup file.]]></description>
			<content:encoded><![CDATA[<p>Cpanel is a good system for administrating a server with many sites on it, i&#8217;ve used ensim, webmin and a couple of others in years gone by (Plesk and parallels were disasters for me!).  However occasionally something that you think should work just doesn&#8217;t and for no obvious reason.</p>
<p>The Cpanel system has a feature to migrate accounts from another server &#8211; be it Cpanel or another webhosting panel &#8211; this often works, recently though I&#8217;ve had a problem with using it for Cpanel to Cpanel where it would connect but fail to transfer the backup file.</p>
<p>Fortunately it&#8217;s really easy to use the commandline with cpanel and you can do it manually (actually it&#8217;s easier than the wizard!)</p>
<p>On the server you are migrating from just type (while logged in as root!)</p>
<p><strong>/scripts/pkgacct <em><span style="text-decoration: underline;">username</span></em></strong></p>
<p>This will create a tar.gz in the /home directory on the server &#8211; just copy this to the new server (it could take a while &#8211; it has everything from the account you are copying).</p>
<p>On the destination server just type in</p>
<p><strong>/scripts/restorepkg </strong><em><span style="text-decoration: underline;"><strong>username</strong></span></em></p>
<p>This creates (or overwrites the account!) on the server &#8211; and your done!.  But what if you have a dedicated IP (due to SSL?)</p>
<p>Easy just use this instead</p>
<p><strong>/scripts/restorepkg &#8211;ip=y <em><span style="text-decoration: underline;">username</span></em></strong></p>
<p>This gives it the next free dedicated IP address (make sure you have one free!)</p>
<p>And that&#8217;s it &#8211; it is honestly easier than the wizard which requires you to add more info to establish the transfer link.</p>
<p>One thing to note is that you should ensure that the versions of cpanel are as near as you can get &#8211; otherwise it might fail or do things a little weird.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ihelm.org.uk/2010/03/migrating-cpanel-accounts-to-new-cpanel-server-by-command-line/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Exim Mail Server Commands</title>
		<link>http://www.ihelm.org.uk/2009/07/exim-mail-server-commands/</link>
		<comments>http://www.ihelm.org.uk/2009/07/exim-mail-server-commands/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 20:18:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.ihelm.org.uk/?p=84</guid>
		<description><![CDATA[Those of you with Exim will sometimes needs to do some work on it &#8211; here&#8217;s a list of the commands which I find most useful: If you want to see what exim is doing right now : &#8220;exiwhat&#8221; if you think you have queue problems then you can print a countof messages in the [...]]]></description>
			<content:encoded><![CDATA[<p>Those of you with Exim will sometimes needs to do some work on it &#8211; here&#8217;s a list of the commands which I find most useful:</p>
<p>If you want to see what exim is doing right now :</p>
<p>&#8220;exiwhat&#8221;</p>
<p>if you think you have queue problems then you can print a countof messages in the queue this will often be quite high &#8211; so it&#8217;s worth running it a few times over a couple of hours to see if you have a queue problem:</p>
<p>&#8220;exim -bpc&#8221;</p>
<p>If you want more information about what is in the queue then the following command will give you the count, the colume, oldest, newest, domain to be sent to and total summaries.  The oldest and volume parts are often the most informative in this to help you see problem domains.</p>
<p>&#8220;exim -bp | exiqsumm&#8221;</p>
<p>Below are some commands to help you manage the queue &#8211; especially useful if you want to try to purge it or take action.</p>
<p>To tell exim to try to deliver things in the queue according to the rules for a queue run</p>
<p>&#8220;exim -q -v&#8221;</p>
<p>If you are blocked up with external mail you can tell exim to run the queue to deliver local mail only &#8211; this may help you get things such as notifications etc.. if they are delayed by other mail in the queue</p>
<p>&#8220;exim -ql -v&#8221;</p>
<p>If you have some problems with older mail (maybe spam related) &#8211; you can use the following to delete mail that over 7 days old (the time given is in seconds so just take one day 86400 and multiply it by 7)</p>
<p>&#8220;exiqgrep -o 604800 -i | xargs exim -Mrm&#8221;</p>
<p>There are many many other commands and other examples &#8211; some sites have longer lists, but these are all the commands I have needed (or variations thereof) for administrating my servers over the last 9 years.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ihelm.org.uk/2009/07/exim-mail-server-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use crontab to schedule tasks in Linux</title>
		<link>http://www.ihelm.org.uk/2009/07/how-to-use-crontab-to-schedule-tasks-in-linux/</link>
		<comments>http://www.ihelm.org.uk/2009/07/how-to-use-crontab-to-schedule-tasks-in-linux/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 20:15:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.ihelm.org.uk/?p=79</guid>
		<description><![CDATA[Another of the most useful tools in server administration is the Crontab &#8211; you use this to schedule jobs (programs) to run at regular intervals. These tasks can be  varied, from restarting servers, services &#8211; creating files, changing permissions, runing batch programs, deleting files etc&#8230; Of course sometimes crontab is not the best solution as [...]]]></description>
			<content:encoded><![CDATA[<p>Another of the most useful tools in server administration is the Crontab &#8211; you use this to schedule jobs (programs) to run at regular intervals.</p>
<p>These tasks can be  varied, from restarting servers, services &#8211; creating files, changing permissions, runing batch programs, deleting files etc&#8230;</p>
<p>Of course sometimes crontab is not the best solution as it can have several problems &#8211; in which case other choices are available &#8211; including writing your own &#8211; however we will cover that another time.</p>
<p>First a coouple of facts about cron:</p>
<ol>
<li>Cron has evolved a bit since inception but the basic principles are the same &#8211; old server admins are as good as new ones with this tool!</li>
<li>Cron will run new jobs at most once a minute &#8211; that&#8217;s the smallest resolution you can have.</li>
<li>Old systems used to wake up every minute and check for new work &#8211; the same as a simple replacement service might do &#8211; however this didn&#8217;t scale well when cpu power was low but users high on old mainframe systems &#8211; new systems still only execute once a minute.</li>
<li>the cron service loads up any relavent cron files (which exist in users home directories or in /etc/cron.d/) and saves the information so it only needs to run when there is really jobs to run &#8211; when you edit the crontab it reloads it&#8217;s list so it doesn&#8217;t need to keep checking for changes &#8211; it&#8217;s important to edit it right!</li>
<li>Even if a previous program hasn&#8217;t finished &#8211; cron can run it again or run more jobs &#8211; this can bring down badly configured systems! so be careful how you use it.</li>
</ol>
<p>Generally to edit the crontab &#8211; which is where you would add things to run type in &#8220;crontab -e&#8221; &#8211; this will open it in your system editor (vim is my choice, but others can be used).</p>
<p>you will probably see some content &#8211; similar to this:</p>
<pre>
</pre>
<pre style="color: black; background-color: #f9f9f9; line-height: 1.1em; padding: 1em; border: 1px dashed #2f6fab;">1 0 * * *  shutdown -r now</pre>
<p>This means that at one minute past midnight the server will reboot (execture the immediate shutdown and restart command with no delay) each day.  The * are wildcards saying that the instruction should run no matter the criteria of that column (if it&#8217;s all * then it will run each minute).</p>
<p>The fields are the following:   I recommend pasting this in the top of your crontab file &#8211; the # at the start mean it will ignore the entries.</p>
<pre>
</pre>
<pre style="color: black; background-color: #f9f9f9; line-height: 1.1em; padding: 1em; border: 1px dashed #2f6fab;"># .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7)  OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  *</pre>
<p>Remember if the program has output you can store it in a file the same as you can on the command line &#8211; just type &#8221; &gt; /var/log/logfile&#8221;</p>
<p>in the entry after the command and it will log output to the file in question.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ihelm.org.uk/2009/07/how-to-use-crontab-to-schedule-tasks-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Grep to find a string inside a file (Linux)</title>
		<link>http://www.ihelm.org.uk/2009/07/using-grep-to-find-a-string-inside-a-file-linux/</link>
		<comments>http://www.ihelm.org.uk/2009/07/using-grep-to-find-a-string-inside-a-file-linux/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 20:00:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.ihelm.org.uk/?p=76</guid>
		<description><![CDATA[Grep is a tool that is used often by system administrators &#8211; including myself, however I often have to double check the syntax online &#8211; as a result this post is to help me find out how and you of course. first I recommend to change to the directory that you think or know the [...]]]></description>
			<content:encoded><![CDATA[<p>Grep is a tool that is used often by system administrators &#8211; including myself, however I often have to double check the syntax online &#8211; as a result this post is to help me find out how and you of course.</p>
<p>first I recommend to change to the directory that you think or know the file containing the text is in:</p>
<ul>
<li>To find the string michael in any file type &#8220;grep michael *         #this will return a the files if any are found within the directory</li>
<li>To find the string michael in any file and search recusively in directories under where you are type  &#8221;grep -R michael *&#8221;</li>
</ul>
<p>Grep is one of the best tools available to an administrator especially for checking log files out and finding regular patterns.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ihelm.org.uk/2009/07/using-grep-to-find-a-string-inside-a-file-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a new swap partition &#8211; Linux</title>
		<link>http://www.ihelm.org.uk/2009/07/adding-a-new-swap-partition-linux/</link>
		<comments>http://www.ihelm.org.uk/2009/07/adding-a-new-swap-partition-linux/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 20:24:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[swap]]></category>

		<guid isPermaLink="false">http://www.ihelm.org.uk/?p=62</guid>
		<description><![CDATA[I realised after my previous post I realised that it would be worthwhile talking about adding a new partitition.

The first thing you need - or I assume - is that you have a separate hard-drive which is not active (mounted) or can be unmounts using the standard umount command.

We assume the device is sdc  (it could be sdb, sda, hda1 etc..).]]></description>
			<content:encoded><![CDATA[<p>I realised after my previous post I realised that it would be worthwhile talking about adding a new partitition.</p>
<p>The first thing you need &#8211; or I assume &#8211; is that you have a separate hard-drive which is not active (mounted) or can be unmounts using the standard umount command.</p>
<p>We assume the device is sdc  (it could be sdb, sda, hda1 etc..).</p>
<ol>
<li>Ensure the drive is unmounted &#8211; turn off any swap already on it with swapoff (or if it&#8217;s clean of swap partitions then you can ignore swapoff)</li>
<li>type in &#8220;parted /dev/sdc&#8221;  This loads the parted prompt which allows you to manage the disk.</li>
<li>enter &#8220;print&#8221; to view details of any existing partitions and free space.</li>
<li>once you have decided the size you need (at minimum I would recommend match your RAM) type &#8220;mkpartfs part-type linux-swap start end&#8221;  Where for the start and end match the start point available in the print command and ending a number x megabtes above i.e. if the start point is 1024 then the end point would be 5120 for a four gigabyte partition (4096)</li>
<li>once done type quit to exit parted.  The new partition will have been given a number e.g. sdc2 (or higher if others exist)</li>
<li>all that needs doing is to format the partition &#8220;mkswap /dev/sdc&#8221;</li>
<li>to enable it&#8217;s the same process as for the file &#8211; &#8220;swapon /dev/sdc&#8221;</li>
</ol>
<p>If you want to make it work each boot &#8211; then edit the fstab using</p>
<p>vi /etc/fstab</p>
<p>add to the bottom: (press insert to enter edit mode)</p>
<p>/dev/sdc2 swap swap defaults 0 0</p>
<p>then press escape and shift-Z shift-Z</p>
<p>as before you can check to see if it&#8217;s been added by using</p>
<p>/proc/swaps</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ihelm.org.uk/2009/07/adding-a-new-swap-partition-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->