Skip to contentSkip to conversation

Problems with raid1 and LVM and initrd

linux-lvm Torsten Neumann 3 participants 4 messages Oct 7, 1999 – Nov 27, 2020

lore
Share & tools
lore
#0 lore raw

Hi,

I hope I get the problem description right, the fault machine is miles away.

I'm trying to setup LVM on top of a md-raid1 device, and then put my root filesystem on it. Setting up raid1 was no problem, setting up LVM on top of it - no problem. Setting up a second VG on other partitions - no problem.

Disk partitions looks something like

	/dev/sda1	/dev/sdb1	256 MB swap area
	/dev/sda2	/dev/sdb2	32  MB /boot for vmlinux and initrd
	/dev/sda3	/dev/sdb3	2048MB /dev/md0 -> vg00
	/dev/sda4	/dev/sdb4	rest   vg01

My linuxrc does something like this

	mount /proc
	insmod raid1
	ckraid --fix /etc/raid1.conf
	mdadd -ar
	insmod lvm
	vgscan
	vgchange -a y
	umount /proc

The problem is the vgscan call. It doesn't find vg00, it just finds vg01. Inserting some debug code ( pvdisplay, pvscan, bash ) in the above it looks to me that /dev/md0 is correctly initialized. But the lvm-commands just returns error codes. The result is an error while booting the real-root-device, since there are no drivers it couldn't boot. (init not found)
( By the way does anybody know how to debug initrd ? I wanted to make an "pvscan -d >foo" but how to I get the output out of ramdisk )

Booting from a third disk and execute the linuxrc script by hand works just fine, all vg's are seen and useable.

Everythings works, execpt if I start it via initrd.

Any Ideas ?

Regards
Torsten

#1 lore raw

Hi
----- Original Message -----
From: Torsten Neumann <[email protected]>
To: LVM for Linux <[email protected]>
Sent: Thursday, October 07, 1999 3:26 PM
Subject: [linux-lvm] Problems with raid1 and LVM and initrd

Quoted 4 lines

Hi,
Everythings works, execpt if I start it via initrd.

Any Ideas ?

I had a similar problem. (I'm not using RAID).

There was a difference among /dev and /etc/lvmtab from the real-root-device and your correspondents in the initrd (it lacked /dev/vg00 / *). I copied /dev and /etc/lvmtab and I re-built the initrd.
Today no longer vg01 exists, just vg00. Everything works fine.

BTW: my SWAP also lives in a LV (only /boot is out) . I hope this helps !

Quoted 2 lines

Regards
Torsten

Cheers,
Fernando

#2 lore raw
In reply to Torsten Neumann

I <[email protected]> wrote:

[ snip ]

Quoted 6 lines

The problem is the vgscan call. It doesn't find vg00, it just finds vg01. Inserting some debug code ( pvdisplay, pvscan, bash ) in the above it looks to me that /dev/md0 is correctly initialized. But the lvm-commands just returns error codes. The result is an error while booting the real-root-device, since there are no drivers it couldn't boot. (init not found)

Finally I found what was wrong, because it may be of interest for others:

If starting vgscan,pvscan from my ramdisk they "only" look in /dev/md/ for md block-devices. They didn't use /dev/md0. Creating /dev/md/ and a symlink /dev/md/md0 -> /dev/md0 solved the problem.

I didn't figured out why vgscan behaves different when starting via initrd vs. "normal" bootup-sequence. As said before booting from a 3rd drive works and there was also no /dev/md dir.

Torsten

#3 lore raw
In reply to Torsten Neumann
Quoted 3 lines

I'm trying to setup LVM on top of a md-raid1 device, and then put my root filesystem on it. Setting up raid1 was no problem, setting up LVM on top of it - no problem. Setting up a second VG on other partitions - no problem.

[snip]

Quoted 6 lines

The problem is the vgscan call. It doesn't find vg00, it just finds vg01. Inserting some debug code ( pvdisplay, pvscan, bash ) in the above it looks to me that /dev/md0 is correctly initialized. But the lvm-commands just returns error codes. The result is an error while booting the real-root-device, since there are no drivers it couldn't boot. (init not found)

This could be related to a consistency problem with the dynamically assigned LVM minors. vgscan creates a /etc/lvmtab and /etc/lvmtab.d (and the correcsponding dev files -- can't remember of head) on your _ramdisk_. Later LVM tries to access the possibly inconsistent data (and dev files) on your hard disk.

Please have a look at
http://linux.msede.com/lvm/mlist/archive/0382.html
http://linux.msede.com/lvm/mlist/archive/0383.html

Please try the following:

I assume the vgscan on the ram disk completes w/o problem. Could you transfer the /etc/lvmtab, /etc/lvmtab.d/* to your hard disk and make sure the LVM dev files are the same?

You should be able to simply call an interactive shell in the linuxrc.

Hope this helps
Michael

--

Michael Marxmeier           Marxmeier Software AG
E-Mail: [email protected]      Besenbruchstrasse 9
Phone : +49 202 2431440     42285 Wuppertal, Germany
Fax   : +49 202 2431420     http://www.msede.com/