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
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.