Unable to boot using LVM for "/"
I have been attempting to move my root partition to a logical volume and eliminate the current normal partition. No luck. I have read the lvmcreate_initrd man page found at
http://linux.msede.com/lvm/man/man2html.cgi?lvmcreate_initrd:8
and followed those instructions but it doesn't work for me. I have tried two different versions of lilo (lilo-0.21.5.1-4mdk and the 0.21.6 binaries from the lilo site) and get the same result from both.
If I use grub with the menu.lst shown below I can boot the entry for linux-2 and the system runs correctly. Neither of the other two entries will boot correctly. The /dev/hda9 is the real partition I am attempting to eliminate. If I try to boot the first, linux, entry it gets a kernel panic because it can't locate init. The third entry produces a kernel panic because it can't mound device 0:0
---------------------------------------------------------
[root@farpt1 /root]# cat /boot/grub/menu.lst
timeout 5
color black/cyan yellow/cyan
i18n (hd0,4)/grub/messages
keytable (hd0,4)/us.klt
default 0
title linux
kernel (hd0,4)/bzImage-2.2.17-0.16mdk-02 init=/boot/init vga=0x318 initrd (hd0,4)/initrd.lrh.gz
title linux-2
kernel (hd0,4)/bzImage-2.2.17-0.16mdk-02 root=/dev/hda9 vga=0x318 initrd (hd0,4)/initrd.gz
title test
kernel (hd0,4)/bzImage-2.2.17-0.16mdk-02 root=/dev/vg01/main vga=0x318 initrd (hd0,4)/initrd.lrh.gz
----------------------------------------------------------
When the system is booted from the linux-2 entry it produces the following. Notice the rdev and "df -h" show clearly different views of where the root partition is sourced.
----------------------------------------------------------
[root@farpt1 /root]# df -h
Filesystem Size Used Avail Use% Mounted on /dev/vg01/main 501M 353M 122M 74% / /dev/hda5 235M 2.9M 220M 1% /boot /dev/vg01/usr 2.5G 2.0G 553M 78% /usr /dev/vg01/src 600M 380M 220M 63% /usr/src /dev/vg01/local 800M 600M 200M 75% /usr/local /dev/vg01/home 1020M 434M 586M 43% /home /dev/vg01/mp3 1.5G 1.4G 98M 94% /mp3 /dev/vg01/var 252M 122M 129M 49% /var /dev/hda8 2.9G 1.3G 1.5G 47% /Archives
[root@farpt1 /root]# rdev/dev/hda9 /
------------------------------------------------------------
My lilo.conf resides in the /boot partition which is an ext2fs on /dev/hda5. It is listed below. When I install lilo and try to boot the system It comes up but it is using /dev/hda6 for the root partition and that belongs to my test copy of LM v7.2 and should have nothing to do with this system.
The one thing that is clearly different is that the lvmcreate_initrd man page references ext2fe file systems and I am using reiserfs for all except the /boot on /dev/hda5. Can anyone see what I am doing wrong and get me turned around? I would sure appreciate the help.
---------------------------------------------
[root@farpt1 /root]# cat /boot/lilo.conf
boot=/dev/hda5
map=/boot/map
install=/boot/boot.b
vga=ext
default=rootonly
keytable=/boot/us.klt
lba32
delay=100
backup=/boot/boot.grub
message=/boot/message
image=/boot/bzImage-2.2.17-0.16mdk-02 vga=0x318
initrd=/boot/initrd.gz root=/dev/vg01/main label=rootonly append="ramdisk_size=8192" read-only
--------------------------------------------------------------
Signature · 3 lines
Good Journey, longevity and prosperity to all Les Hazelton
Quoted 10 lines · Les Hazelton
I have been attempting to move my root partition to a logical volume and eliminate the current normal partition. No luck. I have read the
lvmcreate_initrdman page found athttp://linux.msede.com/lvm/man/man2html.cgi?lvmcreate_initrd:8
and followed those instructions but it doesn't work for me. I have tried two different versions of lilo (lilo-0.21.5.1-4mdk and the 0.21.6 binaries from the lilo site) and get the same result from both.
Quoted 6 lines
If I use grub with the menu.lst shown below I can boot the entry for linux-2 and the system runs correctly. Neither of the other two entries will boot correctly. The
/dev/hda9is the real partition I am attempting to eliminate. If I try to boot the first, linux, entry it gets a kernel panic because it can't locate init. The third entry produces a kernel panic because it can't mound device 0:0
"root=/dev/vg01/main" fails because the kernel, when booting, just determines the major/minor numbers for the root partition based on looking up the root device in a fixed table. What you need to do to get the "test" entry running is change the root to the major/minor number combo in hex; in my case, where /dev/vg01/root has major/minor number 58,3 in decimal, I pass "root=3a03" to grub and that works correctly.
Note that the above presumes that the initrd runs correctly. Does it? (Be aware that I had to add /dev/console and /dev/tty0 entries to the initrd to see output from the programs run from it... this may have been fixed by now, or maybe not).
Hope this has been of some use.
Charles Duffy wrote:
---------snip ----------------
Quoted 9 lines
"root=/dev/vg01/main" fails because the kernel, when booting, just determines the major/minor numbers for the root partition based on looking up the root device in a fixed table. What you need to do to get the "test" entry running is change the root to the major/minor number combo in hex; in my case, where
/dev/vg01/roothas major/minor number 58,3 in decimal, I pass "root=3a03" to grub and that works correctly.
Quoted 6 lines
Note that the above presumes that the initrd runs correctly. Does it? (Be aware that I had to add
/dev/consoleand/dev/tty0entries to the initrd to see output from the programs run from it... this may have been fixed by now, or maybe not).Hope this has been of some use.
Actually, it was a great help. I have it working now - sort of. The problem was in two parts. I changed the grub menu.lst to pass "root=3a06" as you suggested and that changed some of the symptoms. When it still didn't work as expected I reread the lvmcreate_initrd script. It finally sunk in. The initrd creates the ram disk file system as ext2 and I had created my root LV using reiserfs.
This creates a conflict between the initrd root file system and the one on the logical volume and the mount won't work. I re-formatted my LV with mke2fs and made some changes to /etc/fstab. Now it works as expected. It looks to me like you can't use reiserfs for the root file system unless the initrd ram disk can be created using reiserfs. I don't think that will work.
Signature · 3 lines
Good Journey, longevity and prosperity to all Les Hazelton
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 16 lines · Charles Duffy
Quoted 7 lines · Les Hazelton
Actually, it was a great help. I have it working now - sort of. The problem was in two parts. I changed the grub menu.lst to pass "root=3a06" as you suggested and that changed some of the symptoms. When it still didn't work as expected I reread the
lvmcreate_initrdscript. It finally sunk in. The initrd creates the ram disk file system as ext2 and I had created my root LV using reiserfs.Quoted 6 lines
This creates a conflict between the initrd root file system and the one on the logical volume and the mount won't work. I re-formatted my LV with mke2fs and made some changes to
/etc/fstab. Now it works as expected. It looks to me like you can't use reiserfs for the root file system unless the initrd ram disk can be created using reiserfs. I don't think that will work.
Quoted 7 lines
That's interesting, as I'm using reiserfs for my root filesystem without issues (though getting it up was a bit of a challenge, and I modified
lvmcreate_initrdquite heavily). I'm also quite certain that one can switch from a minix-based initrd to an ext2-based root.If you wouldn't mind recounting your symptoms, I'd be curious to hear what happened.
At this point I am a bit confused. I saw your note indicating you used reiserfs for the root file system so I figured I better double check what I had done.
Having made the change you previously suggested, I now had one working setup with the root on a logical volume. That filesystem was ext2. I made another LV with a reiserfs filesystem, copied all the root components into it and updated its etc/fstab entries. I set the /boot/grub/menu.lst to reflect these new conditions and re-booted the system.
Now the root filesystem on a reiserfs LV is working just fine. In fact, I can reboot between the two different root configurations using the exact same initrd.gz file and everything appears to be correct. The initrd.gz file was made with an unmodified lvmcreate_initrd script.
I can only assume I was working too late when I did the other tests. Sorry for any confusion I may have caused.
Signature · 3 lines
Good Journey, longevity and prosperity to all Les Hazelton