I have connected my rooted Mi3 android phone to Ubuntu 14.0.4 using jmtpfs. I am using ~/Desktop/phone as my mount point. I am able to browse the Android device using Nautilus.

Now I want to recover the files from my phone because I have done a factory reset. I am using the dd command to make a clone of the storage of the phone. When I try to do this I get the following error:

:~/Desktop$ sudo sh -c "dd if=~/Desktop/phone of=/media/sf_phone_recovery/image"
dd: failed to open ‘~/Desktop/phone’: Permission denied

Is it because the phone has root priviliges?

:~/Desktop/phone$ ls -l
total 0
drwxr-xr-x 29 root root 0 May 19 4441318 Internal storage

I have also tried Foremost to recover files but it takes forever to run. Have important files on my phone. Help needed asap.

This is the output of lsblk:

:~$ lsblk
sda      8:0    0  14.2G  0 disk 
├─sda1   8:1    0   8.3G  0 part /
├─sda2   8:2    0     1K  0 part 
└─sda5   8:5    0   5.9G  0 part [SWAP]
sr0     11:0    1  1024M  0 rom

I am running Ubuntu using VirtualBox on Mac OSX Yosemite.

EDIT: This question has been answered at the android.stackexchange.com link.

I am marking the answer given by @solsTiCe as the correct answer because it contains important information about MTP protocol and dd command. It also offers an alternative of using the Android terminal to dd the system image on the SD card/ pen drive (connected to your phone via a USB OTG cable). Haven't tried it yet.

| improve this question | | | | |
  • Add the output of lsblk. – ps95 Jul 25 '15 at 10:26
  • @prakharsingh95 android device does not show up in lsblk. Although it does show up in mount as * * jmtpfs on /home/user424/Desktop/phone type fuse.jmtpfs (rw,nosuid,nodev,user=user424)* * – user424 Jul 25 '15 at 10:55
  • Which device are you using? Is it rooted? Is the bootloader unlocked? – kos Jul 25 '15 at 11:58
  • I am using Xiaomi Mi3 phone. Yes my phone is rooted. Root Checker App shows that Root Access is properly installed on my device. I don't think that bootloader needs to be unlocked on Mi3. Maybe it does, but my phone is definitely rooted. – user424 Jul 25 '15 at 12:14

You can dd only from a device or a file not from a directory.

Also this will likely fail because you use MTP. MTP is a layer above the filesystem that expose only files. It's a protocol not a true filesystem.

But even with a filesystem this will not work. You need to do that on the device. The general example is

sudo dd if=/dev/mydevice of=mydump.bin

This will not work here

If you could mount it using MSC aka. USB Mass Storage, then you should be able to do it.

Edit: One other way to do it is by installing a terminal app on android (with busybox ?) and do the dd inside that terminal. you dump it on your sd card.

Look at output of mount and look for your device. Here I dump the /system directory to SD card.

/emmc@android /system ....
su -
dd if=/emmc@android of=/storage/sdcard1/mydump.bin
| improve this answer | | | | |
  • Is it dd=if or dd if=? Also is mydump.bin being saved on the Android device. If it is won't it overwrite the same data that I am trying to recover? – user424 Jul 25 '15 at 11:48
  • This was an general example. I corrected it – solsTiCe Jul 25 '15 at 12:04
  • Mi3 has Android 4.4.4. which does not support USB Mass Storage. As for dd ing it using an Android terminal, Mi3 does not have an SD card. Even if it had I would want to recover the files from that as well. – user424 Jul 25 '15 at 12:16
  • You better ask in android.stackexchange.com – solsTiCe Jul 25 '15 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.