From owner-freebsd-questions@FreeBSD.ORG Mon Aug 6 06:28:52 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6B4F2106566C for ; Mon, 6 Aug 2012 06:28:52 +0000 (UTC) (envelope-from kudzu@tenebras.com) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx1.freebsd.org (Postfix) with ESMTP id EA9958FC0A for ; Mon, 6 Aug 2012 06:28:51 +0000 (UTC) Received: by wibhr14 with SMTP id hr14so1033470wib.13 for ; Sun, 05 Aug 2012 23:28:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=W7y9NQGuAgezdo/HOyDotdKpBTVc7u6+UdWjdPni/NI=; b=CnaDxGigyfoH7Yg5ZjYsh1WE42uU7SbDJxYSPmnaai5yNMBYXjAPDZWhF4Oh1rEhsp T8jN7uLv1Ks10UK9UB5NvSgHod9JbzSYaNNOztSNHOmHcQdQ+KSLBz1yVhtU9CsUxxa7 EZOsU6R405cLsqv1ttknxtrJqBLu7HC6vKrXwyQAFQMBzdF/UsECzQ25EvsTt7tZ8lDH srXv04HuQFDdzOkciddfmYLuESKb1PFstrX4YwEUiEkg+kVJG8VAk0VbrB8FUn99gk9o er0E5u1POzfKWdH7htsdsuFvpN4ZGTjj9BBhs85XMvH6jy2J/0EVdapxJv9Hb1PMNfb6 OcVA== MIME-Version: 1.0 Received: by 10.217.0.75 with SMTP id k53mr4837802wes.214.1344234525268; Sun, 05 Aug 2012 23:28:45 -0700 (PDT) Received: by 10.223.171.71 with HTTP; Sun, 5 Aug 2012 23:28:45 -0700 (PDT) In-Reply-To: References: Date: Sun, 5 Aug 2012 23:28:45 -0700 Message-ID: From: Michael Sierchio To: Matthew Navarre X-Gm-Message-State: ALoCoQkf9RfmBGLz7WWAZSx7qx/JvRYeSwjlWShoUWmXCBR1HEzK1INTWcQUpuH8JfC6zT69k5H8 Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org Subject: Re: Mounting raw disk backup file. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2012 06:28:52 -0000 On Sun, Aug 5, 2012 at 11:12 PM, Matthew Navarre wrote: > I had a drive fail recently, it was working fine until I rebooted. After > that the partition map was corrupt and I can't mount either partition on > the disk. So I made a copy of the whole disk using dd to an old USB drive. > There were several IO errors while dd was copying the disk, so I think the > disk is starting to go. > > I can probably fix the partition table using testdisk, but now that I've > got this image file I'd rather work with that instead of the physical disk. > I've read the Handbook section on using mdconfig, but that assumes the > image file is of a filesystem, not a whole disk. I think I've > found instructions for how to do it on linux, but if there's a way to mount > it on FreeBSD I'd rather do that. > > So, any suggestions? > > Here's what file says about the file: > mnavarre@pcbsd-1810] /# file /mnt/ada1_backup > /mnt/ada1_backup: x86 boot sector; partition 1: ID=0xa5, active, starthead > 1, startsector 63, 167766732 sectors; partition 2: ID=0xa5, starthead 254, > startsector 167766795, 144809910 sectors, code offset 0x3c, BSD disklabel > > Why did you put it in /mnt? That's customarily used for mounting fileystems. Move it ;-) mdconfig -a -t vnode -f /new-path/ada1_backup note the device that's created (probably md0) you can then operate on /dev/md0 as if it were a disk. In particular, you might want to fix the partition map, the label info, etc. You can then fsck the filesystem (presumably something like /dev/md0s1a or /dev/md0a etc). You'll probably need to tell fsck that it's ufs (i.e. fsck -t ufs /dev/md0a ) you can then mount the fs (mount -t ufs /dev/md0a /mnt ) - M