Report this

What is the reason for this report?

HOW TO RECOVER FILE AFTER DROPLET RESTART- UBUNTU 16.04

Posted on September 7, 2018

I all of a sudden started encountering this error “ssh_exchange_identification: read: Connection reset by peer” . then i tried turning off the droplet and on again and when i connected back the the linux, all my files on /var/www/html was wiped out, the sudo service mysql start returns this error: Sep 07 09:10:36 ubuntu-s-2vcpu-4gb-sfo2-01 systemd[1]: Failed to start MySQL Community Server. Sep 07 09:10:36 ubuntu-s-2vcpu-4gb-sfo2-01 systemd[1]: mysql.service: Unit entered failed state. Sep 07 09:10:36 ubuntu-s-2vcpu-4gb-sfo2-01 systemd[1]: mysql.service: Failed with result ‘exit-code’. Sep 07 09:10:37 ubuntu-s-2vcpu-4gb-sfo2-01 systemd[1]: mysql.service: Service hold-off time over, scheduling restart. Sep 07 09:10:37 ubuntu-s-2vcpu-4gb-sfo2-01 systemd[1]: Stopped MySQL Community Server. Sep 07 09:10:37 ubuntu-s-2vcpu-4gb-sfo2-01 systemd[1]: Starting MySQL Community Server… Sep 07 09:10:37 ubuntu-s-2vcpu-4gb-sfo2-01 mysql-systemd-start[5980]: MySQL system database not found in /var/lib/mysql. Please run mysqld --initialize. Sep 07 09:10:37 ubuntu-s-2vcpu-4gb-sfo2-01 systemd[1]: mysql.service: Control process exited, code=exited status=1 Sep 07 09:10:37 ubuntu-s-2vcpu-4gb-sfo2-01 systemd[1]: Failed to start MySQL Community Server. Sep 07 09:10:37 ubuntu-s-2vcpu-4gb-sfo2-01 systemd[1]: mysql.service: Unit entered failed state. Sep 07 09:10:37 ubuntu-s-2vcpu-4gb-sfo2-01 systemd[1]: mysql.service: Failed with result ‘exit-code’. Sep 07 09:10:37 ubuntu-s-2vcpu-4gb-sfo2-01 systemd[1]: mysql.service: Service hold-off time over, scheduling restart. Sep 07 09:10:37 ubuntu-s-2vcpu-4gb-sfo2-01 systemd[1]: Stopped MySQL Community Server. Sep 07 09:10:37 ubuntu-s-2vcpu-4gb-sfo2-01 systemd[1]: mysql.service: Start request repeated too quickly. Sep 07 09:10:37 ubuntu-s-2vcpu-4gb-sfo2-01 systemd[1]: Failed to start MySQL Community Server.

I have tried sudo mysqld —initialize and I got this error: 2018-09-07T08:45:45.504752Z 0 [ERROR] Can’t change data directory owner to mysql 2018-09-07T08:45:45.504983Z 0 [ERROR] Aborting

i have tried the recovery steps on this tutorial : https://www.digitalocean.com/docs/droplets/resources/recovery-iso/ with no luck.

Please how do I restore my os / recover my files. Thanks



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey friend!

This situation is a bit deeper than anyone can know from an external perspective. If you have a system administrator that you trust, you should ask them to review that server for you. Files don’t really just go missing from a reboot, and it’s especially odd if they do and yet the operating system still boots (as that kind of file system corruption is unlikely to specifically target items non-essential to boot).

My concern is that your server was compromised and configured by an attacker to act this way. Most likely you’re not going to restore that data in a meaningful way and should start pulling your external backups. I would not re-deploy on this server, but I would have a sysadmin look at it to see if any evidence remains of what occurred so that it might be prevented.

Jarland

It’s worth double-checking if you have backups enabled:

  1. DigitalOcean Snapshots:
  • Log in to your DigitalOcean Control Panel.
  • Navigate to the “Droplets” section.
  • Check if there are any snapshots that were taken automatically or manually. If you find one, you can create a new droplet from the snapshot to recover your files.
  1. Backups:
  • Again, check if you might have enabled backups at any point. These are different from snapshots and might provide another route to recovery.

If snapshots and backups are not available, you can try using testdisk to recover deleted files. testdisk is a powerful data recovery tool that can work in some cloud environments. You can also check this article:

https://www.digitalocean.com/community/tutorials/how-to-install-testdisk-on-linux-and-recover-deleted-files

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.