I fell so stupid...
I just ran rm /* accidentally, but I meant rm ./* on a cloud server with root access.
Now, no one command works. ls, ssh, sftp... none.
Is there a way to fix that? (Note: params like -r or -f are no used in this case).
|
Restore from backup. Depending on the filesystem you may be able to run an undelete or recovery utility, but it's likely easier and more reliable to just restore from a backup. |
|||
|
|
|
Backup is likely your best fix, however if that isn't an option for whatever reason there are some techniques that can help recover deleted files from ext3/4 partitions. For any of these methods to be effective you want to drop to single user mode and unmount the disk(s) as soon as possible. And preferably run these from a livecd or other recovery environment is also a significantly safer method to avoiding accidental data loss while trying to recover your data. I won't post an epic on undelete processes as you should try to use the backups first, here are the links I find most helpful. |
|||||
|
|
If the Be advised that this only works on new moon, after midnight. A short rain dance beforehand might be beneficial. Or not. YMMV. (Yes, this is Unix' brutal way of teaching unsuspecting users to consider each command carefully before pressing |
|||
|
|
rmtorm -i, at least for a while :-) – jaume Feb 18 at 22:56rm *–– the./is totally unnecessary and, as you’ve experienced, can lead you into trouble. – Scott Feb 18 at 23:43lsbeforerm. – ultrasawblade Feb 19 at 0:45