Bize habercilerden veya telefonla ulaşın.

whatsapp telegram viber phone email
+79214188555

Recover accidentally deleted data

Демитрий

Private access level
Katılım
12 Ara 2017
Mesajlar
422
Tepkime puanı
451
Puanları
193
Konum
г.Ейск, ул.Коммунистическая, 12/1, офис 308
Recover accidentally deleted data.

What to do if you accidentally deleted an important file? Can special services gain access to what you deleted? Today we’ll talk about data recovery.


What happens to the file after you click "Delete"? I do not mean the obvious and simple cases when a file falls into the Trash. What happens to a file that you delete completely - Yes, practically nothing!


How are files generally stored?
To get started, let's look at how files are stored before deletion. This will be needed in order to understand the recovery procedure.


The file system looks something like this:

ec799c68e5d49d67a5c70.png


A bunch of data written sequentially one after another, plus some system information. It can be compared to a book, and each file is a separate chapter. In the ideal case. In practice, of course, everything is much less neat


Imagine a book in which all pages are randomly arranged. It can start from page 5, then the 48th, 30th, and so on. And this is just what the file system actually looks like. This chaos is called fragmentation and it arises precisely because of the constant deletion of old files and the emergence of new ones.


When you insert the USB flash drive you just bought into the computer and write 100 photos to it, they will be written to it sequentially, in perfect order. But, if you delete a couple of pictures - suppose the 29th and 48th - and you will create the conditions for fragmentation to occur. If after that you send a text file and another photo to the USB flash drive, the data is fragmented. This is how it will happen.


First, the text file will fall on the place where the 29th photo lay. But it will take up the "free" space not entirely, but only partially, because text files weigh much less and it just does not need so much space. Then the file system will need to record a photo, and it will go look for a place for it. Most of the new photo will fall on the rest of the space from the 29th photo, and the end of the new photo will go to the beginning of the free space from the 48th. Here is such a division of the file into several pieces and is called fragmentation.


In fact, modern file systems are a little more complicated, but we do not need to consider this in more detail, because the result will be the same. I have already told you the most important and now you can move on to the interesting


<Recover Deleted Data>
How could one recover deleted photos No. 29 and No. 48 from the example above?


In fact, nothing complicated. There is a special software that analyzes the file system and looks for all the remaining pieces of deleted data in it. This is mainly garbage - pieces of data from which it is already impossible to collect anything. But, if you start recovery immediately after clicking on the "Delete" button, you are almost guaranteed to be able to recover your files. As long as the "empty" place where the pictures used to be is not occupied by anything new, it will always be possible. And even when the deleted file is partially overwritten, sometimes it can be partially restored. Let’s take a closer look.


When you just hit DELETE, the files are still completely recoverable. It will be enough to enable special software and you will see the deleted data in the same way as in the file manager. They will be available for viewing and recovery in one click. When you, as it was in the example, after deleting sent a text document to the USB flash drive, photo No. 29 becomes partially damaged. The beginning of its file is overwritten, and the middle and end can still be read. Photo No. 48 in this case is still entirely available for recovery. After sending a new photo to the USB flash drive, photo No. 29 will be permanently deleted, and photo No. 48 will be damaged.


Damaged data can also be restored sometimes, but a lot depends on the case. Some file formats are designed so that data becomes unreadable if a piece is removed from them. Others are read after that. For example, an encrypted archive definitely cannot be restored if at least a small block has been deleted from it. A photograph may be lost in its entirety, or in part - depending on which blocks will be lost. The surviving pieces of a simple text document can always be read, no matter how many percent of the file is lost.


https://i.imgur.com/4vT1HGr.png

Mac Software:
Disk Drill - yes, that one. Free Mac Data Recovery Software. Recover Files. Disk drill


Programs for recovering data from mobile:
Android Photo Recovery - although the word "Photo" is clearly highlighted in the name, the program also knows how to recover other file formats, contact list, SMS and something else. Distributed for a fee. Android Photo Recovery - Recover Deleted Photos / Videos / Music

PhoneRescue for iOS is another paid program, but for iPhone / iPad and other iDevices. PhoneRescue® for iOS - Retrieve Your Lost iPhone and iPad Data


You can connect the mobile device to the computer and use the usual data recovery program. There is nothing particularly unique in specialized reductants and here they are given more likely so that you know that they are. Perhaps they can be a little more convenient, because they have pre-prepared functions for data recovery specifically from mobile. But there are no fundamental differences, so if you do not want to pay for the recovery of one accidentally deleted photo, just use the usual free program and that’s it.


<Experimenting>
So, the test files are created, the program is loaded.

6f1b9dbcad608f8272032.png



We delete everything "irrevocably" - usually for this, the combination Shift + Delete is used, unless you reconfigured otherwise. Run the program. I chose Recuva, but the interface and the principle of operation for all will be approximately the same. Except Linux, for which interfaces are not important:


c692b490a387f988ad2ae.png



Here they are, the first 4 files marked with green circles. Green circles mean that the files are not beaten and can be easily restored - it’s understandable, after all, nothing has been written on top of them yet. Below, marked with red circles are files that were deleted long ago. There is almost no information left about them and it is unlikely that they can be restored. Fortunately, we do not need them. I select all 4 files, click on the "Recover" button ...

87c58b7302e4bb6a0c0be.png



Done! In order to demonstrate that the files were restored in their original form, I opened the picture. Everything opens, there are no changes, you can continue to use the files as before.


<To summarize>
One click on the "Delete" button is not enough if you would like to delete the file securely. If the files were deleted recently, they can usually be restored at least partially. Here is this study https://www.usenix.org/legacy/events/fast11/tech/full_papers/Wei.pdf contains statistics: even when you try to delete a file using safe deletion methods, usually 4% to 75% of the original data remains on the SSD.
 
Original message
Восстановление случайно удаленных данных.

Что делать, если ты случайно удалил важный файл? Могут ли спецслужбы получить доступ к тому, что ты удалил? Сегодня мы поговорим о восстановлении данных.


Что происходит с файлом после того, как ты нажимаешь "Delete"? Я не имею в виду очевидные и простые случаи, когда файл попадает в "Корзину". Что происходит с файлом, который ты удаляешь полностью - да практически ничего!


Как вообще хранятся файлы ?
Для начала, давай разберём, как файлы хранятся до удаления. Это понадобится для того чтобы понимать процедуру восстановления.


Файловая система выглядит приблизительно так:

ec799c68e5d49d67a5c70.png


Куча данных, записанных последовательно друг за другом, плюс немного системной информации. Её можно сравнить с книгой, а каждый файл сотдельной главой. В идеальном случае. На практике всё, конечно, гораздо менее аккуратно


Представь себе книгу, в которой все страницы расположены хаотично. Она может начинаться с 5-й страницы, затем будет идти 48-я, 30-я и так далее. И вот так как раз и выглядит файловая система на самом деле. Этот хаос называется фрагментацией и она возникает как раз из-за постоянного удаления старых файлов и появления новых.


Когда ты вставляешь в компьютер только что купленную флешку и записываешь на неё 100 фотографий, они запишутся на неё последовательно, в идеальном порядке. Но, стоит тебе удалить пару фоток -- предположим, 29-ю и 48-ю -- и ты создашь условия для возникновения фрагментации. Если после этого ты отправишь на флешку текстовый файл и ещё одну фотку, данные фрагментируются. Вот как это произойдёт.


Сначала текстовый файл ляжет на место, где лежала 29-я фотка. Но он займёт "свободное" место не целиком, а только частично, потому что текстовые файлы весят гораздо меньше и ему просто не нужно так много пространства. Затем файловой системе понадобится записать фотографию, и она пойдёт искать место для неё. Большая часть новой фотографии ляжет на остаток пространства от 29-й фотки, а конец новой фотки пойдёт в начало свободного места от 48-й. Вот такое вот разделение файла на несколько кусков и называется фрагментацией.


На самом деле, у современных файловых систем всё немного сложнее, но нам нет смысла рассматривать это подробнее, потому что результат будет тот же. Самое важное я уже рассказал и теперь можно переходить к интересному


< Восстановление удалённых данных >
Как можно было бы восстановить удалённые фотографии №29 и №48 из примера выше?


На самом деле, ничего сложного. Существует специальный софт, который анализирует файловую систему и ищет в ней все оставшиеся куски удалённых данных. В основном это мусор -- фрагменты данных, из которых уже невозможно ничего собрать. Но, если начать восстановление сразу же после нажатия на кнопку "Delete", ты практически гарантированно сумеешь восстановить свои файлы. До тех пор, пока "пустое" место, где раньше находились фотки, не окажется занято чем-нибудь новым, это будет всегда возможно. И даже когда удалённый файл окажется частично перезаписанным, иногда его можно будет частично восстановить. Разберёмся подробнее.


Когда ты просто нажал DELETE, файлы ещё абсолютно пригодны к восстановлению. Достаточно будет включить специальный софт и ты увидишь удалённые данные так же, как в файловом менеджере. Они будут доступны для просмотра и восстановления в один клик. Когда ты, как это было в примере, после удаления отправил на флешку текстовый документ, фотография №29 становится частично повреждена. Начало её файла перезаписывается, а середина и конец всё ещё могут быть прочтены. Фотография №48 в этом случае всё ещё целиком доступна для восстановления. После отправки на флешку новой фотографии, фотография №29 окажется окончательно удалена, а фотография №48 окажется повреждённой.


Повреждённые данные иногда тоже удаётся восстановить, но здесь очень многое зависит от случая. Некоторые форматы файлов устроены так, что данные становятся нечитаемыми, если из них удалить кусок. Другие читаются и после этого. Например, зашифрованный архив однозначно не получится восстановить, если из него удалили хотя бы маленький блок. Фотография может быть утрачена целиком, а может частично -- смотря какие блоки будут утрачены. Уцелевшие куски простого текстового документа можно будет прочесть всегда, сколько бы процентов файла не потерялось.


https://i.imgur.com/4vT1HGr.png

Программы для Mac:
Disk Drill -- да-да, та самая. Free Mac Data Recovery Software. Recover Files. Disk Drill


Программы для восстановления данных с мобильных:
Android Photo Recovery -- хотя в названии отчётливо выделяется слово "Photo", программа также умеет восстанавливать и другие форматы файлов, список контактов, SMS и кое-что ещё. Распространяется платно. Android Photo Recovery - Recover Deleted Photos/Videos/Music

PhoneRescue for iOS -- ещё одна платная программа, но уже для iPhone/iPad и остальных iУстройств. PhoneRescue® for iOS - Retrieve Your Lost iPhone and iPad Data


Ты можешь подключить мобильное устройство к компьютеру и воспользоваться обычной программой для восстановления данных. Ничего особенно уникального в специализированных восстановителях нет и здесь они приводятся скорее для того чтобы ты знал, что они бывают. Пожалуй, они могут быть чуть удобнее, потому что обладают заранее заготовленными функциями для восстановления данных конкретно с мобильных. Но принципиальных отличий никаких нет, так что если не хочешь платить ради восстановления одной случайно удалённой фотки -- просто воспользуйся обычной бесплатной программой и всё.


< Экспериментируем >
Итак, тестовые файлы созданы, программа загружена.

6f1b9dbcad608f8272032.png



Удаляем всё "безвозвратно" -- обычно для этого используется комбинация Shift + Delete, если ты не перенастроил иначе. Запускаем программу. Я выбрал Recuva, но интерфейс и принцип действия для всех будет приблизительно одинаковый. Кроме Linux'а, для которого интерфейсы не главное :


c692b490a387f988ad2ae.png



Вот они, первые 4 файла, отмеченные зелёными кружками. Зелёные кружки означают, что файлы не побиты и их легко можно восстановить -- оно и понятно, поверх них ведь ещё ничего не успело записаться. Ниже, отмеченные красными кружками, идут файлы, которые были удалены давно. О них уже почти не осталось никаких сведений и восстановить их вряд ли удастся. К счастью, нам нужны не они. Выделяю все 4 файла, жму на кнопку "Recover"...

87c58b7302e4bb6a0c0be.png



Готово! Для того чтобы продемонстрировать, что файлы восстановились в исходном виде, я открыл картинку. Всё открывается, никаких изменений нет, файлами можно продолжать пользоваться так же, как раньше.


< Подытожим >
Одного нажатия на кнопку "Delete" недостаточно, если ты хотел бы удалить файл надёжно. Если файлы были удалены недавно, их обычно можно восстановить хотя бы частично. Вот это исследование https://www.usenix.org/legacy/events/fast11/tech/full_papers/Wei.pdf содержит статистику: даже при попытке удалить файл, используя безопасные методы удаления, на SSD обычно остаётся от 4% до 75% исходных данных.
  • Like
Tepkiler: НСК-СБ