[parted-devel] [PATCH 9/9] libparted: device mapper uses 512b sectors

Phillip Susi psusi at ubuntu.com
Fri Feb 6 15:58:44 UTC 2015


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

On 2/5/2015 8:30 PM, Brian C. Lane wrote:
> device mapper doesn't use the device's sector size when creating a 
> table. It always uses 512b units. This causes partitions to be
> created 8x smaller than expected on devices with 4906b sectors.

I'm confused.  Since devmapper always uses 512 byte sectors, what does
the sector size of the underlying physical disk have to do with
anything ( other than alignment )?  We're only dealing with devmapper.

> +        *start *= (part->disk->dev->sector_size /
> PED_SECTOR_SIZE_DEFAULT); +        *length *=
> (part->disk->dev->sector_size / PED_SECTOR_SIZE_DEFAULT);

Since the sector size reported by device mapper is always 512 bytes,
these statements are effectively no-ops ( 512 / 512 is always 1 ).


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)

iQEcBAEBAgAGBQJU1OS0AAoJENRVrw2cjl5Rbg4IAJ89Abv8kPJGqjLXTsmOe38C
Idkyi7dzo9C7+XvTbZ7SxHkyJ3htmdzPhD6eyq311YKSOdbqsPErFtxPWGFshyA2
aaFvRtaUKrA01tqyUwoLaVhBIOh2Z5tB0+GDgvR8/5qFwEifszq4TGuI8Zca78KS
dGqXesGV4Jxcu4+RFXvJW1sOfxTOIzoR70iVyiJTud5J2zrxFWt0c7iKpKq/ET8f
lMGCui3c8rNwmQYWJoWAf/78rw1ugUpUxO8/MfVPtVV4EId8QxSOrXfI6ICuACzt
Ap0yYjWRQgajX6PutJOYzY7AlKX37NE/cE9fkO9JhvS2KEkA+MM6bVo6J/VS3Ks=
=n52R
-----END PGP SIGNATURE-----



More information about the parted-devel mailing list