How to decrypt and split adopted storage? - Android General

How to partition and to have adopted storage at same time.
You don't need to root your device but the device i done this with is rooted
You need to enabled Developer Options.
Enable the USB Debugging option.
Make sure your SD card is formatted as portable, then get the adb executable from android sdk or any other source.
Connect your device to your PC and run the adb devices command. If your device is connected correctly you will see your device listed in the output.
Run adb shell sm list-disks adoptable. This will show you the list of disks that can be used for what we want.
For my device it showed me disk:179,128 so i ran adb shell sm partition disk:179,128 mixed 80 on my 32 GB SD card. It gave me 5 GB as adoptable storage and the rest for other uses. (This will format your SD card.)
How to decrypt adopted storage.
Your device must be rooted.
Using a file browser like ES Explorer, browse to /data/misc/vold.
The .key file there is the encryption key of your adopted storage.
Open that file with a hex editor to view the 16-byte key.
On any Linux distro you can do this first mount your SD card, in my case SD card was mounted at /dev/sdb2.
Then run this command dmsetup create crypt1 --table "0 `blockdev --getsize /dev/sdb2` crypt aes-cbc-essiv:sha256 <You put the 16 bytes of hex data from the file here> 0 /dev/sdb2 0" This might give you a error but ignore it.
If your key is correct you can mount it by mount -t ext4 /dev/mapper/crypt1 /mnt/1/
Finally you can run cd /mnt/1 to browse the decrypted storage.

How can I decrypt without the key? I saw something but i don't know how do. Can you help me?

Im lost the key file
Hello, I have the same situation like pedrolemoz.
Unfortunately, I did a hard reset to my cell phone and do not have the .key file stored in it. Do you still have the possibility to decrypt the sd card?

pedrolemoz said:
How can I decrypt without the key? I saw something but i don't know how do. Can you help me?
Click to expand...
Click to collapse
-CustomX- said:
Hello, I have the same situation like pedrolemoz.
Unfortunately, I did a hard reset to my cell phone and do not have the .key file stored in it. Do you still have the possibility to decrypt the sd card?
Click to expand...
Click to collapse
Ok its not possible to decrypt the SD with no key and you must have made a copy once you encrypted the SD

I had sdcard setup as adopted storage when I remove it from the phone it is not accesible in any way on the phone also is this possible to open it ? Any tool avaiable ?
This sdcard insided again to phone also don't work why ?

sebx_g1 said:
I had sdcard setup as adopted storage when I remove it from the phone it is not accesible in any way on the phone also is this possible to open it ? Any tool avaiable ?
This sdcard insided again to phone also don't work why ?
Click to expand...
Click to collapse
So once you made it adopted storage did it work at all before removing the SD card

Yes
Wysłane z mojego ASUS_Z00A przy użyciu Tapatalka

sebx_g1 said:
Yes
Wysłane z mojego ASUS_Z00A przy użyciu Tapatalka
Click to expand...
Click to collapse
Well i say the best thing is to retry to set it as adopted storage so just extract ur key and copy the data you got from SD and reformat it

Yes but system says it is corrupted and only option is to reformat sdcard... It is quite confusing situation isn't it?
Wysłane z mojego ASUS_Z00A przy użyciu Tapatalka

Same problem here :\
I put my sdcard on my i9505 and from adb i run "su mount", this is what i get:
Code:
130|jfltexx:/ # mount
rootfs on / type rootfs (ro,seclabel,relatime)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime,gid=3009,hidepid=2)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,seclabel,relatime)
none on /acct type cgroup (rw,relatime,cpuacct)
tmpfs on /mnt type tmpfs (rw,seclabel,relatime,mode=755,gid=1000)
none on /config type configfs (rw,relatime)
none on /dev/cpuctl type cgroup (rw,relatime,cpu)
none on /dev/bfqio type cgroup (rw,relatime,bfqio)
/dev/block/mmcblk0p16 on /system type ext4 (ro,seclabel,relatime,errors=panic,data=ordered)
/dev/block/mmcblk0p1 on /firmware type vfat (ro,context=u:object_r:firmware_file:s0,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=cp437,iocharset=iso8859-1,shortname=lower,errors=remount-ro)
/dev/block/mmcblk0p2 on /firmware-mdm type vfat (ro,context=u:object_r:firmware_file:s0,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=cp437,iocharset=iso8859-1,shortname=lower,errors=remount-ro)
/dev/block/mmcblk0p10 on /efs type ext4 (rw,seclabel,nosuid,nodev,noatime,journal_checksum,journal_async_commit,noauto_da_alloc,errors=panic,data=ordered)
/dev/block/mmcblk0p18 on /cache type f2fs (rw,seclabel,nosuid,nodev,noatime,background_gc=on,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6)
/dev/block/mmcblk0p29 on /data type f2fs (rw,seclabel,nosuid,nodev,noatime,background_gc=on,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6)
tmpfs on /storage type tmpfs (rw,seclabel,relatime,mode=755,gid=1000)
/data/media on /mnt/runtime/default/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,multiuser)
/data/media on /storage/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,multiuser)
/data/media on /mnt/runtime/read/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,multiuser)
/data/media on /mnt/runtime/write/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,multiuser)
Tried also to put my sdcard on a linux OS.. but can not find the filesystem..
Any solution ? :\
How can I reach the .key file?

Question on how to decrypt adopted storage... on phone
POQDavid said:
How to decrypt adopted storage.
Your device must be rooted.
Using a file browser like ES Explorer, browse to /data/misc/vold.
The .key file there is the encryption key of your adopted storage.
Open that file with a hex editor to view the 16-byte key.
On any Linux distro you can do this first mount your SD card, in my case SD card was mounted at /dev/sdb2.
Then run this command dmsetup create crypt1 --table "0 `blockdev --getsize /dev/sdb2` crypt aes-cbc-essiv:sha256 <You put the 16 bytes of hex data from the file here> 0 /dev/sdb2 0" This might give you a error but ignore it.
If your key is correct you can mount it by mount -t ext4 /dev/mapper/crypt1 /mnt/1/
Finally you can run cd /mnt/1 to browse the decrypted storage.
Click to expand...
Click to collapse
In steps 5 - 8, it says to use a linux computer to perform the commands. As I don't have a linux computer, I was wondering if those steps can be done on the Android phone, using Busybox and Android Terminal Emulator? If so, what would be the steps to do it (assuming they differ some from the ones posted there)?
Maybe the better question would be, is there a straight-forward way to decrypt the storage ON THE ANDROID DEVICE, so the SD card doesn't have to be removed and read in another machine?

uptwolait said:
In steps 5 - 8, it says to use a linux computer to perform the commands. As I don't have a linux computer, I was wondering if those steps can be done on the Android phone, using Busybox and Android Terminal Emulator? If so, what would be the steps to do it (assuming they differ some from the ones posted there)?
Maybe the better question would be, is there a straight-forward way to decrypt the storage ON THE ANDROID DEVICE, so the SD card doesn't have to be removed and read in another machine?
Click to expand...
Click to collapse
Well its possible i am sure android must have dmsetup and you can give it a try i never done it on android device using Busybox

How i Decrypt in windows enviroment
Dear I rooted my phone and get the .key file and actually they were 2 file
expand_8e6f0fc23f14e31581c6c0ded8a2bb5f.key
expand_a80d5d8eddaee648fd1f0f14cbb88ae2.key
I want to decrypt my adopted sd card to be able to repartition it again and return it into 1 partition 128gb
Please help

Dr.ahmed3386 said:
Dear I rooted my phone and get the .key file and actually they were 2 file
expand_8e6f0fc23f14e31581c6c0ded8a2bb5f.key
expand_a80d5d8eddaee648fd1f0f14cbb88ae2.key
I want to decrypt my adopted sd card to be able to repartition it again and return it into 1 partition 128gb
Please help
Click to expand...
Click to collapse
I download Ubuntu and install it and yet I could not decrypt my SD card using terminal and this commands.
Please Help

i dont have the key, the folder /data/data/vold is empty, i didnt factory reset or anything, i just rooted the phone to be able to get the key

Hello!!!!
POQDavid said:
Ok its not possible to decrypt the SD with no key and you must have made a copy once you encrypted the SD
Click to expand...
Click to collapse
i have created a backup of that .key file but after few days i formatted my Android and after placing it back to its folder my sdcard is still not working. i mean my sdcard is fully readed by my android device and i can write on it to but my old files are not showing but they are in sdcard because my stotage info is proving it.

CheifX said:
i have created a backup of that .key file but after few days i formatted my Android and after placing it back to its folder my sdcard is still not working. i mean my sdcard is fully readed by my android device and i can write on it to but my old files are not showing but they are in sdcard because my stotage info is proving it.
Click to expand...
Click to collapse
maybe try to copy your data using a linux distro like mint just to be safe then see if you can find the files or not

Is it possible to perform the decryption on a guest Ubuntu virtual machine (windows as a host) ? I followed a tutorial on how to link my sdcard onto the virtual machine, but I cannot seem to mount it in Ubuntu I get a "wrong fs type, bad option, bad superblock on /dev/sdb2" error, any help ?

Hi @POQDavid , I ve done the procedure, I can access the files and everything, but my question is, how do I format the sd to make it standard again?

fanfzero said:
Hi @POQDavid , I ve done the procedure, I can access the files and everything, but my question is, how do I format the sd to make it standard again?
Click to expand...
Click to collapse
You should be able to either simply format the card or use the phone to restore it

Related

recovery mode not working

Ok, so I was trying to reflash the modified rc30 update to start from scratch because when trying to do the auto rotate browser tweak I kept getting the not enough space message. I rebooted into recovery mode thinking all I had to do was run the update and it didn't do it. I thought maybe I needed to reflash the modified recovery image so I did that, but now when I reboot into recovery mode I get the G1 logo and then a blank screen. I tried pushing home+back to restart and get nothing. So I used adb to push the recovery image on the device and I get "no space left on device" Tried doing a factory reset and it hangs up on a blank screen there too. can I just wipe the data partition to fix it then reflash the recovery image to the device? The phone works fine, I just can't do anything with recovery. Can someone help me out here in getting back recovery mode? Thanks
When you tried to push the recovery image, did you do so to the sdcard?
I am referencing these pages:
http://android-dls.com/wiki/index.php?title=Keeping_Root
http://code.google.com/android/reference/adb.html
Just remount /system as rw and adb push the recovery.img directly in. Also, if you have the engineering bootloader installed, you could try using fastboot to reflash the recovery partition from the bootloader.
doesn't mount -o remount,rw /dev/block/mtdblock3 /system remount the system as rw? That's what i've been doing, and still says device full. I went in and tried by putting the file on the sd card and then flashing it but get the same message. I don't have the engineering bootloader yet that was next on my list. Is there a way to see what is on my partition so I can remove things to free up space?
jdwme said:
doesn't mount -o remount,rw /dev/block/mtdblock3 /system remount the system as rw? That's what i've been doing, and still says device full. I went in and tried by putting the file on the sd card and then flashing it but get the same message. I don't have the engineering bootloader yet that was next on my list. Is there a way to see what is on my partition so I can remove things to free up space?
Click to expand...
Click to collapse
If you're on RC30 v1.2 put the recovery.img in /data not /system
so then my it should look like this?
mount -o remount,rw /dev/block/mtdblock3 /data
cd /data
cat /sdcard/recovery_testkeys.img > recovery.img
flash_image recovery recovery.img
jdwme said:
so then my it should look like this?
mount -o remount,rw /dev/block/mtdblock3 /data
cd /data
cat /sdcard/recovery_testkeys.img > recovery.img
flash_image recovery recovery.img
Click to expand...
Click to collapse
mtd3 is system. mtd5 is userdata. Don't execute that first step! userdata partition is rw anyway. Just start with step 2.
ok, i did execute the first step in the terminal emulator, is that bad? i will try it now starting with just cd /data
jdwme said:
ok, i did execute the first step in the terminal emulator, is that bad? i will try it now starting with just cd /data
Click to expand...
Click to collapse
Not sure. What do you get if you type mount with no args in the terminal emu?
nothing, it just goes to the next line and lets me enter in the next step. is there a way to flash from the standard bootloader?
jdwme said:
nothing, it just goes to the next line and lets me enter in the next step. is there a way to flash from the standard bootloader?
Click to expand...
Click to collapse
Really? What it should do is return a list of mounted devices, like so (this is a Mod RC30 v1.2 device):
Code:
# mount
rootfs on / type rootfs (ro)
tmpfs on /dev type tmpfs (rw,mode=755)
devpts on /dev/pts type devpts (rw,mode=600)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /sqlite_stmt_journals type tmpfs (rw,size=4096k)
/dev/block/mtdblock3 on /system type yaffs2 (ro)
/dev/block/loop0 on /system/modules type cramfs (ro)
/dev/block/loop1 on /system/xbin type cramfs (ro)
/dev/block/mtdblock5 on /data type yaffs2 (rw,nosuid,nodev)
/dev/block/mtdblock4 on /cache type yaffs2 (rw,nosuid,nodev)
/dev/block/mmcblk0p1 on /sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1000,fmask=0711,dmask=0700,codepage=cp437,iocharset=iso8859-1,utf8)
Stock bootloader can't be used to flash images to the mtd partitions.
ok i misunderstood, i did type just mount now and it shows what you posted. could i have two modified recovery images on there and it cant pick one so thats causing the problem?
Did you change directory to /data? If you can't get it to work from the terminal, as long as you have the recovery.img in /data, just power the G1 off completely and power it back on. It automatically writes the recovery partition every time you cold boot.
Btw make sure that in the mount report the following two lines read exactly as such:
Code:
/dev/block/mtdblock3 on /system type yaffs2 (ro)
/dev/block/mtdblock5 on /data type yaffs2 (rw,nosuid,nodev)
yeah the mount report shows just that. i have cold rebooted everytime i tried to flash, then powered off and tried to boot back up in recovery mode and it doesnt work, gives the g1 logo then screen is black.
jdwme said:
yeah the mount report shows just that. i have cold rebooted everytime i tried to flash, then powered off and tried to boot back up in recovery mode and it doesnt work, gives the g1 logo then screen is black.
Click to expand...
Click to collapse
On your cold reboots were you seeing the flashing screen (arrow onto chip) before booting into Android?
nope, only showed that when i was able to upgrade to modified rc 30 or run the update in recovery mode
jdwme said:
nope, only showed that when i was able to upgrade to modified rc 30 or run the update in recovery mode
Click to expand...
Click to collapse
Are you sure you have the recovery.img in the /data directory? Strange. Maybe someone else has some ideas about whats going on here?
So I decided to show all my partitions listed on the system using cat
/proc/partitions and this is what I got. Does this look normal? Not sure
what it looks like on anyone else device
major minor #blocks name
7 0 2248 loop0
7 1 3176 loop1
31 0 256 mtdblock0
31 1 5120 mtdblock1
31 2 2560 mtdblock2
31 3 69120 mtdblock3
31 4 69120 mtdblock4
31 5 76544 mtdblock5
179 0 7977472 mmcblk0
179 1 7973376 mmcblk0p1
I pushed it to the data directory before, followed the instruction thread, but using oi file manager recovery.omg shows in system, nothing shows in data
so does anyone have any ideas? I was thinking about going back to rc29 to try and fix this but without being able to get recovery mode to come on I can't do it, I also can't flash over to the dev boot loader
jdwme said:
so does anyone have any ideas? I was thinking about going back to rc29 to try and fix this but without being able to get recovery mode to come on I can't do it, I also can't flash over to the dev boot loader
Click to expand...
Click to collapse
Give me an IM if you want. I may be able to help fix your recovery mode. (debugging things like that is such a pain on a forum. real-time is much easier)

[Q] How to fix /mnt/extSdCard hassles on my GT2?

I recently purchased a large (32G) sdcard for my Galaxy Tab 2 (10.1), so I can have a lot of extra storage for certain apps.
However, the external sdcard is named /mnt/extSdCard, while /mnt/sdcard points to a smaller, internal (non-swappable) sdcard that comes with my tablet. I discovered that a whole slew of apps have been hard-coded to only access /mnt/sdcard as the "external sd card" without the ability to point to any other location, and this cripples my ability to use /mnt/extSdCard as extra-huge storage for some of these apps.
I've rooted my GT2, so my first thought about how to fix this was to go into a terminal as root and make a symlink from /mnt/extSdCard to some subdirectory of /mnt/sdcard. This would allow all those apps to at least see the contents of the swappable sdcard when they access /mnt/sdcard. However, /mnt/sdcard and /mnt/extSdCard are both FAT32 filesystems on which symlinks are not supported.
So I thought of another idea, but before I dive in and possibly screw up my GT2 beyond repair, I want to bounce it by you folks here, to see what you think about the feasibility of the following procedure ...
Step 1: back up /mnt/sdcard onto my desktop computer.
Step 2: back up /mnt/extSdCard onto my desktop computer.
Step 3: in the directory on my computer where I backed up /mnt/sdcard, copy the entire /mnt/extSdCard contents to a subdirectory called "ext". The full path name would then be /mnt/sdcard/ext, and this subdirectory would contain the entire contents of /mnt/extSdCard.
Step 4: using adb, or a terminal on my tablet running "su", or something like RootExplorer, change the contents of /etc/fstab (or whatever that file is called under Android), so that the former mount point for /mnt/sdcard is now called /mnt/extra, and so that the former mount point for /mnt/extSdCard is now called /mnt/sdcard. In other words, the new mount point for the swappable card will be /mnt/sdcard, and the new mount point for the internal card will be /mnt/extra.
Step 5: clear out all of /mnt/sdcard
Step 6: clear out all of /mnt/extSdCard
Step 7: run the following commands as root (or whatever similar commands correspond under Android) ...
umount /mnt/sdcard
umount /mnt/extSdCard
mount -av​
The third command (or its Android equivalent) should perform all the mounts in /etc/fstab so that my renamed mounts will go into effect.
Step 8: restore the backed up /mnt/sdcard contents from my desktop computer to the tablet's new /mnt/sdcard filesystem (including that new "ext" subdirectory)
Step 9: restart my tablet
(or perhaps change the order of some of these steps)
If all this works, /mnt/sdcard should now be the large swappable card containing the original internal sdcard contents plus that "ext" subdirectory with the original contents of "extSdCard". Also, /mnt/extra should be the empty internal sdcard, which I can use for whatever I want. Now, all those apps that are hard coded to look at /mnt/sdcard should see my large, swappable sdcard.
Aside from the differences between the commands I gave above (standard Unix/Linux) and the Andoid versions of those commands, do you folks think this general procedure will work on my GT2?
Thanks in advance.
.​
Another thought: back up /mnt/sdcard and /mnt/extSdCard and then reformat each of them to be ext3 or something similar. Then, restore /mnt/sdcard and /mnt/extSdCard to the ext3 filesystems and issue the following command under "su" in a terminal window:
ln -s /mnt/extSdCard /mnt/sdcard/ext​
If this works, it's a much simpler way to make /mnt/sdcard/ext accessible to all apps which can see /mnt/sdcard.
All I'd have to do is figure out how to reformat both sdcards as ext3. I guess I can find a tutorial for that somewhere.
Do you folks think this will work on my GT2? In other words, can you think of any reason why my GT2 might break if /mnt/sdcard or /mnt/extSdCard are ext3 instead of FAT32?
Thanks.
... or maybe this alternative?
Make an empty subdirectory called "ext" under /mnt/sdcard. In other words, it will be /mnt/sdcard/ext.
Then, somehow set up a mount in /etc/fstab (or whatever corresponds to that in Android) to mount the /mnt/extSdCard device to /mnt/sdcard/ext, instead.
Thoughts?
(Note that if this was my linux box at home, I'd just try all of these things and see what works. But I'm afraid to screw around this way with my Android device without first running these ideas past people who are more experienced with that OS than I am.)
Thanks.
That really sounds like it would work. I don't see why it wouldn't.
I think I'll go cat that fstab.
Edit: no such file ..
[email protected] / $ su
cat /etc/fstab
/etc/fstab: No such file or directory
mount
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/platform/omap/omap_hsmmc.1/by-name/FACTORYFS /system ext4 ro,relatime,barrier=1,data=ordered 0 0
/dev/block/platform/omap/omap_hsmmc.1/by-name/DATAFS /data ext4 rw,nosuid,nodev,noatime,barrier=1,data=ordered,noauto_da_alloc,discard 0 0
/dev/block/platform/omap/omap_hsmmc.1/by-name/CACHE /cache ext4 rw,nosuid,nodev,noatime,errors=panic,barrier=1,nomblk_io_submit,data=ordered 0 0
/dev/block/platform/omap/omap_hsmmc.1/by-name/EFS /efs ext4 rw,relatime,barrier=1,data=ordered 0 0
/sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0
/dev/fuse /mnt/sdcard fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/block/vold/179:25 /mnt/extSdCard vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
You could use directory bind, i use it for some game directories
http://forum.xda-developers.com/showthread.php?t=1410262
stranxk said:
You could use directory bind, i use it for some game directories
http://forum.xda-developers.com/showthread.php?t=1410262
Click to expand...
Click to collapse
Thanks!
I tried DirectoryBind, and it looks like in principle, it should do what I want. However, I have a couple issues with it. I discuss those issues in that thread.
.​
Thanks to scottx.
Based on your encouraging message, I want to try the procedure I outlined.
So now, I have a few questions that are more specific.
My questions relate to these particular mounts:
/dev/fuse /mnt/sdcard fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=102 3,default_permissions,allow_other 0 0
/dev/block/vold/179:25 /mnt/extSdCard vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
Where are the /mnt/sdcard and /mnt/extSdCard mounts defined in ICS on my GT2, given that there is no /etc/fstab file?
I saw an /etc/vold.fstab file with a definition of the /mnt/extSdCard mount, but it uses a different syntax from what I'm accustomed to seeing in /etc/fstab, and the device name and the parameters differ from the mount info that is shown above for /mnt/extSdCard. Is /etc/vold.fstab the place where I have to specify this mount? If so, how do I relate its syntax to the mount info above?
The /mnt/sdcard mount is not defined in /etc/vold.fstab. Where is this mount defined?
I notice that /mnt/sdcard is mounted from a device called /dev/fuse. If I find the definition of the /mnt/sdcard mount and change the directory name to /mnt/extra like I described above, will that break anything? In other words, are there dependencies during startup that require the /dev/fuse device to be mounted to something whose exact name is "/mnt/sdcard"?
Likewise, if I mount /dev/fuse as /mnt/extra and then change whatever currently defines the mount for /mnt/extSdCard to create it as /mnt/sdcard, will _that_ break anything? ... possibly because of some kind of timing or ordering considerations during the boot-up procedure that relate to the creation and existence of /mnt/sdcard?
Again, I know that I could investigate all this empirically (once I find out where these mounts are defined), but I don't want to do that blindly, in case one of the tests I run ends up rendering my tablet unbootable.
That's why I'm asking these questions here. My sincere thanks for any help that is offered.
.​
HippoMan said:
Thanks!
I tried DirectoryBind, and it looks like in principle, it should do what I want. However, I have a couple issues with it. I discuss those issues in that thread.
.​
Click to expand...
Click to collapse
Check that topic
Thanks. Yes, I saw your message in that topic, and you indeed described the fix to the problem I was having.
And now, I can use DirectoryBind, and that alleviates the need for my complicated manual mount procedure. It provides the exact functionality that I need.
Well, I am having problems with DirectoryBind. I have left a message in the DirectoryBind thread which addresses those issues, and now, I'm back here to continue with my own external sdcard remounting efforts.
For the purpose of this effort, I'll repeat the questions that I asked above ...
My questions relate to these particular mounts:
/dev/fuse /mnt/sdcard fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/block/vold/179:25 /mnt/extSdCard vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
There is no /etc/fstab file in ICS on my GT2, so where are the /mnt/sdcard and /mnt/extSdCard mounts defined in this OS?
I saw an /etc/vold.fstab file with a definition of the /mnt/extSdCard mount, but it uses a different syntax from what I'm accustomed to seeing in /etc/fstab, and the device name and the parameters differ from the mount info that is shown above for /mnt/extSdCard. Is /etc/vold.fstab the place where I have to specify this mount? If so, how do I relate its syntax to the mount info above?
The /mnt/sdcard mount is not defined in /etc/vold.fstab. Where is this mount defined?
I notice that /mnt/sdcard is mounted from a device called /dev/fuse. If I find the definition of the /mnt/sdcard mount and change the directory name to /mnt/extra like I described above, will that break anything? In other words, are there dependencies during startup that require the /dev/fuse device to be mounted to something whose exact name is "/mnt/sdcard"?
Likewise, if I mount /dev/fuse as /mnt/extra and then change whatever currently defines the mount for /mnt/extSdCard to create it as /mnt/sdcard, will _that_ break anything? ... possibly because of some kind of timing or ordering considerations during the boot-up procedure that relate to the creation and existence of /mnt/sdcard?
Click to expand...
Click to collapse
Thanks in advance for any insights and suggestions.
.​
OK. I think I finally got everything working using the DirectoryBind app, so none of this complicated stuff is necessary, after all.
Check this post and other info within its containing thread:
http://forum.xda-developers.com/showpost.php?p=27603811&postcount=297
In that post, go down to the part which starts with these words: "OK. It does indeed work" ...
.​
I still don't understand the part where all of this allows a user to move apps to an sd card. I followed the instructions and used directorybind to mount my sd card to /sdcard/sdcard_ext and still can't move apps to sd. Maybe I'm missing something?
I think there's a setting somewhere that allows apps to be moved to the sdcard... in Market settings maybe... I think Titanium Backup can also do it.
This app will not let you move apps to sd aka a2sdgui, link2sd, s2e, etc.. this app is not for that purpose.
This app will let you have some files/folders in the external sd and make the phone think they are in the internal SD aka sdcard (even root browsers will show the files in external and internal SD)
Sent from my GT-P3113 using xda app-developers app

How to know and check in what file system the /data partition is formatted ?

Hi !
So...that's my questition. My phone is SGS and i want to check in what file system the /data partition is formatted. Is there any way to do it ?
Thanks in advance, guys !
Open a shell (either install a terminal app or connect via USB and run "adb shell" on your computer) and run the command "mount". This will give you a list of all mounted filesystems. Look for the one mounted to /data.
For example, for my I9505, it reads:
Code:
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 rw,seclabel,nosuid,nodev,noatime,journal_checksum,journal_async_commit,noauto_da_alloc,data=ordered 0 0
This means my /data is an Ext4 partition.
Open the terminal and run the command
Code:
mount
you will see how and where all partitions are mounted.
For data partition, in my phone, it shows up
Code:
/dev/block/mmcblk0p9 /data ext4 rw,nosuid,nodev,relatime,barrier=1,data=ordered 0 0
that means /data is mounted as ext4

Need help setting Ext4 or F2FS on external SD card

Hi everyone;
I want to use Ext4 or F2FS for my SD card, so restarted to my recovery and formated my memory using F2FS first then ext4, the problem is i cant write to it from my phone (maybe any file system that have User-Group-Other permissions), ntfs and exfat are fine though, i check permission with a terminal (with root privileges) and it seems that write access is exclusive to root only on my SD card, i tried then to make a folder and give it 777 permission with ownership to "everybody" but it wont work (pls see the attached image).
I thought that it might be mounted as read only by default but i don't think so,
Code:
#mount | grep /storage/6188bd7f-8755-4867-9c09-dff9a5109d20
/dev/block/vold/public:179,65 on /mnt/media_rw/6188bd7f-8755-4867-9c09-dff9a5109d20 type ext4 (rw,dirsync,context=u:object_r:sdcard_posix:s0,nosuid,nodev,noatime,data=ordered)
/mnt/media_rw/6188bd7f-8755-4867-9c09-dff9a5109d20 on /mnt/runtime/default/6188bd7f-8755-4867-9c09-dff9a5109d20 type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,mask=6)
/mnt/media_rw/6188bd7f-8755-4867-9c09-dff9a5109d20 on /mnt/runtime/read/6188bd7f-8755-4867-9c09-dff9a5109d20 type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,mask=18)
/mnt/media_rw/6188bd7f-8755-4867-9c09-dff9a5109d20 on /mnt/runtime/write/6188bd7f-8755-4867-9c09-dff9a5109d20 type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,mask=18)
/mnt/media_rw/6188bd7f-8755-4867-9c09-dff9a5109d20 on /mnt/runtime/full/6188bd7f-8755-4867-9c09-dff9a5109d20 type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,mask=7)
/mnt/media_rw/6188bd7f-8755-4867-9c09-dff9a5109d20 on /storage/6188bd7f-8755-4867-9c09-dff9a5109d20 type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,mask=18)
It must be some other parameters that prevent RW access to external SD card with ext4 or F2FS, can someone please help set it correctly, i also have this problem with other phones/ROMs, so i think it is related to android.
Phone: Xiaomi redmi note 7 [Lavender]
ROM: Havoc-OS-v3.4-20200422 Official (Android 10)
Magisk: 20.4
Recovery: OrangeFox R10.1_01 Stable
Do you solve it sir

Guide to Treble/GSI on the Palm Phone

From this thread: https://forum.xda-developers.com/pr...velopment/aosp-10-0-quack-phh-treble-t3992559, the TrebleCheck app indicates we need an arm64 "a-only" ROM. The Palm Phone is running vendor version 8.1.
Step 1: Download Sugar. This thread: https://forum.xda-developers.com/android/general/release-root-palm-phone-t4021201, has everything you need to know about Sugar. I ran the upgrade once to download the full stock ROM (make a backup as described). Warning, this erases all of your data.
Step 2: Follow this guide: https://forum.xda-developers.com/android/general/guide-porting-twrp-source-t3843473, to build a TWRP for the Palm Phone without source. I used the latest TWRP for the Asus Nexus 7 2013 LTE as my base. From your Palm upgrade backup, the recovery image is the one that starts with 'R', about 36MB. Rename your new TWRP image to match the stock recovery and replace it similar to the rooting guide for replacing the boot image.
Update: snoopy20 has shared his TWRP image here: https://forum.xda-developers.com/showpost.php?p=82654073&postcount=26
Step 3: Extract the system image you downloaded and rename and replace the stock system image. It's the largest file in your Sugar device folder.
Step 4: Re-run the upgrade in Sugar with your replaced images in place.
Step 5: You're probably stuck in a boot loop. Press and hold the power button until you get into recovery, which is now TWRP. First, I formatted data. Then push or otherwise copy this zip to the device: https://forum.xda-developers.com/android/software/universal-dm-verity-forceencrypt-t3817389 and install it from TWRP. The stock configuration should be fine, i.e. don't worry about re-naming the zip. Note, do NOT use adb sideload, since that seems to wreck the zip installer's ability to use its own file name to configure itself.
Update: The Universal dm-verity zip may not always work, in particular on AOSP Android 10 images. In this case, you can use another Android device and Magisk Manager to patch the Palm boot image. Push the boot image from your Palm backup (described in Step 1) to the other Android device. It's the mbn file that starts with 'B'. I chose to rename it to boot.img for easier use. Than use Magisk Manager to patch it. Push the modified boot image back to the Palm (in TWRP) and use TWRP to Install->Image it.
Step 6: Reboot! Wipe data and cache for good measure, and you should be set!
All credit goes to the folks from the links above for creating the Treble system image, TWRP guide, and dm-verity script. Thanks to snoopy20 for his TWRP image.
Things that work so far:
* Almost everything
Doesn't work
* Soft key requires an app, such as Key Mapper, to use
* Screen auto brightness is missing
Can you post the TWRP you created?
snoopy20 said:
Can you post the TWRP you created?
Click to expand...
Click to collapse
Is it kosher to publicly post a TWRP created like this (i.e. not from source)?
Additionally, I'm not entirely confident I didn't screw something up, so I'm a little wary to risk everyone's device. Specifically, I do not know what would happen if you get caught in a boot loop and don't have a functioning recovery to boot into in order to restore...
Yeah you just write "Unofficial" or something in the title. Right now I'm happy to brick the Palm, I'm 99% of the way to dropping it but it would be fantastic if I can get a stock Android on it.
By the way do the restrictions, i.e wifi tethering, get applied by the Vendor package?
snoopy20 said:
Yeah you just write "Unofficial" or something in the title. Right now I'm happy to brick the Palm, I'm 99% of the way to dropping it but it would be fantastic if I can get a stock Android on it.
By the way do the restrictions, i.e wifi tethering, get applied by the Vendor package?
Click to expand...
Click to collapse
Hard for me to test since I don't have a supported SIM, but the tethering menu is available in Settings. You'll have to try it and let us know.
If you post the TWRP I'll do so. My biggest concern is if I **** up building it. I sent you a PM.
snoopy20 said:
If you post the TWRP I'll do so. My biggest concern is if I **** up building it. I sent you a PM.
Click to expand...
Click to collapse
Just waiting for android file host to approve
I've attempted to repack but found:
1. Two fstab files are fstab.qcom and fstab.grouper, don't know if I should delete them but instructions seem to indicate I should.
2. Stock ramdisk folder doesn't have a fstab.* file to copy over.
I ended up with this twrp.fstab. Note the encryption part from /data is gone? Unsure if this is ok.
# mount point fstype device
#twrp.fstab
/system ext4 /dev/block/bootdevice/by-name/system
/cache ext4 /dev/block/bootdevice/by-name/cache
/data ext4 /dev/block/bootdevice/by-name/userdata
/misc emmc /dev/block/bootdevice/by-name/misc
/boot emmc /dev/block/bootdevice/by-name/boot
/recovery emmc /dev/block/bootdevice/by-name/recovery
/external_sd vfat /dev/block/mmcblk1p1 flags=removable;storage;display="SDCARD"
/usb-otg auto /dev/block/sda1 flags=removable;storage;display="USB-OTG"
Just a big heads up, when trying to connect to the network today (Visible) I noticed that my IMEI was 0000.... I have never successfully connected the Palm phone and while the behavior now is consistent with my issues before, I can't say whether or not flashing the GSI as outlined here erased my IMEI.
Proceed with caution.
I'm not proceeding at all unless you post your twrp or verify the issues I've had creating it.
I read the IMEI is held on another partition, type 'efs'. I can't see Sugar killing it. More likely your fstab options aren't mounting it.
---------- Post added at 06:57 PM ---------- Previous post was at 06:33 PM ----------
Here is a list of all the mountpoints on a working phone. At a guess the IMEI is held in /firmware. Do you have this mounted?
rootfs on / type rootfs (ro,seclabel,size=1358776k,nr_inodes=339694)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=1439668k,nr_inodes=359917,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime,gid=3009,hidepid=2)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
/dev/block/mmcblk0p27 on /system type ext4 (ro,seclabel,relatime,discard,data=ordered)
/dev/block/mmcblk0p28 on /vendor type ext4 (ro,seclabel,relatime,discard,data=ordered)
none on /acct type cgroup (rw,relatime,cpuacct)
debugfs on /sys/kernel/debug type debugfs (rw,seclabel,relatime)
tmpfs on /mnt type tmpfs (rw,seclabel,relatime,size=1439668k,nr_inodes=359917,mode=755,gid=1000)
none on /config type configfs (rw,relatime)
none on /dev/cpuctl type cgroup (rw,relatime,cpu)
pstore on /sys/fs/pstore type pstore (rw,seclabel,relatime)
/dev/block/mmcblk0p52 on /fotadata type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered)
/dev/block/mmcblk0p29 on /cache type ext4 (rw,seclabel,nosuid,nodev,noatime,data=ordered)
/dev/block/mmcblk0p12 on /dsp type ext4 (ro,seclabel,nosuid,nodev,relatime,data=ordered)
/dev/block/mmcblk0p1 on /firmware type vfat (ro,context=ubject_r:firmware_file:s0,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro)
/dev/block/mmcblk0p30 on /persist type ext4 (rw,seclabel,nosuid,nodev,noatime,data=ordered)
tmpfs on /storage type tmpfs (rw,seclabel,relatime,size=1439668k,nr_inodes=359917,mode=755,gid=1000)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,seclabel,relatime)
tmpfs on /sbin type tmpfs (rw,seclabel,relatime,size=1439668k,nr_inodes=359917,mode=755)
/sbin/.magisk/block/persist on /sbin/.magisk/mirror/persist type ext4 (rw,seclabel,relatime,data=ordered)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
/dev/block/dm-0 on /data type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,resuid=10010,data=ordered)
/sbin/.magisk/block/system on /sbin/.magisk/mirror/system type ext4 (ro,seclabel,relatime,discard,data=ordered)
/sbin/.magisk/block/vendor on /sbin/.magisk/mirror/vendor type ext4 (ro,seclabel,relatime,discard,data=ordered)
/sbin/.magisk/block/data on /sbin/.magisk/mirror/data type ext4 (rw,seclabel,relatime,discard,noauto_da_alloc,resuid=10010,data=ordered)
/data/media on /mnt/runtime/default/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid)
/data/media on /storage/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid)
/data/media on /mnt/runtime/read/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=23,derive_gid)
/data/media on /mnt/runtime/write/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid)
The original firmware recovery has the /firmware mounted as the sdcard so depending on how you mounted for twrp could you have wiped it?
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait,verify
/dev/block/bootdevice/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1,data=ordered wait,check
/dev/block/bootdevice/by-name/fotadata /fotadata ext4 noatime,nosuid,nodev,barrier=1,data=ordered wait,check
/dev/block/bootdevice/by-name/vendor /vendor ext4 ro,barrier=1 wait,verify
/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc wait,check
/dev/block/mmcblk0p1 /sdcard vfat nosuid,nodev wait
/dev/block/bootdevice/by-name/boot /boot emmc defaults defaults
/dev/block/bootdevice/by-name/recovery /recovery emmc defaults defaults
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/dev/block/bootdevice/by-name/fsg /fsg emmc defaults defaults
Added my TWRP to the OP
OK I've compared and I can't see anything major. The only thing you do have is a few more mount points which I've not had in mine (listed). Where are they from? I think mounting the sdcard (modem firmware) is a bad idea so I'm going to skip that.
/sbl1 emmc /dev/block/bootdevice/by-name/sbl1
#/sbl2 emmc /dev/block/bootdevice/by-name/sbl2
#/sbl3 emmc /dev/block/bootdevice/by-name/sbl3
/tz emmc /dev/block/bootdevice/by-name/tz
/rpm emmc /dev/block/bootdevice/by-name/rpm
/aboot emmc /dev/block/bootdevice/by-name/aboot
#/sbl2b emmc /dev/block/bootdevice/by-name/sbl2b
#/sbl3b emmc /dev/block/bootdevice/by-name/sbl3b
#/tzb emmc /dev/block/bootdevice/by-name/tzb
#/rpmb emmc /dev/block/bootdevice/by-name/rpmb
#/abootb emmc /dev/block/bootdevice/by-name/abootb
#/usb-otg vfat /dev/block/sda1 /dev/block/sda flags=removable;storage;display=USB-OTG
/external_sd vfat /dev/block/mmcblk0p1
/usb-otg auto /dev/block/sda1
So, I have twrp installed, and a fast bootloop almost instantly on start. I haven't been able to solve it thus far. I can get into twrp which is something though.
snoopy20 said:
OK I've compared and I can't see anything major. The only thing you do have is a few more mount points which I've not had in mine (listed). Where are they from? I think mounting the sdcard (modem firmware) is a bad idea so I'm going to skip that.
/sbl1 emmc /dev/block/bootdevice/by-name/sbl1
#/sbl2 emmc /dev/block/bootdevice/by-name/sbl2
#/sbl3 emmc /dev/block/bootdevice/by-name/sbl3
/tz emmc /dev/block/bootdevice/by-name/tz
/rpm emmc /dev/block/bootdevice/by-name/rpm
/aboot emmc /dev/block/bootdevice/by-name/aboot
#/sbl2b emmc /dev/block/bootdevice/by-name/sbl2b
#/sbl3b emmc /dev/block/bootdevice/by-name/sbl3b
#/tzb emmc /dev/block/bootdevice/by-name/tzb
#/rpmb emmc /dev/block/bootdevice/by-name/rpmb
#/abootb emmc /dev/block/bootdevice/by-name/abootb
#/usb-otg vfat /dev/block/sda1 /dev/block/sda flags=removable;storage;display=USB-OTG
/external_sd vfat /dev/block/mmcblk0p1
/usb-otg auto /dev/block/sda1
Click to expand...
Click to collapse
I think the guide for porting TWRP mentioned to add it, so I did.
snoopy20 said:
So, I have twrp installed, and a fast bootloop almost instantly on start. I haven't been able to solve it thus far. I can get into twrp which is something though.
Click to expand...
Click to collapse
Sounds similar to me. Did you flash the new system as well? If so, this is when you use TWRP to flash the zip to disable dm-verity.
I did, then the dm-verity but with no success. Assuming /system was corrupt or wrong I've deleted it. I'm now trying to work out how to flash the system.img without fastboot (which I don't have).
So far dd is ending up with a corrupt partition and twrp insists on a zip for system flash. Trying to figure out how to convert it.
---------- Post added at 09:44 PM ---------- Previous post was at 09:26 PM ----------
I did, then the dm-verity but with no success. Assuming /system was corrupt or wrong I've deleted it. I'm now trying to work out how to flash the system.img without fastboot (which I don't have).
So far dd is ending up with a corrupt partition and twrp insists on a zip for system flash. Trying to figure out how to convert it.
Actually you said you tried 10 unsuccessfully, so how did you then flash the v8 image?
snoopy20 said:
So far dd is ending up with a corrupt partition and twrp insists on a zip for system flash. Trying to figure out how to convert it.
Click to expand...
Click to collapse
TWRP doesn't say "Install Image" at the bottom when you go to Install?
Actually you said you tried 10 unsuccessfully, so how did you then flash the v8 image?
Click to expand...
Click to collapse
I'm assuming the 2nd link down in OP (github).
This is exciting!
Anytime I got stuck, from TWRP I used
Code:
adb reboot edl
then I used Sugar to reflash everything all over again.
Phew, I didn't know about that one. I'll try again.
You can't flash an img from TWRP, there's no boot partition to enter fastboot mode.
I'd originally downloaded the nogapps without su and added Magisk.zip after, this caused an instant bootloop. The one with build in gapps+su works. It's possible to disable all gapps and related services except GoogleOne (I installed OpenLauncher into /system/app then removed GoogleOne by force). After this "Google" can be removed and all notifications about Google Services end.
I recommend you take down the twrp and remove the line which mounts the firmware partition as sdcard in case this is what wiped your IMEI. I build my own without this line and IMEI survived.
Tested
Wifi hotspot is working!
Bluetooth, camera, all USB,
Stability
Not working
Thee dots button (don't think it's a big deal as you get the three icons for back etc by default).
Auto screen brightness

Categories

Resources