📜 ⬆️ ⬇️

ext3cow file system

ext3cow recently caught the eye of an interesting file system - ext3cow . I decided to make a small review. The ext3cow file system implements an additonal function to ext3 functionality - a time shift.

Those. This is some combination of the version control system and the file system. This is what the documentation says:
In time-shifting, it gives a continuous view of time. You can specify the name of any point in time, for example. The time-shifting interface allows you to create snapshots and access versions. Applications may need to coordinate snapshots with application state. User-space tools are suitable for automation, using software as simple as cron.

One of the features of the system is its versatility - the section can be enabled without changes in the kernel, only by dynamically loading the module. This is possible from the file system structure.

how it works from the user:

the user at a certain point in time who wished to backup the file / s executes the command
[user@host]: snapshot
Snapshot on . 1067992521

(with or without parameter — specific file or all files)
')
This command creates on the disk a version of the data that is currently relevant (the date is returned in the Unix-era format). This is called the epoch snapshot .
Further changes to the file can also be saved and will be saved in another epoch (which is remarkable - file changes are not saved within one epoch, i.e. backup at will, but based on ext3 capabilities - no more than 1 snapshot per second This is a significant difference between this file system and version control systems (subversion, for example).
Reading a file of a certain era looks like this:
[user@host]: cat somefile@1067992521

You can view a list of epochs in which there are versions of a specific file using the command
[user@host]: ls file@

Those. as if on the file system, all versions of the file are stored under the names file @ TIME , which is quite correct from the point of view of the file system model in the kernel.
Because interesting things are possible -
It should be noted that backup versions are immutable and read-only.
the operating system (page cache) looks at one file, all backup copies of which are created only on the disk.

how it works from the inside:
The main difference between ext3cow and ext3 is an increase in the amount of meta-information in i-nodes (offtop: oh, remembering Simonenko and the third retake :)). Quote:
ext3cow doesn’t need to be replaced by the Linux model, therefore it’s possible to integrate data structures or interfaces. Modi fi cations are limited to on-disk metadata and the in-memory fi le system speci fi c fi elds of the VFS metadata. Ext3cow adds directory entries, directory entries, and scrolling inheritance.

Further:
Both on-disk and in-memory inodes were recited to support snapshot and an inode epoch number , a copy-on-write bitmap , and an e-mail reference point.

Those. file versions is a linked list of i-nodes whose head is the latest version of the file. Each of which contains the era number, the copy-on-write bit mask (by the way, cow probably went from here :)) and a link to the next i-node with the next version.

Details on each item:

Here it is. The structure is quite simple and clear (the author has received a PhD on it).

By use. They say the system is quite stable and can be used right now, although in the current implementation there are a lot of TO-DO and sometimes there is not enough essential functionality ( bugs and todos ). Quote:
Since June 2003, the authors have been running. It is beyond the regulatory framework for which it is designed; for several research projects.

There shouldn't be any problems with speed either - there is a comparative test with ext3 in the documentation, so ext3cow loses by 5-6 ms on two or three types of tests, which is already impressive.

Wait a bit and you can do sections and test. if, of course, such file system functionality is in demand :)

by-the-way. I wonder how the well-known new TimeMachine Apple is implemented. program magazine?

Well, in the end, of course:
The GNU Public License is ext3cow. It is available for download at http://www.ext3cow.com .

Source: https://habr.com/ru/post/27056/


All Articles