How to attach an MTD device?
If UBI is compiled as a kernel module, it is enough to specify the MTD device to attach in the module arguments, e.g. $ modprobe ubi mtd=3 loads the UBI kernel module and attaches mtd3. And $ modprobe ubi mtd=3 mtd=5 command loads UBI kernel module and attaches mtd3 and mtd5. If UBI is compiled into the kernel, the mtd device to attach may be specified in the kernel boot parameters, e.g., ubi.mtd=3 command makes UBI attach mtd3 when the kernel is booting, and ubi.mtd=3 ubi.mtd=3 command makes UBI attach mtd3 and mtd6. And finally, MTD devices may be attached or detached at any time with the ubiattach and ubidetach utilities (see here); For example, $ ubiattach /dev/ubi_ctrl -m 3 attaches mtd3. But this “run-time attach” UBI capability was added recently and it is in the main-line kernels starting from version 2.6.25. Note, it is anyway recommended to back-port UBI patches from the latest kernel or even better from the UBI git tree.