Permission denied for “dd” of Android phone's file system connected over mtpfs in Ubunutu 14.0.4 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
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
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.

This is the discussion of this question at askUbuntu.com link

EDIT: There is another method for recovering your data from an Android phone that does not require access to a PC elaborated here. It involves installing an Android terminal and using the dd command to clone the required storage block of internal memory to a SD card or a pen drive (connected to your phone via a USB OTG cable).
Short answer: a complete copy of your phone over dd can't be done.

Explanation: Normally when you access a file, your file system driver will parse the folder hierarchy, translate it to an inode, locate the sector on which the file is stored, the metadata is parsed and the file is read. MTP does things differently: your computer sends a request to the device to get file X, your device will parse the directory structure, parse the metadata, locate the sector/cell on the storage device, read the file and then send the data back over MTP.

dd will make a copy of the blocks that are on the storage device itself. Therefore you can copy files and entire partitions because they are blocks of data on the disk. Directories are stored on the disk but they aren't real regions of disk space, they're more like references so files can indicate "I'm part of this folder". Therefore you cannot do a block copy of a directory. Because you cannot do a block copy of a directory, copying the entire storage device of your Android phone over MTP is not possible.

But there is hope: if your device software allows it, you might be able to mount your device as a USB storage device. This will directly attach the storage partition to your computer, allowing you to make a backup using a command like dd if=/dev/sdb of=~/backup_file.

Alternatively, because you have root you could enable Developer Mode on your Android device and then execute the following command after installing the ADB tools (sudo apt-get install android-tools-adb):

adb shell su -c "dd if=/dev/block/mmcblk0" &gt; ~/full_phone_backup.image


This will make a copy of everything on the storage device. It will run for quite some time. I never reached more than 20MB/s over ADB, so it would take 64000/20=3200 seconds at max speed to copy a 64GiB device. After the copy has finished you can run your file recovery software over full_phone_backup.image to get any files back from the system.