Re: Questions : disk partition re-reading

From: Rogier Wolff
Date: Tue Apr 20 2004 - 09:38:59 EST

On Tue, Apr 20, 2004 at 09:46:50AM +0200, Andries Brouwer wrote:
> You must distinguish the on-disk partition table and the kernel
> partition table. You can change the on-disk partition table just by
> writing to it, but that does not change the kernel's ideas.
> You can change the kernel partition table using the right ioctls
> but that does not change the bits on disk.
> Usually one does
> blockdev --rereadpt /dev/something
> after changing media, or after writing to the partition table,
> but that will fail if the disk is busy.

Which reminds me: Too bad the kernel says "Busy" without really
thinking aboutit.

Assume that I have a
<hda1> swap 1G (*)
<hda2> root 19G (active)
<free space>

disk, and want to add an extra partition. Maybe I have a 20G image
which I want to copy onto 20, 40, 60, 80, 120 and 200Gb disks. I can
then add the third partition as a /data or a /tmp partition. However
as the active root is on that disk I have to reboot. But in fact I
don't intend to change the active partition.

So, there should be objections if I want the new partitioning scheme
to be:

<hda1> swap 1.5G
<hda2> root 19G (active)
<free space>

then there is a problem and I can understand "Busy". But if the new
scheme is:

<hda1> swap 1G
<hda2> root 19G (active)
<hda3> data 20G <unformatted>

then I don't understand the reason for refusing the rereadpt request.

Anybody want to code this up?


(*) usually active as well, but easily deactivated. So lets pretend
it's inactive for this discussion.

** R.E.Wolff@xxxxxxxxxxxx ** ** +31-15-2600998 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
**** "Linux is like a wigwam - no windows, no gates, apache inside!" ****
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at