Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Initramfs fails to mount the mapper device after fsck

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
sylvmarl
Posts: 4
Joined: 2008-05-08 12:23

Initramfs fails to mount the mapper device after fsck

#1 Post by sylvmarl »

Hello,

I haven't rebooted my computer since August 2017, and did some selective apt update/install in the meantime.
Today I restarted, and I got stuck into the initramfs :

Code: Select all

Decompressing Linux... Parsing ELF... No relocation needed... done.
Booting the kernel. Loading, please wait...
Please unlock disk/dev/disk/by-uuid/ff29...5d59 (sdb1): <password>
cryptsetup (sdb1): set up successfully
fsck from util-linux 2.27.1
Usage: mount [-r] [-w] [-o options] [-t type] [-f] [-i] [-n] device directory
Target filesystem doesn't have requested /sbin/init.
mount: No such file or directory
Could not copy file: No such file or directory
No init found. Try passing init= bootarg.
Busybox v1.27.2 (Debian 1:1.27.2-2) built-in shell (ash)
(initramfs) _
I have a non-encrypted /boot partition (sda1), which requests me a LUKS paraphrase to access the encrypted root partition (sdb1). The partition is actually deciphered correctly into /dev/mapper/sdb1, the boot sequence seems to run a fsck with success, but then stops trying to perform a incorrect mount command which returns a "Usage: mount" line.

In the initramfs, I have been able to manually mount the partition on /root or /mnt.
But when I try to type "exit" or "exec switch_root /mnt /sbin/init", I always get a kernel panic.
For information, I have other partitions (encrypted and non-encrypted) on the same disks, which I am able to manually open and mount correctly also. I don't mention them here because it seems not related to my issue. I saw that /dev/mapper/sdb1 is also created as /dev/dm-0, I don't know why but it seems not related with the issue. I don't have any swap partition and I try to avoid using LVM.

After searching on the Internet, I tried a few things:
  • run manually fsck on all the devices with success.
  • mount the partitions without the option "-t ext3". I got an error similar to boot sequence: Usage: mount [-r] [-w] [-o options] [-t type] [-f] [-i] [-n] device directory. So I tried to find the script which does a "mount" command in /etc/initramfs-tools/, but I couldn't find it.
  • rename the encrypted partitions differently than their device name in /etc/crypttab and /etc/fstab ("crypto-root" instead of "sdb1"). I managed to have the boot sequence creating the mapped device with this name, but it didn't help.
  • use "UUID=xxx" instead of device names in crypttab, in fstab and in grub (root=/dev/mapper/crypto-root, root=/dev/dm-0, or root=UUID=xxx). It didn't help either.
  • copy scripts/local-top/ and hooks/cryptroot, from /usr/share/initramfs-tools to /etc/initramfs-tools/, since those scripts dated from 2010 whereas the /usr/share scripts dated from Sept 14th, 2017. However, I haven't copied the whole content from /usr/share/initramfs-tools, since only the cryptroot script was initially set in /etc when it used to work properly.
  • mount /sys, /proc, /dev and the deciphered root partition, chroot it and run "update-initramfs -u" and "update-grub". It generates.
  • run the recovery-mode sequence from grub (option "single"), it gives the following detailed output :

Code: Select all

Begin: Running /scripts/init-premount... done.
Begin: Mounting root file system...
  Begin: Running /scripts/local-top...
    Please unlock disk crypto-root: <password>
    [ ] bio: create slab <bio-1> at 1
    cryptsetup (crypto-root): set up successfully
    Begin: Assembling all MD arrays...
      Failure: failed to assemble all arrays.
    done.
  done.
  Begin: Running /scripts/local-premount... done.
  Begin: Checking file system...
    fsck from util-linux 2.27.1
  done.
  Usage: mount [-r] [-w] [-o options] [-t type] [-f] [-i] [-n] device directory
done.
Target filesystem doesn't have requested /sbin/init.
Begin: Running /scripts/local-bottom... done.
Begin: Running /scripts/init-bottom...
  mount: No such file or directory
done.
Could not copy file: No such file or directory
No init found. Try passing init= bootarg.
Busybox v1.27.2 (Debian 1:1.27.2-2) built-in shell (ash)
(initramfs) _
Note that I have no configured Internet access in the initramfs (I haven't spent time on finding how), so I am not able to run apt update/install from the chroot.

So I am able to mount and chroot all the devices manually, but I am not able to continue the boot sequence manually afterwhile (kernel panic), and I am not able to make initramfs automatically goes further the mount error.
Do you see why the line "Usage: mount" appears at this level of the boot sequence?
How to hack initramfs in order to have it pass the mount command?
Which additional steps may I try?

Thanks for your help.
-Sylvain

sylvmarl
Posts: 4
Joined: 2008-05-08 12:23

Re: Initramfs fails to mount the mapper device after fsck

#2 Post by sylvmarl »

Up.
I am still stuck on this problem :(
Any idea of how to make my system boot ?

Post Reply