Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Aug 2010 22:17:00 +0200
From:      Roland Smith <rsmith@xs4all.nl>
To:        EforeZZ <eforezz@gmail.com>
Cc:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: How to restore a text file from UFS??
Message-ID:  <20100819201700.GC33689@slackbox.erewhon.net>
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

--Sr1nOIr3CvdE5hEN
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Aug 19, 2010 at 09:07:51PM +0300, EforeZZ 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).
> Which tool should I try now to restore any version of my rc.conf?..

The programs from sysutils/sleuthkit might help.

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

That depends on if the partition where /etc/rc.conf is located is read/write
or read-only. In the latter case you are correct. In the former case part or
all of the sectors could have been re-used for other files.

For the best chance at recovery, make your root partition read-only _now_.

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 webpag=
e;
http://www.xs4all.nl/~rsmith/unix/configfiles.html

Roland
--=20
R.F.Smith                                   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)

--Sr1nOIr3CvdE5hEN
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (FreeBSD)

iEYEARECAAYFAkxtkTwACgkQEnfvsMMhpyW3FACgoVf7+N+iXiYnxDKfGHMzmBxv
+z4AnjwqRqaYMybMGpGlI2cJTKY+mSgJ
=MMIu
-----END PGP SIGNATURE-----

--Sr1nOIr3CvdE5hEN--



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