Categories
Mastering Development System & Network

How to prevent LiveCD from automatically starting md, luks, lvm and bcache

Is there any way to build a Debian based LiveCD that will have everything to create and mount md-raid, luks, lvm and bcache (without need to apt install after live boot) but will never automatically start any of these block devices for existing ones on boot?

I have a custom LiveCD (debootstrap / live-boot / grub-mkrescue) that is used for initial os provisioning on bare metal desktop boxes (used as soho servers) with ansible.

To be able to provision configs like : luks on lvm on bcache/md I need all these packets to be installed in livecd but this also makes kernel to autodetect existing raids bcache and lvm. If there were any previous raid / bcache or lvm volumes on disks or any combinations kernel will autodetect them and simply prevent disk repartitioning until all these special devices are stopped. Stopping these devices one-by-one by script becomes a real mess as they come in all kinds of combinations (lusk on lvm / lvm on luks etc) and also all the cases where only one disk of raid or bcache is in this box and another disk have its raid from another box.

Leave a Reply

Your email address will not be published. Required fields are marked *