You are not logged in.

#1 2024-05-01 22:14:48

Xsofito
Member
Registered: 2024-01-29
Posts: 50

[SOLVED] System not able to boot after removing files not owned

Today I was cleaning my system, and without paying attention to what was I removing, I remove all files listed in the following command from the wiki:
https://wiki.archlinux.org/title/Pacman … ny_package

# find /etc /usr /opt | LC_ALL=C.UTF-8 pacman -Qqo - 2>&1 >&- >/dev/null | cut -d ' ' -f 5-

After rebooting I noticed I fucked up, my user didn't have any root rights, as I dont have the root account enabled I booted into the live cd and add my user to the sudoers file.
Rebooted and now I get "failed to mount /boot" and I cannot access the root console to find what went wrong.
I checked the fstab file and all seems normal, I don't know what else to look at.

Last edited by Xsofito (2024-05-02 13:21:21)

Offline

#2 2024-05-01 23:00:38

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,998

Re: [SOLVED] System not able to boot after removing files not owned

files of interest … common false positives

Can you access your shell history or the output of that command (if you redirected it into a file) to see what files you deleted?

Offline

#3 2024-05-01 23:49:00

Xsofito
Member
Registered: 2024-01-29
Posts: 50

Re: [SOLVED] System not able to boot after removing files not owned

There's no output, I switched to root using sudo su and run:

find /etc /usr /opt | LC_ALL=C.UTF-8 pacman -Qqo - 2>&1 >&- >/dev/null | cut -d ' ' -f 5- | xargs rm -rf

I have no idea how many critical files I must have deleted, so I don't know where to start searching for missing system files.

Offline

#4 2024-05-02 00:38:41

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,642

Re: [SOLVED] System not able to boot after removing files not owned

Xsofito, If you were wondering where your posts went, I think you hit 'report', not 'reply'.   It happens.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#5 2024-05-02 02:21:10

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,727

Re: [SOLVED] System not able to boot after removing files not owned

You likely can't mount /boot because the files generated by depmod got deleted. The mkinitcpio presets would be missing as well, so you would need to reinstall the kernel packages to take care of both of those things. I would reinstall all packages.

https://wiki.archlinux.org/title/Pacman … dependency?

Offline

#6 2024-05-02 10:11:55

Xsofito
Member
Registered: 2024-01-29
Posts: 50

Re: [SOLVED] System not able to boot after removing files not owned

I think you hit 'report', not 'reply'.

Yeah, I did, my bad.

I would reinstall all packages.

I reinstalled all packages but had some issues with the certificates and mirrorlist, after fixing that I reinstalled packages but still /boot is not able to mount when starting the system.

[FAILED] Failed to mount /boot.
See 'systemctl status boot.mount' for details.
[DEPEND] Dependency failed for Local File Systems.

...

You are in emergency mode. After logging in, type "journalctl -xb" to view system logs, "systemctl reboot" to reboot, or "exit" to continue bootup.

Cannot open access to console, the root account is locked.
See sulogin(8) man page for more details

Offline

#7 2024-05-02 13:01:37

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,998

Re: [SOLVED] System not able to boot after removing files not owned

This  typically also happens if you forgot to mount the boot partition before updating the kernel - the installed modules and booting kernel fall out of sync, the (likely) vfat module can't be loaded (because it doesn't exist for the version of the booting kernel) and consequently /boot cannot be mounted.
You've to fix this offline, ie. from an installation iso, mount the root of the installed system, the boot partition into /mnt/boot, arch-chroot into /mnt and re-install the kernel.

I'm not exactly sure how you got there w/ your mass deletion script, though.

Offline

#8 2024-05-02 13:20:11

Xsofito
Member
Registered: 2024-01-29
Posts: 50

Re: [SOLVED] System not able to boot after removing files not owned

Reinstalling all packages with the roon and boot partitions mounted solved, now I need to reconfigure all the system.

Does system config files created in the live cd doesnt have ownership? Thus being deleted by the command?

Anyways, thanks for the help.

Offline

#9 2024-05-02 13:41:11

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,998

Re: [SOLVED] System not able to boot after removing files not owned

You originally probably only lost  /usr/lib/modules/*/modules.* but then the re-installation w/o the boot partition mounted got the booting kernel out of sync.
You'll probably have some residuals in the /boot mountpoint (ie. the directory when the partition isn't mounted there) that you want to clean up.

Make sure you're actually booting from a boot partition (cat /proc/cmdline doesn't reference the kernel relative to a "boot/" path) and that you don't accidentally delete the file on the boot partition.
Ie. don't try to automatize that wink

Offline

Board footer

Powered by FluxBB