July 26, 2004

Mismatch in disk geometries and fdisk problems

Thanks to Andy for figuring this one out. Sometimes when I get a PC to make into a firewall with two hard disks that are destined to be mirrored, I find that the geometry on one doesn’t match the geometry on the other according to fdisk, despite the drives being identical. As it turns out this has to do with Linux guessing the disk geometry by looking at the partition table, and is probably a result of a partition table made from DOS/Windows on one drive and not on the other. I dd if=/dev/zero of=/dev/hda bs=1k count=100 and repeat for the other drive, reboot, and then the geometries agree.