1

I'm trying to use an external USB hard drive to copy data between a legacy production OpenBSD 4.2 system (on a slow, fragile network — that's not an option) and a new OpenBSD 5.5 box, and I'm running into a freaky wall while trying to get the drive formatted. Neither box will recognize the MBR written by the other machine.

At this point, I have used fdisk -i on both machines to reinitialize the MBR, using each OS' default MBR template.

On the transfer system:

xfer# fdisk sd1
Disk: sd1       geometry: 30400/255/63 [488378645 4096-byte Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
*3: A6      0   1   1 -  30399 254  63 [          63:   488375937 ] OpenBSD     

On the production system (which already has another drive at sd1):

prod# fdisk sd2
Disk: sd2       geometry: 30400/255/63 [488378645 4096-byte Sectors]
Offset: 0       Signature: 0xAA55
          Starting         Ending        LBA Info:
 #: id      C   H  S -      C   H  S [       start:        size ]
------------------------------------------------------------------------
 0: 00      0   0  0 -      0   0  0 [           0:           0 ] unused      
 1: 00      0   0  0 -      0   0  0 [           0:           0 ] unused      
 2: 00      0   0  0 -      0   0  0 [           0:           0 ] unused      
*3: A6      0   1  2 -  30399 254 63 [          64:   488375936 ] OpenBSD     

I used disklabel on both the production and transfer machines; neither will see each other's partition table, and if I swap the drive back and forth to each machine in turn, each of them continues to see its own copy of the disklabel, even after using disklabel -c on both sides to sync from disk. (I'm assuming that's because the MBR partitions start at different sectors.)

But I'm mightily confused. I thought the whole point of an MBR was to be, well, master? Why aren't the two machines in agreement about the MBR of the drive, and what can I do to get them seeing the same partition table?

Edit: Further research into other disk partitioning schemes has not clarified anything, except to reaffirm that this is an MBR problem. The OpenBSD disk setup page mentions the Partition Boot Record, but that's located in the OpenBSD partition of the MBR so it won't affect what fdisk sees. And OpenBSD still, as of 2014, doesn't have support for GUID Partition Tables. This FAQ answer seems related, but doesn't answer my question.

  • What is the version of fdisk on each machine? – eyoung100 Sep 25 '14 at 22:26
  • @eyoung100 I'm having a surprising amount of difficulty finding that out. fdisk doesn't support the --version or -v flags, and it comes with the OS so pkg_info doesn't list it. Both should be the ones originally installed with the OS (OpenBSD 4.2 and 5.5). – Bax Ramspott Sep 26 '14 at 17:20
  • @eyoung100 This page suggests that OpenBSD 4.2 ships with fdisk 1.35 and 5.5 ships with fdisk 1.39, but I don't know if that's the real version number. – Bax Ramspott Sep 26 '14 at 17:26
  • Here's my hunch... We need to rule out a version conflict as the cause of the issue. You need to put the same versions of fdisk on both machines, and compare the outputs again. – eyoung100 Sep 26 '14 at 18:25
  • Did you zero out the first 1k of the drive before rerunning fdisk and then disklabel on either machine? (dd if=/dev/zero ...) – Liczyrzepa Jul 15 '15 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.