Hi, Somehow[TM] an installation of 4.11 to ad0s3 managed to wipe out my existing disklabel for 7.0 on ad0s4. I now need to recover the disklabel to get my system to boot! There were three labels - ad0s4a: UFS, exact size unknown. Is it possible to infer this from the UFS partition size? I can mount this already, as I simply wrote an 'a' label of maximum size to the disklabel - ad0s4b: GELI encrypted swap - ad0s4d: GELI encrypted ZVOL I only need to find out the start of ad0s4d. Is the consumer size of an GELI device stored in the last 512 bytes metadata? Or are there some magic bytes in this 512 bytes so I could find out the exact end of ad0s4b and thus the start of ad0s4d? Any help or advice would be highly appreciated! Thanks, Uli
On Wed, 06 Feb 2008 21:04:23 +0100 Ulrich Spoerlein <uspoerlein@gmail.com> wrote:> There were three labelsActually, it is one label per slice, unless you are doing something unusual?> - ad0s4a: UFS, exact size unknown. Is it possible to infer this from > the UFS partition size? I can mount this already, as I simply wrote an > 'a' label of maximum size to the disklabel > - ad0s4b: GELI encrypted swap > - ad0s4d: GELI encrypted ZVOLThese are partitions in BSD-speak.> Any help or advice would be highly appreciated!FWIW, I have had success with scan_ffs[1] as documented in this short article[2]. It will recover lost labels, or at least try to. If you are downloading binary packages from somewhere, be sure to double check that you get the one that fits your platform (i386 / amd64 or whatever) and version. Take it slowly, and double check all steps before comitting anything. Good luck! References: 1) http://www.freshports.org/sysutils/scan_ffs/ 2) http://geekinfo.net/article.php?story=20071224175132586 -- Regards, Torfinn Ingolfsen
-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 On Wed, 6 Feb 2008 21:04:23 +0100 "Ulrich Spoerlein" <uspoerlein@gmail.com> wrote:> Hi, > > Somehow[TM] an installation of 4.11 to ad0s3 managed to wipe out my > existing disklabel for 7.0 on ad0s4. I now need to recover the > disklabel to get my system to boot! > > There were three labels > - ad0s4a: UFS, exact size unknown. Is it possible to infer this from > the UFS partition size? I can mount this already, as I simply wrote an > 'a' label of maximum size to the disklabel > - ad0s4b: GELI encrypted swap > - ad0s4d: GELI encrypted ZVOL > > I only need to find out the start of ad0s4d. Is the consumer size of > an GELI device stored in the last 512 bytes metadata? Or are there > some magic bytes in this 512 bytes so I could find out the exact end > of ad0s4b and thus the start of ad0s4d?Hi Ulrich, Try to scan that disk with sysutils/testdisk: http://www.cgsecurity.org/wiki/TestDisk Best regards. - -- Nikola Le?i? = ?????? ????? fingerprint : FEF3 66AF C90E EDC3 D878 7CDC 956D F4AB A377 1C9B -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iQCVAwUBR6pJVfzDP9K2CKGYAQMrxAP9Fxng2ZaHmgB5ID6ZTVfOwNTTDrzPNlMX FRlOIKnksldTzhUdk0UfsJP9kgYpEInz6gQ3unSlUSBDTgN9jSW6yQGM0fW4hZ3H 27Ge5frdzETXg91TRsx1aP24i3SezNHO0AYLQw9cbD7ftDVHH1yzkmZrxSP7kYJ/ YPge/g7YRKI=h/6V -----END PGP SIGNATURE-----
On Thu, 07 Feb 2008 01:05:02 +0100 Torfinn Ingolfsen <torfinn.ingolfsen@broadpark.no> wrote:> Take it slowly, and double check all steps before comitting anything.depending on how valuable your data is, you may want to test any changes first (or at least make a backup of the raw disk...) I would try to do a raw dump of the data into a file (using dd) and mount this as a md device . Then play to your hearts contents getting the data back.... once u have done that, u can either start from scratch on the original disk and dump the data back into it from the image, or repeat the steps on the real disk [tm]. good luck! B _________________________ {Beto|Norberto|Numard} Meijome "Everything is interesting if you go into it deeply enough" Richard Feynman I speak for myself, not my employer. Contents may be hot. Slippery when wet. Reading disclaimers makes you go blind. Writing them is worse. You have been Warned.