LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware 12.1 and LVM (https://www.linuxquestions.org/questions/slackware-14/slackware-12-1-and-lvm-642609/)

plenty 05-16-2008 06:09 AM

Slackware 12.1 and LVM
 
Hi, all!
I just got Slackware 12.1 and decided to install it onto LVM (this is my first time of using LVM).
I use VMWare for test with 11Gb virtual dynamic SCSI-HDD.
I split it on 2 partitions: /dev/sda1 (100Mb, bootable) and /dev/sda2 (type '8e' - Linux LVM).
Next steps I did with reading README_LVM.TXT:
I run:

Code:

# pvcreate /dev/sda2
# vgcreate myvg /dev/sda2
# lvcreate -L 5G -n root myvg
# lvcreate -L 3G -n home myvg
# vgscan --mknodes
# vgchange -ay

Success... Then run 'setup'. Formated my FS:

Code:

/dev/myvg/root / (ext3)
/dev/myvg/home /home (ext3)
/dev/sda1 /boot (ext3)

And install only packages from series A. I made initial system configuration. Then I chroot'ed to /mnt by '# chroot /mnt'
I made initrd:

Code:

mkinitrd -c -k 2.6.24.5-smp -m ext3 -f ext3 -r /dev/myvg/root -L
And edited /etc/lilo.conf:

Code:

image = /boot/vmlinuz-generic-smp-2.6.24.5-smp
    initrd = /boot/initrd.gz
    root = /dev/myvg/root
    label = linux
    read-only

Save. Run 'lilo'. And reboot.
After my system boot I saw:

Code:

No volume group found.
mount: mounting /dev/myvg/root on /mnt failed: No such file or directory
ERROR: No /sbin/init found ... [skip other words]

Please, help me. What I made wrong? Thanks.

Alien Bob 05-16-2008 06:49 AM

I don't see anything wrong in the steps you took. But the error indicates that your LVM is no longer there. Did you see any errors when you ran 'lilo'?
Try booting from the Slackware install CD again, and when you get to the prompt, type
Code:

# vgscan --mknodes
# vgchange -ay

and see what those commands return.
With
Code:

pvdisplay -c
vgdisplay -c
lvdisplay -c

you can try and get more information about your LVM once Slackware activates them.

Eric

plenty 05-19-2008 03:32 AM

Hi, Eric!
Thank you for an answer.
I made just fresh new installation step-by-step from first post.
In past of installation process I ran lilo. Here is what it said to me:

Code:

root@slackware:/# lilo
Warning: LBA32 addresing assumed
Warning: 'proc/partitions' does not match '/dev' directory structure.
    Name change: '/dev/md-0' -> '/dev/myvg/root'
Warning: Name change: '/dev/md-1' -> '/dev/myvg/home'
Warning: Unable to determinate video adapter in use to the present system
Warning: Video adapter does not support  VESA BIOS extentions needed for display  of 256 colors. Boot loader will fall back  to TEXT only operation.
Added Linux *
5 warnings were issued.

After reboot I got the same issue :(

Code:

No volume group found.
mount: mounting /dev/myvg/root on /mnt failed: No such file or directory
ERROR: No /sbin/init found ... [skip other words]

I booted from install dvd and ran command you said:

Code:

root@slackware:/# vgscan --mknodes
  Reading all physical volumes. This may take a while...
  Found volume group "myvg" using metadata type lvm2

root@slackware:/# cgchange -ay
  2 logical volume(s) in volume group "myvg" now active

root@slackware:/# pvdisplay -c
 dev/sda2:myvg:22855680:-1:8:8:-1:4096:2790:742:2048:hclrrm-wYad-Fvmt-GFAw-Sg9C-pJno-f5jsIZ

root@slackware:/# vgdisplay -c
  myvg:r/w:772:1-1:0:2:0:-1:0:1:1:11427840:4096:2790:2048:742:dKCMTq-qqrj-Uxxl-cJ25-V7cY-I5MA-fJydut

root@slackware:/# lvdisplay -c
  /dev/myvg/root:myvg:3:1:-1:0:10485760:1280:-1:0:0:253:0
  /dev/myvg/home:myvg:3:1:-1:0:6291456:768:-1:0:0:253:1

P.S. Sorry for my bad English. I'm from Russia and just learn it.

GazL 05-19-2008 05:32 AM

Quote:

Originally Posted by plenty (Post 3155092)
....

Save. Run 'lilo'. And reboot.
After my system boot I saw:

Code:

No volume group found.
mount: mounting /dev/myvg/root on /mnt failed: No such file or directory
ERROR: No /sbin/init found ... [skip other words]

Please, help me. What I made wrong? Thanks.

It looks like you missed the step to run the 'vgscan' and 'vgchange -ay' inside the chroot environment prior to running mkinitrd and lilo. When you run vgscan in the beginning you just create the LVM devices in the install systems ramdisk and not on the target root partition, so when you chroot, lilo can't find them.

To fix this you should be able to do the following (no need to re run the install again, unless you want to):

boot from install cd, login to command line and then run these
Code:

vgscan --mknodes
vgchange -ay
mount /dev/myvg/root /mnt
mount /dev/sda1 /mnt/boot
mount /dev/myvg/home /mnt/home
mount -o bind /proc /mnt/proc
mount -o bind /sys /mnt/sys
chroot /mnt
vgscan --mknodes
vgchange -ay

Now you should have everything needed to successfully run mkinitrd and lilo as you did before. You probably don't need /mnt/home mounted, but I prefer to have the full chroot environment around just in case.

Though this is mentioned in the readme_lvm file, it's easy to miss and it would be nice if the install scripts could issue these vgscan and vgchange commands for you in the chrooted environment prior to entering the lilo dialog phase of the install. Maybe that's an improvement the Slacware team could look at for future versions?

Anyway, give that a go and let us know if it still doesn't work.

Alien Bob 05-19-2008 06:11 AM

Quote:

Originally Posted by GazL (Post 3157745)
Though this is mentioned in the readme_lvm file, it's easy to miss and it would be nice if the install scripts could issue these vgscan and vgchange commands for you in the chrooted environment prior to entering the lilo dialog phase of the install. Maybe that's an improvement the Slacware team could look at for future versions?

Oh, but the Slackware 12.1 installer does this! The commands
Code:

mount -o bind /proc /mnt/proc
mount -o bind /sys /mnt/sys

are run and in the chroot,
Code:

vgscan --mknodes --ignorelockingfailure
will have been executed before setup runs all the configuration scripts (such as liloconfig). This also means that you can safely run mkinitrd and lilo in your chroot environment at the end of the Slackware installation, when you use LVM.
Running "vgchange -ay --ignorelockingfailure" in the chroot has not been necessary in all my installs so far.

Eric

GazL 05-19-2008 06:17 AM

I stand corrected then. Thanks Eric. I'm still running 12.0 here. I really should get around to upgrading.

plenty 05-22-2008 12:52 AM

I thought a bit and found that md5sum of my DVD didn't match to original :)
I decided to download DVD once again from torrent. May be it will solve all this problems.

Col-Panic 05-22-2008 03:12 PM

Plenty,

I realize you are working on downloading and burning a new ISO because your MD5 checksum doesn't match up, but I may have another solution for you. I just went through the same grief you did (No volume group found), but on a Slamd64 12.1 RC1 installation (64-bit Slackware derivative). I'm a longtime Slack user, but completely new to LVM and messing with initrd. This is significant, because once I read the initrd man page where it described the two phases of boot-up, it lead me to look closer at the boot messages and discover that the boot loader was not finding my hardware SAS RAID controller and disks.

I looked back over the successful boot with the installation disk, and determined that I needed the megaraid_sas kernel module to be present for the system to find /dev/sda, and the associated logical volumes. If I would have been adding that to your mkinitrd command, it would look like this:
Code:

mkinitrd -c -k 2.6.24.5-smp -m ext3:megaraid_sas -f ext3 -r /dev/myvg/root -L
I ran that command from chroot, ran lilo again, rebooted, and everything came up perfectly! Obviously, if this applies to you, you might very well need a different module, but this *might* get you going in the right direction.

Hope this helps, and best wishes to you!

Brett

By the way, you wrote:
Quote:

P.S. Sorry for my bad English. I'm from Russia and just learn it.
I have nothing but admiration for people like you. Keep up the good work! :)

jdedhia 05-23-2008 02:53 PM

Thank you Col-Panic. Figured, solution to Plenty's question is loading the BusLogic module

mkinitrd -c -k 2.6.24.5-smp -m ext3:BusLogic -f ext3 -r /dev/myvg/root -L

ran it from chroot, ran lilo again, rebooted and everthing came up perfecty.

Now I have hard time doing "Install Vmware tools". vmware-config-tools.pl log is detailed below

Code:

None of the pre-built vmhgfs modules for VMware Tools is suitable for your
running kernel.  Do you want this program to try to build the vmhgfs module for
your system (you need to have a C compiler installed on your system)? [yes]

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.24.5-smp/build/include]

Extracting the sources of the vmhgfs module.

Building the vmhgfs module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config13/vmhgfs-only'
make -C /lib/modules/2.6.24.5-smp/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules

make[1]: Entering directory `/usr/src/linux-2.6.24.5'
  CC [M]  /tmp/vmware-config13/vmhgfs-only/cpName.o
In file included from include/linux/string.h:11,
                from /tmp/vmware-config13/vmhgfs-only/cpName.h:18,
                from /tmp/vmware-config13/vmhgfs-only/cpName.c:18:
include/linux/types.h:40: error: conflicting types for 'uintptr_t'
/tmp/vmware-config13/vmhgfs-only/vm_basic_types.h:160: error: previous declaration of 'uintptr_t' was here
make[2]: *** [/tmp/vmware-config13/vmhgfs-only/cpName.o] Error 1
make[1]: *** [_module_/tmp/vmware-config13/vmhgfs-only] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.24.5'
make: *** [vmhgfs.ko] Error 2
make: Leaving directory `/tmp/vmware-config13/vmhgfs-only'
Unable to build the vmhgfs module.

The filesystem driver (vmhgfs module) is used only for the shared folder
feature. The rest of the software provided by VMware Tools is designed to work
independently of this feature.
If you wish to have the shared folders feature, you can install the driver by
running vmware-config-tools.pl again after making sure that gcc, binutils, make
and the kernel sources for your running kernel are installed on your machine.
These packages are available on your distribution's installation CD.
[ Press Enter key to continue ]
pcnet32                34564  0
Unloading pcnet32 module

Trying to find a suitable vmxnet module for your running kernel.

None of the pre-built vmxnet modules for VMware Tools is suitable for your
running kernel.  Do you want this program to try to build the vmxnet module for
your system (you need to have a C compiler installed on your system)? [yes]

Extracting the sources of the vmxnet module.

Building the vmxnet module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config14/vmxnet-only'
make -C /lib/modules/2.6.24.5-smp/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules

make[1]: Entering directory `/usr/src/linux-2.6.24.5'
  CC [M]  /tmp/vmware-config14/vmxnet-only/vmxnet.o
In file included from /tmp/vmware-config14/vmxnet-only/vmxnet.c:35:
/tmp/vmware-config14/vmxnet-only/vm_basic_types.h:160: error: conflicting types for 'uintptr_t'
include/linux/types.h:40: error: previous declaration of 'uintptr_t' was here
/tmp/vmware-config14/vmxnet-only/vmxnet.c: In function 'vmxnet_probe_device':
/tmp/vmware-config14/vmxnet-only/vmxnet.c:476: error: implicit declaration of function 'SET_MODULE_OWNER'
/tmp/vmware-config14/vmxnet-only/vmxnet.c: In function 'vmxnet_open':
/tmp/vmware-config14/vmxnet-only/vmxnet.c:674: error: 'SA_SHIRQ' undeclared (first use in this function)
/tmp/vmware-config14/vmxnet-only/vmxnet.c:674: error: (Each undeclared identifier is reported only once
/tmp/vmware-config14/vmxnet-only/vmxnet.c:674: error: for each function it appears in.)
/tmp/vmware-config14/vmxnet-only/vmxnet.c: In function 'vmxnet_netpoll':
/tmp/vmware-config14/vmxnet-only/vmxnet.c:1058: error: too many arguments to function 'vmxnet_interrupt'
make[2]: *** [/tmp/vmware-config14/vmxnet-only/vmxnet.o] Error 1
make[1]: *** [_module_/tmp/vmware-config14/vmxnet-only] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.24.5'
make: *** [vmxnet.ko] Error 2
make: Leaving directory `/tmp/vmware-config14/vmxnet-only'
Unable to build the vmxnet module.

The fast network device driver (vmxnet module) is used only for our fast
networking interface. The rest of the software provided by VMware Tools is
designed to work independently of this feature.
If you wish to have the fast network driver enabled, you can install the driver
by running vmware-config-tools.pl again after making sure that gcc, binutils,
make and the kernel sources for your running kernel are installed on your
machine. These packages are available on your distribution's installation CD.
[ Press Enter key to continue ]


plenty 05-24-2008 04:39 AM

Hi! I think this link will be usefull for you.

--
Best regards,
Eugene

plenty 06-02-2008 04:46 AM

Hey! I solved my problem!

Quote:

Thank you Col-Panic. Figured, solution to Plenty's question is loading the BusLogic module
mkinitrd -c -k 2.6.24.5-smp -m ext3:BusLogic -f ext3 -r /dev/myvg/root -L
ran it from chroot, ran lilo again, rebooted and everthing came up perfecty.
This message gave me a direction for my search :) I have carefully studied the file /var/dmesg and discovered that I still needed modules mptspi, mptbase and mptscsih.
I remade initrd and got working LVM and LUKS+LVM too!

Alien Bob 06-02-2008 05:12 AM

Nice!
If you would do me a favour, and download this script: mkinitrd_command_generator.sh
I would like to see the results it writes to your console when you run
Code:

sh mkinitrd_command_generator.sh -r
Note: the script does not do anything to your system. It examines your kernel, by reading stuff in /sys and /proc , and tries to show you the best possible command to create an initrd.gz

What I would like to know if it shows (nearly) the same command you have used yourself. If the next Slackware should get the functionality for automatic creation of an initrd, I want it to be tested as much as possible.

Regards Eric

plenty 06-02-2008 06:04 AM

Hi, Eric. I'm glad to be usefull for Slackware team :)
It is an output for your script after running by me:

Code:

#
# mkinitrd_command_generator.sh revision 1.36
#
# This script will now make a recommendation about the command to use
# in case you require an initrd image to boot a kernel that does not
# have support for your storage or root filesystem built in
# (such as the Slackware 'generic' kernels').
# A suitable 'mkinitrd' command will be:

mkinitrd -c -k 2.6.24.5-smp -f reiserfs -r /dev/cryptvg/root -m ata_generic:pata_acpi:scsi_transport_spi:mptbase:mptscsih:mptspi:mii:pcnet32:snd-page-alloc:soundcore:snd:snd-timer:snd-pcm:ac97_bus:snd-ac97-codec:snd-seq-device:snd-rawmidi:gameport:snd-ens1371:ehci-hcd:usb-storage:uhci-hcd:reiserfs -C /dev/sda2 -L -o /boot/initrd.gz

I used for myself the follow command (in case LUKS+LVM and rootFS is reiserfs):

Code:

mkinitrd -c -k 2.6.24.5-smp -m mptspi:reiserfs -f reiserfs -r /dev/cryptvg/root -C /dev/sda2 -L
After that I checked my initrd-tree:

Code:

ls /boot/initrd-tree/lib/modules/2.6.24.5-smp/kernel/message/fusion
mptbase.ko mptscsih.ko mptspi.ko

Code:

ls /boot/initrd-tree/lib/modules/2.6.24.5-smp/kernel/drivers/scsi
scsi_transport_spi.ko

Code:

ls /boot/initrd-tree/lib/modules/2.6.24.5-smp/kernel/fs/reiserfs
reiserfs.ko

That was enough for my fresh system to boot :)

A big note: I used VmWare (with SCSI HDD) in this case for testing purposes only because I would like to saw LUKS+LVM in Slackware. That's why when I made initrd I used such few modules. In a real life I'll plan to install and work with Slackware on my laptop HP 6710s and probably write small howto for installing Slackware on this nice laptop :)

Alien Bob 06-02-2008 06:14 AM

Definitely need to find out why the script tries to drag network and sound drivers into the module list...

Eric

gargamel 06-02-2008 02:40 PM

mkinitrd_command_generator.sh is a great script, already!
In fact, it's amazing how well it works. It helped me a lot.

In my environment I found only one little "snag", if you would call it that way, at all,
regarding keyboard configuration: pkgtool configuration is apparently ignored, instead the
system locale is used. But I guess that most users outside the USA have a standard locale,
ie en_US, but an international keyboard setup, configured with pkgtool. For these users it
would probably be better to support their keyboard, even if the locale is the basic US one.
As README_LVM.TXT points out, you need the right keyboard setup if you use international
characters in your passphrase.

But apart from this little cosmetic thing, that can, of course, most easily be fixed by hand,
anytime, it is a great script.

Once I said: If I were allowed to put only one program on a Slackware wishlist, it would be
src2pkg. But if I were allowed to add a second one, it would be mkinitrd_command_generator.sh.

Thanks, Eric!!!

gargamel


All times are GMT -5. The time now is 09:30 PM.