[dm-devel] Re: Partition tables on devices

Christophe Saout christophe at saout.de
Thu Jun 21 20:14:36 UTC 2007


Hi Geert,

> I have a disk that embeds another disk image (including a partition table and
> partitions).  Using dmsetup and the linear target I created a new device to
> access the embedded disk image. Cfdisk shows me the partitions on the new
> device, but the kernel didn't scan for partitions and hence didn't created
> devices for them.
> 
> Does there exist a way to let the kernel scan for partition tables on a device
> created using dmsetup? Or should I use a script like the one proposed by
> Christophe Saout in http://lkml.org/lkml/2003/7/18/141?

There's a small tool
"kpartx" ( http://www.die.net/doc/linux/man/man8/kpartx.8.html ), which
I think, IIRC is a simple port of the kernel partition detection code to
userspace, which uses the device mapper to set things up. I have used it
at times, it works nicely (it can even replace the kernel detection code
seamlessly, if put into an initramfs for instance). 

There's a copy of it in the distributed with the multipath tools.





More information about the dm-devel mailing list