From the beginning. I was using Link2SD in order to save up some internal memory, but today I noticed that all apps moved to to second partition (EXT2) magically disappeared. I don't want to repair Link2SD because I'm going to change phone very soon. I want to recover data from /data/sdext2, but i can't mount it. I want to recover this data because I change SDCard too. Link2SD saying something about invalid argument during creating mount script. Is there any way to access this data so far? Or I must say goodbye to them?
PS. First partition is safe and sound. It works great.
Answer
To access second partition on SD card if it's not deleted, you may adopt multiple approaches listed below. For deleted partitons or deleted files, you may use tools like testdisk and extundelete which doesn't seem to be the case here.
LINUX / WINDOWS
As mentioned by @iBug, you can remove SD card from phone and insert in a PC with Linux OS like Ubuntu. You will be able to access both partitions there. File browsers like Nautilus and Dolphin by default show all formatted partitions in left panel on newly inserted media.
In order to directly mount a partition from Android device to Linux PC, you can expose it as a USB Mass Storage device. By default UMS is disabled on newer devices but can be enabled by a little hacking.
Windows by default only mounts first accessible partition on SD cards and other removable media. However, if you want to access second partition on Windows, it is possible. You need to make SD card a local hard disk drive using a hacked driver like Cfadisk usb driver. Follow this link for detailed guide.
ACCESS 2nd PARTITION FROM ANDROID
Some custom builds of TWRP auto-mount SD card second partition under something like /sd-ext etc. If not so, you can mount it yourself in Android recovery or ROM, as you seem to have already rooted device.
- Reboot in TWRP recovery and use built-in terminal app there. Or if you want to do it from ROM, install terminal emulator app like
Terminal Emulatorif you don't have one already. Third option is to useadb, in ROM or in recovery. Find how kernel names
block deviceson your phone:~# ls /dev/block/You will find a number of devices there. On a typical
Qualcommdevice,mmcblk0will be representing internal memory i.e. eMMC andmmcblk1will be representing external SD card. Though there will be many other internal partitions and loop devices, we are concerned with three entries of external SD card:mmcblk1 mmcblk1p1 mmcblk1p2Here
mmcblk1p2is the second partition on SD card.For confirmation:
~# fdisk /dev/block/mmcblk1p2This will show details about SD card second partition including
size.Mount partition:
~# mkdir /sd_ext
~# mount -o ro /dev/block/mmcblk1p2 /sd_extFirst command will create a directory
sd_extunder your root which you may access from anyfile exploreror command-line.rooption in second command will mount the partitionread-onlyso that you may not harm any data accidentally. You may eliminate this.
If not successful, you may need to specifyfilesystemyourself what you used at the time of partitioning:~# mount -t ext4 -o ro /dev/block/mmcblk1p2 /sd_extTo know which filesystem a partition has:
~# blkid /dev/block/mmcblk1p2There are many other tools that can be used for the purpose like
parted,fsckandtune2fsetc. but these might not be necessarily available.Mounted partition will be
un-mountedautomatically on reboot. You can do this manually:~# umount /sd_ext
NOTE:
- Be cautious not to touch second partition on internal memory which may belong to bootloader. Or you may brick your phone.
- All commands used above need
root accessand binaries are included in TWRP. You may installbusyboxin ROM if any command not found.
RELATED:
No comments:
Post a Comment