Data recovery, how to mount messed up /data - Internal SD - sda25 in Recovery/ADB - Samsung Galaxy Note 9 Questions & Answers

Hi:
I've messed up my Note 9 pretty bad, such that no partitions mount in TWRP except cache - I'll need to do a data wipe, but I need to save data that I have in the Internal SD.
I've discovered via fdisk in TWRP that the media part - the Internal SD is partition sda25 - however can
t mount it in the terminal through a simple: mount /dev/block/sda25 /mnt
I get an error: mount failed: Invalid argument
I've tried: mount -t sdcardfs /dev/block/sda25 /mnt
This gives me also an error: mount failed: Not a directory
Mounting with -t vfat or exfat gives the Invalid argument error.
Anyone can help me with how to mount it, so that I may copy data off of it manually? I don't want to lose it. Many thanks.

白い熊 said:
Hi:
I've messed up my Note 9 pretty bad, such that no partitions mount in TWRP except cache - I'll need to do a data wipe, but I need to save data that I have in the Internal SD.
I've discovered via fdisk in TWRP that the media part - the Internal SD is partition sda25 - however can
t mount it in the terminal through a simple: mount /dev/block/sda25 /mnt
I get an error: mount failed: Invalid argument
I've tried: mount -t sdcardfs /dev/block/sda25 /mnt
This gives me also an error: mount failed: Not a directory
Mounting with -t vfat or exfat gives the Invalid argument error.
Anyone can help me with how to mount it, so that I may copy data off of it manually? I don't want to lose it. Many thanks.
Click to expand...
Click to collapse
cant you simply wipe the affected partitions(except data of course)? then flash a rom?
have you tried;
mount /sys/block/sda25 /mydata
or
mount /dev/block/sda25 /mydata
or
adb
mount -o rw /dev/block/sda25/data /mydata
in both cases /mydata is just the mount point so I believe it can simply be called what ever you want including just /data
have you read:
https://android.stackexchange.com/q...data-partitions-in-recovery-mode-in-adb-shell
edit:
by any chance when you first flashed twrp, did you forget to format data?
if yes then flash back stock AP file(original phone's firmware) in Odin AP slot only and you should be good to go.( you shouldn't loose any files in internal storage)

Related

Unable to mount SD card in console / terminal

I am trying to mount my SD card via console in recovery, I get
mount: mounting /dev/block/mmcblk0p2 on /system/sd failed: Invalid argument
Any ideas whats wrong?
In recovery you can try:
mount -a
to just mount everything. Try that out.
Are you trying to copy files to the sdcard or the extX partition? It looks like the ext partition because that's blk0p2...
The sdcard would be ums_enable.

factory.zip to mmcblk0p3

I am pretty sure my factory.zip is corrupt or nonexistant from my mmcblk0p3. How do i move the factory.zip file over there from this thread http://forum.xda-developers.com/showthread.php?t=919353
Thanks
I just did this last night. First I booted into clockwork recovery and hooked up the nook to my computer and started up adb. I tried doing this when it was booted normally but I could not mount mmcblk0p3. Anyways once you are in recovery mode go to where adb is installed. Then these were the commands I did
Code:
adb shell mount /dev/block/mmcblk0p3 /emmc
adb pull /emmc/factory.zip factory-1.0.0.zip
adb push factory.zip /emmc/
The second line is me backing up my old 1.0.0 factory zip, just in case things went bad. Then I did the 8 failed boot reset and then reset /data
Thank You! I had something like that except i was missing emmc in the first line and i couldn't figure out why i couldnt mount mmcblk0p3. I want to make a how to once i reach 10 posts on this.
Hate to bring back an old thread, but, no matter how I have tried, I cannot mount /dev/block/mmcblk0p3... I always get invalid argument error... any help is appreciated.
>adb shell mount /dev/block/mmcblk0p3 /emmc
mount: mounting /dev/block/mmcblk0p3 on /emmc failed: Invalid argument
I have yet to be able to mount mmcblk0p3 to copy factory.zip to it.... hoping this would fix my install failed error on the 8 failed boot install.
NM.... fixed it... had to mke2fs /dev/block/mmcblk0p3 before I could mount it... got it fixed... the 8 failed boots works as it should again.

[9001]Mounting external SD Card as ext3

Hey,
I like to mount my external SD Card as ext3 to support large files. The SD Card is formatted with ext3 but now Android shows only an empty folder.
So i tried to remount the SD:
Code:
mount -o rw,remount -t ext3 /dev/block/vold/197:33 /mnt/sdcard/externald_sd
But it doesnt use something... Does anybody has an idea? Some Example or sthing else?
Greetz
FaxXer said:
Hey,
I like to mount my external SD Card as ext3 to support large files. The SD Card is formatted with ext3 but now Android shows only an empty folder.
So i tried to remount the SD:
Code:
mount -o rw,remount -t ext3 /dev/block/vold/197:33 /mnt/sdcard/externald_sd
But it doesnt use something... Does anybody has an idea? Some Example or sthing else?
Greetz
Click to expand...
Click to collapse
u need a kernel that supports ext3. u can ask one of the guys compiling at the moment if they have time to add an ext3 module for u.
May be a stupid question:
would ext4 work instead? I thought the system partition would use this FS.
filesystem is already ext4
wintel_mac said:
May be a stupid question:
would ext4 work instead? I thought the system partition would use this FS.
Click to expand...
Click to collapse
well the system uses ext4 so it should work, but i'm not sure what u're trying to achieve. i use a 16 gb class 10 formatted fat32
Blumdum said:
filesystem is already ext4
Click to expand...
Click to collapse
He's talking about formatting external sd-card
When I get him right, he has a file that exceeds the 4GB FAT32 limit.
So he looks for an alternative to FAT32, which might be some kind of ext*-FS.
wintel your right!
In the Android-Hilfe Forum someone said the system expect first an vfat partition and then the ext. I think thats wrong cause its not working but somehow it has to go.
Hmm should I write these mount command I postet in the init.rc? Or something else. Would be very nice if you post your ideas!
Thanks
init.rc+ ext3 module/object included in kernel
Hmm okay thats good but how do I use them? So I can read and write to my external sd card with an ext3 or ext2 partition.
Thanks
Come on guys where are the great developers?!
Ok I did a test with busybox inbuilt mount, but I tried only with an image.
Not with a real SD card! This worked for me:
On a linux box:
# dd if=/dev/zero of=/tmp/image bs=1M count=1k
# mkfs.ext4 /tmp/image
Copy file to your phone. Then:
On the phone with terminal:
# mkdir /sdcard/mmnt
# busybox mount -o loop /sdcard/image /sdcard/mmnt
To unmount:
# busybox umount -l /sdcard/mmnt
Anybody tried that?
If I understand u right u puting an image file (ext3/4) on the sd and mount that as a virtual disk. Wouldn't the image file be bound to the same restrictoins as other content on a fat32 file system? Like the 4 gig limit!
YOU WILL LOSE ALL DATA ON YOUR SDCARD IF YOUR FDISK
BACKUP WHATEVER IS ON THERE FIRST!!!
YOU'VE BEEN WARNED
using a photon 4g but....
what i did was get an external sdcard reader writer...
(used ubuntu) and let it mount
fdisk device and DELETE ALL PARTITIONS
write
fdisk again
create a linux primary type 83
type mount and grab the /dev/sdcX value (it was /dev/sdc1 for me)
umount that
then
mkfs.ext3 /dev/sdcX ... ( heres the thing though with cyanogen mod 7 kernel 2.6.32.9 SMP PREEMPT)
had to reboot twice for it to be seen in file manager...
its buggy but it does work for the most part
Reviving an old thread, but I just found that I can format a MicroSD under NTFS and it will work with Paragon's NTFS module. At the very least, my phone will mount the drive. I partitioned and formatted it with ext4 on my Linux machine and it didn't recognize it, but I did have it use the GUID partition table. Hoping to be able to load up some videos to take with me.
ext4 sdcard mount works
FaxXer said:
Hey,
I like to mount my external SD Card as ext3 to support large files. The SD Card is formatted with ext3 but now Android shows only an empty folder.
So i tried to remount the SD:
Code:
mount -o rw,remount -t ext3 /dev/block/vold/197:33 /mnt/sdcard/externald_sd
But it doesnt use something... Does anybody has an idea? Some Example or sthing else?
Greetz
Click to expand...
Click to collapse
The problem is with the shell interpreting the special character ":"
To make it work, first create a symlink to the device node:
Code:
ln -s /dev/block/vold/197\:17 /dev/sd2
Then mount it:
Code:
busybox mount /dev/sd2 /mnt/tmp
Code:
sh-4.1# ls -l /dev/sd2
lrwxrwxrwx root root 2013-11-16 14:45 sd2 -> /dev/block/vold/179:17
sh-4.1# mount|grep sd2
/dev/sd2 /mnt/tmp ext4 rw,relatime,user_xattr,acl,barrier=1,data=ordered 0 0
success mounting ext formatted SD Card on Android
An improvement in technique to mount ext formatted SDcard:
1) be root and open terminal
2) insert the card
3) see the block device and partition names from dmesg
4) mount device to location of choice (create the directory if needed)
Below is an example of an SD card with one ext4 partition on it
Code:
bash-4.1# dmesg | tail | grep mmc
<6>[20230.719541] mmc1: new high speed SDHC card at address 0007
<6>[20230.722803] mmcblk1: mmc1:0007 SD32G 29.3 GiB (ro)
<6>[20230.728352] mmcblk1: p1
bash-4.1# busybox mount /dev/block/mmcblk1p1 /data/mnt/sdcard2
tribh said:
An improvement in technique to mount ext formatted SDcard:
1) be root and open terminal
2) insert the card
3) see the block device and partition names from dmesg
4) mount device to location of choice (create the directory if needed)
Below is an example of an SD card with one ext4 partition on it
Code:
bash-4.1# dmesg | tail | grep mmc
<6>[20230.719541] mmc1: new high speed SDHC card at address 0007
<6>[20230.722803] mmcblk1: mmc1:0007 SD32G 29.3 GiB (ro)
<6>[20230.728352] mmcblk1: p1
bash-4.1# busybox mount /dev/block/mmcblk1p1 /data/mnt/sdcard2
Click to expand...
Click to collapse
Would this work just the same way with i9000?
After this, no more access to the extSD by the Windows PC but only with Ubuntu, right?
tetakpatak said:
Would this work just the same way with i9000?
After this, no more access to the extSD by the Windows PC but only with Ubuntu, right?
Click to expand...
Click to collapse
Since it's generic Linux kernel and busybox functionality it should work on any 'droid. The SDcard device name might be different than in the above example - you will see the correct device and partition names after you insert SDcard and run `dmesg | tail` on the tablet or phone.
(of course your device must be rooted and have busybox...)
Typically Windows is engineered not to recognise anything that does not come from Microsoft, so you will not be able to mount the Linux partition via Windows.

[Q] [HELP] Swap sdcard with sdcard-ext

I've edited vold.fstab so that sdcard and sdcard-ext are swapped. But this doesn't work on my XT894. Nothing happens in my case.
Then I found this topic.
In short, you run a script containing:
Code:
busybox mount -o remount,rw /
busybox mount -t vfat -o umask=0000 /dev/block/vold/179:97 /mnt/sdcard
busybox mount -t exfat -o umask=0000 /dev/block/vold/179:97 /mnt/sdcard
if busybox mount | busybox grep vold/179:97; then
busybox mount -o bind /data/media /mnt/extSdCard
fi
After running this script the result is that both sdcard and scard-ext are in fact pointing to my external 32GB card. So in a way I'm happy. Now I can install games and all navigational maps without any hassle. But, I would like my internal 8GB of storage back. To do so I take it "something" has to be mounted to /mnt/sdcard-ext.
My Linux/Unix is of n00b quality so here I am asking for help :cyclops:
I've tried adding these two lines:
busybox mount -t vfat -o umask=0000 /dev/block/vold/179:1 /mnt/sdcard-ext
busybox mount -t exfat -o umask=0000 /dev/block/vold/179:1 /mnt/sdcard-ext
Hoping 179:1 pounted to the internal sdcard and /mnt/sdcard-ext would mount it at exactly that. But it didn't work.
Can anyone explain to me what these commands do? Why vfat and exfat? Is this done so that you always mount the correct filesystem? And what about the vold/179:xx? Does anyone know which one points to the internal sdcard on an XT894 running ICS?
Trust me, I've Googled all I can. I have tried several options, multiple scripts, but my lack of Linux/Unix knowledge is killing me.
Edit:
When I connect as USB Mass storage I get my internal 8GB back. It is accessible on the laptop. When I switch back to MTP it shows a different directory (maybe due to vold/179:1 !?). After I re-run the script sdcard is back to my external 32GB. For now this will do.
I will update later. Sygic is downloading 2GB of data. After that I will switch back and forth between USB M / MTP with and without running the script.
Edit 2
After I connect as MTP, Internal Storage seems to be pointing to an unknown space. There is an .android directory which I am unable to find on the phone.
When I switch to USBMS (from MTP) it seems to switch back to the original setup, sdcard 8GB and sdcard-ext 32GB.
When I disconnect the USB cable everything is back to normal. But, all I need to do is re-run the script and sdcard points back to my external SD.

Phone won't accept decryption (FDE) password anymore.

My device: HTC One M7 Android 4.2.2, S-ON, Root, CWM recovery (years old version)
My ultimate goal was: Get xposed framework. Install via app failed after rebooting due to S-ON, so I wanted to install through recovery. (this is irrelevant to the issue IMO)
What I tried to get there: Decrypting my /data partition in adb (because CWM doesn't support it)
What I found: https : // forumDOTfairphoneDOTcom/t/how-to-mount-encrypted-data-in-recovery/25724
Everything(!) I actually did: (commands after $ means executed on host machine (ubuntu), prefixed by ~ # means run on phone in adb shell)
$ adb shell
~ # setprop ro.crypto.state encrypted
~ # vdc cryptfs checkpw "<wrong password>"
200 0 1
~ # mount /dev/block/dm-0 /data
mount: mounting /dev/block/dm-0 on /data failed: no such file or directory
(( a couple commands like ls and cat to find out what my /data partition should be ))
(( ended up finding out in fstab that it's mmcblk0p37 ))
~ # mount /dev/block/mmcblk0p27 ((accidentally wrong one))
mount: mounting /dev/block/mmcblk0p27 on /data failed: Invalid argument
~ # mount /dev/block/mmcblk0p37
mount: mounting /dev/block/mmcblk0p37 on /data failed: Invalid argument
(( notice i entered wrong password ))
~ # vdc cryptfs checkpw "<right password>"
200 0 2
~ # mount /dev/block/mmcblk0p37
mount: mounting /dev/block/mmcblk0p37 on /data failed: Invalid argument
(( a couple more tried of the previous two commands for no legit reason ))
~ # mount -o rw,remount /dev/block/mmcblk0p37
mount: mounting /dev/block/mmcblk0p37 on /data failed: Invalid argument
(( exit adb shell ))
(( execute $ adb remount )) (( as google suggested (on host machine, not in adb shell obv) ))
$ adb shell
~ # mount -t ext2 /dev/block/mmcblk0p37 (( accidentally wrong fstype ))
mount: mounting /dev/block/mmcblk0p37 on /data failed: Invalid argument
~ # mount -t ext4 /dev/block/mmcblk0p37
mount: mounting /dev/block/mmcblk0p37 on /data failed: Invalid argument
~ # mount -t ext4 /dev/block/mmcblk0p27 (( why not? ))
mount: mounting /dev/block/mmcblk0p37 on /data failed: Invalid argument
~ # exit (( i got frustrated ))
Before I did all this the phone was working normally (after install xposed via app (which gave me xposed version 3x because I had that one previously installed via receovery. But I wanted the newest (5x) so I went all that way)). After I did all these steps - which to me are readonly things which shouldn't brick anything - I got frustrated and wanted to give up, so I rebooted. Now everytime I enter the - 100% correct - password, it tells me to "try again" (guessing it means wrong password? idk).
The whole xposed stuff is irrelevant in my opinion, because after I've installed it using the xposed installer (APK) I rebooted twice and decryption worked fine both times.
What the hell have I done (I'd say I'm a linux expert and I honestly don't see how I could've possible broken anything by what I did) and how can I fix it?
UPDATE: I got myself the cryptheader from the "extra" partition using the read_emmc vulnerability. That way I got the encrypted key and salt. (cryptheader)
I then used this and a modified bruteforce script to check if my right password is still right. Result: It doesn't seem so.
My password contained special characters and was 15 chars long, bruteforce is not an option.
Is there anyway what I did could've changed the password? If so, can I reproduce and get the new key somehow? The cryptheader is not corrupted and still intact. The /data partition (encrypted) is not corrupted and still intact. (I assume this because the encrypted partition's hexdump starts with "This is an encrypted partition", which is a HTC easter egg.)
htcuser311 said:
UPDATE: I got myself the cryptheader from the "extra" partition using the read_emmc vulnerability. That way I got the encrypted key and salt. (cryptheader)
I then used this and a modified bruteforce script to check if my right password is still right. Result: It doesn't seem so.
My password contained special characters and was 15 chars long, bruteforce is not an option.
Is there anyway what I did could've changed the password? If so, can I reproduce and get the new key somehow? The cryptheader is not corrupted and still intact. The /data partition (encrypted) is not corrupted and still intact. (I assume this because the encrypted partition's hexdump starts with "This is an encrypted partition", which is a HTC easter egg.)
Click to expand...
Click to collapse
I'm far from being a linux expert but the simplest would be to factory reset using htc's recovery to remove /data encryption and start from scratch (unless you have some really important data that must be saved from your /data partition)
alray said:
I'm far from being a linux expert but the simplest would be to factory reset using htc's recovery to remove /data encryption and start from scratch (unless you have some really important data that must be saved from your /data partition)
Click to expand...
Click to collapse
I have decided to give up on trying and did a "factory reset" (formatted /data and /data/sdcard through CWM, rebooted, set up device for first use, formatted /data again through CWM to result in clean system).
Fun-fact: Before I did what bricked the system I actually made a backup. The device (µSD-Card) decided to go corrupted filesystem though. I managed to recover most of the files but the /system partition backup (which might have saved me) remained corrupted. I was able to restore all my personal data though, so doing a factory reset wasn't that bad for me.

Categories

Resources