Восстановление удалённых файлов в Linux’е
Для восстановления удалённых файлов нужно сначала перевести сервер в однопользовательский режим
Вводим команду
# init 1
Основные команды для востановления
grep -b ‘search-text’ /dev/partition > file.txt
или
grep -a -B[size before] -A[size after] ‘text’ /dev/[your_partition] > file.txt
- -i : Ignore case distinctions in both the PATTERN and the input files i.e. match both uppercase and lowercase character.
- -a : Process a binary file as if it were text
- -B Print number lines/size of leading context before matching lines.
- -A: Print number lines/size of trailing context after matching lines.
Пример:
# grep -i -a -B10 -A100 'nixCraft' /dev/sda1 > file.txt
