Bug 584533 - fdisk won't create partitions capable of replacing Raid 1 drive
fdisk won't create partitions capable of replacing Raid 1 drive
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: util-linux-ng (Show other bugs)
13
All Linux
low Severity medium
: ---
: ---
Assigned To: Karel Zak
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-21 15:48 EDT by Ed Friedman
Modified: 2011-06-27 11:47 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-06-27 11:47:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ed Friedman 2010-04-21 15:48:03 EDT
Description of problem:
fdisk no longer allows you to create a partition table matching an existing one when replacing a broken drive in a Raid 1 setup

Version-Release number of selected component (if applicable):
util-linux-ng from Fedora 13 beta (Fedora 12 has the same problem)

How reproducible:
always

Steps to Reproduce:
1.Install Fedora 13 Beta
2.Turn off machine and install a blank hard drive identical to the existing drive
3.Try to use fdisk to make an exact copy of the partitions of drive with Fedora 13 Beta installed
  
Actual results:
There is no way to make a copy of the partitions using fdisk

Expected results:
Prior to Fedora 12, fdisk could always be used to set up partitions identical to any existing Raid 1 drive

Additional info:
The reason fdisk won't make an exact copy is that fdisk does not allow overlap of blocks.  Starting in Fedora 12, all of the partitions end with the exact same block that the next partition starts with.  The only exception to this that I've observed is the extended partition, which does start with the block 1 greater than the end of the previous partition, although the partitions that exist within the extended partition also overlap their block numbers.

The simplest fix would be to allow the user to create an initial partition table devoid of overlaps.  Personally, I think this should be the default, but it would be acceptable if this were made a user option.  Right now there is no option other than to accept the fact that the partitions will have overlapping blocks.
Comment 1 Karel Zak 2010-04-21 17:12:20 EDT
(In reply to comment #0)
> Starting in Fedora 12, all of the partitions end with the exact
> same block that the next partition starts with.

I don't see any changes in Fedora-12 fdisk (from util-linux-ng 2.16). The fdisk command has been changed in Fedora-13 (util-linux-ng 2.17).

Are you really sure that you are talking about sectors (blocks) and not about cylinders? Please, I'd like to see:

   fdisk -lu <device>

and the way how reproduce the problem. (Note that the default display units are cylinders, you need to use "-u" to switch to sectors and ideally "-c" to disable DOS mode.)

Anyway, the ideal way how to create an identical PT is to use sfdisk rather than fdisk.
Comment 2 Ed Friedman 2010-04-22 17:56:36 EDT
I tried sfdisk and ran into two problems. First, it wouldn't let me use all of the sectors that were used on the original disk. Second, it gave a warning that the partitions weren't eneding on a cylinder boundary and recommended that the new partition not be saved.

I double checked and prior to Fedora 11 all partitions ended on a cylinder boundary (and could be reproduced with just fdisk).  I never realized this before last week because I haven't had a Raid 1 drive fail until then.

I guess I'll just have to start by installing Fedora 10 in order to get partitions that end on cylinder boundaries, then follow up with a Fedora 13 install......
Comment 3 Karel Zak 2010-04-23 04:28:45 EDT
(In reply to comment #2)
> I guess I'll just have to start by installing Fedora 10 in order to get
> partitions that end on cylinder boundaries

Why do you need partitions aligned to the cylinder boundaries? Linux and Windows use sectors, CHS is obsolete legacy...

The fdisk from F-13 does not care about cylinders anymore if running in non-DOS mode.
Comment 4 Ed Friedman 2010-07-20 15:09:19 EDT
When trying to recover from a failed disk on a RAID-1 setup, I have recovery tools that make use of DOS fdisk already set up and in place to duplicate the partitions of the failed disk onto a blank disk and which I have been using for years. I fail to see why the user should not at least have the option to align partitions to cylinder boundaries during the initial setup.
Comment 5 Karel Zak 2010-07-20 17:00:30 EDT
The fdisk in F-13 still runs by default in DOS mode, in F-14:

The fdisk(8) command does not use DOS-compatible mode and cylinders as display
units by default. The old deprecated DOS behavior could be enabled by 'c' and
'u' fdisk commands or from command line by '-c=dos -u=cylinders' options.

Note that Fedora installer does not use fdisk, it uses GNU Parted.
Comment 6 Bug Zapper 2011-06-02 11:01:50 EDT
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 7 Bug Zapper 2011-06-27 11:47:06 EDT
Fedora 13 changed to end-of-life (EOL) status on 2011-06-25. Fedora 13 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.