Ext3cow file system explained

April 02, 2007
ext3cow file system for GNU/LinuxGNU/Linux supports numerous file systems, some of them that come to my mind being ext2, ext3, xfs, jfs, vfat, ufs and so on. Here is another file system to add to this diverse collection. And the name of the new file system (which is still in heavy development) is ext3cow.

So how is ext3cow different from ext3 file system which we are most well versed with ? Ext3cow file system supports all the features of ext3 file system which include journaling. But other than that, it also has support for version control.

And to put it in layman terms, if you have formatted your hard disk with ext3cow file system, you will never lose a file - even when you overwrite it. What is more, you can go back in time and retrieve an older version of your files because this file system saves a snapshot of your files in any given time - which is what versioning is all about.

Let's look at a simple example. Suppose I have formatted my hard disk running Linux with the ext3cow file system. And I have created a file by name test.txt as follows :
$ cat "This is a test" > test.txt
$ snapshot
Snapshot on :. 10452736
The 'snapshot' command takes a snapshot of the disk. And then I overwrite the same file by entering some other text as follows :
$ cat "This is overwritten text" > test.txt
Now the file 'test.txt' contain the new sentence as is shown by the cat command.
$ cat test.txt
This is overwritten text
But as I have saved the file in an ext3cow file system, the original text is not lost and can be listed and retrieved as follows :
$ cat test.txt@10452736
This is a test
Where the number 10452736 is the unique snapshot number which we received when we executed the 'snapshot' command, which by the way is ideally run by the system at regular intervals.

And if you now cat the 'test.txt' file, you will find that it displays the latest changes. So the primary advantage of ext3cow file system over other file systems is that it is possible to take a snapshot of the disk at any given time and thus safeguard data.

Advantages of ext3cow file system
  • Version control of all your files.
  • Journaling support like in ext3.
  • You can access past directories in the same way you access past files.
  • ext3cow performance is at par with that of ext3
Drawbacks of ext3cow file system
  • There will be a slight increase in the meta data required to support versioning - in between 5% and 15%. So ext3cow file system will take up a bit more space on disk than ext3.
  • Currently there is no mechanism to delete a file in the past but this is an ongoing project and this feature might get included in future versions of the file system.
  • Taking snapshots are not automatic and will require the user to execute the 'snapshot' command.
  • The project is still in experimental stage but work is going on at a fast pace.
You may download and install the tools to create this file system at the ext3cow official site as well as take a look at a couple of ext3cow tools maintained by Tim. If you are interested in a unique project to provide a GUI interface to manipulate the files in the past, then check out the Time Traveling File Manager [Link].