From: "Stuart D. Gathman" <stuart@bmsi.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] is it possible to move lvm2 logvols?
Date: Wed, 12 Sep 2007 17:53:03 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.44.0709121741470.2155-100000@bmsred.bmsi.com> (raw)
In-Reply-To: <46E7FC20.8090003@bppiac.hu>
On Wed, 12 Sep 2007, Farkas Levente wrote:
> ok everything seems to working. after i move the logvols i remove the
> old pv and try to boot the system. now the problem during the boot linux
> can't find the volume group so can't find it's / since the / is on the
> first logvol of the vg. this on centos-5.
> the strange thing if i boot from centos rescue dvd it see the vg and
> logvols too and i can chroot /mnt/sysimage into the new real system.
> what can be the reason that if i boot the new system it can't find the
> vg and it's logvols?
centos-5 puts hardcoded lvm and md activation into the initrd init script.
To see your init script,
# mkdir initrd
# cd initrd
# zcat /path/to/initrd...img | cpio -icvdmu
# cat init
A typical init script has lvm related parts similar to this:
----------
...
echo "Loading dm-mod.ko module"
insmod /lib/dm-mod.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
echo Making device-mapper control node
mkdmnod
mkblkdevs
raidautorun /dev/md3
raidautorun /dev/md4
echo Scanning logical volumes
lvm vgscan --ignorelockingfailure
echo Activating logical volumes
lvm vgchange -ay --ignorelockingfailure rootvg
...
---------
You have to edit the script, make sure it activates any raid PVs your
VG depends on, and change the name of the VG containing root fs.
This is done automatically by mkinitrd. But it has no
options to creat a script for a different LVM environment than the
one you are running on. So you have to manually edit init and
package it back to a new initrd image with cpio.
# pwd
/.../initrd
# find * | cpio -ocv | gzip -9 >../newinitrd.img
This is not convenient. Assuming mkinitrd was more adaptable, it
would still defeat much of the advantage of grub to have to remember
to run it to change LVM environment. (Although, to be fair, this
usually happens only when migrating to new hardware.)
--
Stuart D. Gathman <stuart@bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
prev parent reply other threads:[~2007-09-12 21:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-11 22:42 [linux-lvm] is it possible to move lvm2 logvols? Farkas Levente
2007-09-12 5:06 ` Robert Sander
2007-09-12 14:48 ` Farkas Levente
2007-09-12 15:51 ` Farkas Levente
2007-09-12 21:53 ` Stuart D. Gathman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.44.0709121741470.2155-100000@bmsred.bmsi.com \
--to=stuart@bmsi.com \
--cc=linux-lvm@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).