All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] LVM partition and lvm commands in initrd
@ 2006-09-23  8:02 Mark Ryden
  2006-09-23  8:27 ` Aleksandr Koltsoff
  2006-09-23  8:56 ` Luca Berra
  0 siblings, 2 replies; 5+ messages in thread
From: Mark Ryden @ 2006-09-23  8:02 UTC (permalink / raw)
  To: linux-lvm

Hello linux-lvm,

  First, I am not an expert on LVM neither on initram disk (created
with mkinitrd).

  There is one point which I want to understand and I hope I can get
help here.

  I have Fedora Core 4 (on x386).
  fdisk -l shows that I have a Linux LVM partition.

  I opened the init file of the initrd on my machine
(initrd-2.6.11-1.1369_FC4.img).

  This script have some lvm commands , like:

  lvm vgscan --ignorelockingfailure
  lvm vgchange -ay --ignorelockingfailure VolGroup00

  It also has a call to mkdmnod (which creates  /dev/mapper/control ;
see man nash).

after boot, I see that I have the following (on: /):

/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)

The point which I want to understand is this:
Is existence of LVM partition is a MUST so that this script
will run and not cause panic on boot ?
Suppose I would NOT have an LVM partition.
(change its type with fdisk for example).

Will the calls to "lvm vgscan" and
  "lvm vgchange" and "mkdmnod" and insmoding the dm* modules will not
cause panic ?

any help will be appreciated.

Below here are the entry in grub.conf and the init script.



The entry in grub.conf is :

title Fedora Core (2.6.11-1.1369_FC4)
	root (hd0,1)
	kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=/dev/VolGroup00/LogVol00
rhgb quiet nodma
	initrd /initrd-2.6.11-1.1369_FC4.img


init script of initrd: (initrd-2.6.11-1.1369_FC4.img)

#!/bin/nash

mount -t proc /proc /proc
setquiet
echo Mounted /proc filesystem
echo Mounting sysfs
mount -t sysfs /sys /sys
echo Creating /dev
mount -o mode=0755 -t tmpfs /dev /dev
mknod /dev/console c 5 1
mknod /dev/null c 1 3
mknod /dev/zero c 1 5
mkdir /dev/pts
mkdir /dev/shm
echo Starting udev
/sbin/udevstart
echo -n "/sbin/hotplug" > /proc/sys/kernel/hotplug
echo "Loading dm-mod.ko module"
insmod /lib/dm-mod.ko
echo "Loading jbd.ko module"
insmod /lib/jbd.ko
echo "Loading ext3.ko module"
insmod /lib/ext3.ko
echo "Loading dm-mirror.ko module"
insmod /lib/dm-mirror.ko
echo "Loading dm-zero.ko module"
insmod /lib/dm-zero.ko
echo "Loading dm-snapshot.ko module"
insmod /lib/dm-snapshot.ko
/sbin/udevstart
echo Making device-mapper control node
mkdmnod
echo Scanning logical volumes
lvm vgscan --ignorelockingfailure
echo Activating logical volumes
lvm vgchange -ay --ignorelockingfailure VolGroup00
echo Creating root device
mkrootdev /dev/root
echo Mounting root filesystem
mount -o defaults --ro -t ext3 /dev/root /sysroot
echo Switching to new root
switchroot --movedev /sysroot


Regards,
MR

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-09-23 15:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-23  8:02 [linux-lvm] LVM partition and lvm commands in initrd Mark Ryden
2006-09-23  8:27 ` Aleksandr Koltsoff
2006-09-23 12:35   ` Mark Ryden
2006-09-23 15:49     ` Aleksandr Koltsoff
2006-09-23  8:56 ` 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.