[parted-devel] Warning message if create partition when a partition is mounted

Curtis Gedak gedakc at gmail.com
Fri Oct 9 18:55:09 UTC 2009


There appears to be a regression in (alpha) parted-2.0 since parted-1.9.0.

Specifically something has changed that causes a warning message to be 
displayed when a new partition is created and at least one partition on 
the device is mounted.  The warning messaged displayed is:

    Warning: The kernel was unable to re-read the partition table
    on /dev/sdd (Device or resource busy).  This means Linux
    won't know anything about the modifications you made until
    you reboot.  You should reboot your computer before doing
    anything with /dev/sdd.

This change occurs with (alpha) parted-2.0 that was downloaded from:
ftp://alpha.gnu.org/gnu/parted/parted-2.0.tar.gz

This behaviour did not exist in parted-1.9.0 or prior versions to my 
knowledge.

This change in behaviour is also evident when using GParted with the 
(alpha) parted-2.0 library libparted.  When GParted is started, after 
scanning devices it will show a dialog indicating that the kernel is 
unable to re-read the partition table on a list of devices that have at 
least one partition mounted.  This leads me to believe that the problem 
originates in a subroutine prior to ever calling parted's mkpart 
command.  Perhaps when the _PedDevice structure is set up from a 
ped_device_get() call?  It's just a hunch of mine - I haven't done any 
testing to verify this as a source of the change.


Following are a series of steps that demonstrate this problem:


--> $ dev=/dev/sdd
--> $ parted -s $dev mklabel msdos
--> $ parted -s $dev mkpart primary ext2 1 10
--> $ parted -s $dev print
Model: ATA ST3160022ACE (scsi)
Disk /dev/sdd: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  10.0MB  9968kB  primary  ext2

--> $ mkfs.ext2 ${dev}1
mke2fs 1.40.8 (13-Mar-2008)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
2448 inodes, 9732 blocks
486 blocks (4.99%) reserved for the super user
First data block=1
Maximum filesystem blocks=10223616
2 block groups
8192 blocks per group, 8192 fragments per group
1224 inodes per group
Superblock backups stored on blocks:
    8193

Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
--> $ mkdir /mnt/testmnt
--> $ mount ${dev}1 /mnt/testmnt

##### NOTE: A warning message occurs if a partition is mounted.

--> $ parted -s $dev mkpart primary ext2 11 20
Warning: The kernel was unable to re-read the partition table on
/dev/sdd (Device or resource busy).  This means Linux won't know
anything about the modifications you made until you reboot.  You
should reboot your computer before doing anything with /dev/sdd.
--> $ parted -s $dev print
Model: ATA ST3160022ACE (scsi)
Disk /dev/sdd: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size     Type     File system  Flags
 1      32.3kB  10.0MB  9968kB   primary  ext2
 2      10.0MB  20.0MB  10000kB  primary

--> $ umount /mnt/testmnt/

##### NOTE: No warning message occurs if all partitions are unmounted

--> $ parted -s $dev mkpart primary ext2 21 30
--> $ parted -s $dev print
Model: ATA ST3160022ACE (scsi)
Disk /dev/sdd: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size     Type     File system  Flags
 1      32.3kB  10.0MB  9968kB   primary  ext2
 2      10.0MB  20.0MB  10000kB  primary
 3      20.0MB  30.0MB  10000kB  primary

--> $

Regards,
Curtis Gedak





More information about the parted-devel mailing list