Sponsored Content
Operating Systems BSD OpenBSD fdisk - Linux fdisk compatibility ? Post 302756595 by vilius on Wednesday 16th of January 2013 06:17:13 AM
Old 01-16-2013
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.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

(c)fdisk and RedHat 7.2

I recently installed RedHat 7.2, and cannot find any tools to partition the disks other than during the install. I did a find from / for fdisk and cfdisk, neither turned up. I looked in the RPM directories on the CD's, again no good. What rpm contains a partition management tool? (1 Reply)
Discussion started by: 98_1LE
1 Replies

2. UNIX for Dummies Questions & Answers

Using fdisk in scripts

Hi ! I need to create large amount of portions for database in Linux. Untill now I've used fdisk for manual creation of chunks and changing thei? file system type. Now I want to write script for create them automatically. I think I'm not the first who deal with that problem! Thank you for... (1 Reply)
Discussion started by: Frank_a
1 Replies

3. Solaris

using fdisk

how do i know my disk partion using fdisk (4 Replies)
Discussion started by: seyiisq
4 Replies

4. Red Hat

FDISK problems

OS= Fedora 10 I have a secondary 250GB disk of which I created a 50G partition on to try and set-up an LFS system. I finished with the LFS system and now I want to destroy the partition and reclaim all of the 250GB. So i simply ran fdisk /dev/sdb and deleted the 2 Linux partitions ( one 83 and... (2 Replies)
Discussion started by: woodson2
2 Replies

5. Shell Programming and Scripting

HEREDOC with fdisk

Hi folks What I'm trying is to build a partitioning script. I can pass a HEREDOC to fdisk just fine. Like this: fdisk /dev/sda << EOF p q EOF but I don't know how to put that HEREDOC into a varible to pass it to fdisk. This is what I have tried so far (no luck) #!/bin/bash ... (3 Replies)
Discussion started by: latenite
3 Replies

6. UNIX for Dummies Questions & Answers

Fdisk v/s parted

Just started understanding linux filesystem and partition utilities. I was going though some video tutorials by CBT nuggets and the author was cursing fdisk as fuzzy tool and recommending to use parted instead. In our job environment i have seen almost every one using fdisk utility for... (1 Reply)
Discussion started by: pinga123
1 Replies

7. Solaris

fdisk

Hi All, fdisk -l in linux equals in fdisk option in Solaris Thanks.......... (2 Replies)
Discussion started by: pvkarthykeyan
2 Replies

8. UNIX for Dummies Questions & Answers

Analyse this fdisk -l

Hi, Someone please analyse the following o/p of fdisk -l and tell me what it means for /dev/sda, /dev/sdb, /dev/sdc .... Disk /dev/sda: 53.6 GB, 53687091200 bytes 255 heads, 63 sectors/track, 6527 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start ... (5 Replies)
Discussion started by: stunn3r
5 Replies

9. UNIX for Advanced & Expert Users

Linux fdisk question (Oracle Enterprise Linux)

OS: Oracle Enterprise Linux 6.2 Hypervisor: VMWare workstation 9 I created a VM and attached a 7gb virtual disk to it. Using fdisk , I partioned the disk like below. The filesystems mounted on this is working fine. But I am seeing the message Partition n does not end on cylinder boundary.... (2 Replies)
Discussion started by: kraljic
2 Replies

10. UNIX for Dummies Questions & Answers

RAID autodetect in fdisk -l

Hello, Please refer to the below output: # fdisk -l /dev/sda Disk /dev/sda: 598.9 GB, 598999040000 bytes 255 heads, 63 sectors/track, 72824 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * ... (1 Reply)
Discussion started by: admin_db
1 Replies
All times are GMT -4. The time now is 04:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy