Skip to contentSkip to conversation

vfs level undelete support?

DISCUSSION Shaya Potter 2 participants 3 messages Apr 8, 2003

lore
Share & tools
lore
#0 lore raw

Would there be any interest in a patch that added undelete support to the VFS. the idea would be that when one unlink's a file, instead of it being deleted, it is "moved" to "/.undelete/d_put path of dentry", coupled with a daemon that manages the size (maintains a quota per uid by deleting old files).

It would appear to be an easy CONFIG level option, as it would just be do this, or normal unlink(), and would work for every fs, as well as not needing and LD_PRELOAD.

It seems pretty simple to hack up, just wondering if there's any interest?

thanks,

shaya

#1 lore raw
Quoted 9 lines · Shaya Potter

Would there be any interest in a patch that added undelete support to the VFS. the idea would be that when one unlink's a file, instead of it being deleted, it is "moved" to "/.undelete/d_put path of dentry", coupled with a daemon that manages the size (maintains a quota per uid by deleting old files).

It would appear to be an easy CONFIG level option, as it would just be do this, or normal unlink(), and would work for every fs, as well as not needing and LD_PRELOAD.

This has been implemented as a shared library which you can preload. It is a wrapper around glibc's unlink() function which moves stuff to a trash directory. This is probably better done this way in user space because it allows the user quite a lot of freedom to decide which files get saved.

http://m-arriaga.net/software/libtrash/

Signature · 3 lines
Regards,
David Parrish
0410 586 121
#2 lore raw
Quoted 8 lines · David Parrish
Quoted 6 lines · Shaya Potter

Would there be any interest in a patch that added undelete support to the VFS. the idea would be that when one unlink's a file, instead of it being deleted, it is "moved" to "/.undelete/d_put path of dentry", coupled with a daemon that manages the size (maintains a quota per uid by deleting old files).

Quoted 8 lines
Quoted 3 lines

It would appear to be an easy CONFIG level option, as it would just be do this, or normal unlink(), and would work for every fs, as well as not needing and LD_PRELOAD.

This has been implemented as a shared library which you can preload. It is a wrapper around glibc's unlink() function which moves stuff to a trash directory. This is probably better done this way in user space because it allows the user quite a lot of freedom to decide which files get saved.

except it doesn't work w/ statically linked or non glibc linked binaries, hence really isn't a complete solution. could be good enough though.