Re: Questions : disk partition re-reading

From: Rogier Wolff (R.E.Wolff_at_BitWizard.nl)
Date: 04/20/04

  • Next message: Marcelo Tosatti: "Re: 2.4.26 doesn't compile? ("error: `__cmpxchg' previously defined here")"
    Date:	Tue, 20 Apr 2004 16:36:35 +0200
    To: Andries Brouwer <aebr@win.tue.nl>
    
    

    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?

            Roger.

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

    -- 
    ** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +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@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Marcelo Tosatti: "Re: 2.4.26 doesn't compile? ("error: `__cmpxchg' previously defined here")"

    Relevant Pages

    • Re: Linux community software-update-anarchy polemic
      ... Remember, I'm just a monkey. ... That implies that if you have one disk per partition, ... Trust the kernel or don't trust the kernel, but either way, both ...
      (comp.os.linux.misc)
    • Re: Partition check considered as error is breaking mounting in 2.6.27
      ... Herton Ronaldo Krzesinski wrote: ... creates a partition with an off by one error". ... It is better for the kernel to warn and to proceed ... disk, and let the kernel create block devices which can not be accessed. ...
      (Linux-Kernel)
    • Re: Partition check considered as error is breaking mounting in 2.6.27
      ... Herton Ronaldo Krzesinski wrote: ... creates a partition with an off by one error". ... It is better for the kernel to warn and to proceed ... disk, and let the kernel create block devices which can not be accessed. ...
      (Linux-Kernel)
    • Re: Partition help
      ... > /boot is where the kernel and some associated files live. ... > the disk, so you should make that the first partition. ... I would probably make my swap partition smaller - more like ...
      (Fedora)
    • Re: Setup problems - fdisk, overlapping sectors?
      ... Can we infer that the disk interface ... You use fdisk => meaning you have booted some kernel and are ... and readto read the second and the last sector of the disk. ... the disk had no extended partition. ...
      (comp.os.linux.setup)