Date: Tue, 28 May 1996 10:19:39 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: ost@comnets.rwth-aachen.de Cc: freebsd-questions@freebsd.org Subject: Re: Ist there a way to easily reconstruct partition/slice tables? Message-ID: <199605281719.KAA11319@phaeton.artisoft.com> In-Reply-To: <199605280810.KAA23103@smeagol.comnets.rwth-aachen.de> from "Martin Ostermann" at May 28, 96 10:10:36 am
next in thread | previous in thread | raw e-mail | index | archive | help
> last night I cleared the first few blocks on my FreeBSD disk. It had > nothing particular important on it, which wasn't backup'd, but > contained some configuration data that would take me a while to > restore. > > Is it possible to automatically identify the beginning and endings of > the UFS file systems, and thus construct a new partition table or > label? It doesn't need to be perfect, just enough to copy the relevant > information. In /usr/src/sys/ufs/ffs/fs.h: #define FS_MAGIC 0x011954 /* the fast filesystem magic number */ 1) Look for this value (McKusick's birthday 8-)) as a longword value. At the offset you find the value, minus: ((int)&((struct fs *)0)->d_magic) You will find the start of the superblock for the FS. Look at the first one of these minus 8k minus the size of the disklabel for the start of the partition (assuming reserved space for boot blocks). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605281719.KAA11319>