Bug 35381 - lvm and order of hard disk partitions
Summary: lvm and order of hard disk partitions
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: lvm
Version: 7.1
Hardware: i686
OS: Linux
high
high
Target Milestone: ---
Assignee: Stephen Tweedie
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-04-09 20:48 UTC by Need Real Name
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-09-25 20:50:20 UTC
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2001-04-09 20:48:31 UTC
The problem is when you try to install rootfs on a LVM in a fresh 
Wolverine install.
The process of installing a root filesystem in LVM is as follows:

1. Wolverine kickstart install, with the following partitions:

part /boot  --size 64M
part /lvm   --size 10000M
part /      --size 5000M
part swap   --size 128M

the resulting partition table is:

/dev/hda1  (linux)    -> /boot
/dev/hda5  (linux)    -> /
/dev/hda6  (linux)    -> /lvm
/dev/hda7  (swap)    -> swap
* Note the order of the partitions

2. Make a new initrd based in the original RedHat initrd, adding lvm-
support. The new initrd works fine with the stock kernel.

3. Migrate /lvm and swap partitions to LVM, so the partition table changes 
to:
/dev/hda1  (linux)    -> /boot
/dev/hda5  (linux)    -> /
/dev/hda6  (LVM)    -> rootVG (contains a Logical Volume named root)
/dev/hda7  (LVM)    -> varVG

4. Copy the original / into /mnt/root (root LV).   
Change /mnt/root/etc/fstab to reflect the new partition:
...
   /dev/rootVG/root   /     ext2    defaults 1 0

And /mnt/root/etc/lilo.conf:
...
   root=/dev/rootVG/root
   initrd=/boot/initrd-2.4.1-lvm.img
Activate the new lilo.conf
Reboot.

5. The new root filesystem boots ok, which is in the LVM volume.

6. *** HERE IS THE PROBLEM ***
Because of the new LVM is installed and running, you can remove the old 
root partition (/dev/hda5), and reuse it for LVM:
old:   
/dev/hda5  (linux)    -> /
/dev/hda6  (LVM)    -> rootVG
/dev/hda7  (LVM)    -> varVG
new:
/dev/hda5  (LVM)  -> homeVG (with a home Logical Volume)
/dev/hda6  (LVM)    -> rootVG
/dev/hda7  (LVM)    -> varVG
update /etc/fstab and reboot. After that, the kernels fails mounting the 
root partition.

I discovered than LVM gets confused when you add the third Volume Group:

before adding homeVG:
# vgdisplay rootVG     -> shows rootVG, in /dev/hda6
# vgdisplay varVG     -> shows varVG, in /dev/hda7
after adding homeVG
# vgdisplay homeVG     -> shows rootVG, in /dev/hda6 (must be homeVG)
# vgdisplay rootVG     -> shows varVG, in /dev/hda7 (must be rootVG)
and that explains why the kernel can4t find the root partition.

I finally could install Wolverine + lvm making a manual partition in the 
kickstart install (so lvm is not confused :), but i thing this is just 
a "work around", and not the true solution (a bug in LVM?)

Thanks.
Maximiliano Morales

Comment 1 Stephen Tweedie 2002-10-11 17:29:10 UTC
Current releases should have full installer LVM support.

I think that part of your problem is that you need to rerun "mkinitrd" when you
change the root filesystem to LVM.  Older mkinitrds do not know enough about LVM
to activate LVM partitions before trying to load root.


Note You need to log in before you can comment on or make changes to this bug.