What can I do possibily after I successfully deleted the systemd dir as mistakely

vigneshd

New Member
Joined
Dec 30, 2023
Messages
2
Reaction score
0
Credits
30
Hi,

While I upto something i was deleted the dir of systemd inside /lib as the root. I was able those get know the deleted files with via my friend laptop as the same os and systemctl and systemd versions. As I was delete the folder '/lib/systemd' - I went on, and tried to re-instal the systemd. The pacakage was sucessfully re-installed.

After re-installing I found that the some of the files were missing with my previous versions, cause I have reinstalled as a fresh pacakage.

I was in the fear, wheather while re-booting it will create a problem or not. ( Or can I copy all the files missing under the dir ( /systemd ) from my friends laptop cause it was similar in versions)

If anyone can help please reply. thanks & regards in advance.



I have attached the files were inside the folder while I'm deleting, I able do to one thing 'press TAB' before deleting that was the files thier before deleting.
 

Attachments

  • Screenshot from 2023-12-30 18-58-04.png
    Screenshot from 2023-12-30 18-58-04.png
    227.4 KB · Views: 79


Did you not back up your system to a recovery app before messing with it? if so try a system restore from your app.
 
Did you not back up your system to a recovery app before messing with it? if so try a system restore from your app.
Hi,

This was my office system, I did backup anything before. If the OS needs to be re-installed it has to done with my sys admin only. After deleting the entitre systemd folder, I observer that the any usb driver mounted where not showing in the files and no pop ups while mounting.

This ensuring that something is not working well. As I gone through the details about systemd, it will be started while in system boot start, as I reinstalled immediately after deleting it. i observer the some of the basis files were came up with the re-installation itself.

Can u help, to make sure that this will re-installation will help or I need to do something other things to do cause I couldn't connect the usb drive also for the backup of my office folders. Or any restart will help to resolve this issue ? Or else how can I restore this issue ?



Linux distro : Rocky linux 9.3 x64

*Picture the files came after i re - installed the systemd pacakage by (sudo yum reinstall systemd)
 

Attachments

  • Screenshot from 2023-12-30 20-55-53.png
    Screenshot from 2023-12-30 20-55-53.png
    157.1 KB · Views: 78
Firstly, commiserations about the troublesome deletions from /lib.

Of course, these are system files and are installed and removed by the package manager which takes into account the dependencies. A user usually doesn't mess with them.

To re-install files that may be missing, is a "hit and miss" situation with too many uncertainties unless one knows exactly what one is doing. The most effective way to proceed is to install, or re-install, the relevant systemd programs using the package manager.

If you want to make the current machine include all the systemd files that appear in another machine, then simply find out ALL the systemd packages that are installed on the other machine, and install, or re-install, those packages on the current machine using the package manager. That should take care of all the files.

Note that there are many systemd packages, for example on this machine there are the following:

Code:
libnss-systemd/testing,now 254.1-3 amd64 [installed]
libpam-systemd/testing,now 254.1-3 amd64 [installed]
libsystemd-shared/testing,now 254.1-3 amd64 [installed,automatic]
libsystemd0/testing,now 254.1-3 amd64 [installed]
libvirt-daemon-system-systemd/testing,now 9.7.0-1 all [installed,automatic]
systemd-container/testing,now 254.1-3 amd64 [installed,automatic]
systemd-dev/testing,now 254.1-3 all [installed,automatic]
systemd-sysv/testing,now 254.1-3 amd64 [installed]
systemd-timesyncd/testing,now 254.1-3 amd64 [installed,automatic]
systemd/testing,now 254.1-3 amd64 [installed]

In relation to the problem of not being able to mount a usb, it's important to know how you are trying to mount it. To test whether it is in fact able to be mounted, use mount directly, as root:
Code:
mount -t auto /dev/sd## /mnt
Note that the ## are the letter and number of the drive and partition of the usb device that you can determine with the command: lsblk, after you've plugged the usb into the socket on the machine.
After this mount command succeeds, navigate to the directory /mnt, run the ls command and see it you can see the contents of the usb.

If the usb mounts successfully, then the system is working. If the system is working, but you still cannot mount the usb by using other methods or software than the above method, then that method or software is where you'd need to focus your attention. If root itself can't mount the usb, then you are likely looking at hardware issues to do with the usb itself or the socket. Try another socket. Try another usb etc.
 
Last edited:
Hi,

This was my office system, I did backup anything before. If the OS needs to be re-installed it has to done with my sys admin only. After deleting the entitre systemd folder, I observer that the any usb driver mounted where not showing in the files and no pop ups while mounting.

This ensuring that something is not working well. As I gone through the details about systemd, it will be started while in system boot start, as I reinstalled immediately after deleting it. i observer the some of the basis files were came up with the re-installation itself.

Can u help, to make sure that this will re-installation will help or I need to do something other things to do cause I couldn't connect the usb drive also for the backup of my office folders. Or any restart will help to resolve this issue ? Or else how can I restore this issue ?



Linux distro : Rocky linux 9.3 x64

*Picture the files came after i re - installed the systemd pacakage by (sudo yum reinstall systemd)
If I understand you correctly, your admin is the one who made the mistake because a user should never work as root, especially in an office environment. That is most irregular.

I would ask him to help you revert the damage and ask him to help in future situations where you need root access.

If thats not an option, I‘d suggest followig the above comments advice: Check which files „should be installed“ and reinstall those that are missing.

I‘m also somewhat sure you can automate that process by getting sort of a diff between what is and what should be, using the diff as an install command.

Not sure how that is done in your OS though.
 
Re-installing systemd is the easiest part of this. The hard part is re-installing all the service files you need.
Many are for system services. Some are for installed applications. Usually there are dozens of these.
 

Staff online


Top