I have a number of hard disks that use a proprietary partitioning system. The disks don't contain partition tables themselves, but each have a known number of partitions at fixed positions with fixed lengths. The last partition always extends until the end of the disk.
My Linux machine currently recognises the disk as /dev/sdb, but since this partitioning scheme is proprietary the individual partitions aren't recognised. I want to write a kernel driver to add support for these disks and their partition scheme, so that devices /dev/sdb1, /dev/sdb2 etc appear. Each disk has a header in a known fixed sector outside of the partitions which can be used to identify that the disk is one with this proprietary system, I want the driver to have a probe function that can detect when an applicable disk is attached and handle it just the same as a disk with an msdos or gpt partition table would be by the system.
Is this possible to handle in a kernel driver, or does it require patches to the kernel itself? If so, how does a driver like this work?
udevto handle recognizing the weird disks and invoking your module to provide the partition table.man -k udev<Linux kernel source>/block/partition/*.cfiles. These cannot be built as modules, partly because the detection functions are designed to run in a specific order to avoid false detections (e.g. GPT is detected before MBR to avoid misdetection of protective MBR as a real partition on GPT-partitioned disks).