Broken Partition

Jerry McAllister jerrymc at
Mon May 4 13:39:38 UTC 2009

On Sun, May 03, 2009 at 06:26:42PM -0700, Chris Chambers wrote:

> Hi,
> 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".

You cannot just slab it on the side of an existing slice with fdisk.
You have to create a brand new slice that uses up all the space.
There is something called   growfs(8)  in FreeBSD, but that works 
on FreeBSD filesystems (FreeBSD partitions) rather than slices.

So, you might be able to use the fixit to go back and restore the
slice to the way it was and get a backup of it.   I am not sure.
Do you have any information on exactly which sector it previously
started on?   

You would have to create a slice _identical_ to the old one (without
any extra added on) and then use fdisk and bsdlabel to restore the
labels _exactly_ as before.  Then you might be able to read stuff.
I am not sure what fsck would do with it because some links probably
have been wiped out.

If you can get it to where dump(8) can make a dump of the each of
the partitions in the slice (except swap and /tmp - don't back up swap
or bother with /tmp), then do that.

Then, go back to Partition Magic and delete the FreeBSD slice and then
create a completely new one that combines the space of what you shaved
off from MSdos with the previous FreeBSD slice.   Then you can go back
to sysinstall (or manually with fdisk-bsdlabel-newfs) and create the
new, larger FreeBSD slice, divide it in to partitions and make file
systems out of them with newfs.

I think you will be extremely lucky if you can pull off rescuing
the old FreeBSD slice though.  You will have to get it to start
on the same sector and have identical links.   You might have to
use backup superblocks that are built in to the filesystems if you
can get to them.

This probably stems from a misunderstanding on how slices, partitions
and filesystems work.   Although most everything is flexible, the
beginnings of each are rather fixed and cannot be arbitrarily shoved
around without being remade from scratch.


> Any ideas?
> Chris
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"

More information about the freebsd-questions mailing list