LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 02-08-2010, 01:38 AM   #1
KMBS
Member
 
Registered: Oct 2009
Location: Germany
Distribution: Slackware
Posts: 32

Rep: Reputation: 16
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.

Last edited by KMBS; 02-08-2010 at 08:09 AM. Reason: Typo
 
Old 02-08-2010, 02:52 AM   #2
ChrisAbela
Member
 
Registered: Mar 2008
Location: Malta
Distribution: Slackware 14.1
Posts: 467

Rep: Reputation: 89
Try

Quote:
initrd = initrd.gz
in lilo.conf and run lilo -v again
 
Old 02-08-2010, 02:54 AM   #3
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Ruhr Area, Germany
Distribution: Slackware64 14.0
Posts: 1,524

Rep: Reputation: 94
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/
 
Old 02-08-2010, 07:41 AM   #4
KMBS
Member
 
Registered: Oct 2009
Location: Germany
Distribution: Slackware
Posts: 32

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by ChrisAbela View Post
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.

Last edited by KMBS; 02-08-2010 at 08:06 AM.
 
Old 02-08-2010, 07:44 AM   #5
KMBS
Member
 
Registered: Oct 2009
Location: Germany
Distribution: Slackware
Posts: 32

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by titopoquito View Post
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.
 
Old 02-08-2010, 07:49 AM   #6
GazL
Senior Member
 
Registered: May 2008
Posts: 3,440

Rep: Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959
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.
 
Old 02-08-2010, 07:53 AM   #7
KMBS
Member
 
Registered: Oct 2009
Location: Germany
Distribution: Slackware
Posts: 32

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by GazL View Post
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.
 
Old 02-08-2010, 08:17 AM   #8
ChrisAbela
Member
 
Registered: Mar 2008
Location: Malta
Distribution: Slackware 14.1
Posts: 467

Rep: Reputation: 89
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
 
Old 02-08-2010, 08:21 AM   #9
GazL
Senior Member
 
Registered: May 2008
Posts: 3,440

Rep: Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959
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?
 
Old 02-08-2010, 08:25 AM   #10
GazL
Senior Member
 
Registered: May 2008
Posts: 3,440

Rep: Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959
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.
 
Old 02-08-2010, 08:34 AM   #11
KMBS
Member
 
Registered: Oct 2009
Location: Germany
Distribution: Slackware
Posts: 32

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by ChrisAbela View Post
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.

Last edited by KMBS; 02-08-2010 at 08:43 AM. Reason: Typo
 
Old 02-08-2010, 08:42 AM   #12
KMBS
Member
 
Registered: Oct 2009
Location: Germany
Distribution: Slackware
Posts: 32

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by GazL View Post
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...
 
Old 02-08-2010, 08:55 AM   #13
ChrisAbela
Member
 
Registered: Mar 2008
Location: Malta
Distribution: Slackware 14.1
Posts: 467

Rep: Reputation: 89
Deleted

Last edited by ChrisAbela; 02-08-2010 at 09:12 AM.
 
Old 02-08-2010, 08:58 AM   #14
ChrisAbela
Member
 
Registered: Mar 2008
Location: Malta
Distribution: Slackware 14.1
Posts: 467

Rep: Reputation: 89
Deleted.

Last edited by ChrisAbela; 02-08-2010 at 09:13 AM. Reason: Blame it on IE
 
Old 02-08-2010, 09:00 AM   #15
ChrisAbela
Member
 
Registered: Mar 2008
Location: Malta
Distribution: Slackware 14.1
Posts: 467

Rep: Reputation: 89
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.

Last edited by ChrisAbela; 02-08-2010 at 09:03 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Encrypted root with LUKS on LVM and RAID-1: How? gargamel Suse/Novell 5 03-20-2010 04:30 PM
Slackware 12.2 + RAID-1 + LVM + LUKS encrypted root gargamel Slackware 35 12-17-2009 11:25 AM
Slackware 12.1, LUKS, LVM on external HD. How? randomsel Slackware - Installation 7 06-26-2008 06:35 PM
Windows on LUKS LVM Post Slackware 12.1 Install -{Jester}- Slackware 4 05-23-2008 01:10 AM
mount luks encrypted partition with kdm mattydee Slackware 2 01-28-2008 12:32 AM


All times are GMT -5. The time now is 05:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration