<?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>Digicorp &#187; linux</title>
	<atom:link href="http://dev.digi-corp.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.digi-corp.com</link>
	<description>&#62;&#62; Developer Blog</description>
	<lastBuildDate>Wed, 22 Jun 2011 14:13:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Moving /opt/ Data To New Partition In Linux Due To Low Disk Space</title>
		<link>http://dev.digi-corp.com/2009/09/moving-opt-data-to-new-partition-in-linux-due-to-low-disk-space/</link>
		<comments>http://dev.digi-corp.com/2009/09/moving-opt-data-to-new-partition-in-linux-due-to-low-disk-space/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 10:29:26 +0000</pubDate>
		<dc:creator>bhumish.shah</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[moving partition]]></category>
		<category><![CDATA[partition]]></category>

		<guid isPermaLink="false">http://dev.digi-corp.com/?p=1222</guid>
		<description><![CDATA[1. Introduction (Moving /opt data to a new partition) The partition /opt is one of the most-often-moved partitions Because Linux Installs Third Party Software in /opt Directory. For Example Zimbra, Scalix.. So there is Disk Space Issue Occurs after Log Period Some Times All Space On /opt Becomes Full and Your Application’s Performance Becomes Poor. [...]]]></description>
			<content:encoded><![CDATA[<h3>1. Introduction (Moving /opt data to a new partition)</h3>
<p>The partition /opt is one of the most-often-moved partitions Because Linux Installs Third Party Software in /opt Directory. For Example Zimbra, Scalix.. So there is Disk Space Issue Occurs after Log Period</p>
<p>Some Times All Space On /opt Becomes Full and Your Application’s Performance Becomes Poor. In That Case you need an additional Harddrive or a Partition That Contains Big Space to Moved</p>
<p>In This Article I Will Show You How to Transfer Your /Opt Data to New Harddisk or Another Partition</p>
<p>Add New Hard Disk onto Your Server</p>
<p>When You Attach New Hard Drive on Server, It Will recognized as /dev/sdb.<br />
Your First Hard Drive should be /dev/sda</p>
<h3>2. Create new partition on your new hard drive with fdisk command:</h3>
<p><strong>fdisk /dev/sdb</strong></p>
<p>Press n for Create a New Partition</p>
<p>This Will Ask For Primary or Extended Partition</p>
<p>Press <strong>p</strong> for Primary Partition</p>
<p>Press Enter for Default Setting in cylinder Size of Partition</p>
<p>Type the Size of the Partition That You Want To Allocate To Your New Partition</p>
<p>For Example: <strong>+80000M</strong></p>
<p>This Will Create 80 GB New Primary Partition in to Your New Hard Drive</p>
<p>Press <strong>w</strong> for Save the Settings</p>
<p>Type partprobe Command to update The Kernel about newly added Partition</p>
<p>Now Format the Partition Using ext3 File System So That We Can Use Partition</p>
<p><strong>mkfs –t ext3 /dev/sdb1</strong></p>
<p>You Can Check Newly Created Partition Status Using fdisk –l Command . This Command Will Give You the Status of All the Partition</p>
<h3>3. Mount the new file system in /mnt</h3>
<p>Create a directory called /mnt/newopt, and then mount the new partition there:</p>
<p><strong># mount /dev/sdb1 /mnt/newopt</strong></p>
<h3>4. Drop to single-user mode</h3>
<p>You must go To Single User Mode to Copy All Data in /opt to /mnt/newopt. You shouldn&#8217;t have any files open in /home, and entering single-user mode eliminates this possibility:</p>
<p><strong>#Init 1</strong></p>
<h3>5. Change directories to /home and copy files</h3>
<p>Type The Following</p>
<p><strong># cd /opt<br />
# cp -avx * /mnt/newopt<br />
</strong></p>
<p>The cp -avx command recursively copies the contents of /home to /mnt/newpopt, preserving all file attributes.<br />
After this command finishes, /mnt/newopt will contain an exact copy of all the files and directories currently in /opt.</p>
<h3>6a. If you installed /opt on separate partition then follow below steps</h3>
<p>Unmount the old partition by typing:</p>
<p><strong># cd /<br />
# Umount /opt/</strong></p>
<p>Then, unmount and remount the new partition:</p>
<p><strong># umount /mnt/newopt<br />
# mount /dev/sdb1 /opt</strong></p>
<p>Now, the new partition is available at /opt and is ready to be used. We can perform the last few steps in multiuser mode. Exit single-user mode, so that the system is back up and running Type: init 5</p>
<p>Add This Entry To <strong>/etc/fstab</strong> File</p>
<p><strong>/dev/sdb1   /opt   ext2   defaults   1   2</strong></p>
<h3>6b. If you installed /opt on shared partition then follow below steps</h3>
<p>These instructions are for systems where the old /opt is on a shared partition.</p>
<p><strong># cd /<br />
# mv /opt /opt.old<br />
# mkdir /opt<br />
# mount /dev/sdb1 /opt<br />
</strong></p>
<p>Add This Entry to <strong>/etc/fstab</strong> File</p>
<p><strong>/dev/sdb1   /opt   ext2   defaults   1   2<br />
</strong></p>
<p>That way, your new partition will get mounted correctly the next time the system is rebooted.</p>
<p>We left the old /opt directory/partition behind, just in case there were problems copying files. After verifying that the system is running smoothly, you can remove the /opt.old directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.digi-corp.com/2009/09/moving-opt-data-to-new-partition-in-linux-due-to-low-disk-space/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

