Converting NTFS to ZFS (or other)

7,149

Solution 1

In general: no, you cannot convert from one filesystem type to another.

In practice you can, but the two filesystem types have to be very closely related. For example, ext2 to ext3 is possible, and you can in fact mount ext3 as ext2 if you have to. This is because ext3 is basically ext2 with journalling, but apart from that the on-disk structures are essentially the same.

Specifically: the only way I know of to go from NTFS to $(not NTFS) is to back up the partition and reformat, then restore. If you have enough free disk space you might be able to shrink the partition, create a new one in the free space, copy, then delete the original, then grow the new one. This is all theoretically possible but can fail in exciting data-destroying ways.

I'm curious about your use of NTFS under linux. Is this because you are expecting to use the same partition under a Windows flavor that speaks it? If not... what's the point?

As far as ZFS goes, I'd personally wait before playing with it on Linux a while yet. Of course, I'm hideously conservative. On the other hand, you appear happy with NTFS under linux, and I'd rate that about the same risk.

The reason for my caution is because both NTFS and ZFS are filesystems which were invented elsewhere. While NTFS has been around a long time, Microsoft has fiddled with it and the last time I looked at NTFS support the read/write support was "usually works but good luck to you anyways". ZFS is a little more open, being in OpenSolaris and all, but it still isn't invented by the authors of the Linux support so whenever there is a problem they get to wonder if it's a flaw in the original specification or a flaw in their implementation. ZFS is neat, no question about it, but my impression is that the Linux support isn't quite there yet.

Solution 2

You can convert NTFS to ext with anyfs-tools, and ext to btrfs via btrfs-convert.

Share:
7,149

Related videos on Youtube

NumberFour
Author by

NumberFour

I write code.

Updated on September 17, 2022

Comments

  • NumberFour
    NumberFour over 1 year

    Are there any benefits of converting HDDs that are running NTFS on a Linux machine to ZFS? Is there a way to do such conversion in Linux without losing the data?

    What about the stability of ZFS on Linux, does FUSE really work well in this case? People say that the only way to get the real full ZFS support is to install Solaris.

    I understand that the best choice for Linux would be ext4, but I really havent found a way how to convert to ext4 from NTFS without sacrificing all the data. On the other hand I have doubts whether changing from NTFS to ZFS while using Linux is really wise.

    Thanks for any tips.

    • Philip
      Philip almost 14 years
      What is using the data? Windows clients, Linux clients, etc? You're likely in the best shape keeping it as is (especially if it ain't broke, don't fix it).
    • NumberFour
      NumberFour almost 14 years
      This drive is mainly used by Samba server as data storage - yes, Windows clients get data from it, but since it all goes through Samba there's really no benefit of having it in NTFS I guess.
    • mveroone
      mveroone over 10 years
      Why not have a look at OpenZFS or zfsonlinux which are non-FUSE ports of ZFS into linux ?
  • NumberFour
    NumberFour almost 14 years
    Ok, so going ext4 would always be the best way. The reason Im using NTFS is because this drive was previously in a Windows machine and because it was filled with data I just took the drive and put it into the Linux machine with hope that it'll work just fine (and it works, but no one knows for how long, so thats why I wanted to go with another FS - I had no idea whether ZFS would be more stable in Linux than NTFS)