Recovery of remote linux files
Restoring deleted files in Linux can be quite a difficult task, especially if some time has passed since their deletion. However, there are several methods that can help recover lost data.
1. Using the "undelete" command: Most Linux distributions have the "extundelete" utility, which allows you to restore accidentally or intentionally deleted files on ext2/3/4 partitions. Root rights are required to use this command.
Example of use:
“`
sudo extenddelete /dev/sdaX –restore-all
“`
2. Using data recovery programs: There are a number of third-party data recovery programs for Linux, such as TestDisk and PhotoRec (partial file name). These tools provide a wider range of possibilities for working with different types of file systems and file formats.
3. Creating a hard disk image: If you want to minimize the risk of data damage when you try to restore them, you can create an image of the entire hard disk or a separate partition using the ddrescue or Clonezilla utilities before starting the recovery process.
Example of using ddrescue:
“`
sudo ddrescue /dev/sdaX image.img logfile.log
“`
4. Pay attention to backups: If you made regular backups of your data, this may be the simplest and most reliable way to return deleted information. Check the availability of the latest backups and use a tool to restore from the archive (tar, rsync or others).
It is important to remember that the sooner you start the recovery process after deleting files, the more likely you are to successfully recover the data. As soon as you realized the loss of the file, stop working on the computer and follow the indicated methods, if possible, without writing new data to the disk until the procedure is completed.