08-14-2018, 04:02 AM
Convert file systems with Fstransform
<div style="margin: 5px 5% 10px 5%;"><img src="http://www.sickgaming.net/blog/wp-content/uploads/2018/08/convert-file-systems-with-fstransform.png" width="871" height="537" title="" alt="" /></div><div><p>Few people know that they can convert their filesystems from one type to another without losing data, i.e. non-destructively. It may sound like magic, but <a href="https://github.com/cosmos72/fstransform">Fstransform</a> can convert an ext2, ext3, ext4, jfs, reiserfs or xfs partition to another type from the list in almost any combination. <span id="more-22143"></span>More importantly, it does so in-place, without formatting or copying data anywhere. Atop of all this goodness, there is a little bonus: Fstransform can also handle ntfs, btrfs, fat and exfat partitions as well.</p>
<h2>Before you run it</h2>
<p>There are certain caveats and limitations in Fstransform, so it is strongly advised to back up before attempting a conversion. Additionally, there are some limitations to be aware of when using Fstransform:</p>
<ul>
<li>Both the source and target filesystems must be supported by your Linux kernel. Sounds like an obvious thing and exposes zero risk in case you want to use ext2, ext3, ext4, reiserfs, jfs and xfs partitions. Fedora supports all of that just fine.</li>
<li>Upgrading ext2 to ext3 or ext4 does not require Fstransform. Use the Tune2fs utility instead.</li>
<li>The device with source file system must have at least 5% of free space.</li>
<li>You need to be able to unmount the source filesystem before you begin.</li>
<li>The more data your source file system stores, the longer the conversion will last. The actual speed depends on your device, but expect it to be around one gigabyte per minute. The large amount of hard links can also slow down the conversion.</li>
<li>Although Fstransform is proved to be stable, please back up data on your source filesystem.</li>
</ul>
<h2>Installation instructions</h2>
<p>Fstransform is already a part of Fedora. Install with the command:</p>
<pre>sudo dnf install fstransform</pre>
<h2>Time to convert something</h2>
<div id="attachment_22190" style="width: 881px" class="wp-caption aligncenter"><img class="size-full wp-image-22190" src="http://www.sickgaming.net/blog/wp-content/uploads/2018/08/convert-file-systems-with-fstransform.png" alt="" width="871" height="537" /></p>
<p class="wp-caption-text">Converting one file system to another in-place can take a while</p>
</div>
<p>The syntax of the <em>fstransform</em> command is very simple: <em>fstransform <source device> <target file system></em>. Keep in mind that it needs root privileges to run, so don’t forget to add <em>sudo</em> in the beginning. Here goes an example:</p>
<pre>sudo fstransform /dev/sdb1 ext4</pre>
<p>Note that it is not possible to convert a root file system, which is a security measure. Use a test partition or an experimental thumb drive instead. In the meantime, Fstransform will through a lot of auxiliary output in the console. The most useful part is the estimated time of completion, which keep you informed about how long the process will take. Again, few small files on an almost empty drive will make Fstransform do its job in a minute or so, whereas more real-world tasks may involve hours of wait time.</p>
<h2>More file systems are supported</h2>
<p>As mentioned above, it is possible to try Fstransform with ntfs, btrfs, fat and exfat partitions. These types are very experimental, and nobody can guarantee that the converion will flow perfect. Still, there are many success stories, and you can add your own by testing Fstransform with a sample data set on a test partition. Those additional file systems can be enabled by the use of the<em> –force-untested-file-systems</em> parameter:</p>
<pre>sudo fstransform /dev/sdb1 ntfs --force-untested-file-systems</pre>
<p>Sometimes the process may iterrupt with an error. Feel free to repeat the command <em>again</em> — it may eventually complete the conversion from second or third attempt.</p>
</div>
<div style="margin: 5px 5% 10px 5%;"><img src="http://www.sickgaming.net/blog/wp-content/uploads/2018/08/convert-file-systems-with-fstransform.png" width="871" height="537" title="" alt="" /></div><div><p>Few people know that they can convert their filesystems from one type to another without losing data, i.e. non-destructively. It may sound like magic, but <a href="https://github.com/cosmos72/fstransform">Fstransform</a> can convert an ext2, ext3, ext4, jfs, reiserfs or xfs partition to another type from the list in almost any combination. <span id="more-22143"></span>More importantly, it does so in-place, without formatting or copying data anywhere. Atop of all this goodness, there is a little bonus: Fstransform can also handle ntfs, btrfs, fat and exfat partitions as well.</p>
<h2>Before you run it</h2>
<p>There are certain caveats and limitations in Fstransform, so it is strongly advised to back up before attempting a conversion. Additionally, there are some limitations to be aware of when using Fstransform:</p>
<ul>
<li>Both the source and target filesystems must be supported by your Linux kernel. Sounds like an obvious thing and exposes zero risk in case you want to use ext2, ext3, ext4, reiserfs, jfs and xfs partitions. Fedora supports all of that just fine.</li>
<li>Upgrading ext2 to ext3 or ext4 does not require Fstransform. Use the Tune2fs utility instead.</li>
<li>The device with source file system must have at least 5% of free space.</li>
<li>You need to be able to unmount the source filesystem before you begin.</li>
<li>The more data your source file system stores, the longer the conversion will last. The actual speed depends on your device, but expect it to be around one gigabyte per minute. The large amount of hard links can also slow down the conversion.</li>
<li>Although Fstransform is proved to be stable, please back up data on your source filesystem.</li>
</ul>
<h2>Installation instructions</h2>
<p>Fstransform is already a part of Fedora. Install with the command:</p>
<pre>sudo dnf install fstransform</pre>
<h2>Time to convert something</h2>
<div id="attachment_22190" style="width: 881px" class="wp-caption aligncenter"><img class="size-full wp-image-22190" src="http://www.sickgaming.net/blog/wp-content/uploads/2018/08/convert-file-systems-with-fstransform.png" alt="" width="871" height="537" /></p>
<p class="wp-caption-text">Converting one file system to another in-place can take a while</p>
</div>
<p>The syntax of the <em>fstransform</em> command is very simple: <em>fstransform <source device> <target file system></em>. Keep in mind that it needs root privileges to run, so don’t forget to add <em>sudo</em> in the beginning. Here goes an example:</p>
<pre>sudo fstransform /dev/sdb1 ext4</pre>
<p>Note that it is not possible to convert a root file system, which is a security measure. Use a test partition or an experimental thumb drive instead. In the meantime, Fstransform will through a lot of auxiliary output in the console. The most useful part is the estimated time of completion, which keep you informed about how long the process will take. Again, few small files on an almost empty drive will make Fstransform do its job in a minute or so, whereas more real-world tasks may involve hours of wait time.</p>
<h2>More file systems are supported</h2>
<p>As mentioned above, it is possible to try Fstransform with ntfs, btrfs, fat and exfat partitions. These types are very experimental, and nobody can guarantee that the converion will flow perfect. Still, there are many success stories, and you can add your own by testing Fstransform with a sample data set on a test partition. Those additional file systems can be enabled by the use of the<em> –force-untested-file-systems</em> parameter:</p>
<pre>sudo fstransform /dev/sdb1 ntfs --force-untested-file-systems</pre>
<p>Sometimes the process may iterrupt with an error. Feel free to repeat the command <em>again</em> — it may eventually complete the conversion from second or third attempt.</p>
</div>