無意中刪除了三星S4手機中相機的相冊。過程是這樣的,用手機拍了幾張照片,覺得最后那張拍得不好,想刪除,於是進入相冊,看到有那張照片的圖標,選擇,刪除,悲劇發生了!
這里得說三星的不好:在相冊中,相冊文件夾僅顯示一張大圖片,整個手機拍攝照片的文件夾,就用我最后那張拍攝的照片代替,於是被我選擇后刪除了。在Windows中這是不可能的,如果包含多張圖片,文件夾一定是顯示幾張圖片在文件夾上面,表示這是一個文件夾,但三星不是!我的目的是想刪除最后那張照片,但三星給了我錯誤提示,於是我在不知情的情況下刪除了整個相機相冊。
更悲劇的是前段時間SD卡出了問題,於是我把相機拍攝存儲到手機內存中。如果照片存儲到SD卡,那么還是挺好恢復的。這個網上有大把文章:把SD卡取下來,裝入到讀卡器,再插入電腦,隨便找個恢復軟件就可以恢復了。參考:Windows環境下文件的徹底刪除與恢復,推薦幾個工具(整理)
那么手機內存中的東西誤刪除了,怎樣恢復呢?網上找到的大部分恢復軟件其實是不能用的,因為手機內存對於電腦來說不是硬盤。恢復過程非常不易,下面是我找到的兩種途徑。
簡單的方法,下載恢復軟件
官方網站:http://www.wondershare.com/data-recovery/android-data-recovery.html
drfone-for-android_full,這個軟件是經我測試確實可以恢復手機中的信息的,包括:通訊錄(已經刪除的聯系人可以看到)、短信(已經刪除的短信可以看到)、相片與視頻(已經刪除的可以小圖查看,選擇后恢復)。
軟件使用非常簡單,但掃描非常耗時。16G內存大概需要1~2小時。掃描到你已經刪除的照片后,需要做第二步,恢復。其實恢復只是一個按鈕的事情,但它需要注冊后才可以恢復。官方售價挺貴的。建議到淘寶購買,價格在20~35元左右。
意外的是,我刪除的是文件夾,它並沒有找出來。其它過期圖片啥的,尤其是聯系人,短信,倒都可以恢復。聯系人、短信是直接查看的,不需要恢復操作。
注意:此款軟件同樣有iOS版本,網上可以搜索到注冊碼。
非常復雜的方法,自己動手恢復
具體參考:[GUIDE] Internal Memory Data Recovery - Yes We Can!,本文僅做一些簡單說明與補充:
1. 問題
Internal Memory doesn't mount as a drive like external memory does.
External memory would allow you to use data recovery tools that scan for deleted files and return them to a usable state. These tools work because most operating systems don't go through and set all of those 1's and 0's to just 0's when you delete a file.
Usually the operating system will just delete the reference pointer in the index that says that a file exists with such-and-such name and it's located at this position on the hard disk / memory location. There are destructive delete tools out there that will overwrite the spot of a deleted file multiple times to discourage recovery in just this manner.
The issue is that data recovery tools need an actual mounted drive in order to dig deep and unearth those funny pictures of cats you so tragically deleted by accident. These newest batches of phones don't have external SDcards which are super easy to mount as drives. Internal memory mounts as MTP/PTP which is not treated as a mounted drive and cannot be scanned by these data recovery tools. But, cry no more cream-puff!
2. 分析
My phone is the Samsung Galaxy Nexus (toro) though I imagine this should work for ANY phone with Internal Memory. We will be using a Windows 7 machine to:
- back up the entire internal memory partition to your computer as a single, massive .RAW file,
- convert the .RAW file output to a VHD,
- mount the VHD as a disk in Disk Manager,
- scan the attached VHD volume for files that have been deleted and recover them,
- ?
- profit!

3. 環境准備
3.1 獲得手機Root權限
Kingo Android ROOT這個軟件非常好用(Android手機通用)
參考:How to Root Your Samsung Galaxy S4 (or Almost Any Other Android Phone) in One Easy Click(轉)
3.2 安裝BusyBox到手機上
安裝BusyBox到手機上。三星S4要麻煩一些,因為三星把Google的一些東西給刪除了。
- 步驟一:安裝Google Play(如果手機已經具備,則忽略此過程),參考:Galaxy S4安裝Google Play(轉)
- 步驟二:安裝BusyBox,打開“Play 商店”搜索“BusyBox“,然后下載安裝即可。需要注冊Google帳戶。
3.3 安裝Cygwin及pv/nc/util-linux
我的是Windows 7,64位版本,安裝Cygwin於C:\Cygwin64目錄。
- Cygwin,參考:http://www.cygwin.com/
- pv,參考:http://sourceforge.jp/projects/sfnet_pvforcygwin/,將pv.exe放置於C:\Cygwin64\bin目錄
- util-linux,參考: http://ftp.sjtu.edu.cn/cygwin/release/util-linux/,將相關exe放置於C:\Cygwin64\bin目錄
- netcat,32位下載參考:http://www.daemon.de/Netcat;64位版本下載參考:http://eternallybored.org/misc/netcat/。將nc.exe/nc64.exe放置於C:\Cygwin64\bin目錄
3.4 ADB環境安裝
因為本人機器已經安裝Android開發環境,所以此過程非常簡單。只需要加入adb.exe到PATH,及更換手機USB連接驅動程序即可。其它環境,請參考:
[HOWTO] Install Google SDK and ADB drivers in Windows 7
3.5 手機開啟USB調試模式
參考:豌豆莢不能連接三星S4手機,提示打開手機的“USB調試模式”,但卻找不到在哪兒可以設置
3.6 下載VHD工具
網上自行搜索VhdTool.exe,並放置於 C:\Cygwin64\nexus目錄(新建),用於存放轉出文件。
3.7 准備恢復工具
Recuva恢復工具是個不錯的選擇。有免費版本。我用的是商用版。
3.8 需要點耐心與運氣
4. 步驟
- *****Based on the number of people having trouble with this step it is now my recommendation that you choose to recover your entire memory block instead of just the data partition. In my phone's case that is mmcblk0. Please discover if yours is different.***** Identify which block/partition you want to recover. For our purpose here we are seeking to recover the userdata partition: /dev/block/mmcblk0p12
備注:可以在手機安裝一個終端模擬器,然后輸入下面命令以查看各mmcblk0*對應功能:
su ls -l /dev/block/platform/dw_mmc.0/by-name/
注意:實際目錄路徑可能與上面的不一致。
- Turn on your phone
- Connect the phone in ADB mode
- Unlock the screen.
- Open a Cygwin terminal and enter (This assumes your BusyBox installation is at [/system/bin/busybox]. It may be at [/system/xbin/busybox]):
Code:
adb forward tcp:5555 tcp:5555 adb shell
su /system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0 - Open another Cygwin terminal and enter:
Code:
adb forward tcp:5555 tcp:5555 cd /nexus nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw
- Run around the house a few times. For 32GB internal memory this is going to take 3+ hours. That's a lot of running. When it's done...
- We need to convert the .RAW file to a virtual hard drive. VhdTool.exe basically just puts a VHD footer on the end of the .RAW file. Open a Windows command prompt, go to [c:\cygwin\nexus], and type:
Code:
VhdTool.exe /convert mmcblk0p12.raw
- Now we need to mount the VHD in Windows. Select the Start button-->right-click Computer-->select Manage.
- Select Storage-->Disk Management.
- In the menu select Action-->Attach VHD.
- For Location enter [c:\cygwin\nexus\mmcblk0p12.raw] and select the OK button.
- Right-click on the name (e.g. "Disk 1") to the left of the Unallocated space and select Initialize Disk.
- Select the GPT (GUID Partition Table) radio button and select the OK button.
- Right-click on the Unallocated space and select New Simple Volume...
- In the Wizard select Next>, leave the default for the volume size, select Next>, select a drive letter (e.g. K), select Next>, MAKE SURE to select the 'Do not format this volume' radio button, select Next>, select Finish.
- A box will pop up asking you to format the drive. You DO NOT want to format the drive at this time.
- Right-click on the RAW space and select Format... MAKE SURE to change the File system to FAT32. Set the Allocation unit size dropdown to 'Default.' MAKE SURE that the Perform a quick format checkbox is CHECKED. You do not want to overwrite the entire new drive with all zeroes (0's) and destroy your data. Quick Format means that it will only attempt to destroy the index for the drive by establishing a new index. Without this box checked the Windows operating system will write zeroes (0's) across the entire volume, potentially destroying your data. Select the OK button.
- A box will pop up saying that Formatting this volume will erase all data on it. That would be doubly true if you actually didn't check the 'Perform a quick format' checkbox. Double check that you actually did check the box and select the OK button. (Don't worry. This essentially leaves the volume in the exact same state that your phone's internal memory is living in right now: there is data on the drive...you just can't see it. It's coming back, I promise!)
- Open the Piriform Recuva application. In the wizard select the 'Next >' button. Select the 'Other' radio button and select Next >. Select the 'In a specific location' radio button and enter: k:\ (assuming K is the drive letter you chose...) Select the Next > button. Select the Enable Deep Scan checkbox. This is the magical setting that finds files that have been deleted...but not really deleted. Select the Start button.
- The application may take about an hour to do the 'Deep Scan.' It's time for more laps around the house! Once the application has returned its results you can choose which files to recover using the checkboxes. Select the 'Recover...' button and choose the location to which you wish to output your files.
- ?
- Profit!

