I'm stuck at the loading screen and trying to enter emergency mode failed as well

I am in biiiiiiig trouble…

I was in sudo mode in a system folder (yeah I’m a really big idiot) and did an unlink command on a file and launched an incomplete command inadvertently.

Now after restarting my computer, I get stuck on the loading screen, the rotating logo disappear but still get stuck on the HP logo

I tried to access emergency mode but even that failed and the computer tells me it failed to initialize that as well

At launch I get different fail message after pressing ESC :
“failed to start builds and install new kernel modules through DKMS”
“failed to start lsb init script for live image”
it then changes to a simple _ and nothing else

Anybody know if there is a way to revert that unlink ?

EDIT : found that I had other messages :
failed to start LSB Cisco anyconnect secure mobility client for linux
failed to start sysv: late init script for live image

Edit : a last one
failed to start Restore /run/initramfs on shutdown

If the damage is just on the root file system, the initramfs should still be fine. Even if it isn’t, you should still have two backup initramfses (Fedora Linux keeps the previous two kernels installed by default). Adding rd.break=mount should drop you at a shell right after the root file system is mounted, but just before the system transitions out of the initramfs stage. From there, you should find your operating system mounted at /sysroot. You should be able to change files under that mount point directly (you might need to run mount -o remount,rw /sysroot if ro (read-only) was specified on the command line. Also, if you need to do package management with rpm, you can run chroot /sysroot /bin/bash --login to temporarily switch into the not-yet-started OS’s root file system (use exit to get back to the initramfs when you are done).

Once you are “chroot’d” onto the root file system, you can even start services like NetworkManager if you need to download packages with dnf. You might need to manually mount some dynamic file systems like /proc, /sys, /dev, /dev/pts, and /run before some services will work properly (you can bind mount them from the initramfs environment just to get things working temporarily, but you will want to unmount them when you are done and before you exit the rescue environment).

Bind mounting the said file systems can be done with something like this:

# for m in proc sys run dev dev/pts; do mount -o bind /$m /sysroot/$m; done

And when you are done undo the above with:

# for m in dev/pts dev run sys proc; do umount /sysroot/$m; done

When you exit the rescue environment, the system should attempt to continue booting as normal. Alternatively, you can enter reboot at the rescue prompt.

1 Like

Thanks for trying to help me. I don’t really know what I’m doing but I just typed all your codes and…

Holy shit, it seems to be working !

I’ll come back in a few minutes to tell you

Edit : THANK YOU THANK YOU THANK YOU !

I think anyone who has been working with computers for very long has been where you are. Sometimes we learn a lot from our mistakes. :slightly_smiling_face: