Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 05 Mar 2006 13:46:30 -0500
From:      Gerard Seibert <gerard@seibercom.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: Help with lost MBR on USB HDD
Message-ID:  <20060305134300.75D1.GERARD@seibercom.net>
In-Reply-To: <000001c64058$9d5179a0$040ba8c0@HAPLO>
References:  <20060304204805.8460116A460@hub.freebsd.org> <000001c64058$9d5179a0$040ba8c0@HAPLO>

next in thread | previous in thread | raw e-mail | index | archive | help
Jarrod O'Flaherty wrote:

> 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.

I know you do not want to hear this, but why on earth did you attempt to
mess with the HD without a full backup in place first?

I am not sure if you can recover the lost data. If not, this would be a
good time to wipe the disk clean and partition it to your liking. I
believe that you will have to install Windows before installing FreeBSD.

Good Luck!
-- 
Gerard



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060305134300.75D1.GERARD>