LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   LVM and Kernel patch (http://www.linuxquestions.org/questions/slackware-14/lvm-and-kernel-patch-4175463359/)

PenguinWearsFedora 05-24-2013 04:20 PM

LVM and Kernel patch
 
I've installed recent kernel updates for Slackware64-14.0. At reboot after it says that volume group is recognised, I get following error message:
Code:

  3 logical volume(s) in volume group "myvg" now active
mount: mounting /dev/myvg/root on /mnt failed: No such file or directory
ERROR: No /sbin/init found on rootdev (or not mounted). Trouble ahead.

I have been using LVM, after the update I did:

1. Booted slackware from a usb (using usbboot.img)
2. vgscan --mknodes
3. vgchange -ay
4. mount /dev/mapper/myvg-root /mnt
5. mount /dev/mapper/myvg-home /mnt/home
6. mount /dev/sda1 /mnt/boot
7. mount -o bind /proc /mnt/proc
8. mount -o bind /sys /mnt/sys
9. mount -o bind /dev /mnt/dev
10. chroot /mnt
11. vgscan --mknodes
12. vgchange -ay
13. mkinitrd -c -k 3.2.45 -f ext4 -r /dev/myvg/root -L -u -o /boot/initrd.gz
13. edited '/etc/lilo.conf' to show new kernel (3.2.45)
14. lilo -v

From within chroot, I got following info:

Code:

ls -l /dev/mapper
total 0
crw------- 1 root root 10, 236 May 24 02:38 control
lrwxrwxrwx 1 root root      7 May 24 02:38 myvg-home -> ../dm-2
lrwxrwxrwx 1 root root      7 May 24 02:38 myvg-root -> ../dm-1
lrwxrwxrwx 1 root root      7 May 24 02:38 myvg-swap -> ../dm-0

Code:

fdisk -lu /dev/sda

Disk /dev/sda: 200.0 GB, 200049647616 bytes
240 heads, 63 sectors/track, 25841 cylinders, total 390721968 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1befc874

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          63      393119      196528+  83  Linux
/dev/sda2          393120    81915495    40761188  8e  Linux LVM
/dev/sda3        81915496  369305999  143695252    f  W95 Ext'd (LBA)
/dev/sda5        81915498  204796619    61440561    7  HPFS/NTFS/exFAT
/dev/sda6      204800463  349377839    72288688+  7  HPFS/NTFS/exFAT
/dev/sda7      349377903  349770959      196528+  83  Linux
/dev/sda8      349771023  369305999    9767488+  83  Linux

Code:

cat /etc/fstab
/dev/myvg/swap  swap            swap        defaults        0  0
/dev/myvg/root  /                ext4        defaults        1  1
/dev/myvg/home  /home            ext4        defaults        1  2
/dev/sda1        /boot            ext4        defaults        1  2
/dev/sda5        /win/c          ntfs-3g    fmask=133,dmask=022 1  0
/dev/sda6        /win/d          ntfs-3g    fmask=133,dmask=022 1  0
#/dev/cdrom      /mnt/cdrom      auto        noauto,owner,ro,comment=x-gvfs-show 0  0
#/dev/fd0        /mnt/floppy      auto        noauto,owner    0  0
devpts          /dev/pts        devpts      gid=5,mode=620  0  0
proc            /proc            proc        defaults        0  0
tmpfs            /dev/shm        tmpfs      defaults        0  0

Code:

cat /etc/lilo.conf
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
lba32 # Allow booting past 1024th cylinder with a recent BIOS
# Append any additional kernel parameters:
append=" vt.default_utf8=1"
boot = /dev/sda

# Boot BMP Image.
# Bitmap in BMP format: 640x480x8
bitmap = /boot/slack14.0.2012.bmp
# Menu colors (foreground, background, shadow, highlighted
# foreground, highlighted background, highlighted shadow):
bmp-colors = 255,0,255,0,255,0
# Location of the option table: location x, location y, number of
# columns, lines per column (max 15), "spill" (this is how many
# entries must be in the first column before the next begins to
# be used. We don't specify it here, as there's just one column.
bmp-table = 60,6,1,16
# Timer location x, timer location y, foreground color,
# background color, shadow color.
bmp-timer = 65,27,0,255

# Standard menu.
# Or, you can comment out the bitmap menu above and
# use a boot message with the standard menu:
#message = /boot/boot_message.txt

# Wait until the timeout to boot (if commented out, boot the
# first entry immediately):
prompt
# Timeout before the first entry boots.
# This is given in tenths of a second, so 600 for every minute:
timeout = 1200
# Override dangerous defaults that rewrite the partition table:
change-rules
reset
# Normal VGA console
#vga = normal
# Ask for video mode at boot (time out to normal in 30s)
#vga = ask
# VESA framebuffer console @ 1024x768x64k
#vga=791
# VESA framebuffer console @ 1024x768x32k
#vga=790
# VESA framebuffer console @ 1024x768x256
#vga=773
# VESA framebuffer console @ 800x600x64k
#vga=788
# VESA framebuffer console @ 800x600x32k
#vga=787
# VESA framebuffer console @ 800x600x256
#vga=771
# VESA framebuffer console @ 640x480x64k
#vga=785
# VESA framebuffer console @ 640x480x32k
#vga=784
# VESA framebuffer console @ 640x480x256
#vga=769
vga=794
# End LILO global section
# Windows bootable partition config begins
#other = /dev/sda5
#label = Windows
#table = /dev/sda
# Windows bootable partition config ends
# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/myvg/root
  label = Linux
  read-only
image = /boot/vmlinuz-generic-3.2.45
  initrd = /boot/initrd.gz
  root = /dev/myvg/root
  label = LinuxG
  read-only
#other = /dev/sda7
#  label = CentOS
# Linux bootable partition config ends

Code:

lilo -v
LILO version 23.2 (released 09-Apr-2011)
  * Copyright (C) 1992-1998 Werner Almesberger  (until v20)
  * Copyright (C) 1999-2007 John Coffman  (until v22)
  * Copyright (C) 2009-2011 Joachim Wiedorn  (since v23)
This program comes with ABSOLUTELY NO WARRANTY. This is free software
distributed under the BSD License (3-clause). Details can be found in
the file COPYING, which is distributed with this software.
Compiled at 18:37:44 on Aug 17 2012

Reading boot sector from /dev/sda
Warning: Unable to determine video adapter in use in the present system.
Using BITMAP secondary loader
Calling map_insert_data
Mapping bitmap file /boot/slack14.0.2012.bmp
Warning: Video adapter does not support VESA BIOS extensions needed for
  display of 256 colors.  Boot loader will fall back to TEXT only operation.
Calling map_insert_file

Boot image: /boot/vmlinuz -> vmlinuz-huge-3.2.45
Added Linux  *

Boot image: /boot/vmlinuz-generic-3.2.45
Mapping RAM disk /boot/initrd.gz
The initial RAM disk will be loaded in the high memory above 16M.
Added LinuxG  +

Writing boot sector.
/boot/boot.0800 exists - no boot sector backup copy made.
2 warnings were issued.


Panther_ 05-24-2013 04:40 PM

Quote:

Originally Posted by PenguinWearsFedora (Post 4958391)
13. mkinitrd -c -k 3.2.45 -f ext4 -r /dev/myvg/root -L -u -o /boot/initrd.gz

use:
Code:


mkinitrd -c -k 3.2.45 -f ext4 -r /dev/myvg/root -m ext4:mbcache:jbd2 -C /dev/sda2 -L -u -o /boot/initrd.gz

GL! :^)

PenguinWearsFedora 05-24-2013 05:01 PM

I've tried
Code:

mkinitrd -c -k 3.2.45 -f ext4 -r /dev/myvg/root -m ext4:mbcache:jbd2 -L -u -o /boot/initrd.gz
I believe -C option is for LUKS device, I'm only using LVM without encryption. Anyway, still get the error.

yenn 05-24-2013 07:12 PM

Quote:

Originally Posted by PenguinWearsFedora (Post 4958391)
I have been using LVM, after the update I did:

1. Booted slackware from a usb (using usbboot.img)
2. vgscan --mknodes
3. vgchange -ay
4. mount /dev/mapper/myvg-root /mnt
5. mount /dev/mapper/myvg-home /mnt/home
6. mount /dev/sda1 /mnt/boot
7. mount -o bind /proc /mnt/proc
8. mount -o bind /sys /mnt/sys
9. mount -o bind /dev /mnt/dev
10. chroot /mnt
11. vgscan --mknodes
12. vgchange -ay

No need to scan and activate devices twice since you already mounted /dev. Chrooted environment will use them just fine.

Quote:

Originally Posted by PenguinWearsFedora (Post 4958404)
I've tried
Code:

mkinitrd -c -k 3.2.45 -f ext4 -r /dev/myvg/root -m ext4:mbcache:jbd2 -L -u -o /boot/initrd.gz
I believe -C option is for LUKS device, I'm only using LVM without encryption. Anyway, still get the error.

You're right, -C options is for LUKS encrypted device. You don't need it.

Just to be sure, what kernel (boot option) are you actually starting Slackware with?
Code:

# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/myvg/root
  label = Linux
  read-only
image = /boot/vmlinuz-generic-3.2.45
  initrd = /boot/initrd.gz
  root = /dev/myvg/root
  label = LinuxG
  read-only

Code:

Boot image: /boot/vmlinuz -> vmlinuz-huge-3.2.45
Added Linux  *

Boot image: /boot/vmlinuz-generic-3.2.45
Mapping RAM disk /boot/initrd.gz
The initial RAM disk will be loaded in the high memory above 16M.
Added LinuxG  +

First boot option in lilo.conf will be default (lilo use '*' to mark default boot option) and in this particular case, it doesn't use initrd.

Nikosis 05-24-2013 09:01 PM

You can try and remove "root" line from your lilo.conf

PenguinWearsFedora 05-25-2013 12:35 AM

Quote:

Originally Posted by yenn (Post 4958450)
No need to scan and activate devices twice since you already mounted /dev. Chrooted environment will use them just fine.



You're right, -C options is for LUKS encrypted device. You don't need it.

Just to be sure, what kernel (boot option) are you actually starting Slackware with?
Code:

# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/myvg/root
  label = Linux
  read-only
image = /boot/vmlinuz-generic-3.2.45
  initrd = /boot/initrd.gz
  root = /dev/myvg/root
  label = LinuxG
  read-only

Code:

Boot image: /boot/vmlinuz -> vmlinuz-huge-3.2.45
Added Linux  *

Boot image: /boot/vmlinuz-generic-3.2.45
Mapping RAM disk /boot/initrd.gz
The initial RAM disk will be loaded in the high memory above 16M.
Added LinuxG  +

First boot option in lilo.conf will be default (lilo use '*' to mark default boot option) and in this particular case, it doesn't use initrd.

I was searching linuxquestions for solution and someone suggested running those two commands from within chroot. But that could not be the problem.

I'm booting with 'LinuxG'. Booting with 'vmlinuz-huge-3.2.45' also gives me following error:
Code:

VFS: Cannot open root device "fd01" or unknown-block(253,1)
Please append a correct "root=" boot option; here are the available partitions:

README_LVM.TXT suggested to create initrd when I was doing fresh install of 14.0. So, at the moment I'm just trying to boot 'LinuxG' successfully. By the way is it necessary to boot with initrd (and general kernel) when using LVMs?

PS. I am using Slackware64-14.0 usb boot image (usbboot.img) which comes with 3.2.29 kernels.

gegechris99 05-25-2013 02:22 AM

When you ran lilo you got the following warning:

Quote:

Boot image: /boot/vmlinuz-generic-3.2.45
Mapping RAM disk /boot/initrd.gz
The initial RAM disk will be loaded in the high memory above 16M.
Added LinuxG +
It seems that the initrd.gz file that you created is too big and that may cause trouble when you boot with the generic kernel.

Try to run mkinitrd without the -u option (which includes udev in the initrd). It would like something like that:

Code:

mkinitrd -c -k 3.2.45 -f ext4 -m ext4 -r /dev/myvg/root -L -o /boot/initrd.gz

yenn 05-25-2013 10:25 AM

Quote:

Originally Posted by PenguinWearsFedora (Post 4958515)
README_LVM.TXT suggested to create initrd when I was doing fresh install of 14.0. So, at the moment I'm just trying to boot 'LinuxG' successfully. By the way is it necessary to boot with initrd (and general kernel) when using LVMs?

It is necessary, because bootloader have to activate LVM volume(s) before init ("master" process with pid 1, not initrd) tries to mount rootfs.
Quote:

Originally Posted by gegechris99 (Post 4958545)
When you ran lilo you got the following warning:
Quote:

Boot image: /boot/vmlinuz-generic-3.2.45
Mapping RAM disk /boot/initrd.gz
The initial RAM disk will be loaded in the high memory above 16M.
Added LinuxG +
It seems that the initrd.gz file that you created is too big and that may cause trouble when you boot with the generic kernel.

Try to run mkinitrd without the -u option (which includes udev in the initrd).

I have never seen "The initial RAM disk will be loaded in the high memory above 16M." warning with initrd for generic kernel, only with huge kernel. But maybe that's because I don't include udev in initrd and I'm curious what's the point of including it, since all systems boot fine without it.

PenguinWearsFedora 05-25-2013 11:14 AM

Quote:

Originally Posted by Nikosis (Post 4958477)
You can try and remove "root" line from your lilo.conf

Still get the same error. Thanks for your suggestion though.

PenguinWearsFedora 05-25-2013 11:28 AM

Quote:

Originally Posted by gegechris99 (Post 4958545)
When you ran lilo you got the following warning:



It seems that the initrd.gz file that you created is too big and that may cause trouble when you boot with the generic kernel.

Try to run mkinitrd without the -u option (which includes udev in the initrd). It would like something like that:

Code:

mkinitrd -c -k 3.2.45 -f ext4 -m ext4 -r /dev/myvg/root -L -o /boot/initrd.gz

I've made initrd.gz without -u option, but still get the same error at boot & 'lilo -v' spits out the same output about initial ram disk being loaded above 16M etc.

I'm starting to think new kernel is not working well with some piece of software. I had problem with 13.37's lilo unable to boot 14.0. There was someone else who solved their problem by updating 'mkinitrd'.

Has anyone else made a successful update of kernel with LVM based partitions?

GazL 05-25-2013 12:03 PM

'/dev/myvg/root' is a symlink that should be created for you by device-mapper in combination with udev during the initrd. it should point to /dev/mapper/myvg-root. Maybe some weird udev/rule incompatibility with the new kernel is at work here. I'd try changing /dev/myvg/root to /dev/mapper/myvg-root in both your fstab and on the -r option of mkinitrd and see if that allows you to get the system up and running. Once it's up we can worry about the missing symlinks (Maybe grabbing udev from slackware-current).

As Nikosis rightly pointed out, remove the root= line from your LinuxG entry in lilo.conf (and since you're using LVM, the 'Linux' entry using the 'huge' kernel really isn't of much use either - so that might as well go too.)


BTW, I'm not sure if it was like this in 14.0, but in '-current' mkinitrd forces the -u option on regardless of whether you specify it on the command line or not. Also just to confirm: you don't need '-C' but you do need '-L'.

yenn 05-25-2013 12:29 PM

Quote:

Originally Posted by PenguinWearsFedora (Post 4958756)
Has anyone else made a successful update of kernel with LVM based partitions?

I just updated kernel on my server with LUKS encrypted LVM and it's booting fine.

With mkinitrd like this (usb, fat, etc. are for USB keyboard and FAT32 formated flash drive)
Code:

mkinitrd -c -k 3.2.45 -f ext4 -r /dev/linuxvg/slackware-root -m ext4:mbcache:jbd2:ehci-hcd:uhci-hcd:usb-storage:hid:usbhid:fat:nls_cp437:nls_iso8859-1:msdos:vfat -C /dev/sda2 -K LABEL=NASKEY:/boot/key.luks -L -o /boot/initrd.gz
Trimmed to pure LVM, it'll look like this
Code:

mkinitrd -c -k 3.2.45 -f ext4 -r /dev/linuxvg/slackware-root -m ext4:mbcache:jbd2 -L -o /boot/initrd.gz
LILO also print warning about high memory, but it seems harmless.
Code:

Reading boot sector from /dev/sda
Using BITMAP secondary loader
Calling map_insert_data
Mapping bitmap file /boot/slack.bmp
Calling map_insert_file

Boot image: /boot/vmlinuz -> vmlinuz-generic-3.2.45
Mapping RAM disk /boot/initrd.gz
The initial RAM disk will be loaded in the high memory above 16M.
Added Slackware  +  *

Writing boot sector.
/boot/boot.0800 exists - no boot sector backup copy made.


Richard Cranium 05-25-2013 04:53 PM

Quote:

Originally Posted by PenguinWearsFedora (Post 4958756)
I've made initrd.gz without -u option, but still get the same error at boot & 'lilo -v' spits out the same output about initial ram disk being loaded above 16M etc.

I'm starting to think new kernel is not working well with some piece of software. I had problem with 13.37's lilo unable to boot 14.0. There was someone else who solved their problem by updating 'mkinitrd'.

Has anyone else made a successful update of kernel with LVM based partitions?

LVM on top of RAID. 2 different machines. This one with lilo, the other with grub2.

My lilo.conf:
Code:

# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
lba32 # Allow booting past 1024th cylinder with a recent BIOS
# Append any additional kernel parameters:
append=" vt.default_utf8=0"
boot = /dev/sda

# Boot BMP Image.
# Bitmap in BMP format: 640x480x8
bitmap = /boot/slack.bmp
# Menu colors (foreground, background, shadow, highlighted
# foreground, highlighted background, highlighted shadow):
bmp-colors = 255,0,255,0,255,0
# Location of the option table: location x, location y, number of
# columns, lines per column (max 15), "spill" (this is how many
# entries must be in the first column before the next begins to
# be used. We don't specify it here, as there's just one column.
bmp-table = 60,6,1,16
# Timer location x, timer location y, foreground color,
# background color, shadow color.
bmp-timer = 65,27,0,255

# Standard menu.
# Or, you can comment out the bitmap menu above and
# use a boot message with the standard menu:
#message = /boot/boot_message.txt

# Wait until the timeout to boot (if commented out, boot the
# first entry immediately):
prompt
# Timeout before the first entry boots.
# This is given in tenths of a second, so 600 for every minute:
timeout = 1200
# Override dangerous defaults that rewrite the partition table:
change-rules
reset
# VESA framebuffer console @ 1024x768x64k
vga = 791
# Normal VGA console
#vga = normal
# Ask for video mode at boot (time out to normal in 30s)
#vga = ask
# VESA framebuffer console @ 1024x768x64k
#vga=791
# VESA framebuffer console @ 1024x768x32k
#vga=790
# VESA framebuffer console @ 1024x768x256
#vga=773
# VESA framebuffer console @ 800x600x64k
#vga=788
# VESA framebuffer console @ 800x600x32k
#vga=787
# VESA framebuffer console @ 800x600x256
#vga=771
# VESA framebuffer console @ 640x480x64k
#vga=785
# VESA framebuffer console @ 640x480x32k
#vga=784
# VESA framebuffer console @ 640x480x256
#vga=769
# End LILO global section
# Linux bootable partition config begins
# initrd created with 'mkinitrd -c -k 3.2.29 -f xfs -r /dev/internal_vg/rootlv -m usbhid:ehci-hcd:ohci-hcd:exportfs:xfs -L -u -o /boot/initrd.gz'
image = /boot/vmlinuz-generic-3.2.29
  initrd = /boot/initrd_3.2.29.gz
  root = /dev/internal_vg/rootlv
  label = 3.2.29
#  append=" vga=normal"
  read-only
# Linux bootable partition config ends
# Linux bootable partition config begins
image = /boot/vmlinuz-generic-3.2.45
      root = /dev/internal_vg/rootlv
      label = Linux
      initrd = /boot/initrd_3.2.45.gz
      read-only
# Linux bootable partition config ends


PenguinWearsFedora 05-26-2013 07:50 AM

@yenn
I've used the same mkinitrd command.

@GazL
I've tried removing root= line but to no avail.
I've tried switching to /dev/mapper/.... in place of /dev/myvg/ but still stuck with the same error.

I've made stupid mistake of 'upgradepkg' of kernel, instead of plain 'installpkg'.

Now the good news! I have done upgradepkg --reinstall --install-new on both 'mkinitrd' and 'lilo' using Slackware64-14.0 install DVD.
Booted, same error.

Next I did 'upgradepkg --reinstall --install-new' on kernel 3.2.45 updates. Ran
Code:

mkinitrd -c -k 3.2.45 -f ext4 -m ext4:mbcache:jdcd2:ehci-hcd:ohci-hcd -r /dev/myvg/root -L -u -o /boot/initrd.gz
now I can see out messages showing up about ext4, mbcache, jdcd2, ehci-hcd, ohci-hcd being loaded into the initrd image... So I guess after I have done reinstall of kernel packages, something went right. I did thought it was odd that list of modules didn't show up in the output of 'mkinitrd'. That should have been my clue. You dumb slacker! Anyway, it's all working now.



Thanks for your help.


All times are GMT -5. The time now is 12:33 PM.