[Q] Moving apps to SD card android 4.3-> - Galaxy S 4 Mini Q&A, Help & Troubleshooting

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?

Related

[Q] How to create an Apps2SD partition.

I'm using ClockworkMod Recovery 2.5.0.1 and i've seen a couple of guides where I go into the recovery and do some bits and bobs there to create it, but the only options I seem to get are to mount the sd-ext partition, which fails because it doesn't exist, or to format it.
I'm guessing there is a step beforehand i'm missing?
Thanks
download rom manager from market , open it , then create a ext3 partionion ... done
before you create a partition , backup your sd card!!
y2viks said:
I'm using ClockworkMod Recovery 2.5.0.1 and i've seen a couple of guides where I go into the recovery and do some bits and bobs there to create it, but the only options I seem to get are to mount the sd-ext partition, which fails because it doesn't exist, or to format it.
I'm guessing there is a step beforehand i'm missing?
Thanks
Click to expand...
Click to collapse
I had the same problem.
You can create the partition using the ROM Manager app downloaded from the market as yasars said.
Alternatively, if you want to do it manually, you can format the card on a *nix system. The Gparted Linux app lets you edit the partitions in a nice and simple GUI. Just remember the order of the partitions: first fat32, then about 512 MB of ext2/3/4 (ext4 may not be supported by all ROMs so better to use ext3) and lastly a swap partition of about 32 MB (totally optional). The size of the fat32 partition is whatever is left over after you've allocated the 512 MB for the ext2/3/4 partitions (and the 32 MB for the swap if you decided you wanted it). For instance, for a 2GB card, leaving 512 MB for the ext2/3/4 partition (no swap) leaves us with about 1.5 GB for the fat32 partition. You do the calculations for your card in your head or on paper and use those values in Gparted.
HTH.
Thanks for the help guys
I think i'll just get it up and running using the ROM Manager and if I find the need I'll do a manual version
Foolowing this guide I partitioned my sd card with GParted Live CD.
gianton said:
Foolowing this guide I partitioned my sd card with GParted Live CD.
Click to expand...
Click to collapse
You have no Idea how cool it is for me that my tutorial was useful... ;-)
chrysochire said:
You have no Idea how cool it is for me that my tutorial was useful... ;-)
Click to expand...
Click to collapse
Yes it should be a sticky!
Having a problem when I try to use ROM Manager.
I select the 512 for EXT and 32Mb for Swap and the phone reboots.
It then shows the big triangle with Mr Android next to it until I press some buttons and then I get the recovery screen with the following messages
Finding Update Package....
Opening Update Package....
Verifying Update Package....
E:failed to seek in /cache/update.zip (Invalid Arguement)
E:signature verification failed
Installation Aborted.
I don't have a cache folder on my sd card so i'm guessing it's looking in the internal memory?
Not sure what to do here
BACK-UP sd card before you do this.
For windows users
have clockwork recovery and rom manager on your desire
then format sd in windows.
put it in your desire and go to rom manager.
select Partition SD Card
select your space i used 32 swap 512 ext
than reboot and your sd card has the ext partition.
than put your files back on your sd card and Done
y2viks said:
Having a problem when I try to use ROM Manager.
Click to expand...
Click to collapse
I had the same problem with ROM Manager. My solution was to downgrade ClockworkMod Recovery to v2.5.0.0 (in ROM Manager) and then partition the card. Worked on first try.
When you're done you can upgrade to latest version again if you want.
I don't think you should use a swap partition, so just set it to 0 MB.
Good luck!
Do i just need to find the 2.5.0.0 update.zip file and flash?
going to 2.5.0.0 worked
so now i have the ext partition do I need to do anything for apps to be installed there, or will they install there by default?
Also i've heard that the ext partitions can be 2 3 or 4. I'm presuming higher is better. How do I go about finding what mine is and how can I upgrade it if it need it?
Thanks
chrysochire said:
You have no Idea how cool it is for me that my tutorial was useful... ;-)
Click to expand...
Click to collapse
Hi, I'm also going to give your guide a go. Just one question, do I have to do it with the SD card still in the phone or can i do it with a SD USB adapter?
Thanks,
Joe
I read the tutorial again and you can use an SD adapter, worked a treat. Cheers
y2viks said:
going to 2.5.0.0 worked
so now i have the ext partition do I need to do anything for apps to be installed there, or will they install there by default?
Also i've heard that the ext partitions can be 2 3 or 4. I'm presuming higher is better. How do I go about finding what mine is and how can I upgrade it if it need it?
Thanks
Click to expand...
Click to collapse
As long as you have an ext2/3/4 partition and the ROM you're flashing has A2SD support (check before you download the ROM), you are not required to do anything more. To check whether A2SD is working once you've flashed your ROM, download the Android Terminal Emulator app from the market and use the following commands
Code:
su
ls -l /data
You should see your app directory pointing to /system/sd/app and app-private pointing to /system/sd/app-private
I'm not sure which format ROM Manager defaults to, but you can always check the type of format used by mounting the card in Linux and using the GParted Linux app (you could use a card reader or use the 'Disk Drive' option in your phone to connect it to the computer). Also, ext3 should be fine for most custom ROMs. In fact, not all ROMs support ext4.
ikkokusenkin said:
As long as you have an ext2/3/4 partition and the ROM you're flashing has A2SD support (check before you download the ROM), you are not required to do anything more. To check whether A2SD is working once you've flashed your ROM, download the Android Terminal Emulator app from the market and use the following commands
.
Click to expand...
Click to collapse
- Another quick way is to install quick system info from the Market, it tells you infos about your system, including the use of your a2sd partition.... ;-)
- About ext 2/3/4 I would advise the use of ext3, as ext4 is poorly supported by Roms (even those who pretend seem to have issues...)
cheers
Does the decrease of available internal storage means apps22sd+ is not working? I've partitioned twice and installed seperate 2.2 roms with apps2sd+ included and every time I install more things I see internal storage drop.
You should see your app directory pointing to /system/sd/app and app-private pointing to /system/sd/app-private
Click to expand...
Click to collapse
I checked this and it's doing what you said
ikkokusenkin said:
As long as you have an ext2/3/4 partition and the ROM you're flashing has A2SD support (check before you download the ROM), you are not required to do anything more. To check whether A2SD is working once you've flashed your ROM, download the Android Terminal Emulator app from the market and use the following commands
Code:
su
ls -l /data
You should see your app directory pointing to /system/sd/app and app-private pointing to /system/sd/app-private
Click to expand...
Click to collapse
I took the liberty of including this information into my tutorial. I added a reference to you. ;-)
I hope this makes it to Sticky one day... ;-)
bloosteak said:
Does the decrease of available internal storage means apps22sd+ is not working? I've partitioned twice and installed seperate 2.2 roms with apps2sd+ included and every time I install more things I see internal storage drop.
Click to expand...
Click to collapse
Not in itself, no. Those symbolic links mean that A2SD is working fine. However, from what I understand about the theory, even A2SD installs a part of the app into the internal memory. That may explain the drop you see. By the way, how much free memory do you see on your device? I usually have about 140 MB free on my Desire. I read somewhere that if A2SD wasn't working, that figure would be about 90 MB.
chrysochire said:
I took the liberty of including this information into my tutorial. I added a reference to you. ;-)
I hope this makes it to Sticky one day... ;-)
Click to expand...
Click to collapse
Thanks. Although, I can hardly claim to have come up with the idea myself.
ikkokusenkin said:
Not in itself, no. Those symbolic links mean that A2SD is working fine. However, from what I understand about the theory, even A2SD installs a part of the app into the internal memory. That may explain the drop you see. By the way, how much free memory do you see on your device? I usually have about 140 MB free on my Desire. I read somewhere that if A2SD wasn't working, that figure would be about 90 MB.
Click to expand...
Click to collapse
108 free total of 148
I just recently opened spare parts apps where it allowed me to change where apps2sd installs things. By default it was set to automatic and I'm guessing that was causing the problem. I set it to external and tried installing a browser while my disk was mounted and it wouldn't let me do it. Then I set it to charge mode and it installed normally.
Some roms probably default to external while some automatic.
edit: Just installed an app that I previously installed while using "automatic" and it still uses up internal storage instead of A2SD storage. Dunno what's wrong. I am using ext2 partitioned through rom manager.

[Q] how to transfer apps to new 8gb class 4 kingston sdcard

hi everyone
Been looking how to transfer all my apps to my new sd card using leedroid worked by tmod. Telstra htc desire.
i have tried to transfer everything to my sd card however i formatted it using rom manager, ext however windows wasnt recognising it formatted it using windows 7 then now the sd card wont mount.
would like some advice or software how to do this please help
cheers Arnie
If you want full apps on your sdcard (using ext) then you have to do this:
format to ext using the recovery, i used amon_ra, so im not sure how well and which version of clockwork recovery works well etc. I did 1GB=ext3 rest=fat32. Windows7 does not recognise the ext3 partition and always comes up with an error when mounting the card with "ignore error, fix error"..ignore error works perfectly well.
You need a ROM that has the scripts that allow this to happen. As such, afaik, it is a very minor detail/fix, but your ROM needs to support it. AFAIK, SupervillainHD and Defrost support this, I have not tested any others. Any ROM that says a2sd+ should support this method of a2sd, if in doubt try it out. There is no menu option, no extra thing to do. It will automatically detect if you have an ext2/3 partition on sdcard and do the moving on the first boot. Be aware that Cyanogen does not support the ext3 method of a2sd and only the crappy froyo a2sd. I believe there is a fix, but it sounded kinda hackish to me, and a lot of people in #cm seemed to have a bad opinion of ext3 a2sd (as opposed to the froyo's inbuilt a2sd).
The easiest way to test it out is to adb shell (or access root shell from the phone), and type ls -l /data/app*. If a2sd is on and working you should see something like this:
Code:
lrwxrwxrwx root root 2010-12-02 14:48 app -> /system/sd/app
lrwxrwxrwx root root 2010-12-02 14:48 app-private ->/system/sd/app-private
if note you should see:
Code:
drwxrwxrwx root root 2010-12-02 14:48 app
drwxrwxrwx root root 2010-12-02 14:48 app-private
Note that depending on ROM/phone setup the part after "->" can be /system/sd-ext/app or /sd-ext/app the point is there should be a -> and something after it, and the first letter should be l (for link) and not d (for directory).
N.B: As i said, and I am sure you are aware, Froyo comes with a built in semi-a2sd thing. this version does not need you do anything extra. Merely go to the Menu in any CM based ROM's and click on CyanogenMod menu (or some other extra menu you're rom may have put in) and select "always enable external storage of apps" or something similar (whatever option in there sounds like it). This is a hackish way of doing it. The proper way would be to go to menu->application->manage applications and select the app you want to move after installing it, and click on the "move to sdcard" button.
This is built into the android system, with more security features or smthg, but is a little lacking. Unless you use the hackish method (which is not always reliable afaik), the dude who wrote the app has to enable support for app2sd via this method in his app, not a lot of people do. But most big games and such do so. Also, this method only moves parts of the app to the sdcard. The biggest disadvantage is that the apps are stored in the fat partition, which means mounting the fat partition onto the computer (by clicking on "mount sdcard to computer via usb in the pull down bar") wil disable and render useless any apps that are on sdcard (until the sdcard is mounted back into android)...and widgets go haywire on reboot, since the fat partition takes a bit to come online (due to the checks the system does before mounting it). These issues do not occur at all with a seperate partition that is ext2/ext3.
-Tj

[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] External SD card encryption

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.

[Q] [HELP] SM 113 Unable to mount external partition as sd-ext

Initially Titanium Backup's "move to SD" feature looked like a great way to use tools I was already familiar with to make the most of limited internal storage. While searching for answers on how to set up what TB needed, it became clear that pretty much any similar app or solution - e.g. Mounts2SD - would need this partition mounted to function properly.
Problem is I can't seem to get it to work, despite trying EVERYthing that all of xda forums and Google can tell me. And there's a lot of info on this topic.
This is the mount command in Terminal emulator:
Code:
su
busybox mount -t ext4 /dev/block/mmcblk1p2 /sd-ext
(where I've confirmed that /dev/block/mmcblk1p2 is the partition I want to mount, ext4 is replaced by correct filesystem, and /sd-ext exists and is the desired mount point.)
It seems to go fine... I don't get any errors or feedback. But TB doesn't detect the partition even after adding an "app" folder using "mkdir" command.
Here's way more info than necessary about my situation in case it might help...
Device is SM-113, KK 4.4.4. Rooted, stock everything, selectively debloated using Titanium Backup Pro
Recovery is TWRP 3.0.0
Busybox by Stericson from Google Play
This is what I've done, in all possible combinations:
— Have used 3 separate SD cards: 32GB fresh out of the package (largest size officially supported by this tab) and 2 used 64GB (no documentation but it mounted and works fine for regular storage!)
— Used TWRP, AParted (from Play store) and Minitool (on Windows) to create the partitions
— 2nd partition formatted as ext2 & ext4 (read somewhere that ext3 wasn't a good idea...)
— Size of the 2nd partition ranging from less than 10% of SD card size up to 10GB
— Mounting to /sd-ext, /system/sd, and /data/sd (per TB's knowledgebase, linked above )
I've also attempted using a few apps from Google PIay as recommended by various threads on the subject from this forum (don't even remember which but I can look them up if necessary). I've since wiped and restored a nandroid backup so that none of these can potentially get in the way.
This IS working on my (also stock, MM 6.0.1) Galaxy S5 (G900W8) with one of the cards that didnt work on this tab - a 4GB ext4 partition on a 64GB SD card. After TB recognized it I set up init.d support and it happily mounts on every boot.
So it looks like it's something to do with this device, which sadly has extremely limited space that makes me want to cry. Therefore, I hope someone else with the 113 can lend a hand.
If necessary, I'm totally willing to flash stock, re-root, and set everything up again in order to make this work!
Not too sure. I use Aparted and Link2SD on a couple of my older toys...lol. I use ext 3 too. I have a 210, I'll play with it and see if I can figure it out.
Thanks @RealWelder! Don't know if that'll help as it's a different device, but let me know what, if anything, you figure out.
Personally, I'm going to give it another shot using the 'Mounts2SD' app (even though I'd wanted to do this WITHOUT any new apps... oh well, if it works at least I'll have plenty of space!)
I got it to work! *happy dance* Absolutely NO idea exactly what did it, but there was a lot of fiddling with permissions, and rebooting, and painfully typing "mount -t ext4 etc. etc." into terminal, and making adjustments to init.d scripts until finally ... TB recognized it.
Thank you XDA forum!
Sent from my Samsung SM-T113 using XDA Labs

Categories

Resources