From owner-freebsd-questions@FreeBSD.ORG Sun Mar 5 13:26:16 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 06E5116A420 for ; Sun, 5 Mar 2006 13:26:16 +0000 (GMT) (envelope-from jofsama@yahoo.com) Received: from smtp005.mail.ukl.yahoo.com (smtp005.mail.ukl.yahoo.com [217.12.11.36]) by mx1.FreeBSD.org (Postfix) with SMTP id 50D5B43D46 for ; Sun, 5 Mar 2006 13:26:15 +0000 (GMT) (envelope-from jofsama@yahoo.com) Received: (qmail 72088 invoked from network); 5 Mar 2006 13:26:14 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Priority:X-MSMail-Priority:X-Mailer:Importance:In-Reply-To:X-MimeOLE; b=oazmgIzrdtDfwi61XAdgY7OyFtOxijYPJjDYqyOGTdwYIO/oYBb2RxgnYOR2ZFdig3+30KrwAi3PzEZia2E3iRTlkMhgIfWL4pd7J6s644ExxtAvoJu+f0or/clsJhtdPO7zXor82X/djJCQBSdJHAm871XLND92KZCZSlBOJbc= ; Received: from unknown (HELO HAPLO) (jofsama@220.106.202.194 with login) by smtp005.mail.ukl.yahoo.com with SMTP; 5 Mar 2006 13:26:13 -0000 From: "Jarrod O'Flaherty" To: Date: Sun, 5 Mar 2006 22:27:46 +0900 Message-ID: <000001c64058$9d5179a0$040ba8c0@HAPLO> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal In-Reply-To: <20060304204805.8460116A460@hub.freebsd.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: Help with lost MBR on USB HDD 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: Sun, 05 Mar 2006 13:26:16 -0000 Hi All, I have a dual boot system going with WinXP and FreeBSD on my laptop. Just before I installed FreeBSD I bought a USB HDD to plug in so I could transfer some files off my laptop's internal HDD and make space for it. Alas, even with doing that I could only get a measly 7 GB free, which I used up pretty quickly building the JRE for OpenOffice. When I got my USB HDD I split it into 4 x 60GB slices (partitions), changing one of them from the default NTFS to FAT32, so I could share it with FreeBSD. While the sharing was ok, unfortunately FAT32 doesn't support symlinks and this led to errors when I tried to use that slice for building stuff in ports. I decided I needed a native UFS2 slice instead of a FAT32 one and set to work. Firstly, I have "Acronis PartitionExpert Personal" and according to that, all the slices apparently existed (past tense!) in a single logical partition. I used the program to change my *THIRD* slice (between 120GB and 180GB) from existing in the logical partition to being a physical partition in its own right. Was this a bad move, not being at the end of the disk? Acronis never complained and it all seemed to work ok. I then proceeded to try to change its type from 7 (NTFS) to 165 (FreeBSD). Acronis said it needed to reboot to do this, you know that odd, special WinXP (safe?) mode? When it did so though it said my drive was not present. Was this because the USB drivers aren't loaded in that odd WinXP pseudo-DOS "blocky character" mode? Or was this because I had my USB drive on auto power-off and it took too long to windup? Anyway, whichever it may be, PartitionExpert said that it couldn't find the drive so it couldn't change the type. I then thought well surely if I can't do it under XP then I can do this under FreeBSD. I looked at the MBR under fdisk and it had 2 entries, one for the logical partition and one for the new physical partition I had setup with PartExp. I must admit I was more comfortable with the fdisk in sysinstall, since I had used that when installing FreeBSD, so I changed to that one. The display seemed a little odd because it had about 8 entries, my four 60 GB slices, plus four other very small slices between each 60GB slice. A couple were "63" in size, but the one just above the partition I wanted to change (da0s2) was "7" in size. I wrote down the lines around the partition I wanted to change, but didn't write the whole table out as it was rather long winded. Aerrr, bummer! Anyway, I changed the Type from 7 to 165. And that's ALL I did. I then Wrote the table out and exited. I went into the labelling tool (also in sysinstall) and set the slice as one big FreeBSD partition. The labelling tool automatically newfs'ed it for me, and things were good to go. Next I exited sysinstall and mounted my partition under FreeBSD. Everything was great. Past tense. When I next booted into WinXP a few minutes later, all my NTFS drives were gone. A quick look under Acronis told me only my FreeBSD slice remained. Ummm, so what had gone wrong? Any ideas? I went back into FreeBSD and had a look at the MBR under fdisk (the command line version this time) and now there was no entry 1, just an entry 2, pointing to the FreeBSD slice. So I had lost my 3 other slices, from 0 - 60 GB (NTFS), 60 - 120 GB (NTFS), and 180 GB - end_of_disk (FAT32). Can anyone please tell me what happened when I ran sysinstall's fdisk? Can anyone also perhaps tell me where the slice (partition) info is kept for a logical partition? Since the MBR only had 1 entry for the other 3 partitions their info is obviously not stored there. Where and how is it stored? And last but not least, I really hope someone can tell me how I can salvage my MBR & other 3 partitions. If that is not possible, then perhaps you can point me in the direction of a tool which will salvage the files on the lost slices? There's not heaps of data there, only around 20 GB or so across all three. But if I can, I'd really like to get it back. I'm hoping NTFS is robust enough to allow salvaging like this? Any and all help GREATLY appreciated!! Thankyou, Jarrod.