LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Kernel update on LUKS and LVM encrypted Slackware, mount fails (https://www.linuxquestions.org/questions/slackware-14/kernel-update-on-luks-and-lvm-encrypted-slackware-mount-fails-787706/)

KMBS 02-08-2010 01:38 AM

Kernel update on LUKS and LVM encrypted Slackware, mount fails
 
Hi everyone!

I did a fully encrypted installation (execept /boot) of Slackware (2.6.29.6) on my netbook using this nice howto > http://slackware.osuosl.org/slackwar...ADME_CRYPT.TXT (starting at section "Combining LUKS and LVM
"), which works just fine.

Now I found out, that my Broadcom wireless chip only works with the b43 drivers on kernel 2.6.32.x (the original linux drivers from Broadcom work, but won't let me put the card in monitor mode).
So I updated to 2.6.32.7 using the config-generic-smp-2.6.29.6-smp from the boot folder and 'make oldconfig', because it looks like you can not use the 'huge' kernel with an initrd image.

Now, when I boot into the new kernel, he finds and activates the encrypted volumes, but fails to mount them.

Code:

Enter LUKS passphrase for /dev/sda2:
key slot 0 unlocked.
Command successful:
  Reading all physical volumes. This may take a while...
  Found volume group "cryptvg" using metadata type lvm2
  3 logical volume(s) in volume group "cryptvg" now active
mount: mounting /dev/cryptvg/root on /mnt failed: No such device
ERROR: No /sbin/init found on rootdev (or not mounted). Trouble ahead.
      You can try to fix it. Type 'exit' when things are done.
/bin/sh: can't access tty: job control turned off

When I try to mount it manually I get 'Invalid argument'


This was my first kernel update and I was not sure about some things, It seems like at some point I messed up.

Here is what I did after 'make oldconfig' and 'make modules_install':

copied the kernel and System.map to /boot
Code:

cp arch/i386/boot/bzImage /boot/bzImage
cp System.map /boot/System.map.new
rm /boot/System.map
ln -s /boot/System.map.new /boot/System.map

created a new initrd.gz
Code:

mkinitrd -c -k 2.6.32.7-smp -m ext2 -f ext2 -r /dev/cryptvg/root -C /dev/sda2 -L
The following is one of the steps I wasn't sure about (took it from a howto), because linking to the old modules will not include the modules I chose during 'make oldconfig' I suppose. Would be nice If someone could tell me something about this as well.
Code:

cd /etc/rc.d
rm rc.modules
cp rc.modules-2.6.29.6-smp rc.modules-2.6.32.7-smp
ln -s /etc/rc.d/rc.modules-2.6.32.7-smp /etc/rc.d/rc.modules

created new entry in lilo.conf
Code:

image = /boot/bzImage
initrd = /boot/initrd.gz
root= /dev/cryptvg/root
label = 2.6.32.7
read-only

ran lilo and rebooted

Any help is appreciated. :)

ChrisAbela 02-08-2010 02:52 AM

Try

Quote:

initrd = initrd.gz
in lilo.conf and run lilo -v again

titopoquito 02-08-2010 02:54 AM

I don't see an error popping out. I would suggest to use a config file from Slackware current though. I had the same problem and cannot say what exactly made the mount fail, but with the newer config file it worked like a charm. ftp://slackware.mirrors.tds.net/pub/...rent/source/k/

KMBS 02-08-2010 07:41 AM

Quote:

Originally Posted by ChrisAbela (Post 3856396)
Try

initrd = initrd.gz

in lilo.conf and run lilo -v again

That won't work, lilo won't find it that way, I'd had to move it to / , but it needs to be in /boot, since it is the only unencrypted partition.

KMBS 02-08-2010 07:44 AM

Quote:

Originally Posted by titopoquito (Post 3856399)
I don't see an error popping out. I would suggest to use a config file from Slackware current though. I had the same problem and cannot say what exactly made the mount fail, but with the newer config file it worked like a charm. ftp://slackware.mirrors.tds.net/pub/...rent/source/k/

Thanks, I'll try it with that config, I'll report in in a few hours. :)

GazL 02-08-2010 07:49 AM

This looks a bit fishy

Code:

Command successful:
  Reading all physical volumes. This may take a while...
  Found volume group "cryptvg" using metadata type lvm2
  3 logical volume(s) in volume group "cryptcg" now active

cryptvg when it finds the PVs yet, cryptcg when it finds the LVs.

You might find that -r /dev/cryptcg/root on the mkinitrd might get you up and running, but your lvm looks like it needs some further diagnosis / attention to resolve this inconsistency.

KMBS 02-08-2010 07:53 AM

Quote:

Originally Posted by GazL (Post 3856614)
This looks a bit fishy

Code:

Command successful:
  Reading all physical volumes. This may take a while...
  Found volume group "cryptvg" using metadata type lvm2
  3 logical volume(s) in volume group "cryptcg" now active

cryptvg when it finds the PVs yet, cryptcg when it finds the LVs.

You might find that -r /dev/cryptcg/root on the mkinitrd might get you up and running, but your lvm looks like it needs some further diagnosis / attention to resolve this inconsistency.

No, that's just a typo, it is supposed to be "cryptvg" the second time as well, my bad.

ChrisAbela 02-08-2010 08:17 AM

Quote:

That won't work, lilo won't find it that way, I'd had to move it to / , but it needs to be in /boot, since it is the only unencrypted partition.
I don't think so because you have a boot partition. I ALWAYS make a boot partition and it this is how I configure my lilo.conf. I hope that it works for you too.

Chris

GazL 02-08-2010 08:21 AM

Ahh, ok. I assumed that was a cut/paste so wasn't expecting the possibility of a typo. No worries.

Can you confirm that your rootfs is really on /dev/cryptvg/root? That device should be created within the initrd when it does the vgchange -ay so you shouldn't be seeing device not founds on the mount.

Also are you sure its an ext2 and not a 3 or 4?

GazL 02-08-2010 08:25 AM

It's not anything to do with the initrd= in lilo.conf Chris. The fact that he's getting as far as this shows that the initrd is already loaded.

Most likely, it's the -m -f or -r that is wrong.

KMBS 02-08-2010 08:34 AM

Quote:

Originally Posted by ChrisAbela (Post 3856631)
I don't think so because you have a boot partition. I ALWAYS make a boot partition and it this is how I configure my lilo.conf. I hope that it works for you too.

Chris

Like GazL said, the location of the initrd is not the problem, it gets loaded, otherwise I wouldn't get that far.

KMBS 02-08-2010 08:42 AM

Quote:

Originally Posted by GazL (Post 3856634)
Ahh, ok. I assumed that was a cut/paste so wasn't expecting the possibility of a typo. No worries.

Can you confirm that your rootfs is really on /dev/cryptvg/root? That device should be created within the initrd when it does the vgchange -ay so you shouldn't be seeing device not founds on the mount.

Also are you sure its an ext2 and not a 3 or 4?

Yes, root is in /dev/cryptvg/root, when I boot via USB I can decrypt and mount it and it looks as it should.
And it's definitely ext2 (I read somewhere that ext2 would be easier on the flashdrive since ext3 writes more often to the disk because of the journaling).

I also suspect that I made a mistake while creating the initrd, may the -k option was wrong...

ChrisAbela 02-08-2010 08:55 AM

Deleted

ChrisAbela 02-08-2010 08:58 AM

Deleted.

ChrisAbela 02-08-2010 09:00 AM

I agree that it is not a initrd in lilo.conf issue.

Try

# depmod 2.6.32.7-smp # I assume you have a /lib/modules/2.6.32.7-smp
# mkinitrd -c -k 2.6.32.7-smp -m ext2 -f ext2 -r /dev/cryptvg/root -C /dev/sda2 -L

I hope this helps.


All times are GMT -5. The time now is 06:39 PM.