Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Mar 2011 22:00:26 +1100
From:      Peter Jeremy <peterjeremy@acm.org>
To:        Anders Andersson <pipatron@gmail.com>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: Recover a ufs2 filesystem from a reformat with another ufs2 filesystem
Message-ID:  <20110328110026.GA96624@server.vk2pj.dyndns.org>
In-Reply-To: <AANLkTimBjjCjvtwh08NOEHBEppO0QP8nHbMBLzKE_Hap@mail.gmail.com>
References:  <AANLkTikSTgcsVnjRuF2Un4oBXfYaYy0r_o%2BgKzcRmkrX@mail.gmail.com> <ij9td4$8dh$1@dough.gmane.org> <AANLkTimBjjCjvtwh08NOEHBEppO0QP8nHbMBLzKE_Hap@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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

On 2011-Mar-26 15:27:09 +0100, Anders Andersson <pipatron@gmail.com> wrote:
>Perhaps it would be beneficial if some of this information was spread
>out at random for recover purpose, although I don't know what bad side
>effects this would create.

Well, the backup superblocks have to be at known locations so that
fsck and/or the user can find them.  Traditionally, they were offset
by a track more than an integral number of cylinders so the loss of an
entire platter wouldn't destroy all superblocks - the code still does
this but CHS values are no longer meaningful.  Much of the UFS code
works on the assumption that cylinder groups and inodes are located
at regular locations through the disk so they can be located using
simple arithmetic - check out the various macros in <ufs/ffs/fs.h>.

About the best you can do is to build your filesystems with non-default
parameters so that if you accidently newfs it with default parameters,
it won't overwrite all the superblock copies.  Of course, it will write
superblocks all over your data.

OTOH, since UFS2 doesn't pre-allocate inodes, if you newfs with the
same parameters, you have destroyed the CG-level metadata but the
majority of the inodes and all of the data will remain untouched.
They can't be recovered by fsck but a custom process that looked at
all the potential inodes associated with a cylinder group would
find most of the files.

--=20
Peter Jeremy

--cWoXeonUoKmBZSoM
Content-Type: application/pgp-signature

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

iEYEARECAAYFAk2QakoACgkQ/opHv/APuIfa1QCgpOT42OneHllPLO5I8m8uEBmJ
8iEAoJXP/y3SZRAHpHQY/0GdeF3FA7x5
=Puup
-----END PGP SIGNATURE-----

--cWoXeonUoKmBZSoM--



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