2

Linux supports a set of different disk label or partition table formats. For example, Sun Disk Labels and MS-DOS partition tables are both disk labels that contain (largely) the same information (partitioning) in different formats. Please note, I'm not referring to filesystems like ext{2,3,4} but disklabels like the msdos, GPT, Sun Disk Label, etc.

I'd like to add support for a disk label format that's not currently in the kernel, but it looks like (from browsing fs/partitions/) that these are built into the kernel itself, and can't be compiled as modules.

Is there any sort of kernel API I could use to add support for different disk labels?

Will I have to resort to losetup instead?

1 Answer 1

3

kpartx uses the device mapper tools to create devices over the underlying media; you should be able to implement your partition parser in userspace and create DM mappings that expose parts of the underlying system to the kernel as block devices.

That absolves you of all the complexity of in-kernel work, and should still support booting through an initramfs, if required.

1
  • Thanks! kpartx (and in fact dmsetup) will do the trick nicely, and most importantly without the need to reboot.
    – Alexios
    Feb 19, 2012 at 8:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .