Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
initramfs: fsck fails on boot, root partition not found
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
f.kater
Guru
Guru


Joined: 23 May 2002
Posts: 324
Location: Berlin

PostPosted: Thu Apr 19, 2012 6:58 am    Post subject: initramfs: fsck fails on boot, root partition not found Reply with quote

Hi,

fsck.ext4 is not executed at boot time because
Code:
/dev/mapper/luks
is not found.

After boot, I see that mount does see the root partition:
Code:
mount

rootfs on / type rootfs (rw)
/dev/mapper/luks on / type ext4 (rw,noatime,barrier=1,data=ordered,discard)
...

however ls does not:
Code:
ls /dev/mapper

/dev/mapper/control  # SHOULD LIST /dev/mapper/luks ?!


I am using an initramfs which does:
Code:
...

/sbin/cryptsetup --verbose -T 5 luksOpen /dev/sda3 luks
mount -o ro /dev/mapper/luks /root

umount /proc
umount /sys

exec switch_root /root /sbin/init


Any ideas why /dev/mapper/luks is not listed during/after boot?
Back to top
View user's profile Send private message
f.kater
Guru
Guru


Joined: 23 May 2002
Posts: 324
Location: Berlin

PostPosted: Fri Apr 27, 2012 1:26 pm    Post subject: Reply with quote

Let me insist here: :wink:

Who has initramfs (with or without cryptsetup) and *no* issues from fsck during boot?

Could you post your init script?
Back to top
View user's profile Send private message
f.kater
Guru
Guru


Joined: 23 May 2002
Posts: 324
Location: Berlin

PostPosted: Tue May 01, 2012 6:07 pm    Post subject: Reply with quote

Instead of a solution for busybox + ext4, I found this as a workaround:

http://wiki.gentoo.org/wiki/Early_Userspace_Mounting.

This basically uses full fsck.ext4 + all deps instead of busybox.
Back to top
View user's profile Send private message
leonidus
n00b
n00b


Joined: 16 Mar 2007
Posts: 4

PostPosted: Mon May 14, 2012 12:56 pm    Post subject: Reply with quote

I do have two laptops where I do something similar. For one, everything works - for the other, it doesn't. I came across this thread looking for an answer. Both systems do differ in architecture (amd64/x86) and kernel configurations. udev is the same version on both.

What's different to your description is that the system where the root partition cannot be fscked does have the proper /dev/mapper/root entry once the system has booted completely.
Back to top
View user's profile Send private message
f.kater
Guru
Guru


Joined: 23 May 2002
Posts: 324
Location: Berlin

PostPosted: Mon May 14, 2012 8:42 pm    Post subject: Reply with quote

Hi,

thanks for the info. Which system works: x86 or amd64? I am using amd64 and udev-182-r3... And further, I wonder why fsck fails although /dev/mapper/root exists - what is the error message you get?

Thanks again,
Felix
Back to top
View user's profile Send private message
SlashBeast
Moderator
Moderator


Joined: 23 May 2006
Posts: 2722

PostPosted: Mon May 14, 2012 10:13 pm    Post subject: Reply with quote

Your initramfs suppose to 'move' dev from initramfs to real system before switch_root is running.

You can grab my multifunctional initramfs from https://github.com/slashbeast/better-initramfs (binary images under downloads).

The reason why /dev/mapper is empty is because nothing created it. To force the creation you can use 'dmsetup mknodes' or you can run custom script to create symlinks there from /dev/dm-* like this one whch I created for mdev (I no longer use udev): https://github.com/slashbeast/mdev-like-a-boss/blob/master/devicemapper.sh

When initramfs move own dev to system's /dev, the udev pick it up and continue using, along with all already-created nodes.
_________________
github
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things 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