<?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>Libre Things &#187; cfdisk</title>
	<atom:link href="http://positon.org/tag/cfdisk/feed" rel="self" type="application/rss+xml" />
	<link>http://positon.org</link>
	<description></description>
	<lastBuildDate>Tue, 23 Feb 2016 20:01:11 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.7.1</generator>
	<item>
		<title>Resize an ext3/ext4 partition</title>
		<link>http://positon.org/resize-an-ext3-ext4-partition</link>
		<comments>http://positon.org/resize-an-ext3-ext4-partition#comments</comments>
		<pubDate>Wed, 06 Jan 2010 22:41:00 +0000</pubDate>
		<dc:creator><![CDATA[dooblem]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cfdisk]]></category>
		<category><![CDATA[ext3]]></category>
		<category><![CDATA[ext4]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[NTFS]]></category>
		<category><![CDATA[Parted]]></category>
		<category><![CDATA[partition]]></category>
		<category><![CDATA[resize2fs]]></category>

		<guid isPermaLink="false">http://positon.org:81/?p=80</guid>
		<description><![CDATA[Before doing anything: backup your sensible data! To extend a partition and it&#8217;s filesystem, you have to: Extend the partition Extend the filesystem To shrink a partition and it&#8217;s filesystem, you have to: Shrink the filesystem Shrink the partition For an ext3 partition, simply use parted: parted /dev/sdx print resize N Parted doesn&#8217;t support ext4 [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>Before doing anything: backup your sensible data!</strong></p>
<p>To extend a <a href="http://en.wikipedia.org/wiki/Disk_partitioning">partition</a> and it&#8217;s <a href="http://en.wikipedia.org/wiki/File_system">filesystem</a>, you have to:</p>
<ol>
<li>Extend the partition</li>
<li>Extend the filesystem</li>
</ol>
<p>To shrink a <a href="http://en.wikipedia.org/wiki/Disk_partitioning">partition</a> and it&#8217;s <a href="http://en.wikipedia.org/wiki/File_system">filesystem</a>, you have to:</p>
<ol>
<li>Shrink the filesystem</li>
<li>Shrink the partition</li>
</ol>
<p>For an <a href="http://en.wikipedia.org/wiki/Ext3">ext3</a> partition, simply use <a href="http://www.gnu.org/software/parted/">parted</a>:</p>
<pre>
parted /dev/sdx
print
resize N
</pre>
<p><a href="http://www.gnu.org/software/parted/">Parted</a> doesn&#8217;t support <a href="http://en.wikipedia.org/wiki/Ext4">ext4</a> (yet?). For an <a href="http://en.wikipedia.org/wiki/Ext4">ext4</a> partition or if <a href="http://www.gnu.org/software/parted/">parted</a> refuses to resize your <a href="http://en.wikipedia.org/wiki/Ext3">ext3</a> partition (<code>Error: File system has an incompatible feature enabled.</code>), use <a href="http://en.wikipedia.org/wiki/E2fsprogs">resize2fs</a>:</p>
<p>To extend:</p>
<pre>
cfdisk /dev/sdx
# delete the partition and create it again with the desired size
resize2fs /dev/sdxY
</pre>
<p>Without giving any size, <a href="http://fr.wikipedia.org/wiki/E2fsprogs">resize2fs</a> extends the filesystem to the partition&#8217;s size.</p>
<p>To shrink, it&#8217;s almost as simple:</p>
<pre>
# example if you want a 10G partition
# resize filesystem with a size smaller than the desired size
resize2fs /dev/sdxY 9G
cfdisk /dev/sdx
# delete the partition and create it again with the desired size
# (a little bigger than the filesystem!!)
# then launch resize2fs again
resize2fs /dev/sdxY
</pre>
<p>Doing so we get the good partition size without loosing any space.</p>
<p>Notes:</p>
<ul>
<li>If your partition is over <a href="http://en.wikipedia.org/wiki/LVM">LVM</a>, you can use the <code>lvresize</code> or <code>lvextend</code> or <code>lvreduce</code> commands to resize the partition, instead of deleting/creating the partition with <a href="http://en.wikipedia.org/wiki/Cfdisk">cfdisk</a>.</li>
<li>The method also works for other filesystems like <a href="http://en.wikipedia.org/wiki/NTFS">NTFS</a>. For <a href="http://fr.wikipedia.org/wiki/NTFS">NTFS</a>, you will use the <a href="http://www.linux-ntfs.org/doku.php?id=ntfsresize">ntfsresize</a> command, or <a href="http://www.gnu.org/software/parted/">parted</a> if it works.</li>
</ul>
<p><ins>Links</ins> :</p>
<ul>
<li><code>man resize2fs</code></li>
<li><a href="http://www.gnu.org/software/parted/manual/parted.html" title="http://www.gnu.org/software/parted/manual/parted.html">http://www.gnu.org/software/parted/manual/parted.html</a></li>
<li><a href="http://ext4.wiki.kernel.org/" title="http://ext4.wiki.kernel.org/">http://ext4.wiki.kernel.org/</a></li>
<li><a href="http://ext4.wiki.kernel.org/index.php/Frequently_Asked_Questions#How_to_online_resize_the_Ext4_filesystem.3F" title="http://ext4.wiki.kernel.org/index.php/Frequently_Asked_Questions#How_to_online_resize_the_Ext4_filesystem.3F">http://ext4.wiki.kernel.org/index.php/Frequently_Asked_Questions#How_to_online_resize_the_Ext4_filesystem.3F</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://positon.org/resize-an-ext3-ext4-partition/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
