Broken Partition

John Nielsen lists at jnielsen.net
Mon May 4 14:04:04 UTC 2009


It is best to include the list in all replies, so that people other than 
the original responder can offer additional help and so people searching 
the list archives in the future will have a complete picture.

Also, not top-posting (putting replies in the context of the original 
message) is is preferred on this and many other lists. I've reformatted 
your message and added comments inline below.

On Monday 04 May 2009 04:18:37 am Chris Chambers wrote:
> On Sun May 03 John Nielsen wrote:
> > On Sunday 03 May 2009 09:26:42 pm Chris Chambers wrote:
> > > Using partition magic, I freed some space from my msdos partition.
> > > Then using sysinstall's fdisk and label, I attempted to add the
> > > space to my freebsd partition. I broke the installation. The boot
> > > loader can not find /boot/kernal. I tried mounting the partition
> > > under FixIt, but mount says "broken argument".
> >
> > When you say "add the space to my freebsd partition" what exactly did
> > you do?
>
> Sorry, what I meant by "add the space to my freebsd partition" was:
>
> I created the free space, giving me:
> ad0s1
> ad0s2
> Free Space
> ad0s3
>
> I deleted and recreated ad0s3 in fdisk. Inside the label tool, I added
> swap space and mounted the remaining on / (as before).

You forgot to say "I made a backup." If you really skipped that step then 
hopefully you'll remember next time..

Did you write down the original values from fdisk and bsdlabel? Putting 
them back may be your best bet for recovery.

I would avoid using _any_ swap until you have your data back.

If your new free space had been _after_ the FreeBSD slice on the disk you 
may have had better luck. Since you moved the _beginning_ of your slice 
that changed the relative offsets of everything else which is probably 
why your filesystem is broken (I am not a UFS expert). What is surprising 
is that the loader ran at all... unless you used "bsdlabel -B" or 
similar.

If you revert the fdisk and bsdlabel values, save your data and want to 
try again a safer approach would be to define a fourth slice to occupy 
the free space (yes it will be out of order but FreeBSD shouldn't care.. 
not sure about DOS or PartitionMagic). Then just use the slice as 
additional swap directly (no bsdlabel, just ad0s4). But do make a backup 
this time.

> > What device nodes are listed for your disk from the fixit
> > environment?
>
> Currently, the devices are:
> ad0s1 - DOS, type 7
> ad0s2 - DOS, type 7
> ad0s3
> ad0s3a - UFS
> ad0s3b - Swap
> ad0s3c - ?

The "c" partition is the "raw" partition and is always the same size as 
the underlying device (or should be). I don't know that it's used for 
much any more, but there are historical reasons it's there.

> I would settle for the ability to mount the drive so that I could
> retrieve a few files.

Try reverting the fdisk and bsdlabel values (see above).

JN


More information about the freebsd-questions mailing list