From owner-freebsd-questions@FreeBSD.ORG Tue Apr 15 18:01:12 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B5C637B401 for ; Tue, 15 Apr 2003 18:01:12 -0700 (PDT) Received: from www.get-linux.org (adsl-64-161-78-226.dsl.lsan03.pacbell.net [64.161.78.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 35D8043F93 for ; Tue, 15 Apr 2003 18:01:11 -0700 (PDT) (envelope-from oremanj@www.get-linux.org) Received: (qmail 61854 invoked by uid 1001); 16 Apr 2003 01:01:21 -0000 Date: Tue, 15 Apr 2003 18:01:21 -0700 From: Joshua Oreman To: David David Message-ID: <20030416010121.GB61362@webserver.get-linux.org> References: <20030416004744.20978.qmail@web11303.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030416004744.20978.qmail@web11303.mail.yahoo.com> User-Agent: Mutt/1.4i cc: questions@freebsd.org Subject: Re: MBR, Partition File recover X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2003 01:01:12 -0000 On Tue, Apr 15, 2003 at 08:47:44PM -0400 or thereabouts, David David seemed to write: > > Hello, > > Through a series of very stupid actions i did today i have very > successfully blown a giant hole in my foot. Hopefully i can make this > as short as possible. > > The short of it is, i had FreeBSD 4.7, Gentoo Linux and WinXP > installed on my system and was going to do a complete re-install of > FreeBSD and Gentoo. I backed up all my files from my drive's into > .bz2 files, and placed them in a folder of one of my FreeBSD > partitions. > > I also had turned a spare drive into a storage drive formatted ext2 > which i copied al the files into as added bonus. So while > re0installing Gentoo first, one of the steps in the Install doc was > to dd the mbr of the drive's you wanted to use, here's what i did to > the drive's: > > dd if=/dev/zero of=/dev/hda bs=1k count=1, etc for the other drive's > i was going to use. > > Unfortunately while sleeping i also did this to the drive that had my > backup files on my FreeBSD partition, also due too some more > airheaded-ness i managed to fsck up the spare drive ext2 file system > leaving me at present, looking around the net for a way of recovering > those files, either from the ext2fs or the FreeBSD file system. > > So i was wandering if some kind soul out there could possibly suggest > some action's ( besides jumping from a bridge, which i have finally > ruled out for the moment) that i might take to either restore the 1k > or mbr if that's what i deleted, or of a way of recovering those > file's of that drive? > > One note, since i did the "dd" above i have not touched the drive in > question in any way, it's the same as when i re-booted out of FreeBSD > minus that 1k. > I assume you have a spare FBSD machine (any version). If not, connect the dead drive to a friend's PC. Install /usr/ports/sysutils/gpart. *** In the following I assume the trashed FBSD disk is /dev/ad0 *** Usage: To find partitions: gpart /dev/ad0 If that fails, try this (takes *really* long): gpart -f /dev/ad0 If it works and the preceeding doesn't, use the -f option in all calls to gpart for that disk. Then, when you're satisfied, to write it: gpart -i -W /dev/ad0 /dev/ad0 If you want to backup the existing MBR before write: gpart -b /root/backup.dev_ad0.mbr -i -W /dev/ad0 /dev/ad0 If you are sure about these partitions and don't want confirmation for writing them: Drop the -i option. To write to a file: Replace '-W /dev/ad0' with '-W /root/new.dev_ad0.mbr' I hope this helps! -- Josh [snip] > > Thanks! > > David > > PS: Please CC me ddavid_3@yahoo.com > > > ______________________________________________________________________ > Post your free ad now! http://per0sonals.yahoo.ca > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"