size from df -kh vs size from fdisk -l

Bryn M. Reeves bmr at redhat.com
Wed Apr 22 09:53:50 UTC 2009


On Wed, 2009-04-22 at 11:08 +0930, Tim wrote:
> On Tue, 2009-04-21 at 09:13 -0700, Aldo Foot wrote:
> > After using fdisk or parted, one must do "partprobe" at the CLI to
> > record the changes. Both the OS and the Kernel need to know the
> > changes.
> 
> I don't recall having to do that.  The last time I repartitioned a
> drive, there was an automatic "syncing the system" stage when I exited
> the partitioning program.

The need to use partprobe depends on whether any partitions on the
device were in use (mounted or opened exclusively) when you ran the
partitioning tool.

The fdisk program uses an ioctl that tells the kernel to refresh the
whole table for that device (BLKRRPART). This fails entirely if any
partitions are busy. Partprobe uses a different ioctl (BLKPG) that
allows it to add and remove individual partitions as long as they aren't
busy. This means it can still add or change partitions on a device that
has busy partitions (as long as there are no overlaps or other
conflicts).

Regards,
Bryn.





More information about the fedora-list mailing list