From owner-freebsd-hackers Thu Dec 12 20:51:51 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5EFE437B401 for ; Thu, 12 Dec 2002 20:51:49 -0800 (PST) Received: from aaz.links.ru (aaz.links.ru [193.125.152.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E0C043EC2 for ; Thu, 12 Dec 2002 20:51:48 -0800 (PST) (envelope-from babolo@aaz.links.ru) Received: from aaz.links.ru (aaz.links.ru [193.125.152.37]) by aaz.links.ru (8.12.6/8.12.6) with ESMTP id gBD4s9Dh090800; Fri, 13 Dec 2002 07:54:09 +0300 (MSK) (envelope-from babolo@aaz.links.ru) Received: (from babolo@localhost) by aaz.links.ru (8.12.6/8.12.6/Submit) id gBD4s8tR090799; Fri, 13 Dec 2002 07:54:08 +0300 (MSK) Message-Id: <200212130454.gBD4s8tR090799@aaz.links.ru> Subject: Re: HD data recovery X-ELM-OSV: (Our standard violations) hdr-charset=KOI8-R; no-hdr-encoding=1 In-Reply-To: <20021212214938.4b71b8c0.nospam@hiltonbsd.com> To: Stephen Hilton Date: Fri, 13 Dec 2002 07:54:08 +0300 (MSK) From: "."@babolo.ru Cc: freebsd-hackers@FreeBSD.ORG, "."@babolo.ru X-Mailer: ELM [version 2.4ME+ PL99b (25)] MIME-Version: 1.0 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > On Fri, 13 Dec 2002 06:04:35 +0300 (MSK) > "."@babolo.ru wrote: > > > > When multi-boot system operators go bad :-) > > > > > > Using my PC's bios I could select either IDE or SCSI as the > > > boot device, so I could boot either FreeBSD/W2K with the > > > FreeBSD bootmanager on the 1st SCSI drive, run the bios setup > > > on reboot, and start Linux on the 1st IDE HD. > > > > > > Had a problem with grub and RedHat 8's up2date on the 1st IDE > > > disk messing with my 1st SCSI HD's boot record. It was trying > > > to "automatically" update the Linux kernel and reconfigure > > > grub, and lost its way. > > > > > > Booted to FreeBSD 4-STABLE via fixit floppy and did this :-\ > > > (pre coffee) > > > > > > # cd /boot > > > # dd bs=512 count=1 if=/dev/da0 of=mybootsect > > > # dd bs=512 count=1 if=mbr of=/dev/da0 > > > # shutdown -r now > > > > > > I seem to recall seeing something about my SCSI controller > > > changing the mapping of the drive layout (Tekram DC390U2W) > > > but cannot find that info now. > > > > > > The drive is now unbootable, changed the drive id jumper to 1, > > > installed a fresh FreeBSD system on a different SCSI disk at > > > id 0 and then ran: > > > # fdisk da1 > > > this reported a clean disk, no partitions. > > > > > > The munged HD is an 18 SCSI with 1st slice NTFS 4GB, 2nd slice > > > FreeBSD 9GB, 3rd slice NTFS 5GB. > > > > > > Most of the important data was backed up, but lost a bunch of > > > email and some other stuff, not to mention the time spent > > > configuring and patching the W2K side of the disk. Modem only > > > in my neighborhood, no broadband. > > > > > > Any hope for recovery of this drive? I know the missing piece > > > of information is "out there" in the 512 byte mybootsect file I > > > created. Is it possible to use "forensic" tools to track that > > > down and then copy it and write it back to the correct location? > > > > > > Am up and running now on the spare HD, and can work on my "big > > > mistake" at my lesiure, thanks in advance. > > > > dd bs=512 count=1 if=/boot/mybootsect of=/dev/da1 > > fdisk -B da1 > The file "/boot/mybootsect" is somewhere on /dev/da1 unfortunately Do you remember the order of slices on da1 ? I think that /boot/mybootsect is on "a" BSD partition and that partition is first on a slice. If you have no knowledge about place of slice, just write simple sh cycle to create slice big enough for your lost root partition, try to mount read only, delete if mount is not successful and try slice on next possible place (next cylinder if you are shure that slice was on cylinder border AND geometry do not changed, or next block) until you get succseccful mount. Then cp mybootsect to another disk, umount and do dd and fdisk -B -- @BABOLO http://links.ru/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message