Bug 447623

Summary: repartitioned disk drive partitions not reread until reboot
Product: [Fedora] Fedora Reporter: Tom Shield <twshield>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9CC: nhorman
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-09-14 01:15:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tom Shield 2008-05-20 20:47:17 UTC
Description of problem:

if a hard drive with existing partitions is repartitioned mkfs and subsequent
mounts still use the previous partition settings.  New partitioning scheme is
not active until after a reboot.

Version-Release number of selected component (if applicable):

Fedora 9 Live KDE running from CD

How reproducible:

I've only tried it once as I was repartitioning my system disk. The system was
originally set up as part of an FC3 install.

Steps to Reproduce:
1. repartition an existing disk so that a larger partition is subdivided into
several smaller partitions.  I had a three partitions initially, boot, root and
swap (see below).  I deleted the root and swap and made it into three roughly
equal partitions and a swap partition.  The boot partition stayed the same at
the front of the disk.  I used fdisk to repartition.
2. mkfs (ext3 was what I used) on the new partition, it will use the old size of
the second root partition.
3. mount the new partition it will report the size of the old partition.
  
Actual results:

file system of the old partition size

Expected results:

file system of the new partition size.

Additional info:

the original disk layout was something like (sorry I did not keep the exact
layout, but the cylinder numbers are correct):

Disk /dev/sda: 79.9 GB, 79998951424 bytes
255 heads, 63 sectors/track, 9725 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        9471    ????????+  83  Linux
/dev/sda3            9472        9725     2040223+  82  Linux swap


The following is the new disk layout:

Disk /dev/sda: 79.9 GB, 79998951424 bytes
255 heads, 63 sectors/track, 9725 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2446    19543072+  83  Linux
/dev/sda3            2447        4879    19543072+  83  Linux
/dev/sda4            4880        9725    38925495    5  Extended
/dev/sda5            4880        9471    36885208+  83  Linux
/dev/sda6            9472        9725     2040223+  82  Linux swap

I tried to mkfs and mount /dev/sda2 and got the old sda2 partition size from before.

Comment 1 Chuck Ebbert 2008-05-23 05:37:58 UTC
Did you notice when fdisk rewrote the partition table, whether it said "the old
partition table will be used until the next reboot" or not?


Comment 2 Chuck Ebbert 2008-05-23 05:59:37 UTC
I can't reproduce this at all.

Comment 3 Tom Shield 2008-05-23 15:39:11 UTC
I don't recall it saying that.  I seem to recall it saying "Calling ioctl() to
re-read partition table."  But I don't know for sure.  I never recall seeing the
"used until reboot message" in all the times I've used fdisk.  Under what
conditions does this occur?

I probably should have also said sda is a pair of mirrored IDE disks on a 3ware
controller.

Comment 4 Chuck Ebbert 2008-06-07 01:07:52 UTC
(In reply to comment #3)
> I don't recall it saying that.  I seem to recall it saying "Calling ioctl() to
> re-read partition table."  But I don't know for sure.  I never recall seeing the
> "used until reboot message" in all the times I've used fdisk.  Under what
> conditions does this occur?
> 

It happens when any of the disk partitions are in use.