[dm-devel] What is the deal with the partition separator?

Curtis Gedak gedakc at gmail.com
Wed Feb 16 20:18:47 UTC 2011

On 11-02-16 12:33 PM, Phillip Susi wrote:
> On 2/16/2011 12:19 PM, Curtis Gedak wrote:
>> Only newer versions of (lib)parted which link with the dmraid library
>> work this way with dmraid devices.  In this situation it is the dmraid
>> library that is coming up with the device names.  For all other devices,
>> (lib)parted uses the "linux scheme since the dawn of time" mentioned
>> below.  Older versions of (lib)parted follow the "linux scheme since the
>> dawn of time".
> (lib)parted does not link to dmraid; it contains its own code to
> generate the name by always adding the 'p' in libparted/arch/linux.c.

My bad.  (lib)parted does not link with dmraid.  It has been a while 
since I looked deeply into the libparted code.

I do know that the current version of parted in git has a 
"--enable-device-mapper" option for configure that is enabled by default.

The function _device_get_part_path in libparted/arc/linux.c, does appear 
to always insert a 'p'  for devices such as PED_DEVICE_DM and 

Regarding the GParted code, it has been written to will work with dmraid 
devices regardless of whether the "--enable-device-mapper" configure 
option is enabled or disabled.

>> GParted uses (lib)parted to come up with device names, except in the
>> case of dmraid devices.  Because dmraid does not follow the "linux
>> scheme since the dawn of time", gparted calls dmraid directly to create
>> names following the old dmraid standard (only append partition number to
>> device name).  If kpartx is available, then GParted will call kpartx to
>> ensure that dmraid device names follow the "linux scheme since the dawn
>> of time".  This behaviour enables GParted to work with all versions of
>> dmraid, and maintain compatibility with (lib)parted versions 1.7.1 and
>> higher.
> It shouldn't be using both dmraid and kpartx to create the partition
> devices.  If dmraid does it, then calling kpartx at best does nothing,
> and at worst creates duplicate devices.

It would be easy in GParted to not call kpartx at all.  This is in the 
code to try to follow the normal partition naming standards for GNU/Linux.

More information about the pkg-lvm-maintainers mailing list