* [linux-lvm] booting a dm+lvm2 kernel
@ 2003-12-30 21:21 Kjartan Reynir Hauksson
2003-12-31 3:35 ` Luca Berra
0 siblings, 1 reply; 27+ messages in thread
From: Kjartan Reynir Hauksson @ 2003-12-30 21:21 UTC (permalink / raw)
To: linux-lvm
Hello all.
I've been scratching my head on this for a few days now. I decided to to
migrate to kernel 2.6 but first I need to migrate from lvm1 to dm+lvm2
(from what I understand). So I've allready patched a vanilla 2.4.22 kernel
with the device-mapper patch and with lvm2 support build into the kernel
and it compiled just fine. However since I'm running my root filesystem on
lvm I'm stuck on how to booth the sob. I tried to add the a new kernel to
my lilo.conf using root=/dev/root/1 but all I get is kernel panic. From
what I've read I nead to create an initrd image but thats where the docs
and previous posts get a little fuzzy. So what are the next few steps for
me ? Could someone shed some light on this because I've been googling for
a while now and I seem to be utterly stuck in the mud here :(
TIA
-Kjartan
---------------------------------------------------------------------------------------------------
Kjartan Reynir Hauksson
Kerfisstjóri
Orkustofnun
Sími: 569-6027/863-5912
e-mail: krh@os.is
--------------------------------------------------------------------------------------------------
http://www.os.is/disclaimer.html
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2003-12-30 21:21 Kjartan Reynir Hauksson
@ 2003-12-31 3:35 ` Luca Berra
0 siblings, 0 replies; 27+ messages in thread
From: Luca Berra @ 2003-12-31 3:35 UTC (permalink / raw)
To: linux-lvm
On Wed, Dec 31, 2003 at 03:11:27AM +0000, Kjartan Reynir Hauksson wrote:
>Hello all.
>
>I've been scratching my head on this for a few days now. I decided to to
>migrate to kernel 2.6 but first I need to migrate from lvm1 to dm+lvm2
>(from what I understand). So I've allready patched a vanilla 2.4.22 kernel
are you running a particular distro? if so telling which one it is could
be useful in gifing you the right hints.
your distro probably has an mkinitrd command, so you would need to patch
it to support lvm2 if it does not already.
you might also need to patch your sysinit boot script
you will also need patching lilo to understand device-mapper, else it
will not run anymore on your dm patched kernel (see
http://www.saout.de/misc/)
L.
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
@ 2003-12-31 18:46 Kjartan Reynir Hauksson
2004-01-01 5:11 ` Luca Berra
0 siblings, 1 reply; 27+ messages in thread
From: Kjartan Reynir Hauksson @ 2003-12-31 18:46 UTC (permalink / raw)
To: linux-lvm
>are you running a particular distro? if so telling which one it is could
>be useful in gifing you the right hints.
I using Mandrake 9.2 with mkinitrd 3.5.15.1 and a patched lilo 22.5.8
>your distro probably has an mkinitrd command, so you would need to patch
>it to support lvm2 if it does not already.
>you might also need to patch your sysinit boot script
Could you be a little more specific regarding the sysinit boot scripts as
it's probably the most confusing part of the process.
>you will also need patching lilo to understand device-mapper, else it
>will not run anymore on your dm patched kernel (see
>http://www.saout.de/misc/)
Thanks
-Kjartan
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2003-12-31 18:46 Kjartan Reynir Hauksson
@ 2004-01-01 5:11 ` Luca Berra
0 siblings, 0 replies; 27+ messages in thread
From: Luca Berra @ 2004-01-01 5:11 UTC (permalink / raw)
To: linux-lvm
On Thu, Jan 01, 2004 at 12:36:06AM +0000, Kjartan Reynir Hauksson wrote:
>>are you running a particular distro? if so telling which one it is could
>>be useful in gifing you the right hints.
>
>I using Mandrake 9.2 with mkinitrd 3.5.15.1 and a patched lilo 22.5.8
3.5.15.1?, you mean _MY_ mkinitrd and _MY_ patched lilo?
http://www.comedia.it/~bluca/cooker/lvm2
good, then i can help you
(i suppose you also installed the other stuff from there: lvm1 and lvm2
and initscripts)
>>your distro probably has an mkinitrd command, so you would need to patch
>>it to support lvm2 if it does not already.
just run mkinitrd -v -f /boot/initrd-2.4.22.img 2.4.22
(assuning it was a vanilla 2.4.22)
then you should have a block in your /etc/lilo.conf that looks like
this:
image=/boot/vmlinuz-2.4.22
label=lvm2
root=/dev/root/1
initrd=/boot/initrd-2.4.22.img
append="devfs=mount"
read-only
>>you might also need to patch your sysinit boot script
>Could you be a little more specific regarding the sysinit boot scripts as
>it's probably the most confusing part of the process.
if you install the initscripts on my page it should just work
(note that i updated my page today)
note my patched initscripts does not care what the default alternative
for lvm is (lvm1 or lvm2) but you might, so check and change it with the
"update-alternatives --config" command if you have both rpm installed.
note2: if you want a mandrake patched kernel with support for lvm2
included go to: http://www.netikka.net/tmb/Cooker
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
@ 2004-01-01 10:58 Kjartan Reynir Hauksson
2004-01-01 12:49 ` Luca Berra
0 siblings, 1 reply; 27+ messages in thread
From: Kjartan Reynir Hauksson @ 2004-01-01 10:58 UTC (permalink / raw)
To: linux-lvm
hmmmmm..... I'm getting a different kernel panic, this time it tells me to
try and pass the init= option but I saw it managed to load the device
mapper. Any gotchas you know of that I might be missing ?
>I using Mandrake 9.2 with mkinitrd 3.5.15.1 and a patched lilo 22.5.8
3.5.15.1?, you mean _MY_ mkinitrd and _MY_ patched lilo?
http://www.comedia.it/~bluca/cooker/lvm2
good, then i can help you
(i suppose you also installed the other stuff from there: lvm1 and lvm2
and initscripts)
>>your distro probably has an mkinitrd command, so you would need to patch
>>it to support lvm2 if it does not already.
just run mkinitrd -v -f /boot/initrd-2.4.22.img 2.4.22
(assuning it was a vanilla 2.4.22)
then you should have a block in your /etc/lilo.conf that looks like
this:
image=/boot/vmlinuz-2.4.22
label=lvm2
root=/dev/root/1
initrd=/boot/initrd-2.4.22.img
append="devfs=mount"
read-only
>>you might also need to patch your sysinit boot script
>Could you be a little more specific regarding the sysinit boot scripts as
>it's probably the most confusing part of the process.
if you install the initscripts on my page it should just work
(note that i updated my page today)
note my patched initscripts does not care what the default alternative
for lvm is (lvm1 or lvm2) but you might, so check and change it with the
"update-alternatives --config" command if you have both rpm installed.
note2: if you want a mandrake patched kernel with support for lvm2
included go to: http://www.netikka.net/tmb/Cooker
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
_______________________________________________
linux-lvm mailing list
linux-lvm@sistina.com
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2004-01-01 10:58 Kjartan Reynir Hauksson
@ 2004-01-01 12:49 ` Luca Berra
2004-01-01 15:42 ` Christophe Saout
0 siblings, 1 reply; 27+ messages in thread
From: Luca Berra @ 2004-01-01 12:49 UTC (permalink / raw)
To: linux-lvm
On Thu, Jan 01, 2004 at 04:47:54PM +0000, Kjartan Reynir Hauksson wrote:
>hmmmmm..... I'm getting a different kernel panic, this time it tells me to
>try and pass the init= option but I saw it managed to load the device
>mapper. Any gotchas you know of that I might be missing ?
>
if you were able to give more information about what happened i would be
able to help more, but as i dont' own a scrying orb at the moment i am a
bit at loss.
could you please copy a bit more of the messages that appear before the
panic?
can you provide the output of the mkninitrd -v .... command
btw are you using devfs? (but i tought i squashed that bug)
L.
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2004-01-01 12:49 ` Luca Berra
@ 2004-01-01 15:42 ` Christophe Saout
2004-01-01 16:47 ` Luca Berra
0 siblings, 1 reply; 27+ messages in thread
From: Christophe Saout @ 2004-01-01 15:42 UTC (permalink / raw)
To: linux-lvm; +Cc: Kjartan Reynir Hauksson, Luca Berra
Hi!
Sorry for interrupting your discussion, but if someone is modifying the
initrd script to work with LVM2 or writing a new one, I've perhaps some
inspiration.
Some time ago I used a simple initrd that just ran lvm vgscan and let
the kernel do the rest. But some days ago the system hung while it had
snapshots mounted. It didn't boot. Why? Well, having the snapshots
mounted the minor numbers changed and the kernel didn't find the root
filesystem anymore.
So I modified my initrd to used pivot_root to mount the root filesystem
itself. I can now give root=/dev/vg/root directly as parameter to the
kernel instead of having to rely on lilo to resolve the numeric
major:minor (that caused the trouble).
The only backdraw: If there isn't an /initrd on the root filesystem,
pivot_root fails. Perhaps I could let the script put the detected
major:minor into /proc/sys/kernel/real-root-dev instead of using
pivot_root. (I didn't because another binary like ls would need more
space).
I also switched to ash as shell (a very small bourne-compatible shell).
And I added udev to the initrd. The static /dev entries on the initrd
are only the basic ones, like /dev/console, /dev/null and so.
/dev/mapper/initrd is created dynamically using /proc/misc, and the
existing block devices are created using udev and /sys/block/* (if /dev
isn't devfs).
I think these are alls things that an updated initrd could recognize.
So it could:
a) look whether a 2.4 or 2.6 kernel is used and if udev is available (if
it is, use udev and a minimalistic /dev, if not, copy the existing
/dev).
b) look for a small shell that is bourne-compatible (/bin/ash if found,
/bin/sh (probably bash) else).
c) if LVM2 is used add dynamic /dev/mapper/control detection and use
lvm2 tool, use lvm1 else
d) try to use pivot_root if available and/or write the recognized
major:minor to /proc/sys/kernel/real-root-dev
e) use partial activation mode if available
f) figure out the used binaries and libraries and copy them (just like
the old initrd does) and strip them
g) add the possibility to load modules
You can find my Athlon or P3 optimized initrd on my page:
http://www.saout.de/misc/ (after gunzipping it you can mount it using
mount initrd.blablabla /mnt -o loop).
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2004-01-01 15:42 ` Christophe Saout
@ 2004-01-01 16:47 ` Luca Berra
2004-01-02 8:30 ` Christophe Saout
0 siblings, 1 reply; 27+ messages in thread
From: Luca Berra @ 2004-01-01 16:47 UTC (permalink / raw)
To: Christophe Saout; +Cc: linux-lvm
On Thu, Jan 01, 2004 at 10:40:42PM +0100, Christophe Saout wrote:
>Sorry for interrupting your discussion, but if someone is modifying the
>initrd script to work with LVM2 or writing a new one, I've perhaps some
>inspiration.
I modified mkinitrd for Mandrake Linux, which is in turn based on
redhat's one. I tkink my code is production stable, but i could still be
contraddicted
Redhat(fedora) is also doing a similar thing. I believe to have started
earlier, then merged in some code from fedora...
>So I modified my initrd to used pivot_root to mount the root filesystem
>itself. I can now give root=/dev/vg/root directly as parameter to the
>kernel instead of having to rely on lilo to resolve the numeric
>major:minor (that caused the trouble).
I always use pivot root in case i am using lvm, but i get the LV name
from fstab when creating the initrd image, i do not trust lilo as well,
i did not have your problem, but i had to test switching from lvm1 to
dm, and did not love lilo hardcoding the wrong MAJOR number. How do you
get the "root=/dev/vg/root", by parsing the last occurrence in
/proc/cmdline?
>The only backdraw: If there isn't an /initrd on the root filesystem,
I used to forcibly create /initrd during the mkinitrd script, i don't do
it anymore since /initrd is part of mandrake filesystem package
>I also switched to ash as shell (a very small bourne-compatible shell).
Atm i am using a modified redhat nash, another option would be busybox
(nash is a very minimal command parser designed with initrd in mind)
>And I added udev to the initrd. The static /dev entries on the initrd
>are only the basic ones, like /dev/console, /dev/null and so.
>/dev/mapper/initrd is created dynamically using /proc/misc, and the
>existing block devices are created using udev and /sys/block/* (if /dev
>isn't devfs).
udev was on my todo list, but i never got there, i'll take a look at
what you did.
I don't copy any device file in the initrd at the moment. I create device
nodes if i need them in nash (and lvm tools), and it suffices my
purposes.
>a) look whether a 2.4 or 2.6 kernel is used and if udev is available (if
see above
>b) look for a small shell that is bourne-compatible (/bin/ash if found,
see above
>c) if LVM2 is used add dynamic /dev/mapper/control detection and use
>lvm2 tool, use lvm1 else
i already do this
>d) try to use pivot_root if available and/or write the recognized
>major:minor to /proc/sys/kernel/real-root-dev
pivot_root is cleaner
>e) use partial activation mode if available
this is a good idea
>f) figure out the used binaries and libraries and copy them (just like
>the old initrd does) and strip them
all the tools i use are linked with dietlibc (on arches that support
it), for the other i already detect the needed libraries, look at my
code.
>g) add the possibility to load modules
i already do this
My initrd detects if the root VG is on a md (softraid) device and
starts it before trying to activate the VG.
I also deal with a readonly initrd (read cramfs), by mounting /dev
(devfs or tmpfs) at the beginning of linuxrc and /etc (tmpfs) before
calling vgscan for lvm1.
Btw, in lilo i use your patch but i tested opening /dev/mapper/control
before trying to initialize dm() so users won't see an error if they
don't have dm in their kernel.
Regards,
L.
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2004-01-02 8:30 ` Christophe Saout
@ 2004-01-01 17:40 ` Luca Berra
2004-01-01 17:50 ` Christophe Saout
0 siblings, 1 reply; 27+ messages in thread
From: Luca Berra @ 2004-01-01 17:40 UTC (permalink / raw)
To: Christophe Saout; +Cc: linux-lvm
On Fri, Jan 02, 2004 at 12:10:11AM +0100, Christophe Saout wrote:
>I thought you were talking about the lvmcreate_initrd script that came
i actually never used lvmcreate_initrd that came with LVM1,
>Yes, I've seen redhat doing this. I personally prefer being able to
>override it at the command line though. Having something hardcoded in
>the initrd sounds strange to me.
i agree with your concern, i'll try to get it from the command line
>I have attached the script. I parse /proc/cmdline, try to remove root=
>using a shell function and if it actually removed something I know that
>the rest has to be a device name. :)
uhm, you should be wary of the case when a root= is in lilo.conf and
luser wants to override it from cmdline. you stop a t the first
occurrence.
>Wasn't ash the one from busybox?
no busybox is a dietlibc compiled shell that already has most command
compiled in, so a single executable, and smaller than glibc.
>With udev I just created /dev/console and some others. Doing everything
>from the script seems unnecessary.
i have to, because of tmpfs dev
>> My initrd detects if the root VG is on a md (softraid) device and
>> starts it before trying to activate the VG.
>Doesn't the kernel start them automatically? You mean, if it isn't
>activated in the kernel? Probably a good idea.
I strongly believe that raid autodetection should be done in user space,
possibly with mdadm. There is a big advantage in being able to control
what gets activated and when, besides distribution kernels use modular
scsi drive modules, so probably autodetection won't work anyway.
I also don't have the faintest idea if the kernel deals with stacked
raid devices
>Yes, that's also possible. But I don't really like it being readonly
>because, as you say, mounting something on /etc or /dev is unnecessary.
>What's the problem with ext2? The wasted memory?
wasted memory and disk space, being able to fit kernel+initrd on a
single floppy is a good reason
>I would love making the initrd an initramfs. But that doesn't currently
i think initramfs is not mature yet.
L.
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2004-01-01 17:40 ` Luca Berra
@ 2004-01-01 17:50 ` Christophe Saout
0 siblings, 0 replies; 27+ messages in thread
From: Christophe Saout @ 2004-01-01 17:50 UTC (permalink / raw)
To: Luca Berra; +Cc: linux-lvm
Am Fr, den 02.01.2004 schrieb Luca Berra um 00:39:
> >I thought you were talking about the lvmcreate_initrd script that came
> i actually never used lvmcreate_initrd that came with LVM1,
I did. It was quite simple to use and worked practically everywhere (if
you didn't use an initrd to do anything else).
> >I have attached the script. I parse /proc/cmdline, try to remove root=
> >using a shell function and if it actually removed something I know that
> >the rest has to be a device name. :)
> uhm, you should be wary of the case when a root= is in lilo.conf and
> luser wants to override it from cmdline. you stop a t the first
> occurrence.
Ah. You're probably right. I assumed the boot loader would replace it. I
never tested that though. My mistake.
> >With udev I just created /dev/console and some others. Doing everything
> >from the script seems unnecessary.
> i have to, because of tmpfs dev
Right. You mentioned that later.
> I strongly believe that raid autodetection should be done in user space,
> possibly with mdadm. There is a big advantage in being able to control
> what gets activated and when, besides distribution kernels use modular
> scsi drive modules, so probably autodetection won't work anyway.
> I also don't have the faintest idea if the kernel deals with stacked
> raid devices
One day everything will be done in userspace, even detection of
partitions. So you're right. But it's a thing to do in a generic initrd,
not in an LVM-only one. There are a lot of other things you should
probably think of in a generic initrd. EVMS users, or perhaps encrypted
root volume or something...?
> wasted memory and disk space, being able to fit kernel+initrd on a
> single floppy is a good reason
Yes, but does cramfs save a lot compared to a compressed ext2
filesystem?
> >I would love making the initrd an initramfs. But that doesn't currently
> i think initramfs is not mature yet.
It simply not finished.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2004-01-01 16:47 ` Luca Berra
@ 2004-01-02 8:30 ` Christophe Saout
2004-01-01 17:40 ` Luca Berra
0 siblings, 1 reply; 27+ messages in thread
From: Christophe Saout @ 2004-01-02 8:30 UTC (permalink / raw)
To: Luca Berra; +Cc: linux-lvm
[-- Attachment #1: Type: text/plain, Size: 5786 bytes --]
Am Do, den 01.01.2004 schrieb Luca Berra um 23:45:
> I modified mkinitrd for Mandrake Linux, which is in turn based on
> redhat's one. I tkink my code is production stable, but i could still be
> contraddicted
I didn't say that, I just want to throw something into this discussion.
:)
I thought you were talking about the lvmcreate_initrd script that came
with LVM1. I always used that one before, it doesn't need some extras
compiled, it just takes the binaries it finds on the system. I think
it's well suited for people that don't have a distro-specific script to
handle things.
> >So I modified my initrd to used pivot_root to mount the root filesystem
> >itself. I can now give root=/dev/vg/root directly as parameter to the
> >kernel instead of having to rely on lilo to resolve the numeric
> >major:minor (that caused the trouble).
>
> I always use pivot root in case i am using lvm, but i get the LV name
> from fstab when creating the initrd image, i do not trust lilo as well,
Yes, I've seen redhat doing this. I personally prefer being able to
override it at the command line though. Having something hardcoded in
the initrd sounds strange to me.
> i did not have your problem, but i had to test switching from lvm1 to
> dm, and did not love lilo hardcoding the wrong MAJOR number. How do you
> get the "root=/dev/vg/root", by parsing the last occurrence in
> /proc/cmdline?
I have attached the script. I parse /proc/cmdline, try to remove root=
using a shell function and if it actually removed something I know that
the rest has to be a device name. :)
I then try to look it up and use it.
I'm also doing the same for rw/ro, rootfstype and rootflags, just like
the kernel would.
> >The only backdraw: If there isn't an /initrd on the root filesystem,
> I used to forcibly create /initrd during the mkinitrd script, i don't do
> it anymore since /initrd is part of mandrake filesystem package
Sure. For a generic script it would be probably best to do it too.
> >I also switched to ash as shell (a very small bourne-compatible shell).
> Atm i am using a modified redhat nash, another option would be busybox
> (nash is a very minimal command parser designed with initrd in mind)
Wasn't ash the one from busybox?
The tools from my system that I put into the initrd are:
-rwxr-xr-x 1 root root 16776 28. Dez 04:20 cat
-rwxr-xr-x 1 root root 19896 28. Dez 03:43 mknod
-rwxr-xr-x 1 root root 75572 28. Dez 03:43 mount
-rwxr-xr-x 1 root root 88960 28. Dez 03:43 sed
-rwxr-xr-x 1 root root 91000 28. Dez 03:43 sh
-rwxr-xr-x 1 root root 35940 28. Dez 03:43 umount
Rather small. The only big thing is libc.so.6 in /lib (1,3MB). The whole
initrd compressed is < 1MB. Perhaps linking the tools against dietlibc
would help and/or taking mount/umount/mknod/sed/cat from busybox (does
it have those?). Well, not an option for a generic lvmcreate_initrd.
> udev was on my todo list, but i never got there, i'll take a look at
> what you did.
It's rather simple:
/bin/mount /sys
export UDEV_NO_SLEEP=1 ACTION=add
for i in /sys/block/*; do
DEVPATH=${i#/sys} /sbin/udev block &
for j in $i/*; do
if [ -e $j/dev ]; then
DEVPATH=${j#/sys} /sbin/udev block &
fi
done
done
unset UDEV_NO_SLEEP ACTION
wait
/bin/umount /sys
In the future udev will probably be able to populate /dev itself without
the shell script around it.
What I like is that it will create all block devices the kernel knows
about. Without a special rules file in /etr/rules it uses the device
names the kernel provides (these are traditional style). This should
cause trouble since the LVM device cache is thrown away with the initrd
anyway.
Just look at my linuxrc script, I attached it.
> I don't copy any device file in the initrd at the moment. I create device
> nodes if i need them in nash (and lvm tools), and it suffices my
> purposes.
With udev I just created /dev/console and some others. Doing everything
from the script seems unnecessary.
> >d) try to use pivot_root if available and/or write the recognized
> >major:minor to /proc/sys/kernel/real-root-dev
> pivot_root is cleaner
Ok, I thought just in case there is no /initrd. But I dislike it because
the kernel major:minor thing is in a flux and
/proc/sys/kernel/real-root-dev is kind of broken (8:8 bit split fixed).
> >e) use partial activation mode if available
> this is a good idea
Yes, it's really needed. I accidentally wiped an empty PV without
telling LVM and my system didn't boot anymore...
> all the tools i use are linked with dietlibc (on arches that support
> it), for the other i already detect the needed libraries, look at my
> code.
Ok.
> My initrd detects if the root VG is on a md (softraid) device and
> starts it before trying to activate the VG.
Doesn't the kernel start them automatically? You mean, if it isn't
activated in the kernel? Probably a good idea.
> I also deal with a readonly initrd (read cramfs), by mounting /dev
> (devfs or tmpfs) at the beginning of linuxrc and /etc (tmpfs) before
> calling vgscan for lvm1.
Yes, that's also possible. But I don't really like it being readonly
because, as you say, mounting something on /etc or /dev is unnecessary.
What's the problem with ext2? The wasted memory?
I would love making the initrd an initramfs. But that doesn't currently
work correctly. initramfs is a tmpfs which is populated by a compressed
cpio archive. Linux 2.6 has an initramfs and is able to populate it via
a cpio archive passed via initrd but doesn't call linuxrc... (see the
early userspace discussion).
[-- Attachment #2: linuxrc --]
[-- Type: text/x-sh, Size: 2239 bytes --]
#!/bin/sh
setup_dev() {
MAJOR=$(/bin/sed -n 's/^ *\([0-9]\+\) \+misc$/\1/p' /proc/devices)
MINOR=$(/bin/sed -n 's/^ *\([0-9]\+\) \+device-mapper$/\1/p' /proc/misc)
if test -n "$MAJOR" -a -n "$MINOR" ; then
/bin/mknod --mode=600 /dev/mapper/control c $MAJOR $MINOR
fi
/bin/mount /sys
export UDEV_NO_SLEEP=1 ACTION=add
for i in /sys/block/*; do
DEVPATH=${i#/sys} /sbin/udev block &
for j in $i/*; do
if [ -e $j/dev ]; then
DEVPATH=${j#/sys} /sbin/udev block &
fi
done
done
unset UDEV_NO_SLEEP ACTION
wait
/bin/umount /sys
}
setup_lvm() {
/sbin/lvm vgchange --ignorelockingfailure -P -a y
}
find_root() {
for arg in $CMDLINE; do
ROOT="${arg#root=}"
if [ ! "$ROOT" = "$arg" ]; then
ROOT="/dev/${ROOT#/dev/}"
[ -n "$ROOT" -a -b $ROOT ] || ROOT=
return 0
fi
done
ROOT=
return 0
}
find_fstype() {
for arg in $CMDLINE; do
FSTYPE="${arg#rootfstype=}"
[ "$FSTYPE" = "$arg" ] || return 0
done
FSTYPE=auto
return 0
}
find_flags() {
local MODE
for arg in $CMDLINE; do
FLAGS="${arg#rootflags=}"
[ "$FLAGS" = "$arg" ] || break
FLAGS=
done
for arg in $CMDLINE; do
case "$arg" in
ro) MODE=,ro;;
rw) MODE=,rw;;
esac
done
FLAGS="$FLAGS$MODE"
FLAGS="${FLAGS#,}"
[ -n "$FLAGS" ] && FLAGS="-o $FLAGS"
return 0
}
mount_root() {
find_flags
find_fstype
echo "Mounting root filesystem on $ROOT:"
if ! /bin/mount $FLAGS -t "$FSTYPE" "$ROOT" /mnt; then
echo "... failed!"
return 0
fi
echo -n "Trying to mount old root to /initrd ... "
cd /mnt
if /sbin/pivot_root . initrd 2> /dev/null; then
echo okay
cd /
else
echo failed
cd /
/bin/umount /mnt
return 0
fi
export LD_LIBRARY_PATH="/initrd/lib"
LD_SO="$LD_LIBRARY_PATH/ld-linux.so.2"
echo 0x0100 > /initrd/proc/sys/kernel/real-root-dev
[ -e /initrd/dev/.devfsd ] && $LD_SO /initrd/bin/mount -n --move /initrd/dev /dev
$LD_SO /initrd/bin/umount -n /initrd/proc
if [ -e /initrd/dev/.devfsd ]; then
exec $LD_SO /initrd/bin/umount -n /initrd/dev < /dev/console > /dev/console 2>&1
else
exit 0
fi
}
#################################
/bin/mount /proc
CMDLINE=$(/bin/cat /proc/cmdline)
[ -e /dev/.devfsd ] || setup_dev
setup_lvm
find_root
[ -n "$ROOT" ] && mount_root
/bin/umount /proc
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
@ 2004-01-02 9:12 Kjartan Reynir Hauksson
2004-01-02 10:58 ` Luca Berra
0 siblings, 1 reply; 27+ messages in thread
From: Kjartan Reynir Hauksson @ 2004-01-02 9:12 UTC (permalink / raw)
To: linux-lvm
>note my patched initscripts does not care what the default alternative
>for lvm is (lvm1 or lvm2) but you might, so check and change it with the
>"update-alternatives --config" command if you have both rpm installed.
I noticed that lvm1 was loaded instead of lvm2 but when I check
update-alternatives --config lvm I see lvm2 used as default over lvm1.
Might this be causing my kernel panic (no init found).
-Kjartan
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2004-01-02 9:12 Kjartan Reynir Hauksson
@ 2004-01-02 10:58 ` Luca Berra
0 siblings, 0 replies; 27+ messages in thread
From: Luca Berra @ 2004-01-02 10:58 UTC (permalink / raw)
To: linux-lvm
On Fri, Jan 02, 2004 at 03:02:18PM +0000, Kjartan Reynir Hauksson wrote:
>I noticed that lvm1 was loaded instead of lvm2 but when I check
>update-alternatives --config lvm I see lvm2 used as default over lvm1.
>Might this be causing my kernel panic (no init found).
>
no, mkinitrd 3.5.15.1 does not care about alternatives
your logs, please.
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
@ 2004-01-02 11:37 Kjartan Reynir Hauksson
2004-01-02 12:07 ` Luca Berra
0 siblings, 1 reply; 27+ messages in thread
From: Kjartan Reynir Hauksson @ 2004-01-02 11:37 UTC (permalink / raw)
To: linux-lvm
>no, mkinitrd 3.5.15.1 does not care about alternatives
>your logs, please.
Here's mkinitrd
[root@kjartan root]# mkinitrd -v -f /boot/initrd-2.4.22.img 2.4.22
Looking for deps of module aic7xxx
scsi_mod
Looking for deps of module scsi_mod
Looking for deps of module sd_mod
scsi_mod
Looking for deps of module scsi_mod
/bin/ls: relocation error: /bin/ls: symbol gnu_dev_minor, version
GLIBC_2.3.3 not defined in file l
ibc.so.6 with link time reference
/sbin/mkinitrd: line 529: [: too many arguments
/sbin/mkinitrd: line 543: [: too many arguments
Looking for deps of module ext3
jbd
Looking for deps of module jbd
Using modules: ./kernel/drivers/scsi/scsi_mod.o
./kernel/drivers/scsi/aic7xxx/aic7xxx.o ./kernel/d
rivers/scsi/sd_mod.o ./kernel/fs/jbd/jbd.o ./kernel/fs/ext3/ext3.o
Using /root/tmp as temporary directory.
/sbin/nash -> /root/tmp/initrd.8wLSt0/bin/nash
/sbin/insmod-DIET -> /root/tmp/initrd.8wLSt0/bin/insmod
`/lib/modules/2.4.22/./kernel/drivers/scsi/scsi_mod.o' ->
`/root/tmp/initrd.8wLSt0/lib/scsi_mod.o'
`/lib/modules/2.4.22/./kernel/drivers/scsi/aic7xxx/aic7xxx.o' ->
`/root/tmp/initrd.8wLSt0/lib/aic7x
xx.o'
`/lib/modules/2.4.22/./kernel/drivers/scsi/sd_mod.o' ->
`/root/tmp/initrd.8wLSt0/lib/sd_mod.o'
`/lib/modules/2.4.22/./kernel/fs/jbd/jbd.o' ->
`/root/tmp/initrd.8wLSt0/lib/jbd.o'
`/lib/modules/2.4.22/./kernel/fs/ext3/ext3.o' ->
`/root/tmp/initrd.8wLSt0/lib/ext3.o'
mknod: relocation error: mknod: symbol gnu_dev_makedev, version GLIBC_2.3.3
not defined in file lib
c.so.6 with link time reference
mknod: relocation error: mknod: symbol gnu_dev_makedev, version GLIBC_2.3.3
not defined in file lib
c.so.6 with link time reference
mknod: relocation error: mknod: symbol gnu_dev_makedev, version GLIBC_2.3.3
not defined in file lib
c.so.6 with link time reference
mknod: relocation error: mknod: symbol gnu_dev_makedev, version GLIBC_2.3.3
not defined in file lib
c.so.6 with link time reference
mknod: relocation error: mknod: symbol gnu_dev_makedev, version GLIBC_2.3.3
not defined in file lib
c.so.6 with link time reference
mknod: relocation error: mknod: symbol gnu_dev_makedev, version GLIBC_2.3.3
not defined in file lib
c.so.6 with link time reference
mknod: relocation error: mknod: symbol gnu_dev_makedev, version GLIBC_2.3.3
not defined in file lib
c.so.6 with link time reference
mknod: relocation error: mknod: symbol gnu_dev_makedev, version GLIBC_2.3.3
not defined in file lib
c.so.6 with link time reference
Loading module scsi_mod.o
Loading module aic7xxx.o
Loading module sd_mod.o
Loading module jbd.o
Loading module ext3.o
Contents of RCFILE:
#!/bin/nash
echo "Loading scsi_mod.o module"
insmod /lib/scsi_mod.o
echo "Loading aic7xxx.o module"
insmod /lib/aic7xxx.o
echo "Loading sd_mod.o module"
insmod /lib/sd_mod.o
echo "Loading jbd.o module"
insmod /lib/jbd.o
echo "Loading ext3.o module"
insmod /lib/ext3.o
echo Mounting /proc filesystem
mount -t proc /proc /proc
echo Creating device files
mkdevices /dev
echo Creating root device
mkrootdev /dev/root
echo 0x0100 > /proc/sys/kernel/real-root-dev
echo Mounting root filesystem
mount -o defaults --ro -t ext3 /dev/root /sysroot
pivot_root /sysroot /sysroot/initrd
echo Remounting devfs at correct place if necessary
handledevfs
umount /initrd/proc
Creating filesystem with size 777KB and 176 inodes
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2004-01-02 11:37 Kjartan Reynir Hauksson
@ 2004-01-02 12:07 ` Luca Berra
0 siblings, 0 replies; 27+ messages in thread
From: Luca Berra @ 2004-01-02 12:07 UTC (permalink / raw)
To: linux-lvm
On Fri, Jan 02, 2004 at 05:27:16PM +0000, Kjartan Reynir Hauksson wrote:
>mknod: relocation error: mknod: symbol gnu_dev_makedev, version GLIBC_2.3.3
>not defined in file lib
>c.so.6 with link time reference
reinstall coreutils-5.0-6.1.92mdk
software on my home page is usually for the development version of
mandrake and does not work with mandrake 9.2 (with the exception of the
stuff in the lvm2 subdirectory, which i try to backport to 9.2)
L.
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
^ permalink raw reply [flat|nested] 27+ messages in thread
* RE: [linux-lvm] booting a dm+lvm2 kernel
@ 2004-01-02 13:03 Kjartan Reynir Hauksson
2004-01-02 13:15 ` Luca Berra
0 siblings, 1 reply; 27+ messages in thread
From: Kjartan Reynir Hauksson @ 2004-01-02 13:03 UTC (permalink / raw)
To: linux-lvm
>reinstall coreutils-5.0-6.1.92mdk
>software on my home page is usually for the development version of
>mandrake and does not work with mandrake 9.2 (with the exception of the
>stuff in the lvm2 subdirectory, which i try to backport to 9.2)
Did it and reran mkinitrd but I'm still getting kernel panic. It says
pivotroot: pivot_root(sysroot,/sysroot/initrd) failed: 2
Here's my mkinitrd output
[root@kjartan root]# mkinitrd -v -f /boot/initrd-2.4.22.img 2.4.22
Looking for deps of module aic7xxx
scsi_mod
Looking for deps of module scsi_mod
Looking for deps of module sd_mod
scsi_mod
Looking for deps of module scsi_mod
Looking for deps of module lvm-mod
Looking for deps of module dm-mod
Looking for deps of module ext3
jbd
Looking for deps of module jbd
Using modules: ./kernel/drivers/scsi/scsi_mod.o
./kernel/drivers/scsi/aic7xxx/aic7xxx.o
./kernel/drivers/scsi/sd_mod.o ./kernel/fs/jbd/jbd.o
./kernel/fs/ext3/ext3.o
Using /root/tmp as temporary directory.
/sbin/nash -> /root/tmp/initrd.qPJFGp/bin/nash
/sbin/insmod-DIET -> /root/tmp/initrd.qPJFGp/bin/insmod
`/lib/modules/2.4.22/./kernel/drivers/scsi/scsi_mod.o' ->
`/root/tmp/initrd.qPJFGp/lib/sc
si_mod.o'
`/lib/modules/2.4.22/./kernel/drivers/scsi/aic7xxx/aic7xxx.o' ->
`/root/tmp/initrd.qPJFGp
/lib/aic7xxx.o'
`/lib/modules/2.4.22/./kernel/drivers/scsi/sd_mod.o' ->
`/root/tmp/initrd.qPJFGp/lib/sd_m
od.o'
`/lib/modules/2.4.22/./kernel/fs/jbd/jbd.o' ->
`/root/tmp/initrd.qPJFGp/lib/jbd.o'
`/lib/modules/2.4.22/./kernel/fs/ext3/ext3.o' ->
`/root/tmp/initrd.qPJFGp/lib/ext3.o'
Loading module scsi_mod.o
Loading module aic7xxx.o
Loading module sd_mod.o
Loading module jbd.o
Loading module ext3.o
`/sbin/lvm1-vgwrapper' -> `/root/tmp/initrd.qPJFGp/sbin/vgscan'
Contents of RCFILE:
#!/bin/nash
echo "Loading scsi_mod.o module"
insmod /lib/scsi_mod.o
echo "Loading aic7xxx.o module"
insmod /lib/aic7xxx.o
echo "Loading sd_mod.o module"
insmod /lib/sd_mod.o
echo "Loading jbd.o module"
insmod /lib/jbd.o
echo "Loading ext3.o module"
insmod /lib/ext3.o
echo Mounting /proc filesystem
mount -t proc /proc /proc
echo Creating device files
mkdevices /dev
mknod /dev/lvm b 109 0
mount -t tmpfs /etc /etc
echo Scanning logical volumes
vgscan
echo Activating logical volumes
vgchange -ay
umount /etc
echo 0x0100 > /proc/sys/kernel/real-root-dev
echo Mounting root filesystem
mount -o defaults --ro -t ext3 /dev/root/1 /sysroot
pivot_root /sysroot /sysroot/initrd
echo Remounting devfs at correct place if necessary
handledevfs
umount /initrd/proc
Creating filesystem with size 906KB and 186 inodes
And my lilo.conf
[root@kjartan root]# cat /etc/lilo.conf
boot=/dev/hda
map=/boot/map
vga=normal
default="linux"
keytable=/boot/us.klt
prompt
nowarn
timeout=50
message=/boot/message
menu-scheme=wb:bw:wb:bw
image=/boot/vmlinuz
label="linux"
root=/dev/root/1
initrd=/boot/initrd.img
append="devfs=mount hdc=ide-scsi acpi=ht splash=silent"
vga=788
read-only
image=/boot/vmlinuz
label="linux-nonfb"
root=/dev/root/1
initrd=/boot/initrd.img
append="devfs=mount hdc=ide-scsi acpi=ht"
read-only
image=/boot/vmlinuz
label="failsafe"
root=/dev/root/1
initrd=/boot/initrd.img
append="failsafe devfs=nomount hdc=ide-scsi acpi=ht"
read-only
image=/boot/vmlinuz-2.4.22
label=lvm2
root=/dev/root/1
initrd=/boot/initrd-2.4.22.img
append="devfs=mount"
read-only
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2004-01-02 13:03 Kjartan Reynir Hauksson
@ 2004-01-02 13:15 ` Luca Berra
0 siblings, 0 replies; 27+ messages in thread
From: Luca Berra @ 2004-01-02 13:15 UTC (permalink / raw)
To: linux-lvm
On Fri, Jan 02, 2004 at 06:52:59PM +0000, Kjartan Reynir Hauksson wrote:
>Did it and reran mkinitrd but I'm still getting kernel panic. It says
>pivotroot: pivot_root(sysroot,/sysroot/initrd) failed: 2
>
>Here's my mkinitrd output
>
>Looking for deps of module lvm-mod
>Looking for deps of module dm-mod
ok, you have dm builtin and not as a module, so autodetection does not
work. You have to use the --lvm-version=2 option to mkinitrd.
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
@ 2004-01-02 13:40 Kjartan Reynir Hauksson
2004-01-02 14:12 ` Luca Berra
0 siblings, 1 reply; 27+ messages in thread
From: Kjartan Reynir Hauksson @ 2004-01-02 13:40 UTC (permalink / raw)
To: linux-lvm
>work. You have to use the --lvm-version=2 option to mkinitrd.
kernel panic, this time VFS: Cannot open root device "3a00" or 3a:00
Output from mkinitrd:
[root@kjartan root]# mkinitrd -v -f --lvm-version=2 /boot/initrd-2.4.22.img
2.4.22
Looking for deps of module aic7xxx
scsi_mod
Looking for deps of module scsi_mod
Looking for deps of module sd_mod
scsi_mod
Looking for deps of module scsi_mod
Looking for deps of module dm-mod
Looking for deps of module ext3
jbd
Looking for deps of module jbd
Using modules: ./kernel/drivers/scsi/scsi_mod.o
./kernel/drivers/scsi/aic7xxx/aic7
xxx.o ./kernel/drivers/scsi/sd_mod.o ./kernel/fs/jbd/jbd.o
./kernel/fs/ext3/ext3.o
Using /root/tmp as temporary directory.
/sbin/nash -> /root/tmp/initrd.n7CMXa/bin/nash
/sbin/insmod-DIET -> /root/tmp/initrd.n7CMXa/bin/insmod
`/lib/modules/2.4.22/./kernel/drivers/scsi/scsi_mod.o' ->
`/root/tmp/initrd.n7CMXa/
lib/scsi_mod.o'
`/lib/modules/2.4.22/./kernel/drivers/scsi/aic7xxx/aic7xxx.o' ->
`/root/tmp/initrd.
n7CMXa/lib/aic7xxx.o'
`/lib/modules/2.4.22/./kernel/drivers/scsi/sd_mod.o' ->
`/root/tmp/initrd.n7CMXa/li
b/sd_mod.o'
`/lib/modules/2.4.22/./kernel/fs/jbd/jbd.o' ->
`/root/tmp/initrd.n7CMXa/lib/jbd.o'
`/lib/modules/2.4.22/./kernel/fs/ext3/ext3.o' ->
`/root/tmp/initrd.n7CMXa/lib/ext3.
o'
Loading module scsi_mod.o
Loading module aic7xxx.o
Loading module sd_mod.o
Loading module jbd.o
Loading module ext3.o
`/sbin/lvm2-static' -> `/root/tmp/initrd.n7CMXa/sbin/vgscan'
Contents of RCFILE:
#!/bin/nash
echo "Loading scsi_mod.o module"
insmod /lib/scsi_mod.o
echo "Loading aic7xxx.o module"
insmod /lib/aic7xxx.o
echo "Loading sd_mod.o module"
insmod /lib/sd_mod.o
echo "Loading jbd.o module"
insmod /lib/jbd.o
echo "Loading ext3.o module"
insmod /lib/ext3.o
echo Mounting /proc filesystem
mount -t proc /proc /proc
echo Creating device files
mkdevices /dev
echo Making device-mapper control node
mkdmnod
echo Scanning logical volumes
vgscan --ignorelockingfailure
echo Activating logical volumes
vgchange -ay --ignorelockingfailure
echo Making device nodes
vgmknodes
echo 0x0100 > /proc/sys/kernel/real-root-dev
echo Mounting root filesystem
mount -o defaults --ro -t ext3 /dev/root/1 /sysroot
pivot_root /sysroot /sysroot/initrd
echo Remounting devfs at correct place if necessary
handledevfs
umount /initrd/proc
Creating filesystem with size 1103KB and 191 inodes
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2004-01-02 13:40 Kjartan Reynir Hauksson
@ 2004-01-02 14:12 ` Luca Berra
2004-01-02 14:24 ` Bill Rugolsky Jr.
0 siblings, 1 reply; 27+ messages in thread
From: Luca Berra @ 2004-01-02 14:12 UTC (permalink / raw)
To: linux-lvm
On Fri, Jan 02, 2004 at 07:30:45PM +0000, Kjartan Reynir Hauksson wrote:
>>work. You have to use the --lvm-version=2 option to mkinitrd.
>
>kernel panic, this time VFS: Cannot open root device "3a00" or 3a:00
ouch that should never happen, do you have anything printed above the kernel panic?
>Output from mkinitrd:
>
>[root@kjartan root]# mkinitrd -v -f --lvm-version=2 /boot/initrd-2.4.22.img
this seems ok
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2004-01-02 14:12 ` Luca Berra
@ 2004-01-02 14:24 ` Bill Rugolsky Jr.
2004-01-02 16:11 ` Luca Berra
0 siblings, 1 reply; 27+ messages in thread
From: Bill Rugolsky Jr. @ 2004-01-02 14:24 UTC (permalink / raw)
To: linux-lvm
On Fri, Jan 02, 2004 at 09:10:46PM +0100, Luca Berra wrote:
> On Fri, Jan 02, 2004 at 07:30:45PM +0000, Kjartan Reynir Hauksson wrote:
> >>work. You have to use the --lvm-version=2 option to mkinitrd.
> >
> >kernel panic, this time VFS: Cannot open root device "3a00" or 3a:00
>
> ouch that should never happen, do you have anything printed above the
> kernel panic?
0x3a == 58 == lvm1 major device number. So it looks like the initrd
is still incorrect.
Regards,
Bill Rugolsky
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2004-01-02 14:24 ` Bill Rugolsky Jr.
@ 2004-01-02 16:11 ` Luca Berra
0 siblings, 0 replies; 27+ messages in thread
From: Luca Berra @ 2004-01-02 16:11 UTC (permalink / raw)
To: linux-lvm
On Fri, Jan 02, 2004 at 03:22:06PM -0500, Bill Rugolsky Jr. wrote:
>On Fri, Jan 02, 2004 at 09:10:46PM +0100, Luca Berra wrote:
>> On Fri, Jan 02, 2004 at 07:30:45PM +0000, Kjartan Reynir Hauksson wrote:
>> >>work. You have to use the --lvm-version=2 option to mkinitrd.
>> >
>> >kernel panic, this time VFS: Cannot open root device "3a00" or 3a:00
>>
>> ouch that should never happen, do you have anything printed above the
>> kernel panic?
>
>0x3a == 58 == lvm1 major device number. So it looks like the initrd
>is still incorrect.
>
no, the culprit for 0x3a is lilo, but initrd should purposefully ignore
that.
it should mount the root fs and then do a pivot_root, so the kernel
trying to open a root device is unexpected.
L.
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
@ 2004-01-02 16:54 Kjartan Reynir Hauksson
2004-01-02 17:34 ` Luca Berra
0 siblings, 1 reply; 27+ messages in thread
From: Kjartan Reynir Hauksson @ 2004-01-02 16:54 UTC (permalink / raw)
To: linux-lvm
>no, the culprit for 0x3a is lilo, but initrd should purposefully ignore
>that.
>it should mount the root fs and then do a pivot_root, so the kernel
>trying to open a root device is unexpected.
Well I patched the lilo mdk source file myself so it's probably my fault
(didn't see anything wrong though). I tried to get your package from
comedia.it but it's not responding, can I get it somewhere else ?
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2004-01-02 16:54 Kjartan Reynir Hauksson
@ 2004-01-02 17:34 ` Luca Berra
0 siblings, 0 replies; 27+ messages in thread
From: Luca Berra @ 2004-01-02 17:34 UTC (permalink / raw)
To: linux-lvm
On Fri, Jan 02, 2004 at 10:44:34PM +0000, Kjartan Reynir Hauksson wrote:
>>no, the culprit for 0x3a is lilo, but initrd should purposefully ignore
>>that.
>>it should mount the root fs and then do a pivot_root, so the kernel
>>trying to open a root device is unexpected.
>
>Well I patched the lilo mdk source file myself so it's probably my fault
>(didn't see anything wrong though). I tried to get your package from
no, the fact that lilo writes the major number it sees when it is
invoked (3a in your case) cannot be prevented.
but initrd ignores this option, so what you are seing is unexpected to
me.
If you could tell me what your machine prints before the kernel panic i
could try to guess what happened
>comedia.it but it's not responding, can I get it somewhere else ?
>
thanks for noticing, the server is up again now.
L.
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
@ 2004-01-02 18:02 Kjartan Reynir Hauksson
2004-01-03 4:30 ` Luca Berra
0 siblings, 1 reply; 27+ messages in thread
From: Kjartan Reynir Hauksson @ 2004-01-02 18:02 UTC (permalink / raw)
To: linux-lvm
>If you could tell me what your machine prints before the kernel panic i
>could try to guess what happened
hmmmm... this looks a little suspicious: invalid compressed format
(err=2)<6> Freeing initrd memory 451k freed
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2004-01-02 18:02 Kjartan Reynir Hauksson
@ 2004-01-03 4:30 ` Luca Berra
0 siblings, 0 replies; 27+ messages in thread
From: Luca Berra @ 2004-01-03 4:30 UTC (permalink / raw)
To: linux-lvm
On Fri, Jan 02, 2004 at 11:51:55PM +0000, Kjartan Reynir Hauksson wrote:
>>If you could tell me what your machine prints before the kernel panic i
>>could try to guess what happened
>
>hmmmm... this looks a little suspicious: invalid compressed format
>(err=2)<6> Freeing initrd memory 451k freed
this means either your initrd is corrupted, or you did not rerun lilo
after createing the initrd.
Regards,
L.
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
@ 2004-01-03 11:34 Kjartan Reynir Hauksson
2004-01-05 7:32 ` Luca Berra
0 siblings, 1 reply; 27+ messages in thread
From: Kjartan Reynir Hauksson @ 2004-01-03 11:34 UTC (permalink / raw)
To: linux-lvm
>this means either your initrd is corrupted, or you did not rerun lilo
>after createing the initrd.
Yup.. I forgot to run /sbin/lilo but it doesn't take. The first error is
failed to create /dev/mapper/control and after that everything fails and it
ends up in a kernel panic.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [linux-lvm] booting a dm+lvm2 kernel
2004-01-03 11:34 [linux-lvm] booting a dm+lvm2 kernel Kjartan Reynir Hauksson
@ 2004-01-05 7:32 ` Luca Berra
0 siblings, 0 replies; 27+ messages in thread
From: Luca Berra @ 2004-01-05 7:32 UTC (permalink / raw)
To: linux-lvm
[-- Attachment #1: Type: text/plain, Size: 974 bytes --]
On Sat, Jan 03, 2004 at 05:24:09PM +0000, Kjartan Reynir Hauksson wrote:
>>this means either your initrd is corrupted, or you did not rerun lilo
>>after createing the initrd.
>
>Yup.. I forgot to run /sbin/lilo but it doesn't take. The first error is
>failed to create /dev/mapper/control and after that everything fails and it
>ends up in a kernel panic.
>
ok, the attached file is a log of my computer booting with a 2.4 kernel
with device-mapper enabled and my initrd and lvm packages.
i used the latest prebuilt kernel from mandrake cooker.
tell me where your situation differs from mine and please try copying
down the 'exact' messages that the kernel prints before panicking.
(the failed to create /dev/mapper/control is normal if you are using
devfs, i'll try to remove needless warnings in a future release)
L.
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
[-- Attachment #2: initrd.log --]
[-- Type: text/plain, Size: 3992 bytes --]
------------ mkinitrd ----------
# mkinitrd -v --lvm-version=2 -f /boot/initrd-2.4.24-0.pre2.1mdk.img 2.4.24-0.pre2.1mdk
Looking for deps of module 3w-xxxx
scsi_mod
Looking for deps of module scsi_mod
Looking for deps of module sd_mod
scsi_mod
Looking for deps of module scsi_mod
Looking for deps of module dm-mod
Looking for deps of module ext3
jbd
Looking for deps of module jbd
Using modules: ./kernel/drivers/scsi/scsi_mod.o ./kernel/drivers/scsi/3w-xxxx.o ./kernel/drivers/scsi/sd_mod.o ./kernel/drivers/md/dm-mod.o ./kernel/fs/jbd/jbd.o ./kernel/fs/ext3/ext3.o
Using /root/tmp as temporary directory.
/sbin/nash -> /root/tmp/initrd.02YkRu/bin/nash
/sbin/insmod-DIET -> /root/tmp/initrd.02YkRu/bin/insmod
Loading module scsi_mod.o
Loading module 3w-xxxx.o
Loading module sd_mod.o
Loading module dm-mod.o
Loading module jbd.o
Loading module ext3.o
`/sbin/lvm2-static' -> `/root/tmp/initrd.02YkRu/sbin/vgscan'
Contents of RCFILE:
#!/bin/nash
echo "Loading scsi_mod.o module"
insmod /lib/scsi_mod.o
echo "Loading 3w-xxxx.o module"
insmod /lib/3w-xxxx.o
echo "Loading sd_mod.o module"
insmod /lib/sd_mod.o
echo "Loading dm-mod.o module"
insmod /lib/dm-mod.o
echo "Loading jbd.o module"
insmod /lib/jbd.o
echo "Loading ext3.o module"
insmod /lib/ext3.o
echo Mounting /proc filesystem
mount -t proc /proc /proc
echo Creating device files
mkdevices /dev
echo Making device-mapper control node
mkdmnod
echo Scanning logical volumes
vgscan --ignorelockingfailure
echo Activating logical volumes
vgchange -ay --ignorelockingfailure
echo Making device nodes
vgmknodes
echo 0x0100 > /proc/sys/kernel/real-root-dev
echo Mounting root filesystem
mount -o defaults --ro -t ext3 /dev/vg00/lvol1 /sysroot
pivot_root /sysroot /sysroot/initrd
echo Remounting devfs at correct place if necessary
handledevfs
umount /initrd/proc
Creating filesystem with size 978KB and 147 inodes
------------ lilo.conf ---------
boot=/dev/sda
map=/boot/map
install=menu
vga=792
default="linux"
keytable=/boot/us.klt
prompt
nowarn
timeout=100
message=/boot/message
menu-scheme=wb:bw:wb:bw
image=/boot/vmlinuz
label=linux
root=/dev/vg00/lvol1
initrd=/boot/initrd.img
append="panic=60 acpi=force devfs=mount"
read-only
------------ boot log ----------
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 333k freed
VFS: Mounted root (ext2 filesystem).
Mounted devfs on /dev
Red Hat nash version 3.5.15.1-mdk starting
Loading scsi_mod.o module
Using insmod provided by busybox.
SCSI subsystem driver Revision: 1.00
Loading 3w-xxxx.o module
Using insmod provided by busybox.
3ware Storage Controller device driver for Linux v1.02.00.037.
scsi0 : Found a 3ware Storage Controller at 0x7c30, IRQ: 9, P-chip: 1.3
scsi0 : 3ware Storage Controller
Vendor: 3ware Model: Logical Disk 0 Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 00
Loading sd_mod.o module
Using insmod provided by busybox.
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 240119680 512-byte hdwr sectors (122941 MB)
Partition check:
/dev/scsi/host0/bus0/target0/lun0: p1
Loading dm-mod.o module
Using insmod provided by busybox.
device-mapper: 4.0.1-ioctl (2003-07-12) initialised: dm@uk.sistina.com
Loading jbd.o module
Using insmod provided by busybox.
Journalled Block Device driver loaded
Loading ext3.o module
Using insmod provided by busybox.
Mounting /proc filesystem
Creating device files
Making device-mapper control node
failed to create /dev/mapper/control
Scanning logical volumes
Reading all physical volumes. This may take a while...
Found volume group "vg00" using metadata type lvm1
Activating logical volumes
7 logical volume(s) in volume group "vg00" now active
Making device nodes
Mounting root filesystem
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
Remounting devfs at correct place if necessary
Mounted devfs on /dev
Freeing unused kernel memory: 156k freed
INIT: version 2.85 booting
^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2004-01-05 7:32 UTC | newest]
Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-03 11:34 [linux-lvm] booting a dm+lvm2 kernel Kjartan Reynir Hauksson
2004-01-05 7:32 ` Luca Berra
-- strict thread matches above, loose matches on Subject: below --
2004-01-02 18:02 Kjartan Reynir Hauksson
2004-01-03 4:30 ` Luca Berra
2004-01-02 16:54 Kjartan Reynir Hauksson
2004-01-02 17:34 ` Luca Berra
2004-01-02 13:40 Kjartan Reynir Hauksson
2004-01-02 14:12 ` Luca Berra
2004-01-02 14:24 ` Bill Rugolsky Jr.
2004-01-02 16:11 ` Luca Berra
2004-01-02 13:03 Kjartan Reynir Hauksson
2004-01-02 13:15 ` Luca Berra
2004-01-02 11:37 Kjartan Reynir Hauksson
2004-01-02 12:07 ` Luca Berra
2004-01-02 9:12 Kjartan Reynir Hauksson
2004-01-02 10:58 ` Luca Berra
2004-01-01 10:58 Kjartan Reynir Hauksson
2004-01-01 12:49 ` Luca Berra
2004-01-01 15:42 ` Christophe Saout
2004-01-01 16:47 ` Luca Berra
2004-01-02 8:30 ` Christophe Saout
2004-01-01 17:40 ` Luca Berra
2004-01-01 17:50 ` Christophe Saout
2003-12-31 18:46 Kjartan Reynir Hauksson
2004-01-01 5:11 ` Luca Berra
2003-12-30 21:21 Kjartan Reynir Hauksson
2003-12-31 3:35 ` Luca Berra
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.