How to restore a text file from UFS??

Bruce Cran bruce at cran.org.uk
Sun Aug 22 14:14:46 UTC 2010


On Thu, 19 Aug 2010 22:17:00 +0200
Roland Smith <rsmith at xs4all.nl> wrote:

> For future reference; you should never edit files in /etc/ directly.
> If you want ot edit files in /etc or /usr/local/etc, first copy them
> to a directory in your $HOME, put them under revision control and
> then edit them and copy the edited files to /etc. That way you always
> have a backup and you can even restore previous versions. I've
> documented the procedure I use on my webpage;
> http://www.xs4all.nl/~rsmith/unix/configfiles.html

This failure, where files are truncated to 0 bytes after an unclean
shutdown isn't the same way ext4 was truncating files when using editors
which overwrite files in-place (as opposed to writing to a temporary
file then renaming) is it?  Does calling fsync on FreeBSD not ensure
that even with SoftUpdates the data is on the disk before the editor
has exited?

-- 
Bruce Cran


More information about the freebsd-questions mailing list