[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] [PATCH] multipath-tools: Fix kpartx partition calculation for DASD partitions.

We found an error in the partition calculation of DASD devices. This
only applies to DASDs with CMS, LNX (old linux disk layout) and
unpartitioned devices. In these cases the partition created by kpartx
is smaller than the partion that would be accessible through the kernel
partition device. If 512B blocksize was used when formatting the DASD
the calculations are ok. The partitions are also ok if the default
(Compatible Disk Layout) was used.

The following fix will correct this (and it should be done so kernel
and kpartx partitions are the same). However, if someone has already
used the disk layouts mentioned above and wrote data to the
partitions created by kpartx this will lead to trouble!
The data won't be found at the new start of the partition. But a
manually created linear target might be used to access the data and
move it somewhere else.

echo "0 <size> <device> <offset>" | dmsetup create <name>

<device> = /dev/dasd[a-z][a-z]*
<f>      = 8 (for 4K blocksize), 4 (2K BS), 2 (1K BS)
<size>   = $(blockdev --getsize <device>) - (3 * f) - (3 * f * f)
<offset> = 3 * f * f

To check if someone is affected by the bug the output of
"kpartx -l <device>" can be compared against the start and size
attribute in /sys/block/<devicename>/<devicename>1.
(e.g. "kpartx -l /dev/dasdb" <--> cat /sys/block/dasdb/dasdb1/...)

Stefan Bader

Attachment: mptools-kpartx-dasd.patch
Description: Binary data

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]