Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Aug 2010 07:16:49 +0200
From:      Polytropon <freebsd@edvax.de>
To:        EforeZZ <eforezz@gmail.com>
Cc:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: How to restore a text file from UFS??
Message-ID:  <20100820071649.2452b734.freebsd@edvax.de>
In-Reply-To: <AANLkTi=vNyd=4sM=EgYpqzzBv-CQA=SuZRhu6YzxvCX5@mail.gmail.com>
References:  <AANLkTi=vNyd=4sM=EgYpqzzBv-CQA=SuZRhu6YzxvCX5@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 19 Aug 2010 21:07:51 +0300, EforeZZ <eforezz@gmail.com> wrote:
> I edited my 50Kb /etc/rc.conf, loaded a driver and.... got a kernel panic!!
> After reboot my /etc/rc.conf is 0 bytes (after automatic background fsck).

I don't trust background fsck. Better wait 30 minutes for system to
come up cleanly, instead of racing at full spead into data loss...

You have already gotten good advices in how to recover data: /lost+found
in best case, TSK in worst case. In my "recovery career", I made
good experiences with The Sleuth Kit. If you have installed it, have
a look at /usr/local/share/doc/sleuthkit/ref_fs.txt which gives some
insight on how to recover lost files; it is very interesting and
helpful.



> Which tool should I try now to restore any version of my rc.conf?..

Personally, I use cvs (comes with base system) to keep track of
changes in my config files. In case I accidentally delete a file,
I can simply check it out of the repository, in its current version
as well as in previous versions. CVS is similar to RCS.

I also make a copy of current files of /etc in root's home directory,
which is /root (usually on /).



> I think data should still be somewhere on the disk....

As long as it hasn't been overwritten, it will be there, and usually
will be accessible by simple or complicated means.



If everything fails, maybe you can use a rc.conf of another system
of yours to re-create the original file's contents? Or use the
defaults at /etc/defaults/rc.conf as a template.


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100820071649.2452b734.freebsd>