Juhuslik failide kustutamine, vormindatud SD-kaart ja fotode taastamine¶
Hädaabinumbrid on riigiti erinevad. Sellel lehel kasutatakse numbrit 911, mis on USA ja Kanada number. Paljud teised riigid kasutavad numbrit 112, 999 või muud numbrit. Leidke oma riigi number.
Arusaamine, et vormindasite lihtsalt vale kaamera SD-kaardi, tühjendasite välise töödraivi prügikasti või prügikasti või pühkisite kogemata terve partitsiooni asendamatutest perefotodest, on äge tehniline kriis. Kui fail kustutatakse või andmekandja kiirvormindatakse, kustutab operatsioonisüsteem harva mälurakkude sees olevad binaarandmed kohe. Selle asemel eemaldab see failisüsteemi kataloogikursori ja märgib need loogiliste plokkide aadressid "vaba ruumina", mida saab üle kirjutada. See, kas taastate 100 protsenti oma andmetest või kaotate need igaveseks, sõltub täielikult sellest, mis juhtub esimese 60 sekundi jooksul pärast kustutamist. Iga sekund on draiv ühendatud lugemis-kirjutamisrežiimis, taustal operatsioonisüsteemi indekseerimisel, failide vahetamisel, brauseri vahemäludel ja tahkisketta (SSD) prügikoristusrutiinidel (TRIM / UNMAP) võivad aluseks olevad sektorid jäädavalt nullida.
Kui juhuslik kustutamine või vormindamine hõlmab meditsiinilist telemeetriat, juriidilist tõendit aktiivse kuriteo kohta või eluohutussüsteemi riket, helistage kohalikule hädaabinumbrile (911 Ameerika Ühendriikides ja Kanadas, 112 kogu Euroopa Liidus, 999 Ühendkuningriigis) või tutvuge meie rahvusvaheliste kataloogidega hädaabinumbrid enne riistvara puudutamist. Kõigi tarbija-, fotograafia-, akadeemiliste ja ettevõtete andmete kadumise juhtumite korral peatage kohe kogu kettategevus ja järgige allolevat kohtuekspertiisi taastamise töövoogu.
Tehke seda kohe¶
- Tõmmake eemaldatav SD-kaart, CFexpress-kaart või USB-draiv kohe välja: kui vormindasite äsja kaamera mälukaardi või kustutasite faile väliselt USB-draivilt, lülitage kaamera toitelüliti kohe välja või eemaldage väline USB-kaabel arvutist. Ärge tehke "üht testfotot", et näha, kas kaart töötab, ja ärge lubage Windowsi (
chkdsk) või macOS (fsck_apfs) draivi "skannimiseks ja parandamiseks". - Kui kustutasite failid arvuti sisemisest süsteemidraivist (C: draiv või macOS Macintosh HD), tõmmake toide välja või lülitage jõuliselt välja: ärge sulgege rakendusi tavapäraselt, ärge laadige mõjutatud arvutisse alla andmete taastamise tarkvara ega klõpsake nuppu „Shut Down” (mis kirjutab gigabaite talveunerežiimi faile, registritarude kustutamist ja seansside kustutamist). Hoidke füüsilist toitenuppu 5-10 sekundit all, kuni masin täielikult välja lülitub, või eemaldage lauaarvuti toitejuhe, kui tegemist on mitteakusüsteemiga.
- Libistage täissuuruses SDHC/SDXC kaartide füüsiline kirjutuskaitse lüliti asendisse LOCK: vaadake tavalise 32 mm x 24 mm (1,26 tolli x 0,94 tolli) SD-kaardi vasakut serva ja lükake väike plastikust sakk allapoole alumise serva poole (kuldsetest tihvtidest eemale, et lugeja ei saaks kogemata kirjutada).
.DS_Store,System Volume Informationvõi Spotlighti registrifailid, kui ühendate selle hiljem. - Saage aru SSD TRIM-lõksust enne sisemise SSD uuesti sisselülitamist: kaasaegsed NVMe ja SATA pooljuhtkettad töötavad riistvara tasemel
TRIM(ATA) võiDeallocate(NVMe) käsud mõne sekundi kuni minuti jooksul pärast faili kustutamist või vormindamist. Kui SSD-kontroller käivitab kärbitud lehtede taustal prügi kogumise, loeb töötlemata nikerdamise tarkvara ainult nulle (0x00). Toite väljalülitamine ei lase sisemisel SSD-mikroprotsessoril taustal prügi kogumist lõpetada. - ** Valmistage ette eraldi puhas sekundaararvuti ja suurem sihtketas**: ärge kunagi installige taastetööriistu draivile, mille andmed kaotasid, ja ärge kunagi taastage skannimise ajal taastatud faile samale lähtekettale. Kasutage teist arvutit (või käivitage mõjutatud arvuti väliselt Ubuntu Linux Live USB-mälupulgalt) ja ühendage tühi väline kõvaketas, millel on mõjutatud draivist vähemalt kaks korda suurem mälumaht.
- Looge sektorite kaupa töötlemata kahendkujutis (
.imgvõi.dd) enne mis tahes failitaasteparseri käivitamist: enne PhotoReci, R-Studio, DMDE või UFS Exploreri käivitamist kasutageddrescuevõi HDDSuperClone, et kloonida SD-kaardi või draivi iga sektor oma varukettal üheks pildifailiks. Seejärel saate pildifaili vastu turvaliselt käivitada mitu taastealgoritmi, ilma et riskiksite algse andmekandja edasise kulumise või juhusliku kirjutamisega.
Danger
Ärge kunagi jookske CHKDSK /F Windowsis või Disk Utility'is Esmaabi MacOS-is, kui proovite taastada kustutatud faile või rikutud partitsioonitabelit. Failisüsteemi parandamise tööriistad on loodud operatsioonisüsteemi struktuuri järjepidevuse taastamiseks, mitte failide salvestamiseks. Nad kärbivad rutiinselt orvuks jäänud inoodide ahelaid, kirjutavad üle rikutud failijaotustabelid (FAT) ja hävitavad jäädavalt täpsed metaandmete viidad, mida professionaalsed andmete taastamise tööriistad vajavad kaustahierarhiate ja failinimede taastamiseks.
Otsuste puu: õige taastestrateegia valimine andmekandja ja failisüsteemi järgi¶
Kasutage seda kohtuekspertiisi vooskeemi, et teha kindlaks, kas teie kustutatud andmeid saab taastada loogilise failitabeli rekonstrueerimise, toorfaili allkirjade nikerdamise või spetsiaalse killuanalüüsi abil.
flowchart TD
A["Tuvastati juhuslik faili kustutamine või draivi vorming"] --> B["Lülitage seade kohe välja või eemaldage eemaldatav kandja"]
B --> C{"Millist tüüpi füüsilise mälu riistvara see mõjutab?"}
C -->|"Kaamera SD / MicroSD / CFexpress / USB Flash"| D["Lülitage sisse füüsiline kirjutuskaitse lüliti või kasutage kirjutuskaitstud USB-blokeerijat"]
C -->|"Väline või sisemine mehaaniline kõvaketas (HDD)"| E["TRIM riski puudub: suur taastamise tõenäosus, kui uusi kirjutisi ei ole"]
C -->|"Sisemine või väline SSD / NVMe / Mac / nutitelefon"| F{"Millist failisüsteemi ja OS-i ühendust kasutati?"}
F -->|"NTFS, APFS või ext4 sisemisel NVMe/SATA SSD-l"| G["Suur TRIM-risk: käivitage Linux Live USB kaudu libata.force=noncqtrim"]
F -->|"exFAT või FAT32 standardse USB-massmälu kaudu"| H["Mõõdukas/madal TRIM-i risk: paljud USB-sillad ei läbi exFAT-i TRIM-i"]
F -->|"iOS / Android sisemälu"| I["Riistvara failipõhine krüptimine (FBE): võtmed hävivad kustutamisel, kontrollige kohe pilve/kohalikke varukoopiaid"]
D --> J["Täieliku bitivoo klooni (.img) loomine GNU ddrescue abil eraldi draivile"]
E --> J
G --> J
H --> J
J --> K{"Kas failid kustutati eraldi või oli draiv vormindatud?"}
K -->|"Individuaalne kustutamine / kiirvormindamine (metaandmed puutumata)"| L["Käivitage loogiline metaandmete rekonstrueerimine (DMDE, R-Studio, UFS Explorer, TestDisk)"]
K -->|"Ülekirjutatud failitabel / kaamera korpusesisene vorming"| M["Käivitage töötlemata faili allkirja nikerdamine + fragmenteeritud video taasesitus (PhotoRec, GoPro/MP4 remont)"]
Kustutamise füüsika: HDD magnetplaadid vs. SSD NAND-välklamp ja kaamera SD-kaardid¶
Taastatavate andmete hävitamise vältimiseks peate mõistma, kuidas erinevad salvestusarhitektuurid käitlevad kustutamist ja vormindamist kapoti all.
1. Mehaanilised kõvakettad (HDD) ja shingled Magnetic Recording (SMR)¶
Traditsioonilisel tavalisel magnetsalvestuse (CMR) pöörleval kõvakettal võtab faili kustutamine või kiirvormingu käivitamine vähem kui kaks sekundit, kuna lugemis-/kirjutuspead muudavad ainult põhikataloogi indeksit, näiteks $MFT (peafailitabel) NTFS-is, eraldamise bitmap ja kataloogi B-puu HFS+/APFS-is või failijaotuse tabel FAT32/exFAT-is. Tegelikud magnetvoo ümberpööramised, mis esindavad teie JPEG-sid, PDF-e ja arvutustabeleid, jäävad koobaltisulamist taldrikutele puutumata, kuni operatsioonisüsteem otsustab kirjutada nende täpsete loogiliste plokkide aadresside (LBA) asemel täiesti uue faili.
Paljud kaasaegsed suure võimsusega tarbijate välised kõvakettad (tavaliselt 2 terabaiti kuni 5 terabaiti 2,5-tollistes kaasaskantavates korpustes) kasutavad aga Singled Magnetic Recording (SMR) koos sisemise püsivara tõlkekihiga, mida nimetatakse Meedia vahemälu. Mõned kaasaegsed SMR-kõvakettad toetavad seda TRIM käsk täpselt nagu SSD. Kui kustutate TRIM-toega SMR-kõvakettal suure kausta ja jätate selle 20 minutiks jõudeolekusse ühendatuna, võib draivi sisemine püsivara oma vöötohatisribad ümber korraldada ja taustal olevad jaotamata sektorid jäädavalt nullida. Draivi vooluvõrgust lahtiühendamine hoiab ära selle sisemise majapidamistsükli.
2. Solid State Drives (SSD), NVMe ja TRIM / Deallocate Täitmise aken¶
SSD-de sees olev NAND-välkmälu ei saa olemasolevaid andmeid otse paigas üle kirjutada. Enne kui NAND-välkmälu saab uusi andmeid vastu võtta, peab terve välkmäluplokk (tavaliselt 4-16 megabaidi suurune) läbima aeglase elektrilise Programmi/Kustuta (P/E) tsükli. Kui SSD ootaks vanade plokkide kustutamiseks uue faili salvestamist, väheneks kirjutamiskiirus.
SSD-de kiirena hoidmiseks kasutage kaasaegseid operatsioonisüsteeme (Windows 7 kuni Windows 11, macOS 10.10+ ja Linuxi tuumad fstrim või discard) saatke kohe TRIM (SATA) või Dataset Management: Deallocate (NVMe) käsk SSD-kontrollerile, kui tühjendate prügikasti/prügikasti või käivitate kiirvormingu:
- Deterministlik lugemisnull pärast TRIM-i (DZAT / DRAT): peaaegu kõik kaasaegsed tarbijale mõeldud NVMe ja SATA SSD-d jõustavad pärast TRIM-i deterministlikku nullimist. Täpne millisekund, mille SSD-kontroller vastu võtab
TRIMkäsk paljude sektorite jaoks, lahutab selle sisemine Flash Translation Layer (FTL) need loogilised aadressid füüsilistelt NAND-lehtedelt. - Kohe nulltagastus: isegi enne füüsilise elektrilaengu kustutamist ränielementidest, kui tarkvara (sh.
ddrescue, PhotoRec või R-Studio) palub SSD-l lugeda need kärbitud sektorid standardsete SATA- või NVMe-käskude kaudu, SSD-kontroller peatab päringu ja tagastab puhtad kuueteistkümnendsüsteemi nullid (00 00 00 00) isegi füüsilisi NAND-kiipe kontrollimata. - Kui SSD taastamine on endiselt võimalik:
- Välised USB-korpused ilma UASP/TRIM-i läbipääsuta: vanemad USB 3.0 sillakiibid, mis kasutavad UASP (USB-ga ühendatud SCSI-protokoll) asemel pärandprotokolli BOT (Bulk-Only Transport), ei saa opsüsteemi tõlkida
TRIMkäske USB-kaabli kaudu. - FAT32 ja exFAT köited teatud OS-i versioonidel: ajalooliselt saadeti mitu operatsioonisüsteemi järge ainult automaatselt reaalajas
TRIMkäske natiivsetes päevikuga failisüsteemides (NTFS,APFS,ext4) ja ei andnud välja koheselt reaalajasTRIMeemaldatava pealFAT32võiexFATvaheseinad. - ** Jaotuslaua pühkimine (
diskpart cleanvõi partitsiooni juhuslik kustutamine) ilma vormindamiseta**: partitsioonikirje kustutamine GUID-i partitsioonitabelist (GPT) või põhikäivituskirjest (MBR) jätab mõnikord aluseks olevad sektorid kärpimata, kuni selle peale vormindatakse uus failisüsteem.
- Välised USB-korpused ilma UASP/TRIM-i läbipääsuta: vanemad USB 3.0 sillakiibid, mis kasutavad UASP (USB-ga ühendatud SCSI-protokoll) asemel pärandprotokolli BOT (Bulk-Only Transport), ei saa opsüsteemi tõlkida
3. Kaamera korpuses vormindamine ja Sony / Canon / Nikon SD_ERASE Lõks¶
Fotograafid ja videograafid eeldavad sageli, et SD-, microSD- või CFexpress-kaardi vormindamine digikaameras on identne lauaarvuti kiirvormindamisega. Kuigi see oli tõsi kümme aastat tagasi, käituvad tänapäevased peeglita kaamerad olenevalt tootjast väga erinevalt:
| Kaamera bränd ja meedia tüüp | Mis juhtub kaamerasisese vormingu ajal | Mõju isetegemise tarkvara taastamisele | Vajalik on viivitamatu tegutsemine |
|---|---|---|---|
| Canoni (EOS R-seeria, DSLR) standardvorming | Kirjutab üle ainult FAT/exFAT juurkataloogi ja jaotabelid (0x00 päisesektorites). Jätab töötlemata pildi/video klastrid puutumata. |
Väga edukas (95%+): töötlemata nikerdamine ja killustatud MP4-i taasehitajad suudavad eraldada CR2/CR3 fotosid ja MOV/MP4 videoid. | Eemaldage kaart kohe ja lukustage kirjutamislüliti. ÄRGE valige "Madala taseme vorming". |
| Canoni madala taseme vorming (märkeruut märgitud) | Probleemid riistvaraga ERASE (CMD38) käsk SD-kaardi kontrollerile, eemaldades kõik välguplokid kogu kaardil. |
Kaardilugeja kaudu nullilähedane: kaardi tagastamine 0x00 või 0xFF kõigis sektorites. Nõuab labori monoliitset NAND-i väljatõmmet, kui FTL ainult kaardistamata plokke. |
Kui see on edenemisriba keskel, avage aku luuk või tõmmake kohe kaarti, et salvestada kustutamata protsent. |
| Sony Alpha (a7 IV, a7S III, a9, FX3, FX6) täisvorming | Saadab füüsilise SD_ERASE / DISCARD käsk (CMD32/CMD33/CMD38) standardvormingus SDXC ja CFexpressi A/B tüüpi kontrollerile. |
Null standardtarkvara kaudu: standardsed taastetööriistad skannivad kogu kaardi 30 sekundiga ja leiavad 0 faili, kuna iga sektor loeb 0x00 või 0xFF. |
Lõpetage kohe. Ärge kirjutage kaardile. Ainult spetsialiseeritud kohtuekspertiisi laboritel, mis suudavad lugeda töötlemata NAND-i kontrollerist mööda minnes (ja ainult teatud kontrolleritel), on võimalus. |
| Nikon (Z-seeria, DSLR) / Fujifilm / Panasonic Lumix | Tavaliselt tühjendab failisüsteemi struktuurid SD-kaartidelt; aga CFexpress Type B kaardid kasutavad PCIe NVMe protokolle ja käitavad sageli NVMe Format NVM / Deallocate käske. |
** Kõrge SDXC; Vähene CFexpress**: SDXC-kaardid taastuvad tavaliselt hästi; CFexpressi B-tüüpi kaardid nullivad sageli NVMe kontrolleri prügikogumise kaudu. | Eemaldage kaart kohe. Pilt koos ddrescue ja kontrollige kuusnurkvaadet (0x00 vs juhuslikud suure entroopiaga andmed), et kontrollida, kas plokid on eraldatud. |
| DJI droonid / GoPro tegevuskaamerad / Insta360 | Kasutab exFAT/FAT32 ja salvestab sageli topeltvoogu (.MP4 + .LRV madala eraldusvõimega eelvaade + .THM pisipilt) vahelduvate andmetükkidena. |
** Kõrge fotode jaoks; Video jaoks vajalik spetsiaalne tööriist**: standardsed nikerdajad (PhotoRec) toodavad esitamatuid videofaile, kuna suure bitikiirusega MP4-vood jaotatakse mittekülgnevateks klastriteks, mis on põimitud .LRV andmeid. |
Esmalt pildistage microSD-kaart ja seejärel kasutage kobarateadlikku killustatud videorekonstruktorit (recover_mp4, AeroQuartet Treasured või SanDisk RescuePRO Deluxe). |
Warning
Kuidas saate 10 sekundiga kindlaks teha, kas teie vormindatud SD-kaarti või SSD-d tabas riistvara? TRIM või SD_ERASE? Avage oma ketta kujutis (või kirjutuskaitstud kaart) tasuta kuueteistkümnendsüsteemis (nt HxD Windowsis, 0xED macOS-is või hexdump -C Linuxis) ja kerige esimesest 32 megabaidist (0,03 gigabaiti) mööda draivi keskele. Kui näete tuhandeid ridu erinevaid juhusliku välimusega kuueteistkümnendsüsteemi märke (A4 7F 2C 91 E0..), on teie fotod ja videod füüsiliselt endiselt olemas ja 100 protsenti taastatavad. Kui kogu draivi keskosa on pidevad jooned 00 00 00 00 või FF FF FF FF, the flash controller has unmapped the sectors via TRIM/ERASE, ja ükski kaubanduslik tarkvara ei suuda neid tavalise USB-lugeja kaudu lugeda.
1. etapp: OS-i viivitamatu piiramine ja automaatse kirjutamise blokeerimine¶
Before you try to recover files from an internal drive or attach an external drive to a computer, you must neutralize the operating system mechanisms that silently overwrite deleted space.
1. Recovering from an Internal Windows Drive (C: Drive)¶
If you deleted an important folder from your Windows Desktop, Documents, or Downloads folder and emptied the Recycle Bin:
- Do NOT keep using Windows on that drive: Even leaving Windows sitting idle at the Desktop allows
SearchIndexer.exe, Windows Defender background scans, Chrome/Edge cache updates, Volume Shadow Copy rotation, and the Windows Pagefile (pagefile.sys) to write hundreds of megabytes per minute directly over your newly freed clusters. - If you cannot power off immediately (for example, on a remote workstation with no physical access), disable
TRIMinstantly via Administrator Command Prompt:- Vajutage
Win + X, click Terminal (Admin) or Command Prompt (Admin), and execute: - This stops Windows from sending any further
TRIMnotifications for NTFS and ReFS volumes, though it cannot undoTRIMcommands sent seconds earlier.
- Vajutage
- Check if a Volume Shadow Copy (
Previous Versions) already exists before shutting down (takes 15 seconds):- Right-click the parent folder that held your deleted files, click Properties -> Previous Versions.
- Or run
vssadmin list shadowsin an Administrator Command Prompt. If a shadow snapshot exists from earlier today or yesterday, you can mount that shadow copy read-only (mklink /d C:\ShadowRestore \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\) and copy your intact files directly to an external USB thumb drive.
- If no Shadow Copy exists, shut down hard and boot from a Linux Live USB: Create an Ubuntu or SystemRescue USB flash drive on a different computer, boot the affected PC from that USB drive in Try Ubuntu (Live RAM mode) without mounting the internal drive rw, and image or extract the files from outside Windows.
2. Recovering from a macOS System Drive (Apple Silicon M1/M2/M3/M4 & T2 Macs)¶
Modern Apple computers running macOS on APFS (Apple File System) present two strict architectural hurdles:
- Aggressive APFS TRIM: macOS sends
TRIMcommands immediately upon emptying the Trash on internal Apple SSDs. - Hardware FileVault / Secure Enclave Encryption: On all Macs with an Apple T2 chip or Apple Silicon (M1, M2, M3, M4), the internal SSD is hardware-encrypted at rest by default using keys tied to the Secure Enclave, even if FileVault is turned "Off" in System Settings.
- Immediate Check 1: Local Time Machine Snapshots (
tmutil): Even if your external Time Machine backup drive was unplugged at the time of deletion, macOS automatically creates hidden hourly APFS Local Snapshots on the internal SSD if Time Machine is configured. Open Terminal immediately and run: If you see snapshots listed (such ascom.apple.TimeMachine.2026-10-31-091522.local), open the folder where the file lived and launch the Time Machine app from Applications to restore the file in seconds. - Immediate Check 2: Cloud Sync Trash Bins (iCloud Drive, OneDrive, Dropbox, Google Drive): Because macOS Desktop and Documents folders are frequently synced to iCloud Drive, deleting a file from your Mac Desktop deletes it via iCloud sync rather than just locally. Open a browser on your phone or another PC, log into
icloud.com-> Drive -> Recently Deleted (bottom right corner), where deleted files are retained for 30 days completely untouched by local SSDTRIM.
- Immediate Check 1: Local Time Machine Snapshots (
3. Blocking macOS and Windows from Polluting a Plugged-in SD Card or External Drive¶
When you plug a camera SD card or external USB drive into a computer to recover files, the host operating system immediately tries to write hidden metadata files onto the root of the drive (.DS_Store, .Spotlight-V100, .fseventsd, .Trashes on macOS; System Volume Information ja $Recycle.Bin on Windows). Those tiny writes land right at the beginning of the free space bitmap, often corrupting the exact directory headers you are trying to recover.
- On Linux (Safest Forensic Method): Linux does not auto-write hidden index folders if you disable auto-mounting or mount the block device strictly read-only (
ro,noload). - On Windows (Enable Read-Only Disk Attribute via DiskPart BEFORE inserting the drive, or use Registry WriteBlocker):
- Open
regedit.exeas Administrator, navigate toHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies(create theStorageDevicePolicieskey if it does not exist), and create aDWORD (32-bit)value namedWriteProtectset to1. Plug in your USB card reader afterward, and Windows will treat all removable USB storage as hardware write-protected.
- Open
- On macOS (Mount via Disk Arbitrator): Download and launch the open-source utility Disk Arbitrator before plugging in your SD card reader or external drive. Set Disk Arbitrator to Block Mounts or Mount Read-Only, so macOS cannot write
.DS_Storeor Spotlight indexes onto the damaged partition.
Phase 2: Creating a forensic sector-by-sector clone (ddrescue)¶
Never run file recovery scans directly on a failing hard drive, a worn-out microSD card, or the sole copy of a formatted partition. Creating a raw binary image file (.img või .dd) guarantees that you have a frozen, bit-for-bit snapshot of every sector as it existed the moment you unplugged the drive.
Step-by-Step Cloning with GNU ddrescue (Linux / macOS) or HDDSuperClone¶
- Identify the exact device identifier of your source card or drive:
- On Linux, run
lsblk -o NAME,SIZE,MODEL,RO,FSTYPE,MOUNTPOINTbefore and after plugging in the card reader. Suppose your 64 gigabyte (59.6 gibibyte) camera SD card appears as/dev/sdc(make sure it is not mounted; if mounted, runsudo umount /dev/sdc1). - On macOS, run
diskutil listto find the disk number (for example,/dev/disk4), then unmount its volumes without ejecting the hardware:diskutil unmountDisk /dev/disk4.
- On Linux, run
- Mount your large destination storage drive: Suppose your external 2 terabyte backup drive is mounted at
/mnt/backup(või/Volumes/BackupDriveon macOS). Verify it has enough free space to hold the entire raw capacity of the source drive (a 64 gigabyte SD card produces a 64 gigabyte.imgfile, even if only 10 gigabytes of photos were on it). - Execute
ddrescuewith a mapfile (log file):-duses direct disk access (bypassing the operating system kernel page cache for accurate sector reads; on macOS use/dev/rdisk4instead of-d).-r3tellsddrescueto copy all healthy sectors across the entire drive on the first fast pass, skip over any slow or damaged flash blocks immediately so the card does not overheat or lock up, and then retry bad sectors up to 3 times at the end.sdcard_rescue.mapsaves your exact progress every few seconds. If the USB reader disconnects or the power goes out, running the exact same command resumes seamlessly from where it stopped without re-reading already rescued sectors.
- Make a working copy or mount the
.imgfile read-only: Oncesdcard_raw_clone.imgfinishes at100.00% rescued, eject your physical SD card and store it in a safe drawer. You will perform 100 percent of your recovery work onsdcard_raw_clone.img.
Tip
If you are working on Windows and cannot boot a Linux Live USB, you can create a sector-by-sector raw image file (sdcard_raw_clone.img või .dsk) for free using the built-in imaging tool inside DMDE (DM Disk Editor and Data Recovery Software) (Tools -> Copy Sectors -> Source: Physical Drive -> Destination: File), R-Studio (Create Image in the free demo version), or USB Image Tool. Always choose a plain Raw / Byte-to-Byte Image (.img / .bin) rather than a proprietary compressed backup format so that any recovery tool can open it.
Phase 3: Executing file recovery (Logical Metadata Reconstruction vs. Raw Carving)¶
Once you have a safe .img file (or a hardware write-blocked drive), there are two completely different technical methods to extract your deleted data. You should always attempt Method A (Logical File System Reconstruction) first before falling back to Method B (Raw Signature Carving).
| Funktsioon | Method A: Logical File System Reconstruction | Method B: Raw Signature Carving (Header/Footer Scan) |
|---|---|---|
| How It Works | Parses remnant file system structures ($MFT records on NTFS, FAT/exFAT directory entries, APFS B-trees, ext4 journal/inodes) to locate deleted pointers. |
Ignores the file system completely. Reads every 512-byte or 4096-byte sector looking for magic byte headers (e.g., FF D8 FF for JPEG, 89 50 4E 47 for PNG, %PDF for PDF). |
| Folder Structure & Filenames | Preserved: Restores original folder trees (/DCIM/100CANON/), original filenames (IMG_4821.CR3), and creation timestamps. |
Lost: Produces thousands of generic numbered files (f0012842.jpg, f0019200.pdf) in flat recovery directories (recup_dir.1/), though EXIF dates can be parsed later to rename photos. |
| Handling Fragmented Files | Excellent: If cluster runs remain in the $MFT record or FAT table, reconstructs files split across non-contiguous disk chunks. |
Poor for Fragmented Video: Assumes every file is stored in one continuous block from header to footer. Breaks down on fragmented MP4/MOV video or heavily fragmented drives. |
| Best Tools | DMDE, R-Studio, UFS Explorer, ReclaiMe, TestDisk (for whole lost partitions). | PhotoRec (100% Free/Open-Source), Disk Drill / SanDisk RescuePRO Deluxe (for fragmented GoPro/drone video). |
Step-by-Step 1: Restoring a Deleted Partition or Corrupted Boot Sector with TestDisk¶
If your external drive or SD card suddenly asks "You need to format the disk in drive E: before you can use it" or shows up as RAW / Unallocated in Disk Management after being unplugged without safely ejecting, your files were not deleted at all. Instead, the Master Boot Record (MBR), GUID Partition Table (GPT), or Boot Sector (BPB) was corrupted.
- Run TestDisk against your cloned image file:
- Select Proceed -> confirm the partition table type (
Intel/PCfor MBR SD cards under 2 terabytes, orEFI GPTfor modern large drives). - Select Analyse -> Quick Search.
- TestDisk will scan for backup partition headers (such as the automatic backup NTFS boot sector stored at the very last sector of an NTFS volume, or the backup FAT32 boot sector at sector 6).
- Highlight the discovered partition and press
P(List Files). If you immediately see all your folders and files listed intact inside the terminal window:- Ärge isegi viitsige partitsioonitabelit ümber kirjutada, kui soovite ainult faile. Lihtsalt vajutage
Csoovitud kaustadesse ja kopeerige need 100% originaalsete failinimede ja kaustastruktuuridega otse oma tervislikule sihtkettale.
- Ärge isegi viitsige partitsioonitabelit ümber kirjutada, kui soovite ainult faile. Lihtsalt vajutage
Samm-sammult 2: loogiline metaandmete skannimine DMDE, R-Studio või UFS Exploreri abil¶
Kui failid kustutati kaudu Shift + Delete, emptied from the Recycle Bin, or wiped via a standard Quick Format:
- Avage oma
.imgfail DMDE (tasuta väljaanne taastab kuni 4000 faili kataloogitoimingu kohta; täislitsents on odav), R-Studio või UFS Exploreri standardtaaste. - Esmalt kontrollige olemasolevat virtuaalset failisüsteemi puud:
- NTFS-draividel on igal failil põhifailide tabelis 1024-baidine (1 kilobait) kirje (
$MFT). Isegi kui fail kustutatakse, on see$MFTpesa jääb märgituks passiivse lipuga (0x00instead of0x01), mis sisaldab täpset failinime, ülemkataloogi ID-d ning täpset algusklastrit ja pikkust, kuni uus fail seda uuesti kasutab.$MFTslot. Furthermore, files smaller than ~700 bytes (such as brief text notes, crypto keys, or small scripts) are stored resident entirely inside the$MFTrecord itself and rarely get overwritten quickly. - Look in the
$RootvõiDeleted / Foundvirtual folder generated within the first 5 seconds of opening the partition. If your files appear with a redxor trash icon and show a healthy size, select them and click Recover to your separate destination drive immediately.
- NTFS-draividel on igal failil põhifailide tabelis 1024-baidine (1 kilobait) kirje (
- Run a Full Volume Scan if the Directory Header Was Overwritten:
- If a Quick Format overwrote the root directory or the first few megabytes of the
$MFT, run a Full Volume Scan. The software will scan the entire image for surviving subdirectory index nodes (INDXbuffers on NTFS, subdirectory cluster chains on FAT32/exFAT, or older transaction checkpoints on APFS/ext4) and combine logical metadata with raw file signature detection.
- If a Quick Format overwrote the root directory or the first few megabytes of the
Step-by-Step 3: Raw File Carving with PhotoRec (When Metadata Is Completely Destroyed)¶
When the File Allocation Table (FAT) or $MFT has been completely zeroed out by a format, logical directory pointers are gone, leaving only the raw file contents sitting in unallocated data clusters. PhotoRec (bundled alongside TestDisk, completely free, open-source, and available for Windows, macOS, and Linux) excels at carving over 480 file formats (including Canon .CR2/.CR3, Sony .ARW, Nikon .NEF, Adobe .DNG/.PSD, .JPG, .PNG, .PDF, .DOCX/.XLSX zip containers, and .SQLITE databases):
- Launch PhotoRec against your disk image:
- Select the target partition (or
Whole diskif the partition table was wiped). - Before starting, go to
[File Opt]at the bottom of the screen:- Vajutage
sto deselect all 480 file types if you only care about specific files (for example, check onlyjpg,cr2/cr3,tiffor raw photos,mov/mp4jazip/docx), which drastically speeds up recovery and prevents false-positive garbage fragments.
- Vajutage
- Select
[Options]-> keepKeep corrupted files : Nounless recovering damaged video streams. - Select
[Search], choose file system type[Other](for FAT/exFAT/NTFS/HFS+), and select[Free](if you only deleted files on an active partition) or[Whole](if the partition was formatted). - Choose a destination folder on your separate large backup drive and press
Cto begin carving. - Post-Recovery Sorting for PhotoRec Output: Because PhotoRec saves files as
f123456.jpgacross dozens ofrecup_dirfolders, you can automatically reorganize all recovered photos into cleanYYYY/MM-Month/folders with their exact camera timestamp filenames using the free command-line tool ExifTool:
Specialized recovery: fragmented camera MP4/MOV videos (GoPro, DJI Drones, Sony, Canon)¶
One of the most frequent frustrations after running PhotoRec or standard file recovery software on a formatted camera card is discovering that 100 percent of the recovered .JPG ja .RAW photos open perfectly, but every single recovered .MP4 või .MOV video file refuses to play (0:00 duration or black screen).
Why Standard Recovery Software Breaks Modern Camera Videos¶
- Interleaved Stream Recording: Modern action cameras (GoPro Hero series, DJI Air/Mavic/Mini drones, Insta360) and cinema mirrorless cameras do not write a single
.MP4file sequentially from start to finish. While recording 4K or 5.3K video, the camera simultaneously writes a high-resolution.MP4stream, a low-resolution preview.LRVstream, an audio buffer, and telemetry metadata into alternating clusters on the exFAT/FAT32 card (for example: 4 megabytes of high-res video, followed by 512 kilobytes of.LRVpreview, followed by 4 megabytes of high-res video). - Missing
moovAtom in Unfinalized Recordings: If your drone crashed into water, your camera battery died mid-recording, or the SD card disconnected before you pressed the Stop Record button, the camera never wrote themoovatom (the master index table written at the very end of an MP4/MOV file that tells media players where every video frame and audio chunk sits).
How to Rebuild Unplayable or Fragmented Camera Videos¶
- Case A: Unfinalized Video After Battery Loss or Crash (File Exists on Card, Shows Multi-GB Size, Won't Play):
- The clusters are intact in the file system, only the
moovindex header is missing. - Use the free, open-source tool
untrunc(specifically theanthwlock/untruncfork) orrecover_mp4(slydiman). Provideuntruncwith one healthy, playable reference.MP4recorded on that exact same camera with the exact same resolution and framerate settings, alongside your broken.MP4: untruncreads the codec parameters (avcC/hvcCand audio track layouts) from the working reference video, scans the raw H.264/H.265/HEVC NAL units in your damaged file, and synthesizes a brand-newmoovatom in seconds.
- The clusters are intact in the file system, only the
- Case B: Formatted SD Card with Interleaved / Fragmented Video (GoPro, DJI, Sony, Canon):
- Because the FAT/exFAT cluster map was wiped during formatting, a standard carver grabs the
ftyp/mdatheader of your 4K video and then blindly copies the.LRVpreview clusters and thumbnail clusters right into the middle of your video file, corrupting every single second of footage. - Instead of standard carvers, scan your
sdcard_raw_clone.imgusing a fragmentation-aware video reconstructor that recognizes camera-specific cluster allocation cadences, such as SanDisk RescuePRO Deluxe (which includes specific GoPro/drone fragmented video assembly algorithms), Klennet Carver, or Disk Drill 5+ (which includes a dedicated GoPro/DJI fragmented video signature reconstructor).
- Because the FAT/exFAT cluster map was wiped during formatting, a standard carver grabs the
Smartphone photo deletion: iOS (iPhone) and Android hardware encryption realities¶
A common and dangerous misconception is that you can plug a modern iPhone or Android smartphone into a laptop via USB and run traditional disk carving software (like Recuva or PhotoRec) on the phone's internal storage.
Why Traditional Sector Carving Cannot Read Modern Phones¶
Every iPhone since the iPhone 3GS (and all current iOS devices) uses Data Protection (File-Based Encryption) powered by a dedicated hardware AES crypto engine between the flash storage and main system memory. Similarly, every Android device shipped since Android 7.0+ (and mandatory since Android 10) uses File-Based Encryption (FBE) backed by the hardware Keystore/Titan M/Knox chip.
On both platforms, every single individual photo and file on the internal storage is encrypted with its own unique per-file cryptographic key. When a file is permanently purged from the phone's file system, the phone does not even need to erase the multi-megabyte photo blocks; it immediately destroys the 256-bit per-file encryption key in the metadata table. Without that key, the raw NAND blocks contain cryptographically unbreakable random noise. Even top-tier government forensic labs cannot "carve" permanently deleted photos from the internal flash of a modern iPhone or Android once the per-file key is wiped.
The Actual Recovery Paths for Deleted Smartphone Photos¶
Because hardware encryption blocks raw carving, recovering deleted photos from an iPhone or Android relies on recovering copies before retention timers expire or extracting cached thumbnail databases:
- Check the On-Device "Recently Deleted" Album Immediately (30-Day Window):
- iOS (iPhone / iPad): Open Photos -> scroll down to Utilities -> tap Recently Deleted (requires Face ID / Touch ID / Passcode). Photos stay here for 30 days before permanent key destruction.
- Android (Google Photos / Samsung Gallery): Open Google Photos -> Library / Collections -> Trash / Bin (retained for 60 days if backed up, 30 days if device-only). Also check Samsung Gallery -> Menu (three lines) -> Trash (retained for 30 days), and open the Files by Google or My Files app -> Trash, which maintains a separate 30-day trash folder.
- If You Deleted Photos from "Recently Deleted" on iPhone, Call Apple Support for an Emergency iCloud Server-Side Restore:
- Many users do not realize that even after you manually click "Delete from All Devices" / "Empty Recently Deleted" in iCloud Photos, Apple's backend servers retain a soft-deleted server recovery buffer for a brief window (typically up to 7 to 14 days after permanent deletion).
- Contact Apple Support immediately by phone or chat, ask to speak with a Senior Advisor, and ask them to trigger an iCloud Photo Library Server-Side Recovery on your Apple Account. They can frequently flip a server switch that dumps recently purged iCloud Photos right back into your album within 15 minutes.
- Restore from an Older Unsynced Device or Encrypted Local Backup:
- Airplane Mode Trick on Secondary iPad / Mac: If your iPhone synced a deletion to iCloud, grab your iPad or MacBook before it connects to Wi-Fi (turn off your home Wi-Fi router unplugging the power cord first if the iPad is asleep on your desk). Power on the iPad in total radio isolation, copy the still-present photos via USB cable or AirDrop to another device before the iPad receives the iCloud deletion push command.
- Check iCloud Backup vs. iCloud Photos: If you had iCloud Photos turned OFF (
Settings -> [Your Name] -> iCloud -> Photos -> Off), your Camera Roll is included inside your nightly iCloud Device Backup. You can wipe an old spare iPhone (or temporarily back up and reset your current iPhone) and restore the nightly iCloud Backup from before the moment you deleted the photo. - Check Local Finder / iTunes Backups on Your PC or Mac: Check
~/Library/Application Support/MobileSync/Backup/on macOS or%APPDATA%\Apple Computer\MobileSync\Backup\on Windows. You can browse and extract photos from old local backups without overwriting your phone using iMazing or iBackup Viewer.
- Check Messaging App Local Caches (WhatsApp, iMessage, Telegram, Signal):
- Did you ever text the deleted photo or video to a spouse, friend, or family group chat? Messaging apps store independent copies of media inside their own application sandboxes (
Media/WhatsApp Images/Senton Android, or inside chat attachments in iMessage). Even if you delete a photo from your main Camera Roll and empty the Trash, the copy inside your WhatsAppSentfolder or iMessage thread history remains completely untouched.
- Did you ever text the deleted photo or video to a spouse, friend, or family group chat? Messaging apps store independent copies of media inside their own application sandboxes (
Danger
Beware of deceptive "iPhone / Android Data Recovery" desktop software advertised at the top of search engines (programs claiming they can "recover permanently deleted iPhone photos and texts without any backup"). Because of iOS and Android File-Based Encryption (FBE), these apps can only read existing unencrypted SQLite thumbnail caches or extract data from an existing iTunes backup on your computer. Worse, many require you to unlock and grant full USB Trust permissions on your phone while running background scripts that write temporary logs onto your phone's storage. Never pay $60 to $100 for mobile recovery software before verifying what it can actually see in a free preview.
Cloud drive and enterprise accidental deletion recovery (Google Drive, OneDrive, Dropbox)¶
When an entire shared folder disappears or is overwritten on a cloud drive (or when ransomware or a syncing glitch deletes local files and syncs the deletion to the cloud), local disk recovery is often unnecessary because enterprise and consumer cloud platforms maintain multi-tier version histories:
- Microsoft OneDrive & SharePoint Online:
- First-Stage Recycle Bin (
onedrive.live.com): Retains deleted files for 30 days on personal accounts and 93 days on Work/School accounts. - Second-Stage Site Collection Recycle Bin (Work/School): Even if an employee or hacker empties the main OneDrive Recycle Bin, click the link at the bottom of the Recycle Bin page labeled "Second-stage recycle bin", where purged files remain recoverable for the remainder of the 93-day window.
- Restore Your OneDrive (Point-in-Time Rollback): Microsoft 365 subscribers can click Settings (gear icon) -> Options -> Restore your OneDrive, which uses a visual histogram slider to roll every single file, rename, and deletion across the entire cloud drive back to any exact minute within the last 30 days.
- First-Stage Recycle Bin (
- Google Drive & Google Workspace:
- Google Drive Trash (
drive.google.com/drive/trash): Retains deleted files for 30 days. - Google Workspace Admin Post-Trash Recovery (25-Day Grace Window): Even after a user clicks "Delete Forever" and empties their Google Drive Trash, a Google Workspace Administrator (or individual user contacting Google Drive Support on personal Google One accounts) can open the Google Admin Console (
admin.google.com) -> Directory -> Users -> [Select User] -> More Options -> Restore Data, and restore permanently purged Google Drive files and Gmail messages for up to 25 additional days after the Trash was emptied.
- Google Drive Trash (
- Dropbox:
- Deleted Files (
dropbox.com/deleted_files): Retains deleted files and folders for 30 days on Basic/Plus/Family plans, and 180 days to 1 year on Professional/Business plans. - Dropbox Rewind (
dropbox.com/rewind): Allows rolling back an entire folder or the entire account to undo mass deletions, accidental drags-and-drops, or encryption events.
- Deleted Files (
Korduma kippuvad küsimused¶
Can I recover files if I accidentally executed `rm -rf` on a Linux ext4 or XFS server?
If you ran `rm -rf` on an `ext4` or `XFS` partition, your very first command within 2 seconds must be to remount that partition strictly read-only (`sudo mount -o remount,ro /dev/sda1` or `sudo lsof | grep deleted` before closing running processes). First, check if any running application still holds an open file descriptor to the deleted file: run `sudo lsof +L1`; if a process still has the deleted file open in memory, you can copy it intact right out of `/proc/
What is the difference between a Quick Format and a Full Format in Windows, Mac, and Linux?
A **Quick Format** only writes a brand-new, empty file system index (such as a blank `$MFT` or FAT table) taking less than 5 percent of the drive's sectors and finishes in a few seconds; on non-TRIM mechanical hard drives and many standard camera SD cards, 95 to 100 percent of the underlying files remain recoverable. A **Full Format** (unchecking "Quick Format" in Windows since Windows Vista through Windows 11, or selecting security erase level 2+ in macOS Disk Utility) physically writes hexadecimal zeros (`0x00`) across every single sector from the start of the partition to the end (and sends hardware `TRIM`/`Deallocate` on SSDs). Once a true Full Format finishes 100 percent on any modern drive, the data is permanently overwritten and cannot be recovered by any software or laboratory.
Why did my recovered JPEG photos or Word documents open with half the picture grayed out or scrambled text?
When a recovered JPEG displays the top portion of the image clearly and the bottom half is solid gray, shifted colors, or a piece of a completely different photo, the file was **fragmented** on the drive or partially overwritten before you powered it off. If you used a raw signature carver like PhotoRec, it assumed the entire JPEG occupied consecutive clusters from header (`FF D8`) to footer (`FF D9`), when in reality the middle clusters belonged to another file. First, retry the recovery on your `.img` file using a metadata-aware tool (**DMDE**, **R-Studio**, or **UFS Explorer**) to see if a surviving directory entry still holds the real cluster fragmentation map. If the header or quantization tables are slightly damaged, tools like **JPEG-Repair Toolkit** can sometimes realign shifted MCU blocks, though overwritten sectors cannot be recreated.
My SD card or USB flash drive shows "0 Bytes / No Media" in Disk Management or does not light up at all. Can software fix it?
No. If an SD card, microSD card, or USB flash drive shows `0 MB` physical capacity in Windows Disk Management (`diskmgmt.msc`) or Linux `lsblk` / `dmesg`, the card has suffered an **electrical or firmware controller failure**, not an accidental deletion. No recovery software can scan a device whose hardware controller refuses to report its LBA capacity to the computer. Unplug it immediately; leaving a failed flash controller powered on can burn out the internal voltage lines on a monolithic microSD chip. You must send the card to a specialized **Monolithic Flash / Chip-Off Data Recovery Lab** where technicians sand down the epoxy coating under a microscope, solder ultra-fine micro-wires directly to the internal NAND flash pads (bypassing the dead controller), dump the raw NAND pages, and reconstruct the proprietary ECC and XOR scrambling algorithms.
If I accidentally started installing Windows or macOS onto the wrong backup drive and canceled it at 10 percent, can I get my files back?
Yes, a large portion of your data is often still recoverable if you stopped the OS installer early and the backup drive is a mechanical Hard Disk Drive (HDD). When an OS installer begins partitioning and copying an `install.wim` or base system image, it overwrites the partition table and the first 5 to 20 gigabytes at the start of the drive. If your backup drive is a 1 terabyte to 4 terabyte HDD containing 800 gigabytes of family archives, the remaining 780 gigabytes sitting in the middle and upper Logical Block Addresses were never touched by the aborted installation. Furthermore, NTFS often places a backup copy of directory structures and files deep into the drive. Image the drive immediately and run a full scan in **R-Studio**, **UFS Explorer**, or **DMDE** to reconstruct the upper-sector directory trees and carve remaining files.
Is it ever safe to put a clicking or unrecognized hard drive in the freezer?
**Never put a hard drive in the freezer.** The "freezer trick" is an outdated myth from the 1990s that permanently destroys modern high-density hard drives. Modern hard drive read/write heads fly on an air bearing just 1 to 3 nanometers (less than 0.0000001 inches) above platters spinning at 5,400 to 7,200 RPM. Placing a drive in a freezer causes microscopic water vapor inside the drive enclosure to condense into solid ice crystals directly on the magnetic platters. The instant you plug the cold drive in and the platters spin up, the read/write heads slam into those frost crystals at 120 kilometers per hour (75 miles per hour), causing a catastrophic head crash that scrapes the magnetic coating into metallic dust and makes cleanroom recovery impossible. For physical drive failures, see our guide on [hard drive failure and data recovery](hard-drive-failure-and-data-recovery.md).
Allikad kontrollitud¶
- National Institute of Standards and Technology (NIST, United States): Special Publication 800-88 Revision 1, Guidelines for Media Sanitization (ATA TRIM, NVMe Deallocate, and NAND Flash Translation Layer behavior) and Computer Forensics Tool Testing (CFTT) Program Disk Imaging Specifications (
csrc.nist.gov). - Cybersecurity and Infrastructure Security Agency (CISA, United States): Data Backup, Forensic Preservation, and Incident Handling Guidelines (
cisa.gov). - GNU Project / Antonio Diaz Diaz (International): Official GNU ddrescue Manual: Data Recovery Tool and Block Device Mapfile Algorithms (
gnu.org/software/ddrescue). - CGSecurity / Christophe Grenier (International): TestDisk & PhotoRec Official Documentation: Partition Recovery and File Carving Signatures (
cgsecurity.org). - Apple Platform Security (United States): FileVault, Data Protection Classes, Per-File Encryption Keys, and APFS Trim Architecture on Apple Silicon and T2 Systems (
support.apple.com/guide/security). - Android Open Source Project (AOSP, International): File-Based Encryption (FBE) and Metadata Encryption Architecture (
source.android.com/docs/security/features/encryption). - SD Association (International): SD Specifications Part 1: Physical Layer Simplified Specification (Erase Commands CMD32, CMD33, CMD38 and Write-Protect Mechanical Switch) (
sdcard.org).