How a file is deleted in ufs2?

Oliver Fromme olli at lurza.secnetix.de
Wed Apr 12 13:40:56 UTC 2006


Scott Long <scottl at samsco.org> wrote:
 > [...]  IOW, there is no easy way to undelete a file.

This isn't directly related to the question, but snapshots
are very handy to "undelete" files.  Just set up a cronjob
that creates (and rotates) hourly and daily snapshots.
When a user accidentally deletes a file, he can just copy
it back from the latest snapshot where the file still
exists.  The best thing is that no admin intervention is
required, no backup media have to be shuffled etc. [*]
You could even make an "undelete" alias (or script) which
copies files back from the snapshot.

(I've seen setups where the admins replaced rm(1) with a
script that moved the files to a "wastebasket" directory,
which appeared to me as a gross hack.  Using snapshots
as described above is a much better solution and more
efficient.)

Best regards
   Oliver

[*]  Of course, it doesn't replace a real backup (if you
lose the disk, you lose all data including all snapshots).

-- 
Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"FreeBSD is Yoda, Linux is Luke Skywalker"
        -- Daniel C. Sobral


More information about the freebsd-fs mailing list