Arm Ukraine, zap Putin

Stolen Votes logo logo

No Cookies

Flag UK DE





No Tracking




Fdisk: Answer to an FAQ

This is a rather crude answer to an FAQ,
next time I'll polish a better answer, or convert this to set of pointers
to better pages.

> : I just killed the partition table of my companies laptop by mistake.
> It had 2 WinXP Partitions on it and one BSD.
> Do you have any idea how I can recover the partition table?


Not for nothing do some people bitten by "Fdisk" think of 
"F" as standing for some other word other than "Fixed" ;-)

It's potential similar pain, regardless which OS one's going
from & to, sometime it destroys things. Same program name of Fdisk, but a
lot of different program implementations

One of MS's once only did about about 2G reliably I recall.  
Another friend spent 2 days solid fighting Fdisk.

It might be you just mangled the boot sector & not the table,
if so I think
    fdisk /mbr
under dos will fix that

You can also boot the laptop using the freebsd cdroms, & instead
of using option `install' choose `Fixit' (or rescue, whatever), &
it gives you a choice of floppy or 2nd cdrom, & you then have all
freebsd utils on 2nd cdrom (OK, you need to issue the mount command,
I recall
will prob. show you the names of devices.  Prob something like
    mount -t cd9660 -r /dev/acd0c /cdrom

You can then run the BSD fdisk program manually
(as opposed to automatically as part of install)

Similarly you could boot knoppix (diskless linux) & try fdisk on that.

But if your trying to get exactly the same value again, you'r
probably best using MS Fdisk if thats what you first used to lay
down the partition table.  ('cos it might turn out differently on
a different OS, after all, when each of the OS's ask "How many gig
or meg do you want for this slice ?" A meg isnt always the same
meg. 1000/1024

Of course you'll have to be carefull how far you let an MS install
go, (if it can even be stopped after fdisk - no idea )

Your best bet as its Friday 16:50, is take the disk out of the laptop,
buy one of those adaptors , & mount the disc on another machine,
& then ask on a knowledgeable mailing list for better advice
than mine, over the weekend,
 before touching the disk further.  

I'm certain i've seen much better answers than this on FreeBSD
mail lists, just can't remember which list off hand.

I'd suggest as a start.
If it's not in the FreeBSD FAQ somewhere,
it's something we should add.
Sorry I can't be of more help.

See also `man fdisk' on FreeBSD


More from hw:
on the Knoppix CD (which I used to kill my partition table) is included
the GNU utility: "gpart" (stands for "guess partitions").
To cure everything it is very easy:

gpart <disk>   (e.g. in my case: gpart /dev/hda )

to check the disk. If it comes back with "OK", then you can simply try the next step
(it was that easy for me!) and do:

gpart -W <disk> <disk>  (in my case: gpart -W /dev/hda /dev/hda )

This will ask some simple questions (do you want to change this? - Do you want to write...)
and when it has finished, cross your fingers and reboot.

Works like a charm!


In freebsd: /usr/ports/sysutils/gpart

Stolen VotesBerklix.Net Computer AssociatesDomainsApache: Web ServerFreeBSD: Operating System