Secure delete for S3 - Galaxy S III General (US Carriers)

I want to be able to securely delete files(overwrite the whole file at least once) on my s3. I tried to install the app undelete which also has an option to securely delete files. But when I start the app it complains about not finding any fat formated file system. I also tried shredroid but this program crashes on startup, maybe because it also expects a fat file system? So is there a working way to secure delete files on the s3? It doesn't have to be an app, if there is some linux utility like srm compiled for android that would be great.

There's an app called Secure Deletion for Android in the Play Store that should do what you need. No free version, though, and it only has one review and 50+ downloads. FWIW, the single review was 5 stars. I'm gonna keep looking because I would like the same thing.

From what I can tell, stuff like that wont work on our devices' internal memory due to the method samsung has used to grant access to the partitions. Undelete never worked on my Xoom because of the same issue, possibly due to the fact both devices utilize MTP. However, it should work on any external SD cards you may have, however that is just me speculating as I have not tried it.
Sent from my SAMSUNG-SGH-I747 using xda premium

d3athsd00r said:
From what I can tell, stuff like that wont work on our devices' internal memory due to the method samsung has used to grant access to the partitions. Undelete never worked on my Xoom because of the same issue, possibly due to the fact both devices utilize MTP. However, it should work on any external SD cards you may have, however that is just me speculating as I have not tried it.
Sent from my SAMSUNG-SGH-I747 using xda premium
Click to expand...
Click to collapse
Now that you mention it, the internal storage is mounted as a FUSE filesystem, not the expected ext3/4, so it's probably because it's a "fake" filesystem. I wonder if there is a way to access the raw physical filesystem (/data is ext4, which should be compatible with most secure delete apps) instead of the userspace filesystem.

EndlessDissent said:
Now that you mention it, the internal storage is mounted as a FUSE filesystem, not the expected ext3/4, so it's probably because it's a "fake" filesystem. I wonder if there is a way to access the raw physical filesystem (/data is ext4, which should be compatible with most secure delete apps) instead of the userspace filesystem.
Click to expand...
Click to collapse
Thank you. Couldn't remember what it is called. But that is exactly the reason it can't find it with the app. Also, if journaling is enabled, then a secure delete still wont work on ext3/4. This isn't a bug, its due to the way ext with journaling handles reads/writes.
Sent from my SAMSUNG-SGH-I747 using xda premium

Anyone know why it's mounted via fuse? The same files are also available via /data/media and /data is mounted as ext4. Maybe it would be possible to unmount the fuse filesystem, remount the data filesystem as ext2 (no journaling) and then run some secure delete program?

octapod said:
Anyone know why it's mounted via fuse? The same files are also available via /data/media and /data is mounted as ext4. Maybe it would be possible to unmount the fuse filesystem, remount the data filesystem as ext2 (no journaling) and then run some secure delete program?
Click to expand...
Click to collapse
It's because of the MTP. If it were mounted as a normal filesystem, you could use USB Mass Storage, but you would lose access to all of your internal storage while it was in UMS mode.
Also, I don't think you can mount one filesystem as another, so mounting ext4 as ext2 will possibly corrupt your data. What you could do is mount the ext4 filesystem with the journal features turned off (which is practically the same as ext2 but better), then secure delete.
The issue for me is, that task seems a lot more involved on a phone/tablet than it is on an actual computer. Not sure if it would even work. And if you want to secure delete every time you delete something, that's a whole lot of effort to go through. Of course, if you want it deleted that badly, it's probably worth it to you.

Related

IDEA: Hacking internal/external sdcard mount paths

Hello.
I'm using the latest aurora and I'd like to discuss an idea I had.
Since the U8800 has plenty internal memory and it's quite fast comparing to an average sd card, it'd be great if we could use the internal memory for the tasks that need "speed" instead of "space".
Running apps from the sd card is the perfect example!
So the idea would be, while keeping the external sdcard mounted on /mnt/sdcard, having /mnt/sdcard/Android/data, for instance, point to the «internal sdcard path»/Android/data.
What do you think would be the best solution:
- hacking the mount points?
- using links?
- other solution?
Any developer or filesystem savvy user can point the advantages or dangers of using this solution?
- e.g.: the system or some apps may check if the external sd-card is mounted before trying to read/write to /mnt/sdcard/Android/data... that would mean the system/those apss may think that path isn't reachable with the ext-sdcard unmounted, altough they can be read.
Suggestions? Rants? Ideas?
Regards!
I have wondered if the /data/app or maybe the whole /data partition could be mounted in the internal storage partition. That would give 2gb space for apps and associated files instead of 3-400 ish and would mean no need to move apps to sd card which would mean faster loads at startup due to internal memory being faster.
VuDuCuRSe said:
Hello.
I'm using the latest aurora and I'd like to discuss an idea I had.
Since the U8800 has plenty internal memory and it's quite fast comparing to an average sd card, it'd be great if we could use the internal memory for the tasks that need "speed" instead of "space".
Running apps from the sd card is the perfect example!
So the idea would be, while keeping the external sdcard mounted on /mnt/sdcard, having /mnt/sdcard/Android/data, for instance, point to the «internal sdcard path»/Android/data.
What do you think would be the best solution:
- hacking the mount points?
- using links?
- other solution?
Any developer or filesystem savvy user can point the advantages or dangers of using this solution?
- e.g.: the system or some apps may check if the external sd-card is mounted before trying to read/write to /mnt/sdcard/Android/data... that would mean the system/those apss may think that path isn't reachable with the ext-sdcard unmounted, altough they can be read.
Suggestions? Rants? Ideas?
Regards!
Click to expand...
Click to collapse
Well this is known for a while now . Quoted from my thread here:
vold.fstab - CHANGE THE DEFAULT SDCARD: -thanks to julle131
There is this file named vold.fstab at your /system/etc/ folder, which controls which of your sdcards (Internal/External) will be mounted when you connect your phone to the PC. The last 2 lines are the only that matter. These are the two possibilities:
EXTERNAL SDCARD MOUNTED (DEFAULT):
dev_mount sdcard /mnt/sdcard auto /devices/platform/msm_sdcc.4/mmc_host
dev_mount emmc /mnt/sdcard1 14 /devices/platform/msm_sdcc.2/mmc_host
INTERNAL SDCARD MOUNTED:
dev_mount sdcard /mnt/sdcard 14 /devices/platform/msm_sdcc.2/mmc_host
dev_mount emmc /mnt/sdcard1 auto /devices/platform/msm_sdcc.4/mmc_host
change them as you wish with a root explorer or before flashing.
Click to expand...
Click to collapse
Make this change and every app will use the internal sdcard. Gallery works ok with images to external sdcard, it just might take a while for the first refresh. But I don't know if you'll notice any difference in terms of speed....
Cheers
spirosbond said:
Well this is known for a while now . Quoted from my thread here:
Make this change and every app will use the internal sdcard. Gallery works ok with images to external sdcard, it just might take a while for the first refresh. But I don't know if you'll notice any difference in terms of speed....
Cheers
Click to expand...
Click to collapse
That's not what he talked, I think. He said that the apparel would be installed on the external sd card, but the data would be moved to the internal one. And we have speed, but the main card would be the external one.
I think its a great idea if I understood it right!
Sent from my U8800 using xda premium
mrasquinho said:
That's not what he talked, I think. He said that the apparel would be installed on the external sd card, but the data would be moved to the internal one. And we have speed, but the main card would be the external one.
I think its a great idea if I understood it right!
Sent from my U8800 using xda premium
Click to expand...
Click to collapse
Oh I see! Sorry about that. As far as I know apps are not choosing were to put their data. They just say to the OS "I want these things to be at the sdcard" and the OS puts them at the correct place. So you can't "hack" the app to "see" at somewhere else. On the other hand the OS initialises on boot which card is the primary and which is the secondary. So my knowledge stops there and I can't imagine a way to make this separation between app data and the rest...
I hope for someone else's help!
PaulMilbank said:
I have wondered if the /data/app or maybe the whole /data partition could be mounted in the internal storage partition. That would give 2gb space for apps and associated files instead of 3-400 ish and would mean no need to move apps to sd card which would mean faster loads at startup due to internal memory being faster.
Click to expand...
Click to collapse
Maybe this cannot be done, because I think that the mapping of the partitions and mounts comes from the bootloader, but there is already the solution of resizing the data partition using the space of internal storage.
PaulMilbank said:
I have wondered if the /data/app or maybe the whole /data partition could be mounted in the internal storage partition. That would give 2gb space for apps and associated files instead of 3-400 ish and would mean no need to move apps to sd card which would mean faster loads at startup due to internal memory being faster.
Click to expand...
Click to collapse
That's a great idea!
I almost don't use the so called "internal sd card", therefor I have 2GB of fast empty space being wasted.
Why not simply mounting the internal sd-card partition in the data folder and the data partition on the internal sd card folder?
I only use the internal sd card to hold ringtones and other small stuff that I need to be in accessible 100% of the time, so a few hundred MB are enough!
Me gusta!
Every ROM flashes it's own fstab, right?
So all we'd need to do would be, editing the fstab before flashing it.
-----------------
Regarding the my first idea... I don't think one can simply mount a path on another path. We'd need a "virtual" device pointing to /mnt/sdcard-internal/data/ then mount that virtual device on /mnt/sdcard-external/data/.
My knowledge of unix mount/filesystems is not much more than what's explained here: https://help.ubuntu.com/community/Mount
OK, just found this:
http://askubuntu.com/questions/11079/mount-a-directory-to-look-like-a-drive
there is a FUSE filesystem named bindfs that probably does exactly what you want. For example the following:
bindfs -n /media/USB-HDD-01/ISO/ /home/johnc/ISO-images
Click to expand...
Click to collapse
would result in ISO-images to show up as a mounted filesystem in the Places sidepanel in Nautilus. The -n is required because otherwise bindfs tries to use the allow_other FUSE option, which by default is not allowed for regular users (if you use bindfs in /etc/fstab this is not a problem).
The first directory you give is the existing one, the second directory you give is an empty directory under which the contents of the existing one will appear.
Click to expand...
Click to collapse
So, bindfs depends on FUSE... and there's a port of fuse to android: https://github.com/seth-hg/fuse-android but looking at the README I get the feeling that it's not really working. The last step would be having a kernel with FUSE support... and regarding that, I have no idea, how easy it is to get a kernel like that for our U8800 :\
Finding such a solution to expand the DATA partition indirectly would be great!
I used to apply genokolar's custom partition method as "1.2G DATA + 1.46G INTERNAL SD" before, but i found out that it has some issues with Official 2.3 Roms. One of them -the most important IMHO- is the BOOTLOOP problem occurring in some specific situations!!!
See the details in my post here:
http://forum.xda-developers.com/showpost.php?p=25853141&postcount=134
(Seems that I don't encounter the bootloops on Custom Roms, but i'm not %100 sure and never will be )
So i unfortunately gave up using it, and revert to the stock partition .
I will be grateful to the one who will find a better and reliable solution. Hope to see it soon...
I still have to gather more information on the official update "modus operandi".
My goal is to simply reformat both partitions and then swap their mount points.
If the official update formats the partitions before applying the flashing official ROM files, then partitioning changes shouldn't cause any failure on the official update.
But like I said, I'm still yet to confirm that info.
Gen's idea was great (I learned a lot just by looking at his scripts) but resizing partitions has its dangers.
Since "no one" really uses the internal memory, why not simply exchange its room with /data, right?
This would be awesome! I would love to have 2gb for apps, instead of cluttering my phone.. plus the 2gb of internal storage are just a waste for me.. I never use them.. so this would be great!

Important and Read RE: MTP in recovery aka data/media

This is completely pulled off of my other thread in the HOX+ section
our device is a data/media device which is why usb mount don't work
here's a link that explains it all
http://teamw.in/DataMedia
and part of the convo with dees_troy is below
<Dees_Troy> Nope, it will *never* work on a data/media device
<Dees_Troy> read and learn: http://teamw.in/DataMedia
<WinBot> [Link] http://tinyw.in/lstO :: What is a data media device? | TeamWin
<Dees_Troy> definitely worth understanding
<Dees_Troy> at some point we're going to try to kang in MTP for recovery
<Lloir> so for now then it's sideload or from inside the rom
<Dees_Troy> or adb push
<Lloir> aye
<Dees_Troy> or gtfo
<*****> so cant mount usb storage with newer devices...hmm one x did guess this is where confusion at least on my part came to be
<Lloir> lmao Dees_Troy
<Dees_Troy> one x wasn't a data media device
YOU MUST either transfer the rom\boot\porn\audio\mods while the phone is on or use adb push or even sideload when in recovery, THIS IS THE ONLY way
IF you want to read without clicking the link i'll whack it up in #2
What is a data media device?
I'm writing this page because there seems to be a lot of confusion about how many of the newer Android devices work. Starting in Honeycomb 3.0 with the Xoom, Google changed the way that they handled storage. Instead of having a "data" partition with your apps and a separate "sdcard" partition for storage, Google started giving you a single, very large data partition. Inside /data is a folder at /data/media that contains all of the contents of what you think of as your internal sdcard.
Since /data/media is part of /data, we pretty much never actually format the data partition. Formatting data, of course, also removes the media folder that contains the internal sdcard. When you choose a factory reset, instead of formatting, we use rm -rf commands to remove all the folders except for the media folder so that we can remove all of your apps and settings while leaving your "sdcard" intact. In TWRP we also have a wipe internal storage option that rm -rf's the media folder and a "Format Data" option that formats to recreate the entire file system in case something goes completely wrong or to remove device encryption.
When you're booted to Android, Android fuses the media folder to /sdcard and emulates a FAT files system that doesn't have permissions for legacy apps. We don't currently have fuse in recovery, so we just add an extra mount command to mount /data/media to /sdcard so in recovery you still have to worry about permissions on /sdcard.
Because the "internal sdcard" is not a true FAT file system, you can't mount it via USB storage. Well, that's not technically true, but the vast majority of people use Windows computers and Windows doesn't recognize ext4. If we were to allow you to mount the data partition via USB storage, Windows would claim that the device wasn't formatted and offer to format it for you, which, as you can imagine, would be a disaster. The whole ext4 setup is another reason that Android switched to using MTP for transferring files. Most of these devices don't have the necessary kernel configuration to even support USB storage mode, so it's not very easy to enable USB storage if we even wanted to try. Unfortunately at this time, MTP isn't available in recovery, so if you have no other option, you will have to use adb to push and pull files to/from your device.
As a special note, if you choose to do a factory reset from your ROM, even if the ROM says that it will wipe everything including the internal storage, well, that's not what TWRP will do. A stock AOSP recovery would format data including the "sdcard" but TWRP will use its regular factory reset setup that leaves the internal storage intact.
There are a couple of nice gains with using this setup vs the old data + FAT storage partition. With /data/media you, as the user get more control over how you use your storage. If you have a ton of apps, then that's no problem since you have a huge data partition to work with. If you don't have a lot of apps, you get more room to use for storing things like movies. Further, ext4 doesn't suffer from the 4GB file size limit that FAT has, so you can have a large, high-def movie on your device if you like. I'm sure another motivating factor was to get Android away from using FAT which is a Microsoft creation. Performance on ext4 in Android is also probably better than FAT. As a downside, data media devices tend to store a lot more app data in the "data" section and so backups on these devices tend to be larger.
Thank you for this post. I had been a bit curious about this. I have Evo LTE. But I also Boughy a family member a GNex that I have to maintain. I know that my Evo, I can plug into windows, and when I select USB transfer (not in recovery), it mounts my internal storage (not ext_SD) , and it shows as removable drive in windows. But,....when I plug in GNex, it shows up as GNex , not removable drive H. I always wondered a bit about what this all means.
Thanks for the info. :thumbup:
Sent from my EVO using xda premium
Thanks for the useful post.
If I make a nandroid backup for the whole device, will it exclude the /data/media folder? Because on my old phone the nandroid backup doesn't include /sdcard.
romitkin said:
Thanks for the useful post.
If I make a nandroid backup for the whole device, will it exclude the /data/media folder? Because on my old phone the nandroid backup doesn't include /sdcard.
Click to expand...
Click to collapse
Yes it does, we are past the point where that causes issues.
Everyone just needs to get used to the data/media thing. And learn how to use adb side load
I predict a whole bunch of "bricks" due to people not informing themselves on how the phone works and how to use adb
Sent from my One X using Tapatalk 2
A little bit from my side as well I hope someone will find this helpful. Virtual SD card on Android
Can't you use USB Host if you got recovery installed as well? I think I've read that somewhere...
mike1986. said:
A little bit from my side as well I hope someone will find this helpful. Virtual SD card on Android
Click to expand...
Click to collapse
Link broken, here is the correct URL:
http://android-revolution-hd.blogspot.com/2013/03/virtual-sd-card-on-android.html
Oh and bump for anyone new to the idea of a "data/media" device. You're not in Kansas anymore.
NxNW said:
Link broken, here is the correct URL:
http://android-revolution-hd.blogspot.com/2013/03/virtual-sd-card-on-android.html
Oh and bump for anyone new to the idea of a "data/media" device. You're not in Kansas anymore.
Click to expand...
Click to collapse
Lloir, thanks for sharing and good explanation. MTP makes sense and on my One, this way file transfers are simple and fast. However there are two things I dislike about MTP right now:
When you copy files to the device, on some file types it throws a warning that the device might not be able to read the file. This interrupts the file transfer and I have to confirm I want to copy the file to the device. On an older MP3 player I have, I could deactivate this by editing a device capabilities XML file. On the One, I did not find such a file. Perhaps an option in the MTP deamon?
When I am transferring files, I can't browse through other folders at the same time. It says the device is busy.
Is there a way to solve those two issues or "is it what it is"?
Lloir said:
Windows would claim that the device wasn't formatted and offer to format it for you, which, as you can imagine, would be a disaster
Click to expand...
Click to collapse
I did that on a device. Windows offered to format and I did it. Man that was not good! 2 hours later after manually restoring the partition values I was OK and the most amazing thing all my data was there perfect and untouched :silly: :highfive:
Thanks for that great explanation. Been having some issues with windows and android. Nothing big just had to sideload my ROM and killed my "sdcard" at least now I know why

[Q] [PA 3.99] Enable USB mass storage instead of MTP?

Hello,
Is there a way to enable USB Mass Storage on Paranoid Android 3.99? I know it will supposedly prevent the phone from accessing the virtual sdcard partition while plugged to a computer, but this would be a minor annoyance in comparison to the complete pain in the ass that is MTP:
1. Transfers are slow and unreliable (stopping unexpectedly...)
2. It can only perform one task at a time (can't browse folders while copying files for example)
3. Poor implementation on Windows (Explorer keeps asking stupid questions like "are you sure this type of file will be recognized by your device?")
4. Computers with restricted user rights prevent MTP devices from installing.
and so on...
I've tried the following trick:
Code:
su
setprop persist.sys.usb.config mass_storage
reboot
But it didn't work.
Please help. I know it may require a lot of effort but I don't care: MTP is really too much of an annoyance.
No you cannot mount the sdcard as usb mass storage
In order to do that the sdcard has to be it's own fat partition.
On the nexus 4 it is part of the data partition and the folder is fused to the sdcard mount point.
Basically meaning that you can't mount /sdcard because it's not able to be mounted as it's not actually a partition.
And secondly the format is ext4 so even if you could mount it, it would not be readable by Windows
Sent from my Nexus 4 using xda app-developers app
Alex240188 said:
No you cannot mount the sdcard as usb mass storage
In order to do that the sdcard has to be it's own fat partition.
On the nexus 4 it is part of the data partition and the folder is fused to the sdcard mount point.
Basically meaning that you can't mount /sdcard because it's not able to be mounted as it's not actually a partition.
And secondly the format is ext4 so even if you could mount it, it would not be readable by Windows
Click to expand...
Click to collapse
How would Android react if /sdcard was actually a separate FAT32 partition mounted in its usual location?
CutterX said:
How would Android react if /sdcard was actually a separate FAT32 partition mounted in its usual location?
Click to expand...
Click to collapse
According to this article that should work.
http://www.engadget.com/2011/11/21/ice-cream-sandwich-supports-usb-mass-storage-after-all-galaxy-n/
Swyped from my Nexus 4 using Tapatalk 4
CutterX said:
How would Android react if /sdcard was actually a separate FAT32 partition mounted in its usual location?
Click to expand...
Click to collapse
It would work. However doing that is not an easy task.
It would require;
1. Changing the partition table on the phone.
2. Rewriting the bootloader (not 100% sure on this one, but it would be needed to flash any rom from the bootloader (stock)).
3. Rewriting a recovery to support the new partition.
4. Finally making the changes to the rom to support ums mounting.
Sent from my Nexus 4 using xda app-developers app
It looks like this would be something in relatively high demand. So I've been trying to get Android/vold to mount and recognize a vfat image as an sdcard but haven't had any success. It might be easier to work with if I killed off the fuse mount to start, but I'm not really looking to do that right now. Manually mounting the image isn't a problem (busybox mount or using losetup first to establish the loop) but without Android recognizing it, there's no chance of being able to use usb mass storage.
Of course the inherent issue will then be "lost" space with regards to the internal storage, since it'd be dedicated to the "sdcard". It seems most users would be fine with this, setting aside a gig or two.

Mount EXT4 MicroSD Card

I've given up on reformatting the internal memory as EXT4 (my last post). However now, I want to mount an external SD card that is EXT4 (or any file format that has UNIX permissions). I can't get my device to mount the card, it says the filesystem is unsupported. Now, that's bull**** since Android has built in support for EXT. After searching threads here on XDA and Google, and even purchasing EzyMount as recommended, I can't get it to mount. I've tried BusyBox and mount commands (as root), with various errors such as "mount operation not supported on transport endpoint". I'm at my wit's end by now, trying to get some filesystem which has support for symlinks and UNIX permissions... any ideas?
kcattakcaz said:
I've given up on reformatting the internal memory as EXT4 (my last post). However now, I want to mount an external SD card that is EXT4 (or any file format that has UNIX permissions). I can't get my device to mount the card, it says the filesystem is unsupported. Now, that's bull**** since Android has built in support for EXT. After searching threads here on XDA and Google, and even purchasing EzyMount as recommended, I can't get it to mount. I've tried BusyBox and mount commands (as root), with various errors such as "mount operation not supported on transport endpoint". I'm at my wit's end by now, trying to get some filesystem which has support for symlinks and UNIX permissions... any ideas?
Click to expand...
Click to collapse
you fully rooted with custom kernel or only with rdlv etc?
First you gotta figure out how to mount this damn thing, gotta be possible.
Then you need to get this done on bootup, either in init.rc or init.d or smth.
You probably just use wrong commands? But I could be wrong, didnt try that yet but would also be interested. Having the file permissions also on SD would be nice, but it could cause trouble with mtp maybe?
zroice said:
you fully rooted with custom kernel or only with rdlv etc?
First you gotta figure out how to mount this damn thing, gotta be possible.
Then you need to get this done on bootup, either in init.rc or init.d or smth.
You probably just use wrong commands? But I could be wrong, didnt try that yet but would also be interested. Having the file permissions also on SD would be nice, but it could cause trouble with mtp maybe?
Click to expand...
Click to collapse
I am rooted, but stock ROM and kernel. MTP is for connecting to a computer? If it is, I don't need that. I have tried
mount -rw -t ext4 /dev/block/mmcblk1p1 /storage/extStorageCard
and variants switching the flags and options.
Interesting... I just typed that command in to make sure I didn't make any typos.... and my phone crashed and rebooted. I typed it again to see if it would cause another crash and it appears to have mounted the card! Whwn I type "df" at the prompt it now shows a 28.6 GB filesystem at that location, which has to be my sd card.
Why, how, I don't know. It works, it's all I can say.

[A] Regarding Mounting SD Card in TWRP

After a few days of googling, i stumbled upon a thread in Droid DNA forum. Which led me to this answer right from the source on why it's not possible to mount our SD Card or actually, just a folder in /data, in TWRP.
Just wanted to share and hope this will clear things up and hoping that people won't wipe their /data partition since it will delete the SD Card folder as well.
I find this very enlightening so read on.
What is a data media device?
I'm writing this page because there seems to be a lot of confusion about how many of the newer Android devices work. Starting in Honeycomb 3.0 with the Xoom, Google changed the way that they handled storage. Instead of having a "data" partition with your apps and a separate "sdcard" partition for storage, Google started giving you a single, very large data partition. Inside /data is a folder at /data/media that contains all of the contents of what you think of as your internal sdcard.
Since /data/media is part of /data, we pretty much never actually format the data partition. Formatting data, of course, also removes the media folder that contains the internal sdcard. When you choose a factory reset, instead of formatting, we use rm -rf commands to remove all the folders except for the media folder so that we can remove all of your apps and settings while leaving your "sdcard" intact. In TWRP we also have a wipe internal storage option that rm -rf's the media folder and a "Format Data" option that formats to recreate the entire file system in case something goes completely wrong or to remove device encryption.
When you're booted to Android, Android fuses the media folder to /sdcard and emulates a FAT files system that doesn't have permissions for legacy apps. We don't currently have fuse in recovery, so we just add an extra mount command to mount /data/media to /sdcard so in recovery you still have to worry about permissions on /sdcard.
Because the "internal sdcard" is not a true FAT file system, you can't mount it via USB storage. Well, that's not technically true, but the vast majority of people use Windows computers and Windows doesn't recognize ext4. If we were to allow you to mount the data partition via USB storage, Windows would claim that the device wasn't formatted and offer to format it for you, which, as you can imagine, would be a disaster. The whole ext4 setup is another reason that Android switched to using MTP for transferring files. Most of these devices don't have the necessary kernel configuration to even support USB storage mode, so it's not very easy to enable USB storage if we even wanted to try. Unfortunately at this time, MTP isn't available in recovery, so if you have no other option, you will have to use adb to push and pull files to/from your device.
As a special note, if you choose to do a factory reset from your ROM, even if the ROM says that it will wipe everything including the internal storage, well, that's not what TWRP will do. A stock AOSP recovery would format data including the "sdcard" but TWRP will use its regular factory reset setup that leaves the internal storage intact.
There are a couple of nice gains with using this setup vs the old data + FAT storage partition. With /data/media you, as the user get more control over how you use your storage. If you have a ton of apps, then that's no problem since you have a huge data partition to work with. If you don't have a lot of apps, you get more room to use for storing things like movies. Further, ext4 doesn't suffer from the 4GB file size limit that FAT has, so you can have a large, high-def movie on your device if you like. I'm sure another motivating factor was to get Android away from using FAT which is a Microsoft creation. Performance on ext4 in Android is also probably better than FAT. As a downside, data media devices tend to store a lot more app data in the "data" section and so backups on these devices tend to be larger.
Android 4.2 has changed things with /data/media devices a little bit due to the multi-user support that came in 4.2. Each user is assigned a subfolder in /data/media. The main user gets /data/media/0 and subsequent users get /data/media/10 and /data/media/11 and so on. If you switch users in Android 4.2, the system will remount the /sdcard folder to point to the proper user's folder. TWRP has been updated to use the /data/media/0 folder starting in 2.3.2.0.
Another "feature" of 4.2 is that when you "update" to 4.2 it may attempt to upgrade your /data/media to multi-user. If you're running an older version of TWRP than 2.3.2.0 or newer, a factory reset may trigger multiple upgrades, causing your "sdcard" to get moved to /data/media/0 then /data/media/0/0 and then /data/media/0/0/0 and so on depending on how many times you "upgraded". This may cause backups to not be visible in TWRP. Also, there currently isn't a good way to go back to a 4.1 ROM after using a 4.2 ROM without having to manually move your files around.
Click to expand...
Click to collapse
http://teamw.in/DataMedia
I asked them if it's possible to just mount the ext4 partition if Windows users install some apps that can read them. Will see if they're going to answer.
Hope this helps. Cheers.

Categories

Resources