Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a requirement to give a user access to an NFS share on which they may place some files, and then delete the files. Assume they are rogue and may try to really delete the files (I'm not sure if shred works via NFS but whatever is the equivalent). We don't want them to realise the NFS share has been changed (it's their home directory).

Yeah... strange requirement I know!

Is there a filesystem or setting on NFS so it appears like the user is deleting files while really they are being stored? I was told this was a revisioning file system but I could not find many references to that.

I'm aware you can "undelete" on ext3 and similar by using recovery programs but we would like something more robust than that, ideally something that stores all copies of files in some easily accessible form.

Using CentOS 5.8 . User can't delete their files because they are "rogue" and no longer trusted (it's complicated, and that's all I know).

share|improve this question
Not really a strange requirement, but without more context it's hard to recommend the "best" solution. Why must users be prevented from deleting their own files? – Michael Hampton Mar 11 '13 at 8:27
The user is rogue and may upload files then delete them for political reasons. That's all I know sorry! – hellomynameisjoel Mar 11 '13 at 8:38
I really hate it when they don't give you enough information to do your job. – Michael Hampton Mar 11 '13 at 8:38
up vote 2 down vote accepted

Versioning File System

NILFS does auto and continuous snapshots, so it can keep track of modified and deleted files. Version 2 (aka NILFS2) has also a neat garbage collection mechanism to avoid that the file system gets full with too many snapshots! I would definitively look at that solution!

A search on Wikipedia also returned ext3cow which does copy-on-write at block level and can keep tracks of file versions.

Both solution have been around for a while now, but I cannot speak for their maturity in an enterprise environment as I have no experience with them.

Another approach

One could simply use an incremental backup system, a sort of rsync that keeps the NFS share in a different places, but that can also restore deleted files.

Such a solution is not bullet proof and requires extra storage, so it might not fit your requirements or budget. In addition, this solution would run on a periodical basis, so each file created and deleted between to backup session would be definitively lost.

If these limitations fit still the bill, then have a look at rdiff-backup. It is a command line tool and will do the job properly and easily.

Perhaps, having both approach could prove safer.

share|improve this answer
Thanks I think your right the rdiff-backup is probably the simplest here. A special filesystem is probably overkill. – hellomynameisjoel Mar 11 '13 at 11:38

I do not know about NFS, but you definitely can do this using CIFS. There is samba module called vfs_recycle. When it's on, every deleted file actually moves to dir you've stated in config. You can also include veto files directive and state the recycle dir so users couldn't see the recycle.

share|improve this answer

There's always the option of ZFS on Linux and taking periodic snapshots of the filesystem exports. An example of an auto-snapshot service for the Linux variant of ZFS. ZFS snapshots show up by default in a subdirectory of the filesystem share under (an invisible) .zfs/snapshot/ tree in a manner that's transparent to the user.

share|improve this answer

If you use ext* filesystem, you can use attributes to get the behavior you want. You could either use immutable flag (if you enable it, no action can be done at that file) or 'u' flag (When file is deleted, its contents are saved. This allows the user to ask for its undeletion.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.