Formatting a disk

Gary W. Swearingen garys at opusnet.com
Thu Apr 13 21:06:53 UTC 2006


Daniel Carrera <daniel.carrera at zmsl.com> writes:

> I did this:  dd if=/dev/hda of=/dev/hdb count=1 bs=512

That "bs" is the default.

> I was expecting this to copy the MBR, which it probably did. But it also made fdisk not understand the disk:
>
> # fdisk /dev/hdb
> The number of cylinders for this disk is ... There is nothing wrong with that but it is larger than 1024 and could
> ... cause problems...
>
> Unable to seek on /dev/hdb
> #

I'll guess that the MBR had an end-of-partition LBA that was larger
than the "new" disk and "fdisk", for some reason I don't know, was
ask the disk to "seek" to the end of the partition, past the end
of the disk.

> Does anyone have a rescue suggestion? (yes, I should have done a backup of hdb's MBR but I didn't). There must be a tool
> that can bring sanity to a disk with a broken MBR.

Rescue what, exactly?  You should be able to reformat the disk with:
   dd if=/dev/zero of=/dev/hdb count=1   (or 16k, for kicks)
   fdisk /dev/hdb
   (etc)










More information about the ubuntu-users mailing list