Slashdot Mirror


Filesystems with Transactions?

Bryan Andersen asks: "I'm looking for a filesystem that I can rollback all the changes made by a user to a given date/time. Are there any for Linux or *BSD, or is my only option to go to one of the NAS vendors? I want this so I can more easily cleanup after users trash all the files they can access. Yes I know this would mean I'd have to have much larger partition sizes, but I feel with disk prices the way they are I can't go wrong doing this." I'm not aware of any filesystems that can specifically do this, and I'm not quite up on my JFS knowledge to know if any of those can be adapted to this task without code changes. It would seem like the easiest way to do this would be to mirror the drives at set times (your "commit") and then a "rollback" would be a simple matter of restoring from those images. Of course, there may be just such a file system in the works that I simply haven't heard about yet. Have you?

3 of 13 comments (clear)

  1. somewhat unrelated, but... by Anonymous Coward · · Score: 2, Informative
    I once wanted to have the same convenience, because I tended to do bad things to my own files.


    What I did is have my computer backup every text file in my home directory (other than a list of patterns to exclude) using cvs, every 3 hours. This did not take up much space, because cvs only backs up the changes to a file.
    Every time I did a full backup, I backed up everything including the CVS directory, and then emptied that directory.


    It was really easy to set up, and I can dig up the script if anyone is interested.

  2. Network Appliance by KyleCordes · · Score: 3, Informative

    Network Appliance, vendor of Network Attached Storage, has (or at least had when I looked) a feature close to this. They use a proprietary filesystem on their NAS boxes, which allows them to do unusial things.

    A place where this in quite clever is for stable, snapshot views of the filesystem for the backpup software to look at, while applications continue to use it.

  3. Union mounts by TrumpetPower! · · Score: 4, Informative

    I'm surprised nobody's yet mentioned union mounts, at least available in OpenBSD and FreeBSD.

    The classical use for a union filesystem is to make a CD-ROM appear to be read-write. You mount the CD and then mount another partion on top of it with the union option. Any changes are made to the union-mounted partition.

    The underlying filesystem doesn't have to be a CD-ROM, of course. Your problem could be quite easily solved with three disk partitions: two large enough to hold everything, and one large enough to hold the changes.

    Start by mounting one of the large partitions and then union mounting the smaller one on top of it. If you need to roll back, simply unmount and newfs the union partition. When you want to commit, assume that wd1c and wd2c are your large partitions and wd3c is your small partition and do something like:

    # newfs wd2c
    # mount /dev/wd2c /mnt
    # cd /home/rollback
    # find . -print | cpio -pmvd /mnt
    # cd /
    # umount /dev/wd3c /dev/wd2c /dev/wd1c
    # mount /dev/wd2c /home/rollback
    # newfs /dev/wd3c
    # mount -o union /dev/wd3c /home/rollback

    As an added bonus, the union-mounted filesystem can be mounted normally later and you only see the modified files.

    Of course, if you're working with really large filesystems and time is critical, this is likely to be too slow for you.

    b&

    --
    All but God can prove this sentence true.