7

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
    }
}
  • This is quite hard to debug since you have a relatively complex setup. Please edit your question and add the output of sudo parted -l and the contents of your /boot/grub/grub.cfg file (or at least the Manjaro entry). – terdon Jun 29 '14 at 14:55
  • OK, and are you sure that /dev/sda11 actually contains manjaro's root file system? Have you correctly set up the /etc/fstab on the manjaro system to mount the other partitions you need? Can you confirm that there is a /sbin/init on /dev/sda11? – terdon Jun 29 '14 at 15:30
  • @terdon:First of all , I don't have access to manjaro , only to mint.I am now with live cd in manjaro and as I can see there is a /sbin/init. The /etc/fstab contains only /dev/mapper/root-image and dev/sda9 swap (but I am with live cd) – George Jun 29 '14 at 15:37
  • You need to mount the drive in Mint. Run mkdir foo && sudo mount /dev/sda11 foo from Mint. Then check whether the contents of ~/foo look like a / directory, make sure there is a ~/foo/sbin/init and check ~/foo/etc/fstab` to make sure that the partitions are loaded correctly when in Manjaro. – terdon Jun 29 '14 at 15:39
  • 1
    @terdon In ArchLinux /sbin is now a symlink to /usr/bin. @George That blog comment references that part of the wiki. In your case the problem may be the last bullet point. You need /usr to be mounted by the init ramdisk. – Leiaz Jun 29 '14 at 16:25
7

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.

  • :When I enter "mkinitcpio -p linux" ,it gives me "ERROR: Preset not found /etc/mkinitcpio.d/linux.preset – George Jun 29 '14 at 18:02
  • @George Are there any preset in /etc/mkinitcpio.d/ ? linux is the default on Archlinux, maybe Manjaro gives it another name. – Leiaz Jun 29 '14 at 18:07
  • @terdon:First of all it works fine!I had to use 'linux312' (the kernel) instead of 'linux'.It still gives me the "WARNING: The root device..." I have in my first lines of my post but I think this is ok?And lastly , can you point me to some books or tutorials to learn this kind of stuff? :) . I want to be able to do these things also :).And i really appreciate your help.Thanks – George Jun 29 '14 at 18:19
  • Huh. I thought the entire point of /sbin was that it didn't have to be on the same partition as /usr. I wonder why Arch decided to merge them? – Nate Eldredge Jun 29 '14 at 18:20
  • @terdon:Something last!I need to do all this for every kernel update?And also the reason in the firstplace to have to do all these was that I had separate partitions for root and usr? – George Jun 29 '14 at 18:21
2

From Mint, you can change root to your Manjaro installation, in order to regenerate initramfs.

Mount your Manjaro root under the directory of your choice ( ~/foo). Mount your /usr partition at ~/foo/usr, also mount boot if it is separate. Mount proc sys dev :

# mount -t proc proc ~/foo/proc/
# mount --rbind /sys ~/foo/sys/
# mount --rbind /dev ~/foo/dev/

And change root : chroot ~/foo /bin/bash

As explained in the wiki : "Hooks are small scripts which describe what will be added to the image". Edit /etc/mkinitcpio.conf, add the usr fsck and shutdown hooks to the HOOK entry, as indicated in the wiki and comments. Regenerate initramfs : mkinitcpio -p linux (it will be written in /boot)

Exit the chroot, unmount proc, sys, dev and Manjaro partitions and try rebooting.

  • :Thank you for your help.terdon gave me much details in order to achieve the result :) .(upvoted) – George Jun 29 '14 at 18:20
0

Just wasted around 6 hours creating a USB boot device for Linux Mint, backing up all my data from 2 partitions, and attempting various rescue attempts after getting the dreaded sbin/init not found message...

This happened after a minor update - system would not reboot. It seems the whole sbin folder had mysteriously been deleted and could not be recovered. The only meaningful advice I could find was 're-install'.

The fix, (less than 5 minutes!!) was as follows:

  1. boot from the original live installation disk (Cinnamon Mint 17.1 in this case),
  2. open a file explorer as root (either right click a folder and select 'open as root', alternatively open a terminal and type 'sudo nemo'
  3. locate the live installation's sbin folder
  4. mount the defective Mint partition (click on the icon)
  5. change the permissions applying to the sbin folder (right click, Properties, Permissions, Others, File access, read and write - then click 'Apply Permissions to Enclosed Files')
  6. copy the whole sbin folder into the installed root directory (/). (This is where the system 'bin', 'boot', 'home', 'usr' etc. folders are located.)
  7. Reboot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.