{"id":1331,"date":"2012-09-05T15:53:31","date_gmt":"2012-09-05T07:53:31","guid":{"rendered":"http:\/\/rmohan.com\/?p=1331"},"modified":"2012-09-05T16:12:06","modified_gmt":"2012-09-05T08:12:06","slug":"converting-partitions-from-ext3-to-ext4","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=1331","title":{"rendered":"Converting partitions from ext3 to ext4"},"content":{"rendered":"<p>The new features of <em>ext4<\/em> over <em>ext3<\/em> motivated me to migrate my <em>ext3<\/em> partitions to the new file system.\u00a0 If you want to do the same, here\u2019s the steps yo have to follow.<\/p>\n<h2>Converting from ext3 to ext4<\/h2>\n<p><strong>Note:<\/strong> The following commands must be run on not mounted partitions. If you are planning to convert your system root\u2019s partition, do it from a livecd or a system other than yours.<\/p>\n<p>In order to convert a <em>ext3<\/em> partition, let\u2019s say <em>\/dev\/sda5<\/em>, to <em>ext4<\/em> type the following:<\/p>\n<blockquote>\n<pre>tune2fs -O extents,uninit_bg,dir_index \/dev\/sda5<\/pre>\n<\/blockquote>\n<p>After doing the above, run <em>e2fsck<\/em> on the new <em>ext4<\/em> file system to fix any inconsistency:<\/p>\n<blockquote>\n<pre>e2fsck -fD  \/dev\/sda5<\/pre>\n<\/blockquote>\n<h2>The \/etc\/fstab file<\/h2>\n<p>Don\u2019t forget to edit the\u00a0<em>\/etc\/fstab<\/em> file by changing the partitions that will be mounted as <em>ext4<\/em> instead of <em>ext3<\/em>:<\/p>\n<pre># &lt;file system&gt; &lt;mount point&gt;\u00a0\u00a0 &lt;type&gt;\u00a0 &lt;options&gt;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;dump&gt;\u00a0 &lt;pass&gt;\r\nproc\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/proc\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 proc\u00a0\u00a0\u00a0 defaults\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0      0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0\r\n\/dev\/sda6 \u00a0\u00a0 \/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>ext4<\/strong>\u00a0\u00a0\u00a0 errors=remount-ro    0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1\r\n\/dev\/sda5\u00a0\u00a0 \u00a0\/home\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>ext4<\/strong>\u00a0\u00a0\u00a0 defaults\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0      0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2\r\n\/dev\/sda7 \u00a0\u00a0 none\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 swap\u00a0\u00a0\u00a0 sw\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0      0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0\r\n\/dev\/scd0\u00a0\u00a0  \/media\/cdrom0\u00a0\u00a0 udf,iso9660 user,noauto\u00a0\u00a0\u00a0\u00a0  0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<\/pre>\n<p>&nbsp;<\/p>\n<h2>Ext4?s features<\/h2>\n<p>But the way, if you want to know what those new features are, check out the following table:<\/p>\n<table border=\"0\">\n<tbody>\n<tr>\n<td><strong>Feature<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Large file system<\/td>\n<td>Support for volumes up to 1 Exbibyte and files up to 16 tebibytes.<\/td>\n<\/tr>\n<tr>\n<td>Extents<\/td>\n<td>An extent is a range of contiguous physical blocks, improving large file performance and reducing fragmentation<\/td>\n<\/tr>\n<tr>\n<td>Backward compatibility<\/td>\n<td>The ext4 filesystem is backward compatible with ext3 and ext2, making it possible to mount ext3 and ext2 filesystems as ext4<\/td>\n<\/tr>\n<tr>\n<td>Persistent pre-allocation<\/td>\n<td>The space allocated for files would be guaranteed and would likely be contiguous. The full of\u00a0 0?s method is deprecated.<\/td>\n<\/tr>\n<tr>\n<td>Delayed allocation<\/td>\n<td>Ext4 delays block allocation until the data is going to be written to the disk.This improves performance and reduces fragmentation by improving block allocation decisions based on the actual file size.<\/td>\n<\/tr>\n<tr>\n<td>Higher subdirectory limit<\/td>\n<td>The number of subdirectories that a directory can contain was raised to 64,000.<\/td>\n<\/tr>\n<tr>\n<td>Journal checksumming<\/td>\n<td>Checksums in the journal to improve reliability is used, since the journal is one of the most used files of the disk.<\/td>\n<\/tr>\n<tr>\n<td>Faster file system checking<\/td>\n<td>In ext4, unallocated block groups and sections of the inode table are marked as such. This enables e2fsck to skip them entirely on a check and greatly reduces the time it takes to check a file system of the size ext4 is built to support.<\/td>\n<\/tr>\n<tr>\n<td>Multiblock allocator<\/td>\n<td>Ext4 allocates multiple blocks for a file in a single operation, which reduces fragmentation by attempting to choose contiguous blocks on the disk.<\/td>\n<\/tr>\n<tr>\n<td>Improved timestamps<\/td>\n<td>As computers become faster in general and as Linux becomes used more for mission critical applications, the granularity of second-based timestamps becomes insufficient. To solve this, ext4 provides timestamps measured in nanoseconds.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>The new features of ext4 over ext3 motivated me to migrate my ext3 partitions to the new file system. If you want to do the same, here\u2019s the steps yo have to follow.<\/p>\n<p> Converting from ext3 to ext4 <\/p>\n<p>Note: The following commands must be run on not mounted partitions. If you are planning to convert [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1331"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1331"}],"version-history":[{"count":5,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1331\/revisions"}],"predecessor-version":[{"id":1333,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1331\/revisions\/1333"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}