[Q] External SD card encryption - Galaxy S 4 Mini Q&A, Help & Troubleshooting

Hi there,
I'm thinking of encrypting my phone as some important files (like my private key) are stored on it. Getting the internal storage to be encrypted isn't the big deal. My problem is that I can't find an option to encrypt the external SD. Some googling showed me, that it is theoretically possible. But I can't find such a point on my phone.
I'm on CM11 M8 (4.4.4) without any special kernel.
I've read occasionally that encrypted phones will suffer from speed loss. I don't really think that is a problem for my S4 Mini. What do you think? Is it practically or even necessary?
Thanks a lot

hadage said:
My problem is that I can't find an option to encrypt the external SD. Some googling showed me, that it is theoretically possible. But I can't find such a point on my phone.
Click to expand...
Click to collapse
You could use the SD card itself as data partition: http://forum.xda-developers.com/showthread.php?t=2644540 That way you can encrypt the whole SD card using Android stock encryption.
Keep in mind though that currently there is no (publicly known) way to mount an Android encrypted partition on another OS, should you ever wish to use that card e.g. on your PC.
hadage said:
I've read occasionally that encrypted phones will suffer from speed loss. I don't really think that is a problem for my S4 Mini.
Click to expand...
Click to collapse
Flash memory is sooooo slow, I expect the CPU to encrypt faster than that.

Thanks
So am I right, that after doing that "workaround" I'll be having one big internal storage (divided into real internal and fake internal) but no external SD card?
Aguaz said:
For the sake of still having an "official" external sdcard I made two partitions
Click to expand...
Click to collapse
Is there any need to?
Aguaz said:
This partition however has to be manually specified in the ramdisks fstab which involves flashing the boot partition.
Click to expand...
Click to collapse
I'm not sure if I'm understanding it right, but that means that I have to delete my boot partition?

hadage said:
So am I right, that after doing that "workaround" I'll be having one big internal storage (divided into real internal and fake internal)...
Click to expand...
Click to collapse
yes, nothing really changes except that the data partition will then be on the sdcard. The size of it is only limited by the size of your card.
hadage said:
...but no external SD card? Is there any need to?
Click to expand...
Click to collapse
As mentioned in the other thread I still use a small partition on sdcard for the "external" sdcard. Android usually tries to automount the first partition on the sdcard as "external" sdcard. So I chose to have data on the 2nd partition.
I doubt that this really is necessary though. I assume vold will just give up trying to mount "external" sdcard after realizing the partition is already in use.
Generally, I don't think there is a need for an external sdcard.
hadage said:
I'm not sure if I'm understanding it right, but that means that I have to delete my boot partition?
Click to expand...
Click to collapse
You would need to flash a new boot.img onto it, because this image holds the fstab.qcom file, which needs to be edited to change the mount point of the data partition. Unfortunately it's triple packed:
cm-11-UNOFFICIAL-serranodsdd.zip
.....> boot.img
..........> initrd.img
...............> fstab.qcom
So it's not very straight forward, but the forum is full of info on how to do so. Keep in mind that your recovery.img has to be changed the same way in order for it to find the new data partition.
When formatting a data partition to be used for Android encryption, make sure the filesystem doesn't extend into the last 16 Kbytes of the partition where the crypto footer is kept. See https://community.freescale.com/docs/DOC-93753
hadage said:
Thanks
Click to expand...
Click to collapse
Don't say that. Hit the button

Alright, I'll have a look on that. I'm not absolutely sure if I'll be doing this, but thanks anyway. Helped me a lot

It's a bit of effort to set up, but in the long term it'll save you time not having to deal with additional tools. Plus you got ONE big storage instead of data fragmentation across several locations.
Good luck!

aguaz said:
It's a bit of effort to set up, but in the long term it'll save you time not having to deal with additional tools. Plus you got ONE big storage instead of data fragmentation across several locations.
Good luck!
Click to expand...
Click to collapse
@aguaz,
That's some very interesting stuff you are writing about.
Few questions, if you will:
1. You say the fstab.qcom is tripple-packed. But if I use a tool like Android Kitchen or AIK to unpack the boot.img, it appears there's only one layer of packing.
2. why not mount the external SD card just as the /data/media/0/ instead of /data? This way, app-data is still kept on the internal memory, and we get even more free space on SD + faster read/write speeds for app-data.
3. What /dev/ are you using to mount the external?
Can you shed some light on that?
EDIT:
Ad. 1
I guess this is kind of irrelevant as doing it with the tools I'm using seems to work flawlessly.
Ad. 2 and 3.
I did in fact manage to mount the sdcard just as a subfolder /data/media/0/ while leaving all the remaining /data on the internal storage, and from brief testing on an old SD card, it seemed to work fine
Code:
/dev/block/platform/msm_sdcc.3/mmcblk1p1 /data/media/0/ ext4 nosuid,nodev,noatime,noauto_da_alloc,journal_async_commit,errors=panic wait,check,encryptable=footer,length=-16384
Now, the question is how to tune those mount options for a SD card, and how would they change if I was to use F2FS instead of ext4, which would be the ultimate solution.

1) I'm not familiar with the tools you mention, but boot.img consists of both kernel & ramdisk images. The ramdisk image itself contains fstab etc.
Alternatively you could also try an init.d script to change fstab. Those scripts get executed before data and sdcard are mounted.
2) Did you keep the vold entry regarding the external card? If so, does it still get (additionally) mounted as external card?
impactor said:
Now, the question is how to tune those mount options for a SD card, and how would they change if I was to use F2FS instead of ext4.
Click to expand...
Click to collapse
The mount options are usually file system depended. So if file system is the same, you can use the same options as for internal flash partitions. I'd probably only change "errors=panic" into "errors=remount-ro" and remove "length=-16384" (deprecated).
I can't help you with f2fs mount options.
As the original question was about encrypting the card, let me add that stock encryption only works on partitions mounted as /data. So in your case that would not work.

Thanks for the clarification.
I commented out the vold mount, so it does not get automounted. Moreover, I doubt it would mount anyway because AFAIK a device in linux can only be mounted once.
aguaz said:
As the original question was about encrypting the card, let me add that stock encryption only works on partitions mounted as /data. So in your case that would not work.
Click to expand...
Click to collapse
I do want to encrypt my phone, eventually.
Can you elaborate more on why a card mounted under /data/media/0/ would not get encrypted when /data is being encrypted?
Also, what happens to encrypted partition when I install a new ROM? Can it still be mounted (will the rom ask me for password), or is the data lost and device needs to be reencrypted each time new ROM is installed??

impactor said:
Moreover, I doubt it would mount anyway because AFAIK a device in linux can only be mounted once.
Click to expand...
Click to collapse
You can multi mount as long as you specify the same mount options. I imagine it's technically the same as bind mounts.
impactor said:
Can you elaborate more on why a card mounted under /data/media/0/ would not get encrypted when /data is being encrypted?
Click to expand...
Click to collapse
Actually it's not the /data directory tree which gets encrypted, but the whole file system of the underlying partition. Linked locations or external mount points are are not part of that file system, so they are not regarded.
impactor said:
Also, what happens to encrypted partition when I install a new ROM? Can it still be mounted (will the rom ask me for password)
Click to expand...
Click to collapse
Yes, Android checks the data partition for an encryption footer and if found will ask for a password. So as long as you don't wipe/format that partition even a freshly installed ROM is supposed to recognize it.

aguaz said:
Actually it's not the /data directory tree which gets encrypted, but the whole file system of the underlying partition (as referenced by fstab). Linked locations or external mount points are are not part of that file system, so they are not regarded.
Click to expand...
Click to collapse
I see. Are you aware whether it's possible to use cross-device virtual devices (like LVM vgroups or BTRFS raid options) on android?
aguaz said:
Yes, Android checks the data partition for an encryption footer and if found will ask for a password. So as long as you don't wipe/format that partition even a freshly installed ROM is supposed to recognize it.
Click to expand...
Click to collapse
Is it still the case (4.4 CM roms) that if encrypted, the password must be the same as screenlock AND you have to tape it every time you unlock the screen AND the screenlock cannot be pattern?
BTW, what SD card model/spec are you using on your device for mounting as /data?
---------- Post added at 10:13 AM ---------- Previous post was at 09:25 AM ----------
One more thing. The tool I have been using seems to have proglems with boot.img fot KitKat. Where can I find this abootimage, and what options/operators are you using while (de)compressing with gzip, cpio & abootimage?

impactor said:
I see. Are you aware whether it's possible to use cross-device virtual devices (like LVM vgroups or BTRFS raid options) on android?
Click to expand...
Click to collapse
I'm not sure. Android tends to make things complicated, but at the end it's still just Linux.
impactor said:
Is it still the case (4.4 CM roms) that if encrypted, the password must be the same as screenlock AND you have to tape it every time you unlock the screen AND the screenlock cannot be pattern?
Click to expand...
Click to collapse
This is all by memory, but I think I might not be too far off:
- screenlock initially has to be either pin or pwd
- encryption password will be set the same as the current screenlock and cannot be changed once encrypted.
- screenlock however can be changed anytime.
- screenlock can also be completely removed by e.g. removing lock offline or installing a fresh ROM.
You can then choose whatever lock, or skip lock completely doh.
impactor said:
BTW, what SD card model/spec are you using on your device for mounting as /data?
Click to expand...
Click to collapse
I believe I got a Transcend 64GB UHS. But the S4 Minis controller is probably hooked to a slow USB line anyway, so It does not achieve advertised sequencial speeds.

aguaz said:
I'm not sure. Android tends to make things complicated, but at the end it's still just Linux.
Click to expand...
Click to collapse
Tis true, but it is quite gutted to achieve smaller footprint (among other reasons). Which is why, for example, we have so very few filesystems in kernels. I doubt getting LVM support is doable, but BTRFS should be less outlandish, as it's just a filesystem.
The thing is, hardly anyone here talks about it, which is strange as it offers features that scream "AWESOME" for uses in mobile phones - for example with transparent data compression: on an old HDD with interface capped at 50MB/s, I am able to reach transfers of up to 600MB/s with BTRFS. Imagine how that'd change the performance of internal memory and SD card in the phone...
aguaz said:
This is all by memory, but I think I might not be too far off:
- screenlock initially has to be either pin or pwd
- encryption password will be set the same as the current screenlock and cannot be changed once encrypted.
- screenlock however can be changed anytime.
- screenlock can also be completely removed by e.g. removing lock offline or installing a fresh ROM.
You can then choose whatever lock, or skip lock completely doh.
Click to expand...
Click to collapse
Now, this is interesting, because that would mean there were some serious changes since JellyBean 4.1.
See this bug: https://code.google.com/p/android/issues/detail?id=29468
Its status is still "NEW" instead of "Closed", so I wonder if anything has been done about it. If I had to type in the pin every time I unlock the screen, that would make encryption unusable for me due to practicality.
aguaz said:
I believe I got a Transcend 64GB UHS. But the S4 Minis controller is probably hooked to a slow USB line anyway, so It does not achieve advertised sequencial speeds.
Click to expand...
Click to collapse
UHS speeds are not achievable for mobile phones, but there is a difference in speed between various UHS-1 cards when used in such devices.
Right now I have SanDisk Ultra, but I've been digging around and decided this would be the option, especially if I have to use it as /data mountpoint: http://www.amazon.com/Samsung-Electronics-Adapter-MB-MP64DA-AM/dp/B00IVPU7AO#customerReviews
By the way: The tool I have been using for operations on boot.img seems to have proglems with boot.img fot KitKat. Where can I find this abootimage, and what options/operators are you using while (de)compressing with gzip, cpio & abootimage?

impactor said:
Now, this is interesting, because that would mean there were some serious changes since JellyBean 4.1.
See this bug: https://code.google.com/p/android/issues/detail?id=29468
Its status is still "NEW" instead of "Closed", so I wonder if anything has been done about it. If I had to type in the pin every time I unlock the screen, that would make encryption unusable for me due to practicality.
Click to expand...
Click to collapse
As mentioned above Android (I'm speaking for kitkat) lets you change the screenlocks pwd / pin after encryption. So the lock eventually can become independent of the pwd you enter for encryption at boot. If you want to use another kind of screenlock or remove it alltogether you can e.g. replace it offline or make a fresh ROM installation.
impactor said:
By the way: The tool I have been using for operations on boot.img seems to have proglems with boot.img fot KitKat. Where can I find this abootimage, and what options/operators are you using while (de)compressing with gzip, cpio & abootimage?
Click to expand...
Click to collapse
It's called abootimg, I've corrected that. All those tools are generally included in your distribution, so you can easily install them with the package manager.
unpacking ramdisk
Code:
$ abootimg -x boot.img
$ mkdir ramdisk && cd ramdisk
$ cat ../initrd.img | gunzip | cpio -idv
repacking boot.img
Code:
$ find . | cpio -o -H newc | gzip > ../initrd.img
$ cd ..
$ abootimg --create boot.img -f bootimg.cfg -k zImage -r initrd.img

Thanks. I have another problem, though. Whatever changes I make to fstab, they are being ignored by KitKat. Here's the details: http://forum.xda-developers.com/android/help/wrong-fstab-qcom-kitkat-changes-effect-t2898184
Do you know what might be causing it?

aguaz said:
When formatting a data partition to be used for Android encryption, make sure the filesystem doesn't extend into the last 16 Kbytes of the partition where the crypto footer is kept. See https://community.freescale.com/docs/DOC-93753
Click to expand...
Click to collapse
Something occurred to me. Later on, you said to drop the "length=-16384" from mount options. Is it the same thing as the above? If so, then is it no longer necessary to leave the extra space?

I can't recall why the mount flag was removed from CM. I expect the footer to be still in use though.
Run logcat via adb then start encryption for error messages.

impactor said:
I doubt getting LVM support is doable, but BTRFS should be less outlandish...
Click to expand...
Click to collapse
No sign of lvm, but btrfs is in the official samsung kernel sources.
Technically it should even work with encryption since the file system is on top of dm-crypt. But then again, it's Androids implementation...

Interesting. But still, it needs kernel module for BTRFS, and judging from the rarity of F2FS kernels, I am extremely doubtful we will get BTRFS one anytime soon, unless we compile it ourselves.
On the subject of encryption - I think I found a way to encrypt the external SD card mounted on /data/media/0 independently on /data encryption:
http://www.guyrutenberg.com/2012/06...isk-encryption/comment-page-1/#comment-357674
Read the comment from January 14, 2013 at 05:28.

impactor said:
I am extremely doubtful we will get BTRFS one anytime soon, unless we compile it ourselves.
Click to expand...
Click to collapse
Obviousely someone has to do it. But if nobody would do stuff like that there was no xda and we all use stock ROMs
impactor said:
On the subject of encryption - I think I found a way to encrypt the external SD card mounted on /data/media/0 independently on /data encryption:
http://www.guyrutenberg.com/2012/06...isk-encryption/comment-page-1/#comment-357674
Read the comment from January 14, 2013 at 05:28.
Click to expand...
Click to collapse
Yes, but this approach uses luks, another variant of dm-crypt used in stock encryption. There is nothing wrong with luks, in fact it'd be desirable if stock used luks as it is the de facto standard.
But as it's not the standard in Android a few downsides come to mind:
- requires 3rd party app/tool
- luks is not supported by recovery
- is that a plain text password in the init.d script!? If true you might as well skip encryption altogether.
Another approach could be:
- temporarily use sdcard as data just to encrypt it
- change again to desired mount point via fstab with "wait,check,encryptable=footer" options
- find out whether Android is smart enough to ask for password and mount it (even if it's not used for /data anymore)
Keep in mind that by hanging the sdcard in /data/media/0 most stuff gets written on the card anyway, so internal /data would not be of great use.
There is other good stuff you can do with it.

Related

Two Download folders in SD Card

Apologies if this has been resolved before, but I've been seeing two download folders in my SD card "downloads" and "Downloads." I've tried deleting one but I get an error - this also confuses Recovery when I try to flash a file located in one of the directories it typically looks in the wrong one. Has anyone had this or resolved it?
pongalong said:
Apologies if this has been resolved before, but I've been seeing two download folders in my SD card "downloads" and "Downloads." I've tried deleting one but I get an error - this also confuses Recovery when I try to flash a file located in one of the directories it typically looks in the wrong one. Has anyone had this or resolved it?
Click to expand...
Click to collapse
I have the issue and have just learned to deal with it. I don't really know when it why it happened, sometime around when I first flashed jellybean I think. Idk. Just letting you know you're not alone. Btw the "download" folder appears first in recovery. I move all my roms and kernels there. The "Download" is the folder all the general downloads end up in for me... at least I think... it's confusing but a sms issue to me.
DARKSIDE
I made a folder called Aaroms. It goes alphabetical and capital letters first so that folder is always on the top of the list. I then sort my roms mods and kernels with sub folders.
If you keep your (D)download folder clean and sorted it should be easy to know which one has what
Sent from my Galaxy Nexus using xda premium
This is just speculation, but...
1. I think the virtual sdcard (sdcard0) and its links exists to make the real "sdcard" (/data/media) look like fat to apps instead of ext, which it really is (because it doesn't have a separate partition to itself). Most apps only know how to write to fat on the sdcard.
2. To programs that expect to be writing to fat, "download" and "Download" are the same directory, so they can be careless how they spell it when they access it or create it. But since the real filesystem is ext, they get created as two different directories. Maybe through some case-checking bug in the virtual sdcard or some program that writes directly to /data/media.
3. What I wound up doing was taking all my data out of both directories, deleting one, and making sure the remaining one was named "directory". Then I put all my data back in that one and everything has been good since then.
Well this is Linux after all. Downloads != downloads
Sent from my Galaxy Nexus using xda premium
Need help too
pongalong said:
Apologies if this has been resolved before, but I've been seeing two download folders in my SD card "downloads" and "Downloads." I've tried deleting one but I get an error - this also confuses Recovery when I try to flash a file located in one of the directories it typically looks in the wrong one. Has anyone had this or resolved it?
Click to expand...
Click to collapse
I have the same issue. I have two Download folders. The thing is that the one with the small "D" (download), it is empty, and when I try to delete it, it always reappear.
Help!
this was anwsered like 2 days ago.
sent from my i9250
bk201doesntexist said:
this was anwsered like 2 days ago.
sent from my i9250
Click to expand...
Click to collapse
I cant find the post telling the answer. Lol. The last post isbin october 2010.
strumcat said:
1. I think the virtual sdcard (sdcard0) and its links exists to make the real "sdcard" (/data/media) look like fat to apps instead of ext, which it really is (because it doesn't have a separate partition to itself). Most apps only know how to write to fat on the sdcard.
Click to expand...
Click to collapse
I think that the symlinks are there just for backwards compability issues with apps, that look under /sdcard/ mount point. it doesn't have anything to do with fs, android never used fat, or ntfs; known fs in android are yaffs2, ext4 and maybe a few proprietary ones like sammy's rfs.
bk201doesntexist said:
I think that the symlinks are there just for backwards compability issues with apps, that look under /sdcard/ mount point. it doesn't have anything to do with fs, android never used fat, or ntfs; known fs in android are yaffs2, ext4 and maybe a few proprietary ones like sammy's rfs.
Click to expand...
Click to collapse
The real sdcards were formatted as fat, and most apps that used them to store data only knew how to read/write a fat fs. I found this out by creating a mountable volume on a real sdcard on my old phone. It mounted as a directory on the sdcard. If I formatted the volume as fat, all my apps could use it normally. If I formatted it as ext(anything), a few apps could use it but most could not.
The symlinks are for backwards compatibility, but I believe the fuse filesystem virtual sdcard0 exists to make ext4 look like fat to all apps and to windows.
Note that if the gnex "sdcard" had its own partition, it could be formatted as fat and mounted as USB external storage like a real sdcard. I don't know, but it seems like Google went out of their way to prevent that.
The Google line is that the gnex sdcard shares an ext4 partition to maximize space, ie no unused wasted space on two partitions. But that is pretty farfetched, since the number of problems caused by this arrangement is huge in proportion to the "space saved" which is negligible.
Obviously, the real reason for this kludged-up mess is to discourage local storage/backup and encourage cloud storage, which can then be monetized.
strumcat said:
The real sdcards were formatted as fat, and most apps that wrote data to it only knew how to write it to a fat fs. I found this out by creating a mountable volume on a real sdcard on my old phone. It mounted as a directory on the sdcard. If I formatted the volume as fat, all my apps could use it normally. If I formatted it as ext(anything), a few apps could use it but most could not.
The symlinks are the for backwards compatibility, but I believe the fuse filesystem virtual sdcard0 exists to make ext4 look like fat to all apps and to windows.
Note that if the gnex "sdcard" had its own partition, it could be formatted as fat and mounted as USB external storage like a real sdcard. I don't know, but it seems like Google went out of their way to prevent that.
The Google line is that sdcard shares ext4 partition to maximize space, is no unused wasted space on two partitions. But that is pretty farfetched, since the number of problems caused by this arrangement is huge in proportion to the "space saved" which is negligible.
Obviously, the real reason for this kludged-up mess is to discourage local storage/backup and encourage cloud storage, which can then be monetized.
Click to expand...
Click to collapse
sure, i was talking about nand storage. still, if apps really depend on that to survive (said "fat compability"), it's unlogical to me coming from linux, where several fs can co-exist, as you may know.
if sdcard had its own partition like you say, and it could be formatted to fat, it would suck from a performance point of view, right? because its way slower than ext4 or yaffs2?
sent from my i9250
bk201doesntexist said:
sure, i was talking about nand storage. still, if apps really depend on that to survive (said "fat compability"), it's unlogical to me coming from linux, where several fs can co-exist, as you may know.
if sdcard had its own partition like you say, and it could be formatted to fat, it would suck from a performance point of view, right? because its way slower than ext4 or yaffs2?
sent from my i9250
Click to expand...
Click to collapse
Sure, Android knows how to read/write fat as well as ext. But I guess the app devs figured sdcards would be fat forever. so they only included fat I/O in their apps.
Yes, ext4 is better than fat. But fat+mass-storage is far better and faster than ext4+fuse+mtp. For example, an sdcard backup from fat mounted as mass storage to a pc is much faster and more reliable than an sdcard backup using mtp. MTP backups are painfully slow and often won't even complete due to errors.
strumcat said:
Sure, Android knows how to read/write fat as well as ext. But I guess the app devs figured sdcards would be fat forever. so they only included fat I/O in their apps.
Yes, ext4 is better than fat. But fat+mass-storage is far better and faster than ext4+fuse+mtp. For example, an sdcard backup from fat mounted as mass storage to a pc is much faster and more reliable than an sdcard backup using mtp. MTP backups are painfully slow and often won't even complete due to errors.
Click to expand...
Click to collapse
Well it still happens in 2017 running Android 7.1.2 lol
Sent from my SM-G930W8 using Tapatalk

[Q] Will HBOOT check eMMC for PB31IMG.ZIP files??? No external sdcard in slot.

I am retiring my DInc for a life after cell-phone service (i.e. for games).
The Plan
1. Remap '/mnt/emmc' to '/mnt/sdcard', and '/mnt/sdcard' as '/mnt/ext_sd', in both the system ROM and the CWM recovery. (I can do this.)
2. Remove my microSD card. (No longer needed.)
The Unknown
But what will happen to HBOOT????
Will it find a "PB31IMG.zip" in the internal memory?
If not, can it be modified?
None of the emmc/sdcard threads also include explanations with regard to HBOOT.
If I partially succeed with "The Plan," it may be necessary to flash a restored recovery and system fix.
If I can figure the last part out, I'll post fully instructions and necessary flashables in the dev board.
Haraldr Blaatand said:
I am retiring my DInc for a life after cell-phone service (i.e. for games).
The Plan
1. Remap '/mnt/emmc' to '/mnt/sdcard', and '/mnt/sdcard' as '/mnt/ext_sd', in both the system ROM and the CWM recovery. (I can do this.)
2. Remove my microSD card. (No longer needed.)
The Unknown
But what will happen to HBOOT????
Will it find a "PB31IMG.zip" in the internal memory?
If not, can it be modified?
None of the emmc/sdcard threads also include explanations with regard to HBOOT.
If I partially succeed with "The Plan," it may be necessary to flash a restored recovery and system fix.
If I can figure the last part out, I'll post fully instructions and necessary flashables in the dev board.
Click to expand...
Click to collapse
You can mount emmc as sd with the vold.fstab file but that only works for in the os.
You may be able to modify cwm to make it think emmc is sd, but what for? Cwm has the option to flash from both.
Hboot will never look for PB images on emmc, only the sdcard. The only way to fix that would be to try and figure out how to modify an hboot flashable, and then flash it and hope it dosent brick the phone. So essentially you would be creating your own custom hboot, which is unheard of as far as i know.
Why do you even want to do this? Whats wrong with leaving the sd in?
cmlusco said:
You can mount emmc as sd with the vold.fstab file but that only works for in the os.
You may be able to modify cwm to make it think emmc is sd, but what for? Cwm has the option to flash from both.
Click to expand...
Click to collapse
Consistency. There are instructions to make the swap. It's just another fstab in the recovery img.
cmlusco said:
Hboot will never look for PB images on emmc, only the sdcard.
Click to expand...
Click to collapse
I placed an old PB on the emmc. The bootloader buzzed through some messages... to fast for me to read. But it tried, right?
cmlusco said:
Why do you even want to do this? Whats wrong with leaving the sd in?
Click to expand...
Click to collapse
A) Because it's there. B) 1 less piece to not care about when it gets lost.
Skimmed the hex view of the hboot_____.nb0. EMMC partition appears in come strings. shrug. Who knows.
Haraldr Blaatand said:
I placed an old PB on the emmc. The bootloader buzzed through some messages... to fast for me to read. But it tried, right?
Click to expand...
Click to collapse
No, it was searching on your SD card which wasn't present for a PB file. no SD card > no file > no flashing
Haraldr Blaatand said:
A) Because it's there. B) 1 less piece to not care about when it gets lost.
Click to expand...
Click to collapse
Essentially emmc isn't very useful if you have an SD card, that's part of the reason Google wants to get away from expandable storage; to make the internal storage have a use and to reduce confusion. And not to belittle your money but an 8GB sd card or you could get even less than that for your purposes are fairly cheap so they shouldn't be something you worry about too much.
nschiwy said:
No, it was searching on your SD card which wasn't present for a PB file. no SD card > no file > no flashing
Click to expand...
Click to collapse
Tested. You are correct. HBOOT never checks the emmc. I pulled the sdcard, and nothing was scanned.
I wasn't sure... and I should have thought of that test earlier.
I just double checked the boot.img that's in with the hboot package. No signs there of altering things there either... but I found it a bit odd that it has a kernel+ramdisk in there.
nschiwy said:
Essentially emmc isn't very useful if you have an SD card, that's part of the reason Google wants to get away from expandable storage; to make the internal storage have a use and to reduce confusion.
Click to expand...
Click to collapse
If you check, I tried a set of ROM mods to get emmc and sdcard to be subdirectories of one or the other for that very reason. The problem is that vfat/fat/fat32 does not support mount points. (I wish emmc was ext3/4, and USB mounting of it went through a vfat emulation layer.)
IMO, I think Google goofed. The stock Android platform does not allow for multiple storage locations. i.e. When prompted for a location, emmc and sdcard should have been listed. Instead, "/mnt/sdcard" is pretty much hard coded into every layer of Android as the only path, when it could have been an array of paths.
nschiwy said:
And not to belittle your money but an 8GB sd card or you could get even less than that for your purposes are fairly cheap so they shouldn't be something you worry about too much.
Click to expand...
Click to collapse
It wasn't about the money. I now have 3 sdcards (32, 16, 8) and 2 phones. It just became a challenge to see if it could be done.
Since the phone is already modded to death, the hboot matter really shouldn't make a difference. But, there was still some uncertainty.
Oh well. Thanks for playing, guys.
Haraldr Blaatand said:
Oh well. Thanks for playing, guys.
Click to expand...
Click to collapse
Exactly. The emmc is great for playing. Playing music, running a Ubuntu chroot, storing backups from Titanium, even booting ROMs from the emmc using Boot Manager (at least before Jelly Bean broke that), the emmc is good for all kinds of stuff. Or maybe it's just the challenge of trying to get good use out if it that I enjoy, hmm...

[How-to] Using an ext4 formated SD card.

Update: I've since made a flashable zip that automatically creates a modified sdcard1 binary and extracts an init.d script to handle it all. Will make a thread in a more general location as this could be used on many TouchWiz devices. Link.
Hello everyone,
The mailman brought me a new 64GB microSD card this morning, and I wanted to try formatting it in ext4 instead of exFAT. Both for the heck of it and in case I wanted to give AOSP ROMs a try down the road.
The usual caveats apply.
Required:
init.d support
a mounting script
a mounting updater-script for custom recoveries.
You can get init.d support with the stock kernel on many devices by having the run-parts command launch from a custom install-recovery.sh script. See the following thread for files and a how-to:
[MOD]Term-init & Zip-init: Enable Init.d for Any Phones w/o Need of Custom Kernels!!!
SD card removal:
Should you need to remove the card it can be unmounted and safely removed from the storage settings as usual. Mounting it again requires either a reboot or manually executing the mount command and then activating the card in the storage settings.
Mounting script:
Make sure you have proper line endings, file name (e.g. 95mountsdext4) and permissions set.
Code:
#!/system/bin/sh
# Mount SD Card Ext4 Script
mount -rw -t ext4 /dev/block/mmcblk1p1 /storage/extSdCard
Mounting in CWM/TWRP:
The other piece in this is the attached zip file, which simply runs the appropriate mount command for Clockworkmod Recovery. Unmount as usual. This way you can also store nandroid backups and other update zips on the external as well.
Technical considerations:
The mounting occurs early enough during the boot process that the media scanner and MTP services have no issues with this.
There may be are some permissions related glitches to look out for, but it hasn't been an issue for me so far. (One possible fix would be a recursive chmod/chown added to the mounting script.)
Update: The camera app saves the photos properly to the SD card, but leaves them with improper permissions which prevent subsequent viewing or editing again until you chmod the files. To be continued...
If your init.d support comes from the install-recovery.sh trick, CWM will prompt to delete the script before reboot. Don't.
If the mounting script doesn't run for some reason, or you try to activate the card before having mounted it manually, the phone will give an error and ask if you want to format the card. Don't.
Enjoy,
Darkshado
I have been looking for a way to do this for a long time for numerous reasons (symlinks, >4GB file size, linux-only environment, etc.). I'll be giving this a try very soon.
Thanks for sharing!
EDIT: Just wanted to add that I think it's ridiculous Android doesn't support this natively.
The permissions issues are frustrating. I can take photos and store them on the card, but the umask for JB has been set as 077, in other words, rwx------ permissions, and ownership by the application's user.
I tried different arguments for the mount command to try and force permissions and ownership one way or another with no luck so far. Ironically, an NTFS formatted card might work better in this respect.
A similar mod had been made on the Nexus S and one of the posters resorted to an apk that regularly ran chmod -R 0777 on new files, I tried using it but it just hung there and did nothing on the Note II.
Another possibility would be using FUSE, although I'm not sure how to go about doing this yet.
Also, I pondered the possibility of using UDF instead of ext4, it is a standardized format and just about every major OS out there supports it too...
Any updates? Is it working already or...?
Despite all the good of Android, Google/carriers, whoever, not including ext2/3/4 support natively is just a slap in the face. Good to see someone working to right a wrong that subjugating software has done.
You should NOT be doing this. The Android hardware requirements clearly state that all shared storage directories must be case insensitive and must not have permissions. FAT32 is the only supported filesystem which meets these requirements. Mounting an EXT filesystem directly will break applications.
The newer versions of Android come with an "sdcard" utility which uses a FUSE driver to wrap a native EXT filesystem and exposes a pseudo filesystem which is case insensitive and is without permissions. You should mount the EXT SD card at a different location (/dev/fuse) and use the "sdcard" utility to emulate it at /storage/whatever. You can see the command line syntax of the "sdcard" utility in the source code.
CM10.1 does this automatically. https://github.com/CyanogenMod/android_system_core/tree/cm-10.1/sdcard
KurianOfBorg said:
You should NOT be doing this. The Android hardware requirements clearly state that all shared storage directories must be case insensitive and must not have permissions. FAT32 is the only supported filesystem which meets these requirements. Mounting an EXT filesystem directly will break applications.
The newer versions of Android come with an "sdcard" utility which uses a FUSE driver to wrap a native EXT filesystem and exposes a pseudo filesystem which is case insensitive and is without permissions. You should mount the EXT SD card at a different location (/dev/fuse) and use the "sdcard" utility to emulate it at /storage/whatever. You can see the command line syntax of the "sdcard" utility in the source code.
CM10.1 does this automatically. https://github.com/CyanogenMod/android_system_core/tree/cm-10.1/sdcard
Click to expand...
Click to collapse
Again, Android not natively supporting ext4 is a slap in the face. Usability over technical merit disgusts me.
muqali said:
Again, Android not natively supporting ext4 is a slap in the face. Usability over technical merit disgusts me.
Click to expand...
Click to collapse
It does support EXT4! Officially. All Google ROMs and AOSP can mount EXT4 partitions as /storage/*. The correct way to mount it is to use the command "sdcard" not "mount". I'm pretty sure any AOSP ROM will automatically mount an EXT4 SD card using the "sdcard" command just like Cyanogenmod does.
Thanks for the info. I'll look into this soon-ish, once my exams are over.
Sent from my SGH-T889V using xda app-developers app
KurianOfBorg said:
It does support EXT4! Officially. All Google ROMs and AOSP can mount EXT4 partitions as /storage/*. The correct way to mount it is to use the command "sdcard" not "mount". I'm pretty sure any AOSP ROM will automatically mount an EXT4 SD card using the "sdcard" command just like Cyanogenmod does.
Click to expand...
Click to collapse
It's still a second class citizen to a xFATx filesystem.
muqali said:
It's still a second class citizen to a xFATx filesystem.
Click to expand...
Click to collapse
No it's fully supported by AOSP exactly the same as FAT on AOSP and exFAT/NTFS on Samsung ROMs. It's the manufacturer's fault for REMOVING support from their ROM. When you insert an EXT SD card on AOSP, it gets mounted at /storage/* just like any other SD card.
In my N7100 with CM 10.1, ext4 has stopped working for my 32gb SDCard on 05-01-2013 nightly, even after reformatting, going back to stock, then reinstalling CM 10.1. I also noticed that my ext4 formatted 8GB SdCard still works, however, so I am not sure if it's a storage size issue in my case (32gb vs 8gb). I am trying a hybrid of 8mb fat32 / 28.*gb ext4 to see if that will work.
KurianOfBorg said:
No it's fully supported by AOSP exactly the same as FAT on AOSP and exFAT/NTFS on Samsung ROMs. It's the manufacturer's fault for REMOVING support from their ROM. When you insert an EXT SD card on AOSP, it gets mounted at /storage/* just like any other SD card.
Click to expand...
Click to collapse
clearday said:
In my N7100 with CM 10.1, ext4 has stopped working for my 32gb SDCard on 05-01-2013 nightly, even after reformatting, going back to stock, then reinstalling CM 10.1. I also noticed that my ext4 formatted 8GB SdCard still works, however, so I am not sure if it's a storage size issue in my case (32gb vs 8gb). I am trying a hybrid of 8mb fat32 / 28.*gb ext4 to see if that will work.
Click to expand...
Click to collapse
Is it formatted properly as ext4? Using mke2fs or (tune2fs to convert to ext4). All ROMs only mount the first partition on the SD card regardless of the file system. Sometime after mounting USB Mass Storage an the SD card doesn't remount properly so you need to reboot the device. You'll most probably want to use MTP with ext4 anyway.
KurianOfBorg said:
Is it formatted properly as ext4? Using mke2fs or (tune2fs to convert to ext4). All ROMs only mount the first partition on the SD card regardless of the file system. Sometime after mounting USB Mass Storage an the SD card doesn't remount properly so you need to reboot the device. You'll most probably want to use MTP with ext4 anyway.
Click to expand...
Click to collapse
Finally fixed the problem by running this command in ROM Toolbox Lite:
"find /storage/sdcard1/ -print0 | xargs -0 chown root:media_rw"
http://forum.xda-developers.com/showthread.php?p=38182488#post38182488
clearday said:
Finally fixed the problem by running this command in ROM Toolbox Lite:
"find /storage/sdcard1/ -print0 | xargs -0 chown root:media_rw"
http://forum.xda-developers.com/showthread.php?p=38182488#post38182488
Click to expand...
Click to collapse
Then it's not mounted properly! Your ext4 SD card has directly been mounted at /storage/* instead of through the FUSE driver. You should NOT be able to see permissions when it's mounted at /storage/*. The physical partition should be mounted at /dev/fuse. Reboot the device and check again whether permissions are visible at /storage/*.
KurianOfBorg said:
Then it's not mounted properly! Your ext4 SD card has directly been mounted at /storage/* instead of through the FUSE driver. You should NOT be able to see permissions when it's mounted at /storage/*. The physical partition should be mounted at /dev/fuse. Reboot the device and check again whether permissions are visible at /storage/*.
Click to expand...
Click to collapse
It's still visible at storage
How do I fix it?
clearday said:
It's still visible at storage
How do I fix it?
Click to expand...
Click to collapse
It should show up at /storege/* but that should be the FUSE driver's mount point with permissions stripped away. The real ext4 partition will be at /dev/fuse.
Any further progress?
I want to use symlinks and ext4 on my note 2 also.
On aosp roms just use the sdcard binary with an initd script.
Gesendet von meinem GT-N7105 mit Tapatalk 2
DerTeufel1980 said:
On aosp roms just use the sdcard binary with an initd script.
Click to expand...
Click to collapse
I'm trying to do this on Tweaked. There is an sdcard binary, however, it appears to be modified by Samsung as it's hardcoded to mount to /storage/sdcard0 and overrides the internal sdcard mount when I use it. It doesn't take a destination parameter like the AOSP/CM version does.
If anyone has an AOSP/CM build environment, could I trouble you for a statically linked version of the sdcard binary? I downloaded CM10.2-nightly, but it's dynamically linked and, of course, doesn't work on the stock based ROMs.
EDIT
It might still be nice, but I figured out a way around it. I hex edited the sdcard binary from the Note2 to use /storage/sdcard1. Then in the mount script, bind mounted it over to /storage/extSdCard. I've rebooted a few times and it seems to be working fine. I am copying data to it over MTP right now. I've attached a zip of the files I'm using.
NOTE: THIS IS NOT A FLASHABLE ZIP.
I might make one later, but this kind of needs to be a manual process anyway.
put the sdcard1 file in /system/xbin
chmod 755 /system/xbin/sdcard1
put the script file in /etc/init.d
set permissions/ownership on it
Now, if you have an ext4 formatted SD, and it's not mounted, you should be able to run the script and have it mount it, run the sdcard1 binary on it, and bind mount it over to the normal extSdCard spot. It will happen at boot if you got it all right.
There are probably improvements that can be made, my shell scripting is a bit rusty. Hopefully this will get people interested in it again, now that the permissions issues are resolved.

[Q] Moving apps to SD card android 4.3->

So what I have gathered is that this phone even with root/cmod/titanium backup doesn't allow me to move apps to my _real_ sdcard. So is it really phone related or is there a way to do it with custom rom/kernel or some other way?
leripe said:
So what I have gathered is that this phone even with root/cmod/titanium backup doesn't allow me to move apps to my _real_ sdcard. So is it really phone related or is there a way to do it with custom rom/kernel or some other way?
Click to expand...
Click to collapse
on stock android 4.2 u could actually use app2sd to move some apps to external storage
using Cyanogenmode 4.3 based Carbon MOD i found that i no longer can do that, tried app2sd and link2sd
i read somewhere that external storage is defined in system PATH variables, dont know how relevant that is but seems connected
but i honestly dont know yet much about the android platform to fix this issue myself, so i might be wrong
we need some pro tip help
Would be very interesting to habe feature. Especially for phones with only 8 GB internal flash. Hope this will come for my s4 Mini. Samsung has this implemented in their stock Rom.
Gesendet von meinem GT-I9195 mit Tapatalk
tesme33 said:
Would be very interesting to habe feature. Especially for phones with only 8 GB internal flash. Hope this will come for my s4 Mini. Samsung has this implemented in their stock Rom.
Gesendet von meinem GT-I9195 mit Tapatalk
Click to expand...
Click to collapse
Yes this would be awesome, but seems that cmod has gone moneymaking company and tries to make cmod to google standards which means they have been starting to remove/hiding features. Their goal now is to make installing cmod without cwm and to remove root or have it as optional feature. Or all this is what I gathered over the net, but I still hope some other custom rom could have this feature.
Edit:
All of the above may not be like that nowadays, and this is somewhat speculation since there hasn't(?) been an official statement from cm about app2sd support. Though emulated sdcard may require something different.
(edited 19.2.2014)
Moving apps to external card.
leripe said:
Yes this would be awesome, but seems that cmod has gone moneymaking company and tries to make cmod to google standards which means they have been starting to remove/hiding features. Their goal now is to make installing cmod without cmw and to remove root or have it as optional feature. Or all this is what I gathered over the net, but I still hope some other custom rom could have this feature. This feature may only need one to repartition the sdcard, but I can't get it to mount as mass storage nor with sdcard reader(it shows "empty" card) in windows(maybe i should try it in linux).
Click to expand...
Click to collapse
About two months ago I upgraded my Xoom to JB 4.2.2, and because space was limited, I hadn't noticed whether I could move operating programs to the external card or not. This was a custom rom. Well, I was using a 32 Gig card that was nearly full of data.
This last week, I invested in a 64 Gig sdhc card and upgraded my rom to Kit-Kat 4.4.2. Thus its also a custom rom, but now I find that though, for the most part, I can designate the external card to store and access data from, I can't run programs from it. Hmm!
Here I am with all this memory. Sure wish I had better management options.
Kingsman1 said:
About two months ago I upgraded my Xoom to JB 4.2.2, and because space was limited, I hadn't noticed whether I could move operating programs to the external card or not. This was a custom rom. Well, I was using a 32 Gig card that was nearly full of data.
This last week, I invested in a 64 Gig sdhc card and upgraded my rom to Kit-Kat 4.4.2. Thus its also a custom rom, but now I find that though, for the most part, I can designate the external card to store and access data from, I can't run programs from it. Hmm!
Here I am with all this memory. Sure wish I had better management options.
Click to expand...
Click to collapse
Well check my thread on my signature and the requests section in the 1st post for more info on about app2sd.
Resolve the issue
Hi all,,,
This is my first time in XDA. Someone fixed this bug for me. You need to be rooted to fix this issue. Install from market Terminal Emulator and type the following commands
su
/system/bin/restorecon -R -v /data/media/
dlightx said:
Hi all,,,
This is my first time in XDA. Someone fixed this bug for me. You need to be rooted to fix this issue. Install from market Terminal Emulator and type the following commands
su
/system/bin/restorecon -R -v /data/media/
Click to expand...
Click to collapse
Can I check with you what bug this fixes?
Ability to use app2sd?
I use FolderMount and works real well. No need to partitioning sd card.
I've gotten to getting Link2SD working on the GT-I9195 with nightly 20140402 KitKat.
Based loosely on [Tutorial/HOWTO] Convert Your External SD Card from FAT/exFAT to EXT4! (3 ways!)
1. Clear everything out of your external SD card. We're gonna be formatting it so you'll have to backup your data.
2. Boot up into recovery and have a working ADB environment setup on your computer
3. adb shell (Do NOT mount your /storage/sdcard1)
5. Check that you have fdisk and mke2fs installed (Type fdisk --help and mke2fs --help ensure they don't throw up errors)
6. fdisk /dev/block/mmcblk1
7. Type o and Enter to destroy the partition table
8. Type n to create a new partition. Make sure its Primary (p). Select first partition and choose how many cylinders you want to allocate to it.
9. Type n to create your second partition. Again, make sure its Primary (p). Leave cylinder allocation blank to use remainder of space by default.
10. Verify partition layout by typing p to show partition layout.
11. Exit fdisk and save changes by typing w
12. mke2fs -t ext4 /dev/block/mmcblk1p1
13. mke2fs -t ext4 /dev/block/mmcblk1p2
14. reboot
15. Once CM has booted up, check if your external storage partition 1 has been mounted. It should be mounted at /mnt/media_rw/sdcard1
16. Try creating a folder in /mnt/media_rw/sdcard1 and /storage/sdcard1 to test if your read/write permissions are correct.
17. Install DiskInfo from playstore to check if your second partition is visible
18. Once done, install Link2SD and select ext4 when prompted to ask what kind of filesystem your 2nd partition is.
19. Reboot after Link2SD installs scripts.
20. Voila!
Let me know if there are any issues. I modified several files while doing this so not sure if any of them affected.
Should #16 not work, try:
1. Going to /system/etc/permissions/platform.xml and adding media_rw group to the element that only has sdcard_r group in it.
2. Typing mount in Terminal Emulator (su) or adb shell and see whether your partitions are mounted. If you're not sure, post the output out here.
Final mount output (filtered with mmcblk1 or sdcard stuff):
Code:
/dev/block/mmcblk1p2 /data/sdext2 ext4 rw,seclabel,relatime,data=ordered 0 0
/dev/fuse /mnt/shell/emulated fuse rw,nosuid,nodev,relatime,user_id=1023,group_i
d=1023,default_permissions,allow_other 0 0
/dev/block/vold/179:33 /mnt/media_rw/sdcard1 ext4 rw,dirsync,context=u:object_r:
sdcard_external:s0,nosuid,nodev,noexec,noatime,data=ordered 0 0
/dev/fuse /storage/sdcard1 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1
023,default_permissions,allow_other 0 0
EDIT 2: *** IMPORTANT!! Do NOT select External in the App2SD option in Link2SD. Otherwise you will not be able to install any apps from the Play Store (Insufficient Storage error)
I use GL to SD on my Slimrom: https://play.google.com/store/apps/details?id=com.slf.ListglApp
It may not have fancy UI like FolderMount or Link2SD, and it slight complex to use. But it works on per app basis, without re-partition too.
Hi leripe !
I have got the same device and ROM like you and i would like to know if you have found a solution to move apps to the sdcard ?
Thank you in advance, regards.
Oijkn said:
Hi leripe !
I have got the same device and ROM like you and i would like to know if you have found a solution to move apps to the sdcard ?
Thank you in advance, regards.
Click to expand...
Click to collapse
If it non system apps, you can use GL to SD as I provide the link already above. It works.
TNCS said:
If it non system apps, you can use GL to SD as I provide the link already above. It works.
Click to expand...
Click to collapse
Hi, i tried your link but this tool don't show all my user app so i can't move them... Have you another tool that can do the job please?
Oijkn said:
Hi, i tried your link but this tool don't show all my user app so i can't move them... Have you another tool that can do the job please?
Click to expand...
Click to collapse
Nope, sorry. I tried this tool and it work so never bother to look for another one.
If GL to SD doesn't have the app you want to move, you can manually link the app and the relevant folder at GL to SD settings. After you linked them, at the main page of apps you can tell it to start to move.
This thread shows up on google for me when trying to figure out why minitool partition wizard doesn't detect my phone at all. The guide I'm following says USB-SDcard reader is required but is that really true?? Surely there is a way to mount the SDcard at a low enough level to partition it without addition hardware?? Even if I have to mount it using TWRP recovery or something I would think it's possible. Anyone know?

[Q] Inc as a data media device

I know I'm late to the party and this was probably already discussed, but I couldn't find it with search. Has anyone considered converting the inc to a data media device (http://www.xda-developers.com/android/what-is-a-data-media-device/)? I've seen this done with other devices (e.g. hp touchpad). I'd be nice to be able to use the EMMC partition for storage and data. I know there is ext4all but I still seem to run out of space quickly since dalvik-cache is half of /data.
Not sure if hboot will let you combine partitions to do what you want; however, lvm can probably accomplish what you're hoping to achieve but it takes quite a bit of effort to setup.
Sent from my One using Tapatalk
I wasn't necessarily thinking we need to combine any partitions. Just don't mount the existing /data and /data/data partitions, and mount the EMMC partition as /data with an emulated sdcard at /data/media. I think this is how the Samsung phones work; you have both "internal" and "external" sdcards. Seems like it should just be some config changes and maybe a recovery that is datamedia aware so you don't erase the emulated sdcard when wiping data.
Smells like a project. I'll see if I will get around to this but this sounds doable.
No promises but my Inc could get bricked and I wouldn't cry over it so I can take a few risks.
Sent from my One using Tapatalk
I've only done a little research so far, but it seems like you'd only need to change a few configuration files. I don't think you could truly brick your Inc, could you? I'm tempted to try and get it working myself but I can't risk bricking my dd.
Sent from my ADR6300 using Tapatalk
ive got 2 incs so I dont mind messing with it, I have a touchpad tho and from what I know (I am decent friends with invisiblek and he does work on the touchpad) the only real difference, is re-partitioning your internal and setting the device tree to mount data as data/media instead of for say /data or /data/data
I have a TouchPad too. Finally made the leap to kk and datamedia there which is what got me thinking about the Inc. The repartioning done for the TouchPad was too make the data partition larger since it now holds both apps and sdcard data. We shouldn't have to do that for the Inc since we already have a partition with 6.6 gig available. Nothing is mounted at /data/media, it's just another directory on the main /data partition. That's why you need a special recovery that "wipes" data instead of formatting...
I've been looking at the changes milaq made. I assume invisiblek did something similar if not the same.
Sent from my ADR6300 using Tapatalk
natediggity said:
I have a TouchPad too. Finally made the leap to kk and datamedia there which is what got me thinking about the Inc. The repartioning done for the TouchPad was too make the data partition larger since it now holds both apps and sdcard data. We shouldn't have to do that for the Inc since we already have a partition with 6.6 gig available. Nothing is mounted at /data/media, it's just another directory on the main /data partition. That's why you need a special recovery that "wipes" data instead of formatting...
I've been looking at the changes milaq made. I assume invisiblek did something similar if not the same.
Sent from my ADR6300 using Tapatalk
Click to expand...
Click to collapse
A fancy flashable script to convert your boot.img to use /data/media should be possible. So far I told it to switch to mmcblk03 from 01 for /data so it's 6.6GB. The other part is relocating fuse to use /data/media for the internal storage instead of /emmc. That should be somewhat easy to change but a bit harder to script.
/data/media was designed for devices that don't have an sdcard slot which the Inc does have so this is more of a proof of concept idea for me than actual utility.
Ok, the last part is recovery and the current recovery images appear to be large enough to make the recovery build part fail. I'm not sure the actual recovery partition size on the inc but the images come to be about 4.5 MB and fail.
zachf714 said:
ive got 2 incs so I dont mind messing with it, I have a touchpad tho and from what I know (I am decent friends with invisiblek and he does work on the touchpad) the only real difference, is re-partitioning your internal and setting the device tree to mount data as data/media instead of for say /data or /data/data
Click to expand...
Click to collapse
/data/media uses fuse on an existing ext4 partition so the recovery as nate said has to be told to wipe /data instead of format (in other words, using an rm command and excluding /data/media).
This makes filesystem corruption harder to fix since the partition can't be wiped from recovery normally unless it's a format which TWRP does have an option to format /data.
tiny4579 said:
A fancy flashable script to convert your boot.img to use /data/media should be possible. So far I told it to switch to mmcblk03 from 01 for /data so it's 6.6GB. The other part is relocating fuse to use /data/media for the internal storage instead of /emmc. That should be somewhat easy to change but a bit harder to script.
/data/media was designed for devices that don't have an sdcard slot which the Inc does have so this is more of a proof of concept idea for me than actual utility.
Ok, the last part is recovery and the current recovery images appear to be large enough to make the recovery build part fail. I'm not sure the actual recovery partition size on the inc but the images come to be about 4.5 MB and fail.
Click to expand...
Click to collapse
Check my device tree, I have a commit on omni that compresses recovery a bit more and I use it to build
Sent from my SCH-I535 using Tapatalk
tiny4579 said:
A fancy flashable script to convert your boot.img to use /data/media should be possible. So far I told it to switch to mmcblk03 from 01 for /data so it's 6.6GB. The other part is relocating fuse to use /data/media for the internal storage instead of /emmc. That should be somewhat easy to change but a bit harder to script.
Click to expand...
Click to collapse
I don't need a flashable script unless it's required. Personally, I'm fine just building a new system image and flashing that.
tiny4579 said:
/data/media was designed for devices that don't have an sdcard slot which the Inc does have so this is more of a proof of concept idea for me than actual utility.
Click to expand...
Click to collapse
datamedia can be used in conjunction with sdcards. This is what the new samsung phones do. I thought the HTC One did as well, but I just remembered it doesn't have a sdcard slot. If you haven't already, check out this page: https://source.android.com/devices/tech/storage/config-example.html. Our config would be similar to the Xoom's.

Categories

Resources