Bug 117863 - changing partition table on a drive where at least one parition is used does not work without a reboot.
changing partition table on a drive where at least one parition is used does ...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: parted (Show other bugs)
2.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-03-09 08:24 EST by Pierre Amadio
Modified: 2007-11-30 17:06 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-03-09 18:48:57 EST
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 Pierre Amadio 2004-03-09 08:24:59 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5)
Gecko/20031007 Firebird/0.7

Description of problem:
It doesn seems possible to change a drive partition table without
having to either unmount all of its partition or to reboot before
creating a filesystem on the new partition.

man fdisk says:" Long ago it used to be necessary to reboot after the
use of fdisk.  I do not think this is the case anymore - indeed,
rebooting too quickly might cause  loss  of not-yet-written data. Note
that both the kernel and the disk hardware may buffer data."

But it doesnt work. I have been told that this step (rebooting or
unmounting all partition) was not necessary with parted. I still have
the same trouble:

#####################################
[root@dhcp-111 root]# fdisk -l

Disk /dev/hda: 255 heads, 63 sectors, 1216 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1        13    104391   83  Linux
/dev/hda2            14       395   3068415   83  Linux
/dev/hda3           396       460    522112+  82  Linux swap
/dev/hda4           461      1216   6072570    5  Extended
/dev/hda5           461       492    257008+  83  Linux
/dev/hda6           493       524    257008+  83  Linux
/dev/hda7           525       537    104391   83  Linux
/dev/hda8           538       550    104391   83  Linux

Disk /dev/hdb: 255 heads, 63 sectors, 2434 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hdb1             1       637   5116671   83  Linux
/dev/hdb2   *       638      2370  13920322+  83  Linux

[root@dhcp-111 root]# parted /dev/hda
GNU Parted 1.4.16
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
the GNU General Public License for more details.

Using /dev/hda
Warning: The operating system thinks the geometry on /dev/hda is
1216/255/63.  Therefore, cylinder 1024 ends at
8032.499M.  You should check that this matches the BIOS geometry
before using this program.
(parted) p
Disk geometry for /dev/hda: 0.000-9541.546 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031    101.975  primary   ext3        boot
2        101.975   3098.474  primary   ext3
3       3098.474   3608.349  primary   linux-swap
4       3608.350   9538.593  extended
5       3608.380   3859.365  logical   ext3
6       3859.396   4110.380  logical   ext3
7       4110.412   4212.355  logical   ext3
8       4212.387   4314.331  logical   ext3
(parted) mkpart logical 4315 9000
Error: Unknown file system type.
(parted) mkpart logical ext3 4315 9000
(parted) q
Warning: The kernel was unable to re-read the partition table on
/dev/hda (Device or resource busy).  This means Linux
knows nothing about any modifications you made.  You should reboot
your computer before doing anything with /dev/hda.
[root@dhcp-111 root]# fdisk -l

Disk /dev/hda: 255 heads, 63 sectors, 1216 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1        13    104391   83  Linux
/dev/hda2            14       395   3068415   83  Linux
/dev/hda3           396       460    522112+  82  Linux swap
/dev/hda4           461      1216   6072570    5  Extended
/dev/hda5           461       492    257008+  83  Linux
/dev/hda6           493       524    257008+  83  Linux
/dev/hda7           525       537    104391   83  Linux
/dev/hda8           538       550    104391   83  Linux
/dev/hda9           551      1147   4795371   83  Linux

Disk /dev/hdb: 255 heads, 63 sectors, 2434 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hdb1             1       637   5116671   83  Linux
/dev/hdb2   *       638      2370  13920322+  83  Linux
[root@dhcp-111 root]# mke2fs -j /dev/hda9
mke2fs 1.26 (3-Feb-2002)
mke2fs: Device size reported to be zero.  Invalid partition specified, or
        partition table wasn't reread after running fdisk, due to
        a modified partition being busy and in use.  You may need to
reboot
        to re-read your partition table.
 
[root@dhcp-111 root]#
 


#####################################




Version-Release number of selected component (if applicable):
parted-1.4.16-8 kernel-2.4.9-e.38 e2fsprogs-1.26-1.72

How reproducible:
Always

Steps to Reproduce:
1.install a machine and leave some space on a disk that has one
partition mounted in the system
2. use parted to create a new partition.
3. try to created a ext3 filesystem on this new partition.
    

Actual Results:  parted says:

Warning: The kernel was unable to re-read the partition table on
/dev/hda (Device or resource busy).  This means Linux
knows nothing about any modifications you made.  You should reboot
your computer before doing anything with /dev/hda.

mke2fs says:
 Device size reported to be zero.  Invalid partition specified, or
        partition table wasn't reread after running fdisk, due to
        a modified partition being busy and in use.  You may need to
reboot
        to re-read your partition table.
 



Expected Results:  new partition with ext3 filesystem shall be created.


Additional info:

i was not able to reproduce the problem while shrinking an already
existing partition. 

If i reboot on the machine used in the above example, i can 
do "resize 9 4314.362 4400". I still have the error message telling i
m supposed to reboot, but if i try to recreate an ext3 filesystem , i
dont have the mke2fs error message.
Comment 1 Jeremy Katz 2004-03-09 18:48:57 EST
parted 1.4 doesn't have support for the newer ioctl, it is supported
in parted 1.6 which is present in RHEL 3.

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