From owner-freebsd-fs@FreeBSD.ORG Sun Feb 13 21:07:16 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BDE2106566B for ; Sun, 13 Feb 2011 21:07:16 +0000 (UTC) (envelope-from pipatron@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id DF2058FC16 for ; Sun, 13 Feb 2011 21:07:15 +0000 (UTC) Received: by gyc15 with SMTP id 15so1848333gyc.13 for ; Sun, 13 Feb 2011 13:07:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=MPeJngEksFdC9Lt59qZewl8UxnXsqfmhOBr8q3A4cYI=; b=LB7jfzkW/SEtVG39n5RlsU4bF5ICJo4yKjIbtUraliOkRcaehq1HKrnOpsFVinoIuX qWfAUNq2bLf+N+B1XVk0QvWvr0XVGEinoT5VUkQBW2dwYny2G8i998jN1yZDNVnBPIm6 LO7oV3+q3/oiLNGNHQtkdHBbtEyQiv7VQ4ZRM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=u2zwtyLVZ6LV64e6QmdpmgqkdoIJ2oK3p7pw/0LHEgwt+NR7vCHpAAGUpB2tZUc0i0 forekTV0ElBJS7SQazosq9qgUxGaDMJKl/PHw0ZZj2Kfyt2lMRE1BSKOoSbiuyiEO6s7 3tGgb3JORjcVt4ZB7DkYoytUeYnmMEL5Iuc9A= MIME-Version: 1.0 Received: by 10.151.63.24 with SMTP id q24mr3347759ybk.385.1297629544042; Sun, 13 Feb 2011 12:39:04 -0800 (PST) Received: by 10.150.196.17 with HTTP; Sun, 13 Feb 2011 12:39:04 -0800 (PST) Date: Sun, 13 Feb 2011 21:39:04 +0100 Message-ID: From: Anders Andersson To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=UTF-8 Subject: Recover a ufs2 filesystem from a reformat with another ufs2 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 21:07:16 -0000 Hi! I'm sorry if this has been brought up already but the search function in the archives seem to be broken (since 2007?) so I couldn't search for duplicates. A short summary of my problem: I am trying to recover files from a UFS2 file system that has been overwritten by a new UFS2 file system. A longer problem description: I'm trying to help a friend recover from a somewhat stupid mistake. He used a specialised distribution based on FreeBSD (FreeNAS), that among other things can manage harddrives and file systems. For reasons that he doesn't know, this tool formatted his old partition with a new UFS2 file system when he attached it, even though there was a perfectly fine one on the disk already. Now I'm trying to recover the files from the old one, but a problem is that the old one was also a UFS2 file system, so the tools I have tried only finds the new one. Now, being a linux guy with (unfortunately) very little experience of any of the BSDs, I am trying this out in linux with the tools I have, but it's not very easy. I don't know anything about UFS2 so I have some questions: 1) If an old file system is overwritten by a new file system with the same size, are there any traces of the old file system meta data left? I'm thinking randomized backup headers scattered throughout the file system, which would have a different location after each new format. 2) If there are no traces left of the old file system, would there be any UFS2-aware recovery programs that could scan the disk and try to regenerate the necessary meta data from, say, partition size, file offsets, some other magic...? 3) Are there any powerful tools availaible for tasks like this in FreeBSD that are not ported to Linux? In that case, I could easily install FreeBSD in a virtual machine and salvage the files there. 4) If everything else fails, can you recommend a good overview about UFS2, how and where the bits and pieces are stored on disk? Anything helps! // Anders