OpenBSD fdisk - Linux fdisk compatibility ? | Unix Linux Forums | BSD

  Go Back    


BSD BSD, sometimes called Berkeley Unix, is a Unix operating system developed by the Computer Systems Research Group of the UC Berkeley.

OpenBSD fdisk - Linux fdisk compatibility ?

BSD


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-16-2013
vilius vilius is offline
Registered User
 
Join Date: Aug 2007
Last Activity: 29 April 2013, 3:32 PM EDT
Location: Lithuania
Posts: 106
Thanks: 3
Thanked 3 Times in 3 Posts
OpenBSD fdisk - Linux fdisk compatibility ?

Hello,

MBR partition table made by linux fdisk looks certainly not correct when printed by openbsd fdisk:

Partition table created on linux (centos 6.3):

Code:
# fdisk -l /dev/sdc

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x61f77373

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         131     1052226   83  Linux
/dev/sdc2             132         262     1052257+  83  Linux
/dev/sdc4             263        1305     8377897+   5  Extended
/dev/sdc5             263         523     2096451   8e  Linux LVM
/dev/sdc6             524         784     2096451   8e  Linux LVM
/dev/sdc7             785        1045     2096451   a6  OpenBSD


Same disk on OpenBSD (5.2):

Code:
# fdisk sd1
Disk: sd1       geometry: 1305/255/63 [20971520 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 83      0   1   1 -    130 254  63 [          63:     2104452 ] Linux files*
 1: 83    131   0   1 -    261 254  63 [     2104515:     2104515 ] Linux files*
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 3: 05    262   0   1 -   1304 254  63 [     4209030:    16755795 ] Extended DOS
Offset: 4209030 Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 8E    262   1   1 -    522 254  63 [     4209093:     4192902 ] Linux LVM
 1: 05    523   0   1 -    783 254  63 [     8401995:     4192965 ] Extended DOS
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 3: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
Offset: 8401995 Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 8E    523   1   1 -    783 254  63 [     8402058:     4192902 ] Linux LVM
 1: 05    784   0   1 -   1044 254  63 [    12594960:     4192965 ] Extended DOS
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 3: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
Offset: 12594960        Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: A6    784   1   1 -   1044 254  63 [    12595023:     4192902 ] OpenBSD
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 3: 00      0   0   0 -      0   0   0 [           0:           0 ] unused

OpenBSD fdisk shows separate 4 partition block for extended partition, but result above shows 4 4-partition blocks(instead of 2).

If I create same partition table on OpenBSD from scratch:

Code:
# fdisk sd1
Disk: sd1       geometry: 1305/255/63 [20971520 Sectors]
Offset: 0       Signature: 0x0
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 83      0   1   1 -    130 254  63 [          63:     2104452 ] Linux files*
 1: 83    131   0   1 -    261 254  63 [     2104515:     2104515 ] Linux files*
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 3: 05    262   0   1 -   1304 254  63 [     4209030:    16755795 ] Extended DOS
Offset: 4209030 Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 8E    262   1   1 -    522 254  63 [     4209093:     4192902 ] Linux LVM
 1: 83    523   1   1 -    783 254  63 [     8402058:     4192902 ] Linux files*
 2: A6    784   1   1 -   1044 254  63 [    12595023:     4192902 ] OpenBSD
 3: 00      0   0   0 -      0   0   0 [           0:           0 ] unused

Now if we connect that disk to linux partition table is not recognized:

Code:
# fdisk -l /dev/sdb

Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

#


Why this is happening ?
How do I create partition table compatible between two OSes ?

thanks
Vilius M.
Sponsored Links
    #2  
Old 01-16-2013
RudiC RudiC is offline Forum Advisor  
Registered User
 
Join Date: Jul 2012
Last Activity: 17 September 2014, 4:41 PM EDT
Location: Aachen, Germany
Posts: 4,265
Thanks: 72
Thanked 1,029 Times in 975 Posts
The first partition table(s) has the correct - whatever this means - standard structure as introduced, I think, by Microsoft (?) centuries ago. Which is boot sector with partition entries, one of which points to a chain of partition tables each consisting of one entry and a link entry.
I've spent ages fiddling around with non-standard structures in extended partitions without any luck, esp. when it comes to coexistence of several OSs on the same disk.
On the other hand, linux should at least recognize the partition entries in the boot sector of your experiment. Mysterious. Not sure what the zero disk identifier does.
Did you try to use another partition tool (cfdisk, parted, sfdisk)? Did you try to read the sectors binarily (od, hexdump)?

BTW - you are fdisking sdc in your first quote and sdb in the second...
Sponsored Links
    #3  
Old 01-16-2013
vilius vilius is offline
Registered User
 
Join Date: Aug 2007
Last Activity: 29 April 2013, 3:32 PM EDT
Location: Lithuania
Posts: 106
Thanks: 3
Thanked 3 Times in 3 Posts
Quote:
Originally Posted by RudiC View Post
BTW - you are fdisking sdc in your first quote and sdb in the second...
I'm just experimenting on virtual machines before touching real one - sdc sdb - the same disk only rearanged.

I did few more experiments - and yes looks like incompatibility happens in extended partition logical drives....

V
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
fdisk pvkarthykeyan Solaris 2 05-12-2011 02:58 AM
HEREDOC with fdisk latenite Shell Programming and Scripting 3 09-27-2009 01:38 PM
FDISK problems woodson2 Red Hat 2 03-30-2009 09:14 AM
using fdisk seyiisq Solaris 4 11-22-2008 03:17 AM
Using fdisk in scripts Frank_a UNIX for Dummies Questions & Answers 1 02-11-2005 08:46 AM



All times are GMT -4. The time now is 11:36 PM.