Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So by matter of typo, i managed to basically execute rm -r * as root in /
As far as I can tell /bin and /etc are completely gone.
My important files are in /home/useraccount.
I only have 2 open ssh clients, and if they disconnect, I can't reconnect to the server. The servers too far away to simply go to, and an OS reload costs money. I'd at least like to back up my files before having to reformat.
I can use wget...so I tried copying over some bash files (ls / mkdir) but got permission denied...and chmod is gone do I can't change the permissions...
Anyone have any suggestions or should I just give up?
I'd honestly suggest backing up the home directories and reinstalling. Chances are you've deleted eenouygh critical system libraries that recovery will be difficult without booting to a LiveCD and re-installing the base system packages. If you can't do that, I'd suggest a reinstall.
Sounds like you learned a lesson about being careful with rm and the root account.
It's a self dedicated server, so os reloads cost money, but I managed to restore /bin by zipping /bin off my home linux box and unzipping it off the server, seems to have retained the permissions, will post here if i run into any problems.
You should check and see if your /lib is still intact (hopefully it is). If you're using a RPM based distro the -V (verify) option to RPM can help quite a lot.
Assuming that /home is on its own partition, you could simply reinstall. The critical step however would be that during the partitioning step, do NOT reformat /home. Simply leave it as is, then continue the installation normally. What you'd more or less be doing would be to re-install the distro "around" /home.
Note that this approach would also allow you to switch from one distro to another pretty painlessly. Again, the key is just that /home must exist on its own partition.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.