I have deleted data from the root directory. How to safely restore them?

assylbek

New Member
Feb 3, 2025
1
0
1
I have a Kubernetes cluster with 1 master node and 2 worker nodes working as a virtual machines in the Proxmox VE. I am being connected to the master node server using SSH client session using Mobaxterm. Server's operating system is CentOS 8. While being in the root directory I have deleted all the data in there...

What algorithm of actions should I take?


Markdown (GitHub flavored):
[gitlab-runner@k8smaster01 java]$ id<br>uid=971(gitlab-runner) gid=971(gitlab-runner) groups=971(gitlab-runner),984(docker)<br>[gitlab-runner@k8smaster01 java]$ cd ..<br>[gitlab-runner@k8smaster01 opt]$ exit<br>logout<br>[root@k8smaster01 ~]# clear<br>[root@k8smaster01 ~]# ls<br>admin.conf       <br>'cribe configmap -n kube-system kube-proxy'<br>jmix2-base-img-Dockerfile  <br>portainer-lb.yaml   <br>values.yaml<br>admin-openrc.sh<br>cuba72-base-img-Dockerfile<br>k9s<br>scripts<br>zynd<br>admin-user.yaml<br>Downloads<br>openstack.env<br>scripts.tar.gz<br>anaconda-ks.cfg<br>dump.txt<br>portainer_agent<br>ter-info<br>[root@k8smaster01 ~]# nano admin-user.yaml<br>[root@k8smaster01 ~]# rm -rf * jmix2-base-img-Dockerfile<br>[root@k8smaster01 ~]# rm -rf * cuba72-base-img-Dockerfile<br>[root@k8smaster01 ~]# nano values.yaml<br>[root@k8smaster01 ~]# ls<br>zynd
How can I recover my data? I'm asking for your help, Please.

I have downloaded many files on my host system using Mobaxterm interface:

Markdown (GitHub flavored):
.bashrc<br>.bash_history<br>.bash_logout<br>.bash_profile<br>.cache<br>.config<br>.cshrc<br>.docker<br>.kube<br>.lesshst<br>.local<br>.mysql_history<br>.redhat<br>.ssh<br>.tcshrc<br>.viminfo<br>.vscode-server<br>.wget-hsts<br>Downloads<br>jmix2-base-img-Dockerfile  <br>cuba72-base-img-Dockerfile<br>portainer_agent<br>scripts<br>zynd
But, unfortunately, these files haven't installed:

Code:
admin.conf       <br>'cribe configmap -n kube-system kube-proxy'<br>portainer-lb.yaml   <br>values.yaml<br>admin-openrc.sh<br>k9s<br>admin-user.yaml<br>openstack.env<br>scripts.tar.gz<br>anaconda-ks.cfg<br>dump.txt<br>ter-info
1738599453961.png
 
Last edited:
You did a rm -rf * <somefilename> in the root user's home folder and therefore deleted the content of /root?
If you do not have a backup, the files and folders are gone. You do have a backup, right?