Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved]fail to mount root in initramfs using cryptsetup&lvm
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
vfan
n00b
n00b


Joined: 26 Aug 2009
Posts: 8

PostPosted: Tue Oct 27, 2009 3:00 pm    Post subject: [solved]fail to mount root in initramfs using cryptsetup& Reply with quote

Hello, I have been setting up a laptop with whole disk encryption. I have followed

http://en.gentoo-wiki.com/wiki/Booting_encrypted_system_from_USB_stick#Preparing_the_USB_stick

and

http://en.gentoo-wiki.com/wiki/Initramfs

and have got to the point of booting from the USB stick. It will boot and give me the grub option, it then starts the initramfs but fails to mount root. My init file is

#!/bin/busybox sh

busybox --install -s;exec sh (only in so I can run command manually)

mount -t proc none /proc
mount -t sysfs none /sys

cryptsetup luksOpen /dev/sda luks

lvm vgscan
lvm vgchange -a y

mount -o ro /dev/lvm/root /mnt/root

umount /proc
umount /sys

exec switch_root /mnt/root /sbin/init


I can run the commands manually, cryptsetup runs and asks for the password. This is accepted and the command says it works but does strangely give a usage message.

The two lvm command create the revelant entries in /dev/mapper and /dev/lvm.

But the mount give the following message

mount: mounting /dev/lvm/root on /mnt/root failed: Invalid argument.

I have tried different mountpoints like /newroot with full permissions, tried using /dev/mapper/lvm-root, tried without the ro.

The disk will mount when I have booted from the LiveDVD - latest version (10.1 I think)

So has anyone ever run through the above HOW-TOs and got a bootable system?

The only thing to note is I did not do a fress install of gentoo but restored from a backup, but I am not getting that far to use the install.


Last edited by vfan on Tue Oct 27, 2009 8:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
vfan
n00b
n00b


Joined: 26 Aug 2009
Posts: 8

PostPosted: Tue Oct 27, 2009 8:00 pm    Post subject: Reply with quote

:oops: the fault was all mine. I slavishly followed the instructions, even to using xfs for formating the root partition. I don't normally use xfs and don't include it in my kernel builds. As I said this was a restore not an install and forgot that the kernel did not have xfs support. Thought I might as well leave this up just incase someone is a foolish as me :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum