Borsenkow Andrej <[EMAIL PROTECTED]> writes:
> I thought, I try it with new mkinitrd and new way how it handles devfs
> (Chmouel, what is this magic handledevfs in nash? What it does - or,
rpmmon would have told you to ask me, not chmouel, the question.
[gc@bi ~] rpmmon -p mkinitrd
gc
> better, how?) I had LVM volume so I formatted it (as Reiser), installed
It does:
void handledevfsCommand()
{
// I need to close my IO's in order to release the lock on initial /dev
close(0); close(1); close(2);
if (umount("/initrd/dev"))
return;
mount("/dev", "/dev", "devfs", MS_MGC_VAL, NULL);
}
> minimal number of packages, setup lilo to boot off main cooker but with
> root on LVM volume, modified initrd - and what'd'you think? It booted
> without any error messages.
So it works, that's it?
> In case it helps, here are some files.
>
> linuxrc (I obviously had to make initrd larger to put vgscan, vgchange and
> libc on it). :
There is a patch to adapt the size of the initrd to what's inside. Wasn't
it enough?
[...]
> echo Creating root device
> #mkrootdev /dev/root
Why have you quoted mkrootdev?
[...]
> I can run vgscan as many times as I like without any errors.
>
> So in principle it is possible. Just how exactly is totally different :-)
So now you tell that it doesn't work... it's inconsistent. Does it work or
not ?
> Some points:
>
> 1. Does mkrootdev handle LVM? What exactly it does?
Use the source luke.
void mkrootdevCommand(char * cmd, char * end) {
char * path;
unsigned int devNum = 0;
int fd;
int i;
char buf[1024];
if (!(cmd = getArg(cmd, end, &path))) {
printf("mkrootdev: path expected\n");
return;
}
if (cmd < end) {
printf("mkrootdev: unexpected arguments\n");
return;
}
fd = open("/proc/sys/kernel/real-root-dev", O_RDONLY, 0);
if (fd < 0) {
printf("mkrootdev: failed to open /proc/sys/kernel/real-root-dev: %d\n",
errno);
return;
}
i = read(fd, buf, sizeof(buf));
if (i < 0) {
printf("mkrootdev: failed to read real-root-dev: %d\n", errno);
close(fd);
return;
}
close(fd);
buf[i - 1] = '\0';
devNum = atoi(buf);
if (devNum < 0) {
printf("mkrootdev: bad device %s\n", buf);
return;
}
unlink(path);
if (mknod(path, S_IFBLK | 0700, devNum)) {
printf("mkrootdev: mknod failed: %d\n", errno);
}
}
> 2. If you have really many volumes - is it possible that there will be no
> space in ramdisk to create cofig files? Is it possible to limit scan to
> specific group only (i.e. tell vgscan to *not* create configuration for
> other groups). Or better yet do something like
>
> vgscan | vgchange :-)
no idea, i don't understand the pb
> 3. You cannot shutdown root volume but that's probably just cosmetic
> (warning on shutdown). May be sensible to filter root VG from shutdown.
is the initrd getting umounted gracefully?
> 4. We need static versions of vgchange and vgscan of course.
the problem is that it will be large -> fscking the boodisks :-(.
--
Guillaume Cottenceau - http://people.mandrakesoft.com/~gc/