[DRBD-user] CHS versus LBA

paddy paddy at panici.net
Sun Feb 19 13:49:14 CET 2006

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


On Sun, Feb 19, 2006 at 12:07:34AM +0000, Casey Allen Shobe wrote:
> I recently set up a new DRBD+heartbeat cluster for our webmail servers.
> 
> All works well but...
> 
> I'm a bit concerned because the partitions aren't exactly the same size.
> 
> The hard disks are PATA disks in identical models in identical machines, and I 
> created them exactly the same in fdisk - by using +4G as the size.  Problem 
> is, which I discovered after the fact, is that one machine shows the drive's 
> partition table in CHS notation, and the other LBA, so for whatever reason, 
> fdisk interpreted +4G differently on each.
> 
> So here's what I have now:
> 
> *** NODE 1:
> 
> Device Model:     FUJITSU MPF3102AT
> Serial Number:    05119851
> Firmware Version: 0028
> 
> Disk /dev/hda: 10.2 GB, 10248118272 bytes
> 255 heads, 63 sectors/track, 1245 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
> 
>    Device Boot      Start         End      Blocks   Id  System
> /dev/hda1               1          32      257008+  82  Linux swap / Solaris
> /dev/hda2   *          33         519     3911827+  83  Linux
> /dev/hda3             520        1245     5831595   83  Linux
> 
> 
> *** NODE 2:
> 
> Device Model:     FUJITSU MPF3102AT
> Serial Number:    05117966
> Firmware Version: 0028
> 
> Disk /dev/hda: 10.2 GB, 10248118272 bytes
> 16 heads, 63 sectors/track, 19857 cylinders
> Units = cylinders of 1008 * 512 = 516096 bytes
> 
>    Device Boot      Start         End      Blocks   Id  System
> /dev/hda1               1         497      250456+  82  Linux swap / Solaris
> /dev/hda2   *         498        8248     3906504   83  Linux
> /dev/hda3            8249       19857     5850936   83  Linux
> 
> 
> hda3 is what drbd0 uses.  As you can see the block size is different for each.  
> It contains a reiserfs partition and doesn't seem to be causing any 
> problems...yet...but it concerns me.  I don't have any recollection of which 
> machine the filesystem was mkfs'd on.
> 
> The real question here is why is one disk shown using CHS instead of LBA?  I 
> checked the BIOS's on both machines, and both have LBA enabled.
> 
> I don't mind rebuilding one of the nodes in order to get this remedied - does 
> anybody know how to fix it?  Somebody I was talking to said that a product 
> called 'spinrite' might fix the drive, but he wasn't certain.

If it isn't a big hassle for you to do, then the safest option might be
to have the same geometry on both disks, if that's how they would naturally be.

Having said that I wouldn't start there. I'm not sure how hard you have
to try to be able to shoot yourself in the foot with two drbd partitions
of different sizes, but my guess would be: fairly hard, but could be done ;)
It would probably repay you well (in terms of familiarity with drbd) to
explore that question first before rushing off to repartition.

Also, you really don't want to know about PC disk geometries in detail!

I recently changed the geometry on a disk (that I had foolishly set to 
something strange a while ago) and I did something like:

  BACKUP FIRST !!! backup evrything ! (sorry but you have to say these things)
  wipe the first sector of the disk
  set the relevant bios settings to taste (defaults are good if they work, consider what happens if your bios nvram (what people call cmos) is wiped/battery flat )
  boot from something fairly recent (I think I ended up using an old LNXBBC 
  disk, but an installer for your chosen system might be a good idea)
  partition from there
  copy everything back to the new partitions

Of course, you could mess about resizing and moving partitions to fit your
new geometry, but it would be fairly intricate, and AFAIK parted and won't
do this kind of geometry change for you, so you're likely going to end up
in shell script and dd looking for a fencepost error ;)  Perhaps this is
something 'spinrite' can do, dunno.

FWIW, the 255 heads by 63 sectors looks more likely to be the "right" 
geometry to me, but there is no "works everywhere" answer with these 
things: it does depend on the BIOS to some extent.  So if these two
disks are on different mobos then that might even explain why you've
gotten different geometries. (and if that turns out to be the case,
you might want to think carefully about what is more important to you:
matching geomtries, or the implications of using a slightly strange
geometry on one machine.  For example, my own recent geometry change
was in pursuit of getting the partition table recognized at boot time
by a non-initrd kernel.)

CHS, scary huh ?  640k should be enough for anyone ;)

Another alternative: putting your drbd resources on LVM LV's gives you 
control over the size of the block device(s) that drbd sees.

Regards,
Paddy
-- 
Perl 6 will give you the big knob. -- Larry Wall



More information about the drbd-user mailing list