ERROR: Root device mounted successfully, but /sbin/init does not exist

bootmanjarosystemd

I've installed Linux Mint and Manjaro Linux on my computer. I installed only the Linux mint on the MBR. For Manjaro, I created a /boot/efi partition, but I have not checked to install to MBR.

So, I am controlling grub from mint. Now, when I try to boot Manjaro, it shows :

ERROR: resume: no device specified for hibernation: performing fsck on
dev/sda11  /dev/sda11: clean 1727/915712 files, .... blocks

WARNING: The root device is not configured to be mounted read-write!It
may be fsck'd again later

:mounting /dev/sda11 on real boot running cleanup hook [udev]

ERROR: Root device mounted successfully, but /sbin/init does not exist.

sh:can't access tty; job control turned off

[rootfs /]#

After the shell prompt, I can't write anything. It hangs, or sometimes it shows me messages continuously like :

usb 3-3: device not accepting address 2, error -62

and so on…

I tried to add init=/usr/lib/systemd/systemd to grub, as I saw in google, but still the same.

I must note that for the Manjaro installation I am using a separate partition for / and for /usr and for /var.
This maybe have an influence? As I saw here .

But the problem is that I can't write anything, it hangs.

I also found a comment on a blog post here that states:

“If you keep /usr as a separate partition, you must adhere to the following requirements:
“ – Add the shutdown hook. The shutdown process will pivot to a saved copy of the initramfs and allow for /usr (and root) to be properly unmounted from the VFS.

“ – Add the fsck hook, mark /usr with a passno of 0 in /etc/fstab. While recommended for everyone, it is mandatory if you want your /usr partition to be fsck’ed at boot-up. Without this hook, /usr will never be fsck’d.

“ – Add the usr hook. This will mount the /usr partition after root is mounted. Prior to 0.9.0, mounting of /usr would be automatic if it was found in the real root’s /etc/fstab.”

And never forget to run mkinitcpio -p linux every time after you make changes to mkinitcpio.conf to actually create the new images and get them the right place.

That sounds promising since my /usr is indeed on a separate partition. What are these "hooks" and how do I add them?

parted -l:

Model: ATA TOSHIBA MQ01ABD0 (scsi)
Disk /dev/sda: 750GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system     Name                  Flags
 1      1049kB  1075MB  1074MB  ntfs            Basic data partition  hidden, diag
 2      1075MB  1347MB  273MB   fat32           Basic data partition  boot
 3      1347MB  1482MB  134MB   ntfs            Basic data partition  msftres
 4      1482MB  80,1GB  78,6GB  ntfs            Basic data partition  msftdata
 5      80,1GB  80,4GB  262MB   ext4
 6      80,4GB  90,4GB  10,0GB  ext4                                  msftdata
 7      93,0GB  102GB   9000MB  ext4                                  msftdata
 9      102GB   106GB   3999MB  linux-swap(v1)
10      106GB   106GB   250MB   fat32                                 boot
11      106GB   121GB   15,0GB  ext4                                  msftdata
12      121GB   151GB   30,0GB  ext4                                  msftdata
13      151GB   165GB   14,0GB  ext4                                  msftdata
14      165GB   206GB   40,9GB  ext4                                  msftdata
 8      206GB   743GB   537GB   ext4                                  msftdata
15      743GB   747GB   4000MB  linux-swap(v1)                        msftdata

grub:

menuentry 'Linux Mint 17 Cinnamon 64-bit, 3.13.0-24-generic (/dev/sda5)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    gfxmode $linux_gfx_mode
    insmod gzio
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt5'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  19af2e09-8946-4ca2-9655-75921f3609a5
    else
      search --no-floppy --fs-uuid --set=root 19af2e09-8946-4ca2-9655-75921f3609a5
    fi
    linux   /vmlinuz-3.13.0-24-generic root=UUID=9356f543-f391-4ba5-9dcc-e8484d6935e0 ro   quiet splash $vt_handoff
    initrd  /initrd.img-3.13.0-24-generic
}
menuentry 'Linux Mint 17 Cinnamon 64-bit, 3.13.0-24-generic (/dev/sda5) -- recovery mode' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod gzio
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt5'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  19af2e09-8946-4ca2-9655-75921f3609a5
    else
      search --no-floppy --fs-uuid --set=root 19af2e09-8946-4ca2-9655-75921f3609a5
    fi
    echo    'Loading Linux 3.13.0-24-generic ...'
    linux   /vmlinuz-3.13.0-24-generic root=UUID=9356f543-f391-4ba5-9dcc-e8484d6935e0 ro recovery nomodeset 
    echo    'Loading initial ramdisk ...'
    initrd  /initrd.img-3.13.0-24-generic
}


menuentry 'Manjaro Linux (0.8.10) (on /dev/sda11)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-95ed019d-9269-4869-9f99-a03f002a53c6' {
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt11'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt11 --hint-efi=hd0,gpt11 --hint-baremetal=ahci0,gpt11  95ed019d-9269-4869-9f99-a03f002a53c6
    else
      search --no-floppy --fs-uuid --set=root 95ed019d-9269-4869-9f99-a03f002a53c6
    fi
    linux /boot/vmlinuz-312-x86_64 root=/dev/sda11
    initrd /boot/initramfs-312-x86_64.img
}
submenu 'Advanced options for Manjaro Linux (0.8.10) (on /dev/sda11)' $menuentry_id_option 'osprober-gnulinux-advanced-95ed019d-9269-4869-9f99-a03f002a53c6' {
    menuentry 'Manjaro Linux (0.8.10) (on /dev/sda11)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-312-x86_64--95ed019d-9269-4869-9f99-a03f002a53c6' {
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt11'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt11 --hint-efi=hd0,gpt11 --hint-baremetal=ahci0,gpt11  95ed019d-9269-4869-9f99-a03f002a53c6
        else
          search --no-floppy --fs-uuid --set=root 95ed019d-9269-4869-9f99-a03f002a53c6
        fi
        linux /boot/vmlinuz-312-x86_64 root=/dev/sda11
        initrd /boot/initramfs-312-x86_64.img
    }
}

Best Answer

As @Leiaz very correctly pointed out in the comments, /sbin in Arch (and by extension, Manjaro) is now a symlink to /usr/bin. This means that unless /usr is mounted, /usr/sbin/init will not exist. You therefore need to make sure that /usr is mounted by the initial ramdisk. That's what the Arch wiki quote in your OP means:

If you keep /usr as a separate partition, you must adhere to the following requirements:

  • Enable mkinitcpio-generate-shutdown-ramfs.service or add the shutdown hook.

  • Add the fsck hook, mark /usr with a passno of 0 in /etc/fstab. While recommended for everyone, it is mandatory if you want your /usr partition to be fsck'ed at boot-up. Without this hook, /usr will never be fsck'd.

  • Add the usr hook. This will mount the /usr partition after root is mounted. Prior to 0.9.0, mounting of /usr would be automatic if it was found in the real root's /etc/fstab.

So, you need to generate a new init file with the right hooks1. These are added by changing the HOOKS="" line in /etc/mkinitcpio.conf. So

  1. Boot into Mint and mount the Manjaro / directory:

    mkdir manjaro_root && sudo mount /dev/sda11 manjaro_root
    

    Now, Manjaro's root will be mounted at ~/manjaro_root.

  2. Edit the mkinitcpio.conf file using your favorite editor (I'm using nano as an example, no more):

    sudo nano ~/manjaro_root/etc/mkinitcpio.conf
    

    Find the HOOKS line and make sure it contains the relevant hooks

    HOOKS="shutdown usr fsck"
    

    Important" : do not remove any of the hooks already present. Just add the above to those there. For example, the final result might look like

    HOOKS="base udev autodetect sata filesystems shutdown usr fsck"
    
  3. Mark /usr with a passno of 0 in /etc/fstab. To do this, open manjaro_root/etc/fstab and find the /usr line. For this example, I will assume it is /dev/sda12 but use whichever one it is on your system. The "pass" number is the last field of an /etc/fstab entry. So, you need to make sure the line looks like

    /dev/sda12  /usr  ext4  rw,errors=remount-ro     0      0
                                                            ^
                             This is the important one -----|
    
  4. Create the new init image. To do this, you will have to mount Manjaro's /usr directory as well.

    sudo mount /dev/sda12 ~/manjaro_root/usr
    

    I don't have much experience with Arch so this might not bee needed (you might be able to run mkinitcpio without a chroot) but to be on the safe side, set up a chroot environment:

    sudo mount --bind /dev ~/manjaro_root/dev && 
    sudo mount --bind /dev/pts ~/manjaro_root/dev/pts && 
    sudo mount --bind /proc ~/manjaro_root/proc && 
    sudo mount --bind /sys ~/manjaro_root/sys &&
    sudo chroot ~/manjaro_root
    

    You will now be in a chroot environment that thinks that ~/manjaro_root/ is actually /. You can now go ahead and generate your new init image

    mkinitcpio -p linux
    
  5. Exit the chroot

    exit
    
  6. Update your grub.cfg (again, this might not actually be needed):

    sudo update-grub
    

Now reboot and try booting into Manjaro again.


1 "Hooks" are small scripts that tell mkinitcpio what should be added to the init image it generates.

Related Question