Hello, i am new to Linux and after deleting some orphaned packages to make space in root, Manjaro wouldn’t start properly, got a black screen with “[FAILED] Failed to start Load Kernel Modules”, “[Failed] Failed to mount /boot/efi/”.
After checking some other similar topics i tried fixing this by booting from a USB and mounting my root installation and using chroot, i reinstalled the package linux510 thinking it would be enough and rebooted. Obviously i did something wrong since now the GRUB screen is gone and Manjaro is still showing the same error.
To add some info, this doesn’t seem to be an issue related to the latest update(my system wasn’t updated to the latest stable release) or to any Nvidia drivers. I am also dual-booting with Windows10 even though now it boots straight into Manjaro. Last time i made a system update was about two weeks ago.
Is it okay to boot from a USB again and use pacman -Syu or do i need to do something specific to fix GRUB? Or do i need to do something else entirely? Not sure what to do, if someone could help me and give me the steps needed to fix my system, please.
It seems rather obvious that you removed … a little too much.
I’d go and inspect what you did and reinstall that which you removed.
Hopefully these packages are still in the pacman cache /var/cache/pacman/pkg
and you can use pacman -U /var/cache/pacman/pkg/_name_of_package
to reinstall the original
If they are not there anymore - because you needed space and may have removed them:
they can still be had - don’t know from where exactly
The other option would be to do a system update - and reinstall the newer versions of those packages you removed as well.
all this requires booting from USB and chrooting into your system from there
cat /var/log/pacman.log | grep removed
will show you what got removed and when
so you have a reference of what you did and can reverse it
all this requires booting from USB and chrooting into your system from there
In regards to the chrooting, last time i just mounted my root partition manually. But since i got a /boot/efi/ partition and a swap one don’t i need to mount those too? After using pacman -S linux510 there were some messages of GRUB updating near the end.
Here is the output of lsblk -fm:
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT SIZE OWNER GROUP MODE
loop0 squashfs 4.0 0 100% /run/miso/sfs/livefs 27.5M root disk brw-rw----
loop1 squashfs 4.0 0 100% /run/miso/sfs/mhwdfs 620.5M root disk brw-rw----
loop2 squashfs 4.0 0 100% /run/miso/sfs/desktopfs 1.7G root disk brw-rw----
loop3 squashfs 4.0 0 100% /run/miso/sfs/rootfs 667.8M root disk brw-rw----
sda 238.5G root disk brw-rw----
├─sda1 vfat FAT32 SYSTEM 222B-197E 260M root disk brw-rw----
├─sda2 16M root disk brw-rw----
├─sda3 BitLocker 2 190.4G root disk brw-rw----
├─sda4 ntfs WinRE_DRV 1E782E0B782DE26F 1000M root disk brw-rw----
├─sda5 vfat FAT32 A47A-E698 512M root disk brw-rw----
├─sda6 swap 1 cbc87e37-4f83-4f21-a23b-bbd2ea05d0b5 2G root disk brw-rw----
├─sda7 ext4 1.0 36874956-5802-45b7-b40b-7c47b66fd5ef 20G root disk brw-rw----
└─sda8 ext4 1.0 a05618e2-00d7-4b61-bd89-d3eaf4bb50c3 24.4G root disk brw-rw----
sdb iso9660 Joliet Extension MANJARO_KDE_2021 2021-01-03-09-07-36-00 0 100% /run/miso/bootmnt 14.4G root disk brw-rw----
├─sdb1 iso9660 Joliet Extension MANJARO_KDE_2021 2021-01-03-09-07-36-00 3G root disk brw-rw----
└─sdb2 vfat FAT12 MISO_EFI 7B2D-7571 4M root disk brw-rw----
Here /dev/sda7 was the one i mounted last time, sda8 is /home or /usr(sorry, i don’t remember). I think i am gonna need a little handholding through the steps to fix this, since i only end up messing things up further by going in alone. Thanks to both for replying.
mounting your partitions - all of them in the correct order, to the correct place - is a requirement
this has to be done - before chroot
simply mounting them … will not do
Manjaro provides a script - called “manjaro-chroot” - which tries to automate the process, so you don’t have to do all the mounting …
This is often, but not always, successful.
Have you tried using that?
Without chroot - it’s not impossible but very much harder
to fix your system.
If manjaro-chroot is not working (try it first):
Can you supply /etc/fstab from your system?
It should be on /dev/sda7
I did use chroot after mounting /dev/sda7/, but yes i did not mount any other partitions.
Just used manjaro-chroot -a and got:
grub-probe: error: cannot find a GRUB drive for /dev/sdb1. Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sdb1. Check your device.map.
==> Detected systems:
--> 0) ManjaroLinux
==>Select system to mount [0-0]:
Do i select 0 and i am guessing there is a problem with the /boot/efi/ partition or GRUB, so it would not work properly? 0 gives me an ERROR: You can’t mount 0
if you want to chroot using the automated tool: don’t mount anything - it’ll interfere and prevent it from doing it’s job
it will do the mounting for you
Sorry, that quote was referencing what i did yesterday and the only time i chrooted. I did not mount anything in this session yet.
Now entering manjaro-chroot -a shows what i posted above. Entering 0 throws: ERROR: You can't mount 0.
The output of manjaro-chroot is ERROR: Can't create chroot on non-directory
I don’t know why an earlier version of this tool had this confusing bug:
it asks you to select a system - shows you the system a 0 and asks you to enter 0 to chroot into it
when it actually only works if you say 1
so:
put 1 and try again
yes - ignore it
but, once you are inside
still check if everything is where it is supposed to be
Your /etc/fstab could help there.
A terminal file-manager like mc would also help if you are not familiar with the command line.
But - it looks ok from here.
You can also access the files from outside the chroot - to look at them.
The whole system is now below /mnt
But the work, the fixing and reinstalling and updating … has to be done from that terminal you used to chroot.
And:
be careful!
inside the chroot - you are root
no sudo protection!
Nope - don’t worry about that.
You could try swapon -a
to use it.
But I wouldn’t bother unless you are low on RAM.
and tmpfs is taken care of by the chroot
It was probably a bit much to ask of you to judge whether the system inside the chroot is indeed assembled fully and correctly.
Let’s just assume it is.
Just be careful - you are root!
No questions asked, whatever you do.
… but at least I didn’t give you any potentially dangerous commands to try and execute - I’m very sure of that!
Another thing, what about the only package i reinstalled yesterday using pacman -S linux510 i have the old version in the pacman cache. Do i reinstall the old version or let it pass and just try to reinstall all the other packages?
If you installed it yesterday, it is very very unlikely that this is “an old version”
let it pass I’d say
but:
this is Manjaro - not Arch
in Manjaro you normally do not install kernels with: pacman -S linux510
In Manjaro, there is a tool for that: mhwd-kernel
Don’t worry - it just takes care of some extra steps that are needed after installing a kernel via pacman … to make it actually usable.
If you are worried nonetheless:
just reinstall it
I used pacman -U /var/cache/pacman/pkg/_name_of_package to reinstall all the packages i could find that matched the ones i removed. After exiting and rebooting my system is still the same, GRUB won’t show up, it boots directly into the “Emergency Mode” with the same messages as before.
Here is the list of the orphaned packages removed:
After using the exit command it unmounted everything, i don’t think i used the exit command when i chrooted yesterday. Maybe it helps narrow down the problem? Also i used the pacman -Qs _name_of_package to see if some of the packages were already installed and did not need to reinstall, which was the case for linux510 and linux-firmware.
cat /var/log/pacman.log | grep PACMAN
will show the actual commands you ran
From the removed (and now re-installed packages)
I can’t glance anything other than:
with these in the list of packages about to be removed
I’d have at least hesitated to actually do it.
Are you sure that’s all of them?
cat /var/log/pacman.log
will show the whole thing
the grep command is used to filter the output by certain distinctive keywords
and then there is always the possibility of running a full system update/upgrade
if the here attempted reconstruction of the former state didn’t work
I’d try to re install xorg - possibly also your DE
and
your nvidia driver seems to have been among the victims
or was it even mhwd itself?
… don’t know
I don’t think i can make the system update, the total installed size is about 3.7gb while i only got about 1.5 of free space in root. Already backed up the important things in /home .
Last time i installed Manjaro it was months ago, is there no conflicts with all the partitions already made and windows 10, or do i just follow the same steps as before? I don’t want to break my system any further.
Is there a good guide to reinstall Manjaro? Or a guide to uninstall Manjaro and see if Windows is still intact?