[parted-devel] [PATCH 2/6] libparted: handle busy extended partition

Phillip Susi psusi at ubuntu.com
Mon Oct 15 14:11:16 UTC 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/15/2012 4:31 AM, Petr Uzel wrote:
> When parted encounters busy partition during its loop for informing
> the kernel about partition changes, it tries to compare geometry of
> the to-be created partition with the geometry of the existing
> partition (reported by the kernel). If these geometries match,
> there is nothing more to do for parted.
> 
> However, this fails for msdos extended partitions, because kernel 
> always reports size of extended partition to be 2s, no matter how 
> big it actually is (to avoid having overlapping partitions in the 
> kernel's representation of partition table). This makes the 
> comparison of geometries to fail for extended partitions, so they 
> need to be handled specially.
> 
> Steps to reproduce: modprobe scsi_debug parted -s /dev/sdX mklabel 
> msdos parted -s /dev/sdX mkpart extended 1M -- -1 exec 3>/dev/sdX1 
> # make sdX1 busy parted -s /dev/sdX mkpart logical ext2 2M 4M

Isn't this a bit of a contrived case?  I mean in practice, an extended
partition should never be in use.  IIRC, the only reason the kernel
even creates the extended partition is to allow lilo to install itself
there easily, outside of that, nobody ever opens them.

What happens if the old partition was NOT an extended partition, but
the new one is?  In other words, we are removing a primary partition
and replacing it with a primary that starts in the same place?  Then
wouldn't this change prevent parted from complaining that it couldn't
make the change if the partition is in use?


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQEcBAEBAgAGBQJQfBmEAAoJEJrBOlT6nu75bjgIANpVkWjfW/LcmrdQjCuukIP6
5wHJJ4V93fGGsrsiseFafSA2ESOzzsEUM7DnHpVXaONJyrtR41pB/UfTmWBJPq6W
FyHIi7+oel0XXzYnUEVCUstMiYTacWFB1oHUiA6+jozMX5SKDUNF0uwZQbBdGg9C
m8kKSCNhhap2kO8LRUgPWYWLJhJF1XzD5yPaPLsY8I3SR2rcktGzMAl1FtCjGgdG
/YfSDhBC0n/uc241q+UjokWmWyDmvXk8paPbSr86xlDbe7BAOD5NGD+BE9/qNKBe
xRW4z7EtyQpGgkCbpu9XnBG6JbESy7cQQcv0k2ckvHzMKswudx9Um1O67W9/vME=
=nr6k
-----END PGP SIGNATURE-----



More information about the parted-devel mailing list