[kpartx] add DASD large volume support
authorStefan Weinhuber <wein@de.ibm.com>
Tue, 7 Jul 2009 21:51:29 +0000 (23:51 +0200)
committerChristophe Varoqui <christophe.varoqui@free.fr>
Tue, 7 Jul 2009 21:51:29 +0000 (23:51 +0200)
commitd678c139719d5631194b50e49f16ca97162ecd0f
tree56d8024cf254660e698b84a0e4ef23525d5717ae
parent5032e81e991b4cb4829b878066790faa36d888e0
[kpartx] add DASD large volume support

With kernel 2.6.30 the DASD device driver supports devices with more
then 65520 cylinders. As the traditional record layouts and hardware
interfaces only allow for 16-bit cylinder values, the new larger
cylinder addresses have to be partially encoded into the head part
of a cylinder/head address. To make things complicated, old kernels
will recognize a large volume device, but with a maximum of 65535
cylinders, so a large volume that has been formatted with old tools
will only be partially formatted. To handle these issues our disk
layouts and partition detection code had to be extended, and to use
large volumes with the multipath tools, the DASD partition detection
code in kpartx needs to be extended as well.

compatible disk layout (VOL1 label):
We use the same address encoding as the hardware interfaces.
To prevent old tools and kernels from misinterpreting the encoded
partition sizes, the new VTOC entries have the format number 8
instead of 1.

linux disk layout (LNX1 label):
Here we will still create one partition for the whole disk.
To make sure that the whole disk has been formatted, large volumes
use a new version of the disk label, which contains the number of
formatted blocks. If the disk contains an old volume label, we know
it was formatted with the number of cylinders as reported by the
HDIO_GETGEO ioctl.

CMS disk layout (CMS1 label):
Already contains the number of formatted blocks in the label, we
just have to use it.

Signed-off-by: Stefan Weinhuber <wein@de.ibm.com>
kpartx/dasd.c
kpartx/dasd.h