Stahnul jsem Debian LiveCD
https://www.debian.org/CD/live/pres Etcher nahral na USB Stick a nabootoval.
Heslo pro "user" je "live", kdyz nabehne Screensaver ....
Chyba byla, ze jsem pred pouzitim nezformatoval ten externi SSD Disk co ma exFAT
a neni vubec videt nejaka performance boost toho SSD pri kopirovani .......
Na tom Live OS jsem si doinstaloval tohle:
sudo apt install testdisk gddrescue ddrescueview foremost scalpel safecopy ext4magic extundelete sleuthkit autopsy e2fsprogs mbr nvme-cli
Zkousim:
Podle navodu na Arch Linux
https://wiki.archlinux.org/title/File_recoveryuser@debian:~$ sudo lsblk -p
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
/dev/loop0 7:0 0 2.5G 1 loop /usr/lib/live/mount/rootfs/filesystem.squashfs
/run/live/rootfs/filesystem.squashfs
/dev/sda 8:0 0 3.6T 0 disk
└─/dev/sda1 8:1 0 3.6T 0 part /media/user/ExtremeSSD
/dev/sdb 8:16 1 29.3G 0 disk
├─/dev/sdb1 8:17 1 3G 0 part /usr/lib/live/mount/medium
│ /run/live/medium
└─/dev/sdb2 8:18 1 5M 0 part
/dev/mmcblk0 179:0 0 7.4G 0 disk
└─/dev/mmcblk0p1 179:1 0 7.4G 0 part /media/user/FAT32
/dev/nvme0n1 259:0 0 1.8T 0 disk
├─/dev/nvme0n1p1 259:6 0 512M 0 part
├─/dev/nvme0n1p2 259:7 0 1.8T 0 part
└─/dev/nvme0n1p3 259:8 0 977M 0 part
/dev/nvme1n1 259:4 0 476.9G 0 disk
├─/dev/nvme1n1p1 259:2 0 100M 0 part
├─/dev/nvme1n1p2 259:3 0 16M 0 part
├─/dev/nvme1n1p3 259:5 0 476.2G 0 part
└─/dev/nvme1n1p4 259:9 0 633M 0 part
user@debian:~$ sudo fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Samsung SSD 970 EVO Plus 2TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: AB12345C-1234-1A21-F1BA-654321E9A0AB
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1050623 1048576 512M EFI System
/dev/nvme0n1p2 1050624 3905028095 3903977472 1.8T Linux filesystem
/dev/nvme0n1p3 3905028096 3907028991 2000896 977M Linux swap
#ext4magic
https://ext4magic.sourceforge.net/ext4magic_en.htmlZaloha "filesystem" journal:
sudo debugfs -R "dump <8> /media/user/ExtremeSSD/BackUp/dump.journal" /dev/nvme0n1p2
Vytvoril se mi soubor o velikosti 1GB
a potom ext4magic, ale ten konci vzdy s "Segmentation fault":
sudo ext4magic /dev/nvme0n1p2 -a "$(date -d "-9hours" +%s)" -f /home/USER/Downloads -j /media/user/ExtremeSSD/BackUp/dump.journal -l
sudo ext4magic /dev/nvme0n1p2 -r -f /home/USER/Downloads/deleted.mkv -d /media/user/ExtremeSSD/
user@debian:~$ sudo ext4magic /dev/nvme0n1p2 -r -d /media/user/ExtremeSSD/ext4magic/
"/media/user/ExtremeSSD/ext4magic/" accept for recoverdir
Filesystem in use: /dev/nvme0n1p2
Using internal Journal at Inode 8
Inode 2 is allocated
Segmentation fault
#TestDisk
TestDisk "Undelete" funguje pouze na partitions ktere maji MBR a na
SSD s GPT se mi to nezobrazilo
https://adamtheautomator.com/linux-recover-deleted-files/Tak jsem udelal backup celeho disku a ma ted soubor "image.dd" o velikosti (2000398933504 bytes)
#PhotoRec
Dale jsem zkusil jeste:
sudo photorec
Po 3 hodinach mi to na tom externim SSD vytvorilo cca 750 adresaru "recup_dir.xxx"
a v tech bylo celkem 43 *.mkv's, ale vsechny jsou tak 2-3 mesice stare ......
ale soubor ktery jsem omylem smazal vcera ne ...
Pro jistotu jsem tech cca 750 recup_dir.xxx jeste prohledal podle velikosti souboru
, ale nasel jsem akorat 4K TS video co jsem pred 3 mesici vymazal s priponou xxxxxx.a
ktere ale pri prehravani v mpv pixelovalo ....takze nepouzitelne, ale zajimave je
ze MKV video a dalsi co jsem pres Shift+Delete vymazal proste nejsou videt .........
Koukam na video EXT File System Recovery - SANS Digital Forensics and Incident Response Summit 2017
https://www.youtube.com/watch?v=6pzm6909IvYa kdyby clovek mnel aspon ten inode cislo toho souboru
tak by snad fungovalo tohle:
https://www.cyberciti.biz/tips/linux-ext3-ext4-deleted-files-recovery-howto.htmlTakze zkousim aspon tohle
sudo debugfs /dev/nvme0n1p2
debugfs: lsdel
Ale vysledek je tohle s datumem Feb 23rd:
Inode Owner Mode Size Blocks Time deleted
18874372 1000 100644 8090076 1879/ 1976 Fri Feb 23 11:30:57 2024
18874374 1000 100644 475476 117/ 117 Fri Feb 23 11:30:57 2024
18874490 1000 40755 4096 1/ 1 Fri Feb 23 11:30:57 2024
18874491 1000 100644 1340178 56/ 328 Fri Feb 23 11:30:57 2024
4 deleted inodes found.
#Foremost
https://packages.debian.org/bookworm/foremostTakze jsem se posunul k dalsimu nastroji:
user@debian:~$ sudo foremost -v -T -c /etc/foremost.conf -i /dev/nvme0n1p2 -o /media/user/ExtremeSSD/Foremost/
Foremost version 1.5.7 by Jesse Kornblum, Kris Kendall, and Nick Mikus
Audit File
Foremost started at Thu Mar 7 21:24:02 2024
Invocation: foremost -v -T -c /etc/foremost.conf -i /dev/nvme0n1p2 -o /media/user/ExtremeSSD/Foremost/
Output directory: /media/user/ExtremeSSD/Foremost_Thu_Mar__7_21_24_02_2024
Configuration file: /etc/foremost.conf
Processing: /dev/nvme0n1p2
|------------------------------------------------------------------
File: /dev/nvme0n1p2
Start: Thu Mar 7 21:24:02 2024
Length: 1 TB (1998836465664 bytes)
Num Name (bs=512) Size File Offset Comment
0: 00124903.mov 3 MB 63950456
1: 00124800.mov 3 MB 63897754
2: 00130413.mpg 1 MB 66771716
3: 00143004.mpg 60 KB 73218266
4: 00143043.mpg 41 KB 73238302
5: 00143072.mpg 26 KB 73253158
6: 00164487.mpg 101 KB 84217615
7: 00164525.mpg 82 KB 84236824
Zkousim, specifikovat jen MKV ...
sudo nano /etc/foremost.conf
#filename case sensitive? (y/n) size header footer
#=====================================================================================================
#mpg y 20000000 \x00\x00\x01\xba \x00\x00\x01\xb9
mkv n 1500000000 \x1a\x45\xdf\xa3
sudo foremost -v -T -c /etc/foremost.conf -i /dev/nvme0n1p2 -o /media/user/ExtremeSSD/Foremost/
Foremost version 1.5.7 by Jesse Kornblum, Kris Kendall, and Nick Mikus
Audit File
Foremost started at Thu Mar 7 21:26:05 2024
Invocation: foremost -v -T -c /etc/foremost.conf -i /dev/nvme0n1p2 -o /media/user/ExtremeSSD/Foremost/
Output directory: /media/user/ExtremeSSD/Foremost_Thu_Mar__7_21_26_05_2024
Configuration file: /etc/foremost.conf
Processing: /dev/nvme0n1p2
|------------------------------------------------------------------
File: /dev/nvme0n1p2
Start: Thu Mar 7 21:26:05 2024
Length: 1 TB (1998836465664 bytes)
Num Name (bs=512) Size File Offset Comment
****0: 01009369.mkv 7 MB 516797171
*1: 01108492.mkv 58 MB 567548250
*************************************************2: 11075584.mkv 92 MB 5670699008
...........
A tady jsem skoncil s tim samym vysledkem jako u PhotoRec .....
#Scalpel
https://github.com/sleuthkit/scalpelTakze jsem se posunul ke SKalpelu, coz je lepsi vereze feremost.
Nastavil jsem MKV
sudo nano /etc/scalpel/scalpel.conf
#filename case sensitive? (y/n) size header footer
#=====================================================================================================
#mpg y 20000000 \x00\x00\x01\xba \x00\x00\x01\xb9
mkv n 1500000000 \x1a\x45\xdf\xa3
user@debian:~$ sudo scalpel -c /etc/scalpel/scalpel.conf -o /media/user/ExtremeSSD/S-calpel /dev/nvme0n1p2
Scalpel version 1.60
Written by Golden G. Richard III, based on Foremost 0.69.
Opening target "/dev/nvme0n1p2"
Image file pass 1/2.
/dev/nvme0n1p2: 100.0% |**********************************************************| 1.8 TB 00:00 ETAAllocating work queues...TAETAETATAETAE
Work queues allocation complete. Building carve lists...
Carve lists built. Workload:
mkv with header "\x1a\x45\xdf\xa3" and footer "" --> 546 files
Carving files from image.
Image file pass 2/2.
/dev/nvme0n1p2: 5.2% |************* | 96.3 GB 39:15:05 ETAError writing to file: /media/user/ExtremeSSD/S-calpel/mkv-0-0/00000071.mkv -- Operation not permitted
Scalpel was unable to write output files and will abort.
This error generally indicates that disk space is exhausted.
A tady jsem asi udelal chybu, protoze se mi ten externi SSD Disk "/media/user/ExtremeSSD/"
pres noc cely zaplnil, 80 *.mkv souboru 4TB .....
jeste pred tim nez jsem sel spat jsem z neho vymazal 2TB zalohu "/dev/nvme0n1p2"......
Kdyz se snazim otevrit ty *.mkv soubory tak tam jsou hlavne 99% videa, ktera
vubec nemnela mkv priponu, ale jsou *.TS (4K co jsem stihal v ffmpeg), a ty nemaji pocatecni/konecnou hlavicku,
takze je divne ze skoncily ve vyhledavani jako mkv .....
Takze mne ted napadlo, ze bych tu hlavicku asi mnel zmenit a pridat vsech 32 bytes u MKV
a treba to uz ty TS nenajde ......
$ head --bytes 32 file.mkv | hexdump --canonical
00000000 1a 45 df a3 a3 42 86 81 01 42 f7 81 01 42 f2 81 |.E...B...B...B..|
00000010 04 42 f3 81 08 42 82 88 6d 61 74 72 6f 73 6b 61 |.B...B..matroska|
00000020
Takze jeste zkousim:
#ExtUndelete
https://extundelete.sourceforge.net/options.htmluser@debian:/media/user/ExtremeSSD/ExtUndelete$ sudo extundelete --restore-all --after 1709792121 /dev/nvme0n1p2
Only show and process deleted entries if they are deleted on or after 1709792121 and before 9223372036854775807.
NOTICE: Extended attributes are not restored.
Loading filesystem metadata ... 14893 groups loaded.
Loading journal descriptors ... 0 descriptors loaded.
Searching for recoverable inodes in directory / ...
0 recoverable inodes found.
Looking through the directory structure for deleted files ...
0 recoverable inodes still lost.
No files were undeleted.
user@debian:/media/user/ExtremeSSD/ExtUndelete$ sudo extundelete /dev/nvme0n1p2 --restore-file home/USER/Downloads/video.mkv
NOTICE: Extended attributes are not restored.
Loading filesystem metadata ... 14893 groups loaded.
Loading journal descriptors ... 0 descriptors loaded.
extundelete: Extent block checksum does not match extent block while finding inode for video.mkv
extundelete: Extent block checksum does not match extent block while finding inode for video.mkv
Failed to restore file home/USER/Downloads/video.mkv
Could not find correct inode number past inode 7733283.
Try altering the filename to one of the entries listed below.
File name | Inode number | Deleted status
extundelete: Operation not permitted while restoring file.
extundelete: Operation not permitted when trying to examine filesystem
Ale to taky konci, nezdarem
#R-Linux for Linux
https://www.r-studio.com/free-linux-recovery/Download.shtmlhttps://www.r-studio.com/free-linux-recovery-help/basicfilerecovery.htmlcurl -kLO https://www.r-studio.com/downloads/RLinux6_x64.deb
sudo dpkg -i RLinux6_x64.deb
Ted jsem nainstaloval R-Linux a zkousim jeste tento nastroj.
Jsem prekvapeny, ze jako jediny nasel videa, ktere taky
byla vymazana i s tim, ktere jsem nechtel, ale video.mkv
ve vysledcich "Scan" neni
Jeste zkousim specificky hledani "*.mkv" .. a ...
BINGO!
R-Linux nasel jako jediny ten file.
Mohlo mne napadnout se podivat do: Root/home/USER/.local/share/Trash/files
Bohuzel ...
Recovery chances: Below Average (Signature, Overwritten by existing file).