[NewCommand] set real_root_dev

drtyc at centrum.cz drtyc at centrum.cz
Mon Feb 6 18:31:51 UTC 2006


Hello.

Got idea for another busybox command that will realy be usefull in my
scenario.
Something like:
busybox set_real_root_dev /dev/r5/root

Where r5 is lvm/device mapper's r5 volume group direcory with underneath
"root" being block device node created by the lvm/dm but one can't trust
in it's getting always same minor/major number.

It's especially usefull in cases where one needs to rely on ramdisk.

Here is the full scenario:
There is partitions which are pc requirement and /boot in raid level 1
The partitions sda2,sdb2,sdc2,sdd2 holding lvm
The lvm groups a,b,c,d holding logical volumes
a/r5, a/r6, a/r10, b/r5, b/r6, b/r10, ..., d/r10
The logical volumes provide additional features to softraid they contain.
The soft raid md5, md6, md10 where md10 is composed of a/r10, b/r10,
c/r10, d/r10. etc.
The softraid device number is set to be same as the raid level actually
used on the device.
Each soft raid contains yet another lvm to provide flexible paritioning.
The soft raids contain each one group raid5, raid6, raid10 (where md10
contains raid10 only).
Each volume group gives flexibility to parition the raid level to be spent
by different filesystem or same filesystem type with different
flags/limits.

Now you may understand the situation. The initrd script setups everything
correctly now but one thing. It does not touch real_root_dev in proc. The
value has been there since the kernel compiled and there is high
probability that it breaks when I add or remove logical volumes.

Or is there another way to do the math from the device name grab minor +
major device number and do the converion into octal format? All just with
busybox?




More information about the busybox mailing list