Disaster Strikes: What to Do When You Accidentally Delete Files or Format Disks in the Cloud

I'm a tech enthusiast who loves to explore DevOps and Web development.
Search for a command to run...

I'm a tech enthusiast who loves to explore DevOps and Web development.
No comments yet. Be the first to comment.
A few months ago, my product manager dropped something in the team channel. "We are adding an AI agent to the platform next quarter. It will handle follow-ups automatically." Just like that. One messa

f you’re diving into React, you’ve likely come across the useRef hook. But what exactly is useRef(), and how can it make your life easier? In this post we’ll cover what useRef is, walk through five

A bug that only happens for some users, that you can never reproduce, that isn't in your code. Welcome to the React + browser-translation crash — what causes it, why it's so sneaky, and the battle-tested one-file fix.

Upgrading a core production database is usually the stuff of dev nightmares. It often involves maintenance windows, scheduled downtime, and the looming fear of a botched migration. But what if you cou

We are moving into products that adapt, predict and react with real context. Designing only interfaces is not enough anymore. We are designing experiences that understand the user. Designers and digital agencies are now challenged to move beyond trad...

Engineering at JoBins
167 posts
Welcome to Engineering at JoBins — where we share the stories, insights, and lessons from building a world-class hiring platform. From system design and scalability to developer tools and team culture, our engineers write about the real challenges we solve every day. Whether you're a curious developer or a fellow builder, we hope our experiences inspire and inform your own engineering journey.
Recovering lost files or formatted disks in a cloud server can be a daunting task, especially if you're not familiar with the recovery process. Unlike physical computers, where you can simply remove the disk and attempt to recover the data, cloud servers require a more complicated approach.
Gracefully shut down the system. This will prevent any further damage to the disk and improve the chances of recovering lost data.
Mount the formatted disk as read-only. It is essential to mount the formatted disk as read-only or avoid any read operations to the disk if possible.
Recover the partition table of a formatted disk.
Use TestDisk, a powerful tool that can analyze and recover lost partition tables.
Follow the Steps:
Install TestDisk on your cloud server.
Launch TestDisk and select the formatted disk.
Select "Analyse" and wait for the tool to scan the disk.
Select "Quick Search" to search for lost partitions.
If Quick Search doesn't find the lost partition, select "Deeper Search" to search for more partitions.
Select the lost partition and choose "Write" to save the partition table.
PhotoRec: Media file recovery tool
Use PhotoRec, which can recover files (especially media files) from a formatted disk or a deleted partition.
Follow the steps:
Install PhotoRec on your cloud server.
Launch PhotoRec and select the disk where the deleted files were located.
Select the file system type of the disk.
Choose the partition where the deleted files were located.
Select "Search" and wait for the tool to scan the disk.
Select the files you want to recover and choose "Copy" to save them to a safe location.
R-Studio disk recovery: powerful GUI recovery tool
If you prefer GUI Tool then use, R-Studio disk recovery is an excellent tool that does a great job of recovering lost files or formatted disks.
Follow the steps:
Install R-Studio on your cloud server.
Launch R-Studio and select the formatted or deleted disk.
Select "Scan" and wait for the tool to scan the disk.
Select the files you want to recover and choose "Recover" to save them to a safe location.
Recovering lost files from boot partitions from the cloud server
Create a new instance to store boot partition data in a separate disk.
Prepare another disk to mount with sufficient disk space to store the dump of the deleted partition.
Use the dd command to transfer the data from a deleted instance to a newly created disk in a new server, you can use the dd command.
# Cloning boot disk remotely
# run this command from server where file was deleted
sudo dd if=/dev/sdX | ssh username@server sudo dd of=/dev/sdY
Replace "sdX" with the deleted disk block and "sdY" with a new disk for storing the block.
Use any tools mentioned above to start recovery.
Follow the Instructions Carefully While the recovery process begins, it can be time-consuming, so be patient.
Links:
R-studio https://www.r-studio.com/
Test-disk https://www.cgsecurity.org/wiki/TestDisk
Photo-rec https://www.cgsecurity.org/wiki/PhotoRec
Feel free to share your thoughts and opinions and leave me a comment if you have any problems or questions.
Till then, Keep on Hacking, Cheers