[Script] swapconf - swap config - Motorola Milestone Android Development

Description:
A small command line tool to create, delete, enable or disable swap file on sdcard and autostart swap file or partition on boot (zRam (compcache) is configured through system Settings))
Features:
- Automatic detection of partitions and files: if you do not have a dedicated swap partition, script uses swapping to file - first on sd-ext and if that one does not exist then it swaps to sdcard. Swap partition takes precedence over files. This should work no matter if you have or do not have ext partition (for app2ext) on sd card.
- create and delete swap file - you can test different sizes without rebooting
- ability to start and stop swapping where ever it may be configured: biggest advantage of this is that you can stop swap if you have it on your /sdcard so you can use mass storage mode. Also, you can test various sizes for swap files or how your system works when swap is disabled, without need for a reboot
- misc. activities: view status of swap partition/files and status of memory
Usage:
Code:
Disable startup: swapconf 0 -> disables startup script
Enable startup: swapconf 1 -> enables startup script
Create swap file: swapconf mkf size_in_MB -> creates swap file of specified size (e.g. swapconf mkf 30 for 30MB swap file)
Remove swap file: swapconf rmf -> removes previously created swap file
Start swap: swapconf start p|f -> starts swapping to partition (p) or file (f)
Stop swap: swapconf stop -> stops swapping whereever it may be started
View swap status: swapconf status -> view status of swaps and memory
NOTE: Enabling both swapping to partition and to file is not supported.
If you have a dedicated swap partition on sdcard it will be used if enabled. Otherwise you need to configure swap file.
The attachment is OpenRecovery flashable update zip. Simply apply update.
Startup script should persist across new ROM updates until you do a factory reset (wipe data)
Feedback is welcome
Changes for version 0.2:
- relocated script from /data/local/bin to /system/bin: if your terminal app does not export /data/local/bin to PATH that should not be an issue anymore. Script should still persist across ROM updates [thanks to kabaldan for the tips ], startup script should persist until you do a factory reset (or you delete/disable it ).
- reworked script commands: previously you were not able to create swap file without enabling startup script
- improved partitions detection
- fixed a bug where you could not stop swapping to file if zRam was active
- mics. fixes and cleanups
Changes for version 0.2b:
- fixed backup of swapconf script during ROM upgrade on CM10
Notes:
- script will not persist when changing different ROM versions, e.g. from CM7 to CM10
- kabaldan and Skrilax_CZ have informed me that it is a bad idea to have active swap on sdcard's FAT32 partition unless there is an app that will disable swapping when the sd card is going to be mounted to PC. So far, the only issue I have noticed is that you can not mount USB mass storage mode until you turn off swap so I left that possibility enabled. The choice is yours (btw., it uses fat32 partition only if you have no dedicated swap partition or ext partition).

Thanks a lot for the info.

Bravo mrvek!
"Svaka cast!"
Sent from my Milestone using xda app-developers app

Great piece of swap tool! Great jobs mrVek!
in my case i can't directly cmd 'swapconf status' as shown in your screenshot, but have to cmd 'sh swapconf status' than the script run...
Thank you anyway, save me lots of time.

@arttree: that's odd. I haven't had such issues. Do other commands have the same issue? What rom are you using?
That seems like a permissions problem, execute perm. maybe missing. I'll look into it. You can try to chmod 755 /data/local/bin/swapconf to see if it'll help.

/data/local/bin/swapconf permision is 755. i installed/flashed it using update-OR-swapconf.zip you posted in 1st post.
anyway other than execute using "sh", everything work fine, even after reboot my MS, swap partition detected automatically.

Do you have /data/local/bin in your PATH? Or you always navigate to /data/local/bin?
Try this:
echo $PATH
To see if /data/local/bin exists in your path, if not then:
export PATH= $PATH:/data/local/bin
after that you wont need "sh" or "./" before swapconf (and you will be able to execute swapconf cmd from everywhere)...
Remember that this is not permanent PATH export, you need to do that everytime, as mrvek guided me, in terminal's settings there is an option to execute some commands on console startup (similar to .bash_profile) and you should put there "export PATH= $PATH:/data/local/bin" so you don't have to do that every time on console startup.
Sent from my Milestone using xda app-developers app

great tips! It work! Thanks.

Little problem:
$ su
# swapconf 1
[[: /dev/block/mmcblk0p1: unknown operand
Created configuration.
Enabled startup script.
#
Seems like the script thinks that mmcblk0p1 is swap - but that's my ext-partition...
My swap is mmcblk0p2
But it seems like I'm misinterpreting this error, am I not?
Sent from my Milestone using xda app-developers app

Eiertschik said:
Little problem:
$ su
# swapconf 1
[[: /dev/block/mmcblk0p1: unknown operand
Created configuration.
Enabled startup script.
#
Seems like the script thinks that mmcblk0p1 is swap - but that's my ext-partition...
My swap is mmcblk0p2
But it seems like I'm misinterpreting this error, am I not?
Sent from my Milestone using xda app-developers app
Click to expand...
Click to collapse
mmcblk0 is sd card, if present. mmcblk0p1 is first partition and should be FAT32, mmcblk0p2 is second partition (ext, and it must be p2 because some things in system assume that ext is 2nd partition if it exists, otherwise it won't mount it) and mmcblk0p3 is 3rd (usualy swap).
Neverthelss, these are issues, especially on CM7, with the script that need to be fixed asap.

Updated OP with new version (0.2).
I have tested it with different configurations and it seems to be working. Let me know if I missed anything.
Thank you all for your feedback.

I hope not being nasty, more between your script and what we've used (-FuFu-v5), is there any difference important?

with this script you can config your settings by using the terminal
my script only aktivate swap and creates a swapfile (if needed), to config my script you must edit the script itself

Yes, interactivness.

ty!

bug fix
Updated OP (again).
Only change was a fix for CM10 so it should persist between rom upgrades (ie., swapconf script is properly backed up during CM10 install).
I'm sorry for the trouble, haven't noticed it before.

thank you for improving your scripts. Great piece of script that our life a lots lots easier.
btw, if i used swap file option, do i need to manually stop it before i enable the mass storage(connect to PC)?

arttree said:
thank you for improving your scripts. Great piece of script that our life a lots lots easier.
btw, if i used swap file option, do i need to manually stop it before i enable the mass storage(connect to PC)?
Click to expand...
Click to collapse
Yes but only if swap file is on sd card fat32 partition. If you do not have an ext partition then it was created in sdcard's fat32 (/sdcard/.swapfile)
If it is on your fat32 partition and is active you need to stop it before connecting to mass storage mode.
Please note that intended purpose of startup script is to enable swap on boot. To do that it uses certain priority - first it tries swap partition, if that did not exist then it tries ext partition (if you created file) and the last resort is sd card fat partition (also needs pre-created file). The same applies to manual creation of file - ext has precedence over fat32.
I guess that is not a design flaw.

is it fullly compatible with Compcache of zRam?

gambarini said:
is it fullly compatible with Compcache of zRam?
Click to expand...
Click to collapse
Hm... not sure if I understand.
zRam/compcache is controlled in ROMs settings.
On the other hand you can have zram enabled and still use this scrip to configure swap to partition or file but you can't manipulate zram with this script.

Related

[Q] ext2/ext3/ex4 and lynux-swap with incubus RLS14/15

Hi, I have been testing several NAND set-ups
-system to NAND and data to resized data,img
-system to resized system.img and data to resized data.img
-system to NAND and data to ext2
...
I am currently using NAND and data to ext2 partition, so all apps are installed there. After lots of reading I can not understand posts that are obsolete and posts that are not so I would appreciate if someone can explain me the basics and optimal setup for incubus superfroyo RLS14/15 roms:
I have now 4 partitions:
1) fat32,
2) 1,5G ext2 (app, app-private etc),
3) 1,5G ext2 (lost+found folder) and
4) 96M lynux-swap.
- How can I turn ext2 to ext3? do I need to do so? I have also read about ext4. Upgrading to ext3/ext4 applies to my 2) partition, to my 3) partition or to both? will I loose data stored? "there is no ext3/ext4 fs because there isn't the support on the compiled kernel. Ext3/ex4 are journal file system so are bad for limited writing device like nand or sd and thre is no good rease to use it" answered by l1qd1.
- How can I check if my lynux-swap is enabled and used by the rom?
- Do partitions 2) and 3) really need to be <1,5 G? why so?
- Can I take apk from apps folder in partition 2) in case I want to keep them for future fresh installs?
- What is lynux-swap optimal size? a 1,5G partition would be worse than 96 M? Why?
- Which tools are you using with incubus roms to manage installaion location and similar functionalities?
Another big mark I have is about deoxeding installed aps (not belonging to the ROM). Should I do it? why? how?
Pretty basic stuff I guess for experienced users & programmers, but I am new to lynux and android. Have read lots of things but it is difficult to learn by myself what would work with our Polaris and incubus ROMS and dzo/kk kernels,
Stick to ext2 man, you won't turn your old engine to 240mph on a Ford Model T.
You're not getting some major boost if the hardware dosn't use it, so I'd stick with ext2.
And you also want Super FroYo on your ext2 partition, yes? I'm here to help.
- How can I check if my lynux-swap is enabled and used by the rom?
adb shell
Code:
free
if on swap you have 0 it isn't enabled.
Code:
swapon /dev/device
to enable it or i suggest you tu use compcache.
- Do partitions 2) and 3) really need to be <1,5 G? No
- Can I take apk from apps folder in partition 2) in case I want to keep them for future fresh installs? Yes but not all apk support this
- What is lynux-swap optimal size? a 1,5G partition would be worse than 96 M? Why? Too Big = more sparse but it's a problem only for real disk so you can create a swap big as you want but it's unuseful (100 M is enaught)
i suggest you to switch to my kernels because are more updated and kk move to another device.
Yah l1q1d I love ur kernels. Eager for more !
l1q1d, I am testing your kernel as you advised me. I could apply the wifi patch without problems using your androiupdate18-09-10, as you told me some time ago they are both 2.6.25.
However I do not manage to turn linux-swap on: that's what I do: I install ubuntu, I use G-Parted to create partitions on the sd card. When I do so, the third partition is always shown as linux-swap in G-Parted but when I test adb shell -> parted -> print, it always shows as ext2. I can not dismount and can not swap on it.
The other way round, if I deleted all partitions with G-Parted and create the partitions with mkpartsfs or if I use mkfs to change the third partition from ext2 to linux-swap, then sometimes I can swap on it (directly on adb shell or with G-Parted) but when I unplug the device will tell me the card is empty and will not be able to mount it, access it from ubuntu or from the device. If I reboot then, the system will hang until I install both data and sysetm to nand. This happens no matter if I activate or not from the polaris or even if I switch on or off usb mode. The card at that point is useless. I guess the partition table or some other basic file is messed.
Could you please explain a little more how can I come with a 13.5G fat32 partition, a 2,4 ext2 partiions and a 0,1 lynux swap swapped on partition??
I really need to test this set up, since with the standard set-up (system to nand, fat32 for files and ext2 for installed apps I can not install all apps I use since performance drops significantly).
regards
well, ... dumb me, maybe with compcache you are referring to launch a script?
where do I get this compcache.sh? how do I launch it? from adb? from the terminal? from the sd card?...

[Utility] ext4 data2sd for Froyo ROMs

If you are always low on program memory, this data2sd might be for you. It works with any Froyo for the G3.
Note: This won't wipe your data, but you should have a backup, just in case. First backup the phone to the SD card, then the SD card to your computer. Be cautious. I give no guarantee whatsoever. If your phone behaves funny, even eats your cat afterwards, I take no responsibility.
Note: starting with version 3, the new storage size will NOT be reflected in the Task Manager or in Titanium Backup. I'll see what I can do about it.
You need a rooted phone and an SD card, preferably 2 GB or more and class 6 or better (higher). data2sd doesn't make your phone faster. Much to the contrary: it extends your memory at the cost of speed. That said, if your SD card is of a class smaller than 6, this will work too. The slowdown, however, will be noticeable in some situations.
Three steps are needed. First, we need a kernel with built-in ext4 if you don't have one. Second, we bring the data2sd into its place. And third, we create an ext 4 partition with the desired size. Now follows a detailed description of these steps.
Step 1: Check your kernel
You need a kernel with built-in ext4 capability. The custom ROMs mostly have one. If you are running a stock kernel, you must install one, e.g. from http://forum.xda-developers.com/showthread.php?t=978823 . Follow the installation steps detailed there. (Changing the kernel does not wipe your phone).
Step 2: Install data2sd
You now must install data2sd onto your phone. As long as you didn't modify your SD card (as long as partition #2 is not ext4), this will have no further impact on your phone.
Download data2sd.zip from below and unzip it. There's a single file in there: data2sd.sh. Use the tool that suits you best to transfer it to the SD card of your phone. With adb, you would do
Code:
adb push data2sd.sh /mnt/sdcard
Now either start a terminal emulator with a root shell or use adb again. With adb, you would execute
Code:
adb shell
Make sure you are root (the prompt reads '#'), else run "su". Now type in:
Code:
# sh /mnt/sdcard/data2sd.sh
You will see some lines about what is happening and a final confirmation.
That's it. Again, your phone will continue to behave as usual.
Step 3: Prepare your SD card
You can use any amount of program memory up to the size of your SD card, but be sure to leave some room for application data on the normal (#1, vfat) partition. As a rule of thumb, 0.5 GB of program memory will satisfy most needs, 1 GB is plenty.
If you're running Linux, prepare a second partition (must be partition #2) with the desired size. Use the usual utilities to do so. This includes gparted, but there are also other means. If you use gparted, you can follow the description for Parted Magic below.
If you have no access to a Linux computer, even not your friend's, your (probably) best choice is to run Parted Magic from a live CD. For this, go to http://partedmagic.com, and burn your CD. Instructions on how to do it with different burning tools are also there.
Step 3.1: Partition and format your SD card with Parted Magic (also applies to gparted)
The following describes the steps to partition your SD card with Parted Magic. You don't need to use this method - use the tool that suits you best.
I assume you have gparted or Parted Magic running and your SD card inserted into the card reader of your PC. Now select your card from the drop-down menu of available drives in the upper right corner. You better double check that you're on the correct drive (card). It will happily erase your system disk if told to do so.
Right click near top into the block designating your current partition #1. Select "resize". (I assume that your partition #1 is the only one. If not, delete the other partition(s)). Change the size to the total size of your SD card minus the desired size for program storage (/data). Confirm your selection.
There is now a gray block designating free space to the right of your first partition. Right click it and select "New". In the following window, leave the sizes as they are. Leave "create as" to be a primary partition, and change "file system" to ext4. Confirm your selection ("Add").
The gray block at the right has changed to a colored frame. Right click it again and select "Format as". Select "ext4".
If everything went well, you can now click on the green check mark in the icon bar near the top, confirm, and watch Parted Magic resizing your normal (#1, VFAT) partition and creating the new ext4 one.
4. Finale furioso
Now insert the SD card and reboot your phone. The Task Manager will report the new size in its rightmost tab, as do the other utilities like Titanium. All user apps and data should be in place. All will look like you have soldered in an extra chunk of internal memory. Despite not being directly visible, your program memory is resized to be the new partition. You see its size and its usage (in percent) by running
Code:
df
from adb or from a terminal emulator. Have a look at the subdirectories of /data displayed there.
As a final step, you can safely remove data2sd.sh from your SD card (/sdcard). It is not needed any more.
Q&A
* How can I remove my SD card while the phone is on?
You can't. Don't try. Always switch your phone off before you remove the SD card.​* How can I return to the state before data2sd?
Remove the SD card. All user data and apps will be there in the state you left them before you installed data2sd. The data2sd script you have installed simply does nothing as long as there is no ext4 #2 SD partition.
If you want to reuse the SD card, remove partition #2. This can be done with each partitioning tool, you don't need Linux.​• What about app2sd from Kyrillos 3.0? Is it compatible?
Yes. But "no" for the "no wipe" version which was offered for a short period of time. In the latter case, clear out the ext4 partition (important: do not forget the hidden .data2sd_initialized file) or simply reformat it before reusing it.​* It doesn't work. What can I do to help diagnose the problem?
See if the file /mnt/asec/data2sd/log.txt exists. If it does, have a look at it and try to make sense of it. If it doesn't tell you anything useful, add it to your error description in the forum here. If there is none, mention that in the description.​* What things must be considered if I flash a new ROM?
As always with such actions, make sure you have a backup. That said, just flash the new ROM and then install data2sd. When you reboot with the SD card in place, all user Apps and all data should be there. No restore from backup required.
Only in the rare case that the new ROM explicitly requires you to NOT restore your old data, e.g., from Titanium, you should reformat your ext4 partition (to clear it out) and proceed as advised by the ROM makers.​Versions:
2011-03-19 Initial release
2011-03-21 Version 2
- Updated for ROMs without /system/etc/init.d
- Simplified installation of the core parts
2011-03-23 Version 3
- Vibration bug fixed
- App2SD mode added: If the ext4 partition bears the volume label "app2sd" on a new blank SD, only /data/app is moved. This greatly reduces size benefits, but results in nearly no speed loss.
- Just run the data2sd.sh file (as described in step 2) to upgrade without data loss.
- Note: the actual size will NOT be reflected as described in the Task Manager or in Titanium.
Gosh this sounds so complex and risky! Isn't there a easier way?
☞★sent from my Galaxy3!!
♪drajax!! ♬♂ツ
drajax said:
Gosh this sounds so complex and risky! Isn't there a easier way?
☞★sent from my Galaxy3!!
♪drajax!! ♬♂ツ
Click to expand...
Click to collapse
Flash Kyrillos' v3.1 where's the script's allready built in...
It is less complex than it sounds. The description is just really very detailed. The details may sound confusing until you try it. And if you have access to Linux, it is really simple. We Linux users also have to use a different operating system when we flash our phones.
Alternative: Install Kyrillos 3.1. It contains the same data2sd and comes with a partitioning tool. But, as far as I can tell, you need to reformat the SD card's vfat part on the phone and lose the data there (not sure, however).
when i try to set permissions it says permission denied . Any help?
http://www.appbrain.com/app/move2sd-enabler-(root-only)/com.leinardi.setinstalllocation
Just one quick question....
I am having the stock JPM ROM... in that case do i need to have some new Kernel to use your data2sd???
I'll be using this!
Sent from my ACID Lestatious v1.4.5.5 Galaxy 3 FROYO
When i write down "/ # cd /system/etc/init.d/"
it says "sh: cd: can't cd /system/etc/init.d/"
What am i doing wrong???
Pinak.ahuja said:
when i try to set permissions it says permission denied . Any help?
Click to expand...
Click to collapse
You're not in a root shell. Enter "su" as your first command.
next2devil said:
When i write down "/ # cd /system/etc/init.d/"
it says "sh: cd: can't cd /system/etc/init.d/"
What am i doing wrong???
Click to expand...
Click to collapse
Don't know. Try this:
cd /system
cd etc
cd init.d
and report where it fails and if you are using adb or a terminal emulator. If it doesn't fail, continue with the line after the cd command.
Awesome work mizch!
We can refer to below link for partitioning of sd card to ext4 using adb
http://forum.xda-developers.com/showthread.php?t=534714
Hi Mizch,
Thanks for the script. have few questions; requesting for an answer:
1. Once data2sd is done, will sd card be auto mounted on reboot?
2. I am running JPM with Apollo's data2sd (ext2 partition for apps 1.1GB). What will be the benefit of ext4 over ext2?
3. I understand that i have to remove apollo's lagfix and then apply ext4 data2sd. Is there a way, i can also apply lagfix?
Thanks
jaskiratsingh said:
Hi Mizch,
Thanks for the script. have few questions; requesting for an answer:
1. Once data2sd is done, will sd card be auto mounted on reboot?
Click to expand...
Click to collapse
Yes. And for the first boot, it gets initialized too.
2. I am running JPM with Apollo's data2sd (ext2 partition for apps 1.1GB). What will be the benefit of ext4 over ext2?
Click to expand...
Click to collapse
Reliability, especially in crash cases and generally when the phone is shut down without a clean unmount. Ext 4, being a journaling file system, tries to keep the file system in a consistent state whenever possible. ext2 does nothing like that. So, when you forcible switch off your phone by long pressing the power button, most likely you are continuing with a damaged file system whose errors accumulate from now on and will eventually become visible at some time later.
There's one drawback, however: ext4 has to write more data than ext2. ext4 must always write the information needed to reconstruct a consistent file system to its journal.
3. I understand that i have to remove apollo's lagfix and then apply ext4 data2sd. Is there a way, i can also apply lagfix?
Click to expand...
Click to collapse
If I'm correct, the lagfix converts /data (your program storage) to ext2. Since /data is now handled by data2sd and converted to eyt4 anyway, you cannot use lagfix any more. You need to remove it.
mizch said:
If I'm correct, the lagfix converts /data (your program storage) to ext2. Since /data is now handled by data2sd and converted to eyt4 anyway, you cannot use lagfix any more. You need to remove it.
Click to expand...
Click to collapse
Thanks for the quick reply mizch. If i have to check apart from data, if anything else is converted into ext2, how can i do that?
jaskiratsingh said:
Thanks for the quick reply mizch. If i have to check apart from data, if anything else is converted into ext2, how can i do that?
Click to expand...
Click to collapse
have a look at the output of 'mount' or 'busybox mount'.
rm 02-app2sd for who use kyrillos ROM...i didn't do that command..but it seems works fine...what does it change if i use that command???
mizch said:
Don't know. Try this:
cd /system
cd etc
cd init.d
and report where it fails and if you are using adb or a terminal emulator. If it doesn't fail, continue with the line after the cd command.
Click to expand...
Click to collapse
I tried what you mentioned.... but again it shows the same error. It works well till "cd etc". Then, for init.d it shows out the error.
It seems the location for init.d is different in my device
next2devil said:
I tried what you mentioned.... but again it shows the same error. It works well till "cd etc". Then, for init.d it shows out the error.
It seems the location for init.d is different in my device
Click to expand...
Click to collapse
Yes. Probably there is none. What ROM are you using? Is it a Froyo ROM and from where?

[SCRIPTS] [HOWTO´S] (untested) app2sd, sd card speed fix script | how to guides |

hi all! im new TF user but i tough i could post here some fixes and scripts that i use on my Samsung galaxy 3 but beaware that i have not tested these but they should work on every device im not responsible for any damage that may occur when you apply these scripts!!
1st there are 3 app2sd scripts
What is App2sd? App2sd is a utility which automatically moves some/all your data partition to your ext sd partition. So, your internal space is partially/not used
Which app2sd version should i choose? As you can see, there are 3 versions: App2sd-v1, App2sd-v2 & App2sd-v3.
Differences in versions App2sd-v1: It is the normal app2sd script. This script moves your /data/app/ & /data/log/ to your sdcard's ext partition. It is very fast but your real internal space will be full if you install many apps. This version is not recommended. App2sd-v2: It is an enchanced version of app2sd, which moves /data/app/, /data/log/ & /data/dalvik-cache/ to your sdcard's ext partition. It is fast and you can install many apps until your internal memory reaches 0mb.. Is is recommended for sdcards class2 - class4. App2sd-v3: It is an ultra enchanced version of app2sd, which is like data2sd, but you won't have so many lag like data2sd. App2sd-v3 moves /data/app/, /data/log/, /data/dalvik-cache/ & /data/data/ to your sdcard's ext partition. Your internal memory won't be used unless you do install so many apps and your sdcard's partition get full! SDcard class6+ is highly recommended! Conlusion: If you have class2 or class4 sdcard use App2sd-v2. If you have class6 sdcard use App2sd-v3.
Requirements You must have a kernel which supports init.d & ext4. And you must have an ext partition in your sdcard. Ext4 is recommended. And last thing... You need android 2.2.
How do i check my sdcard's class? Remove your sdcard from your phone and check if you see a circle with a number. If your dont see anything, you may have a class2 sdcard.
How to partition my sdcard? Download MiniTool Partition Wizard Home Edition 6.0. But make a backup before
How to install the script? Take a nandroid backup. Download it from links below and decompress it to your sd. You can either adb push this script in /system/etc/init.d/ or copy it with root eplorer to /system/etc/init.d/. Type the commands: adb shell (adb only) su mount -o rw,remount /dev/block/stl6 /system chmod 777 /system/etc/init.d/* chown 0.0 /system/etc/init.d/* Then reboot in recovery and do a wipe data/factory reset. All your data will be wiped. From now on some/all of your data (depends on the script version) will be moved to your sd automatically. Before you restore your apps with titanium, go in titanium preferences and select to force restore apps to internal memory. Don't move apps to external!!
Why i see only 200mb as internal? App2sd is invisible You can check your sdcard's ext partition in Titanium Backup.
=> app2sd script v.1
http://forum.xda-developers.com/attachment.php?attachmentid=592379&d=1305062488
=>app2sd script v.2
http://forum.xda-developers.com/attachment.php?attachmentid=592380&d=1305062488
=> app2sd script v.3
http://forum.xda-developers.com/attachment.php?attachmentid=592381&d=1305062488
credits go to KYRILLOS13 who introduced these on SG3!
then there is sd card reading speed fix
How to make it work!
At first it needs root & busybox...
Download the script, choose the cache size you want between 1024, 2048, 3072, 4096 kb! (Recommended size: 2048kb)
Extract the .zip file you downloaded and put the 77sdcardspeedfix in your sdcard.
Run root explorer and move the file in /system/etc/init.d/ (If there is no init.d folder, create one!).
You can also adb push 77sdcardspeedfix /system/etc/init.d/
Run a Terminal Emulator/Adb and type the commands:
Code:
adb shell (if you are using Terminal Emulator, skip this command)
su
chmod 777 /system/etc/init.d/77sdcardspeedfix
chown 0.0 /system/etc/init.d/77sdcardspeedfix
reboot
After that the phone will reboot. You will see that your sdcard reading speed has increased!
thanks for BRAINMASTER who made the script!
more scripts coming soon!!
[HOWTO] get ADB up and running (easy way)
ADB is an acronym for Android Debug Bridge and is a development tool for the Android Mobile Operating System
NOTE this is only for windows!
-open this link --> http://adf.ly/Xfyl wait 5 secs and click upper right corner "skip ads" it will download a program that automaticly installs android sdk (wich includes ADB)
-Open the app, leave the destination as C:\ and click ok/install
-Installing ADB/USB Drivers:
*NOTE* You may need additional (Device Specific) Drivers for your Device!
- Connect your Android Device to your PC using the provided USB Cable or just a plain ole 6-pin to 4-pin usb cable... (I prefer to use one with a ferite core)
- When the new hardware device notification pops-up on your pc point windows to the driver folder we moved to our C-drive(C:\android-sdk-windows\google-usb_driver) and install the adb driver.
** if your having issues with installing ADB drivers read this --> http://dl.dropbox.com/u/20575563/ADB...or_dummies.pdf
-Running ADB from the Command Prompt:
-Windows XP: Select Start or Tap the Windows Key on your Keyboard, select
"Run" and type "CMD" then hit "Enter".
-Windows Vista/Win7: Select Start or Tap the Windows Key on your Keyboard, select the search box on the left and type "cmd" then hit "Enter".
Add the "ADB" directory path as a system variable in windows:
-To do this right-click on "My Computer" and select Properties. Next select the Advanced tab(Advanced Settings in Vista/7) then select Environment Variables.
-Click "New" under System Variables and add the following:
Variable =
Code:
adb
value =
Code:
C:\android-sdk-windows\platform-tools
-Call up your Command Prompt:
Time to start adb
- Open up a Command Prompt Windows
- Type the commands below:
Code:
cd C:\android-sdk-windows\platform-tools
<= press enter
Code:
adb.exe
<= press enter
and voila You will see alot of scripting fly through the command prompt window.
***note! you have to enable usb debugging in --> settings --> applications --> developement --> check usb debugging
tutorial is not made by me, its made by AndroidSamurai. i found it after lot of researching, so i tough i could share it with you!
[HOWTO] edit BUILD.prop
1. open root explorer
2. go to /system, find build.prop, change to read/write mode. open the build.prop in text editor
* change build version: 4th line should say ro.build.display.id=(here you write your build version name), reboot and check build version in "about phone"
* change model number: 15th line should say ro.product.model=(here write your model number ), reboot and check model number in "about phone"
* change firmware version: 8th line should say ro.build.version.release=(here write your firmware version, like 4.x ice cream sandwich), reboot and check firmware version in "about phone"
you can also change different things but ill write a guide of that later
hope you like it!
also reserved for later use
updated how to´s
over 100 views but no replys.... are you there ? if you like these ill provide more scirpts, how to's and fixes
Considering the TF is android 3.x based I assume this is just a typo in the first post "Requirements You must have a kernel which supports init.d & ext4. And you must have an ext partition in your sdcard. Ext4 is recommended. And last thing... You need android 2.2."
Thanks for the post
1 question:
WHY use app2sd on a device with 16gb of internal storage?
DroidRevenge said:
1 question:
WHY use app2sd on a device with 16gb of internal storage?
Click to expand...
Click to collapse
well, maybe you have 16gb of music and you wnt to have somegames too : D
jazux said:
well, maybe you have 16gb of music and you wnt to have somegames too : D
Click to expand...
Click to collapse
Why not put the music on the microsd card instead? Then you wouldnt need apps2sd.
stuntdouble said:
Why not put the music on the microsd card instead? Then you wouldnt need apps2sd.
Click to expand...
Click to collapse
true.. well the script is there if someone wants it
jazux said:
true.. well the script is there if someone wants it
Click to expand...
Click to collapse
Ehhh....just a couple notes about the "speed fix" at least. First, it's easy enough to test using hdparm. Second, none of those scripts will work for the external card because that's not where the readahead knob is located. Third, the only script that will work is one that would be exceptionally ill advised to use. The scripts writing to .../vold/179:0 or mmcblk0 adjust the readahead for all of the mmc0 partitions, ie, /system, /cache, /data, etc. If you set readahead to some obscene value, you'll certainly end up thrashing data as you do all sorts of unnecessary readahead. (ie, you readahead on a file, you don't use the section of data which was read ahead, it gets flushed from memory, you readahead on another file, don't use it, it gets flushed from memory, etc, etc.)
Fourth, I actually did test this when I first got my Transformer, and the difference is read speeds was only about 1.5% for a readahead value at the default 128kB or 2048kB for either the internal or my external class 10. YMMV.
edit - Please update the op so we don't keep spreading bad information.
Waste Thread
lol don't you think this thread is crap and it should be deleted
jazux said:
true.. well the script is there if someone wants it
Click to expand...
Click to collapse
But does it work with android 3.2??? or only 2.2?
stuntdouble said:
Why not put the music on the microsd card instead? Then you wouldnt need apps2sd.
Click to expand...
Click to collapse
because some reason the stock music player and many other music player dont even read music on the microsd card.
Add the fact we are starting to get large games that has gigabyte worth of data to download(shadowgun)
victorythagr8 said:
because some reason the stock music player and many other music player dont even read music on the microsd card.
Add the fact we are starting to get large games that has gigabyte worth of data to download(shadowgun)
Click to expand...
Click to collapse
What are you talking about? The stock music app absolutely DOES read music off the microSD. I don't keep any music on the internal SD.
You guys are arguing over a several month old thread that someone necroed.
philburkhardt said:
What are you talking about? The stock music app absolutely DOES read music off the microSD. I don't keep any music on the internal SD.
Click to expand...
Click to collapse
i confirm it,i have msic on sdcard and gb of gameplay files on internal memory from the day that i buy transformer,half summer!
Jazux thanks so much you rule
Sent from my Transformer TF101G using Tapatalk

[script] 98swapon by -FuFu-

Hi there,
here now the official thread for my 98swapon script...
Latest Version: V11
Download: http://droid-world.bplaced.net/index.php?cat=Downloads&page=Scripte
there you will always find the latest version
Infos about the Script you can find here: http://droid-world.bplaced.net/index.php?cat=Milestone&page=Swap Aktivieren
but its German
here a translation using google translate (so please excuse the bad english, but i think my english is not much better then google translate)
Simply download the latest zip and copy to /sdcard/Open Recovery/updates and then run in the Open Recovery by apply update.
Best done previously a Nandroid backup of your current system, which you can import in case of problems again.
UPDATE
As of Version 9, there is on the SD card, the file swapon.conf with which you can adjust the different variables of the script, so it's no longer necessary to directly edit the script.
SWAPSIZE is the amount of swap in MB
If you put SWAPINT to 1, the internal memory is used for swap.
Swapdev determines which internal partition to use, possible / are cache and / data, all other partitions were too small to use it for swap.
RESETSWAP at 1 and at every reboot the swapfile is created, what is nützlch when changing SWAPSIZE.
SWAPIONLY set to 1 and it will only set the value for swappiness with boats, the rest are ignored.
For the rest of the values ​​consulted with Google, I can not say at all what may.
To edit the swapon.conf please use Notepad + + or it may cause problems.
Click to expand...
Click to collapse
i only test the script on cm7 and there it works fine...
if you have problems or find some issues, please let me know...
please post your swapon.log from /cache if you have a problem, and also your swapon.conf from sdcard.
changelog
V11
- add dos2unix to script, so that is now also possible to edit the swapon.conf with windows editor
V10
- add disable funktion to the script
- script now work on cm7 and cm10
Works perfectly on CM10.
Erovia said:
Works perfectly on CM10.
Click to expand...
Click to collapse
Did you try internal memory settings? It doesn't work for me on CM10.
main problem is, that the swapon.conf will not be found on boot...
so i need the mount points on bootup to see if the sdcard will be mount and for that i have line 19 in the script only thing to do is to delete the "##" to activate the line...
you also can edit the line directly in the zip befor apply it via OR apply update...
but if there still "/sdcard/swapon.conf not found..." in /cache/swapon.log there is something wrong...
may sdcard will not be mount on boot
or
there is no swapon.conf an sdcard
koodiifin said:
Did you try internal memory settings? It doesn't work for me on CM10.
Click to expand...
Click to collapse
Nope. I have serious concerns about using the internal memory as swap.
@Erovia
did you also have "/sdcard/swapon.conf not found..." in /cache/swapon.log?
if so i think its a mounting issues on cm10
I think you misunderstood me.
I have concerns about the idea of swapping on the internal memory, not problems with the script itself.
i understand you
i only want to know if the script found the swapon.conf on sdcard
Oh, in that case I misunderstood you.
You are right. It seems the config file is not found on CM10.
(Maybe if you use /mnt/sdcard/swapon.conf ? I know it is basically the same, I just dont have any other idea. Or maybe CM10 mounts the sdcard after the script runs? )
i add a mount command to the script, for cm7 it works fine but i think on cm10 it wont work...
but i dont kwno why...
for me it will be a help if you also delete the "##" on line 19 in the 98swapon script, the in the swapon.log all mountpoints will be shown....
on line 18 the script will try to mount the sdcard, but maybe on cm10 the mountpoint is different to cm7
i think i must flash cm10 this weekend to test it
I guess I found the source of problem.
It seems that sdcard is not being mounted. (although sd-ext is mounted)
on cm7 also the sdcard is not mountet on boot, first i try to mount with "mount /sdcard" but it wont work so i try "mount -t vfat -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,shortname=mixed,utf8 /dev/block/vold/179:1 /sdcard" and that works on cm7, after that the sdcard is mount on /mnt/sdcard and /sdcard
but i think that not work for cm10, but dont know way, maybe the sdcard will be mount but not on /sdcard.
for that i have add line 19 to the script to check that (for debugging its helpfull, but for release i comment out that line) so i have all mountpoint in the swapon.log to see what is mountet and where...
so i think i must flash cm10 to test it here to see where is the problem and its the fastes way for me
as i know the sdcard will not be mount on boot on no rom, cause there is no need to, the sdcard will be mount from android when the system is load
Wish I could help more, but I'm not really an expert in this kind of stuff.
An easy "workaround" would be if the config file was placed on the sd-ext as it is mounted properly. I know then it would be not as easy to edit it (for windows users) but it should work.
if i find no other way, i will add a option to use also /data and /sd-ext for the config file
at the moment i flash cm10 on my second device for testing
maybe its just a mountpoint issues
I think I found a solution.
I edited row #17 to this:
mount -t vfat /dev/block/vold/179:1 /sdcard >>$SWAPLOG
Basically I just deleted the parameters.
The log shows no error and /mnt/sdcard is mounted properly.
I ran some test and it doesn't work.
im testing
now i have 4 mount commands in the script an one of them work ^^ now i must find the one that work
i think i found the right command
maybe you can test it and confirme?
use
Code:
mount -t vfat /dev/block/mmcblk0p1 /sdcard
here it works, i reboot now 10 times and on every boot it mounts sdcard
if you confirm, i will update the script so that all can be test it ^^
now i just must test if it also works for cm7
Confirmed.
Works fine. :good:
Great job, again.
okay so now the latest version ist V10 ^^
i edit the first post and also uploaded the new script to my homepage
http://droid-world.bplaced.net/load.php?file=download/scripts/98swaponV10or.zip
it also works on cm7
now i have 1 device on cm7 and one on cm10 and btw, cm10 with 32mb swap on cache and sslauncher may works smooth so i stay on cm10 and test some days
Hey fufu I'm trying to enable internal memory swap with your new script. But now I'm getting a new error in the log.
Here's my config:
## 98swapon config file
##
## set to 1 to disable swap on boot
DISABLE=0
## set swapfile size in MB
## default setting is 32 for 32mb
SWAPSIZE=32
## set to 1 to use intern memory for swap
SWAPINT=1
## settings for use swap on intern memory
## use /cache or /data for swap
SWAPDEV=/cache
## recreate swapfile on every boot
## set to 1 to recreate swapfile on every boot, may be helpfull if you change SWAPSIZE
RESETSWAP=0
## set to 1 to set only swappiness value all other values will be ignored
SWAPIONLY=0
## vm settings
## swappiness
SWAPPINESS=15
## dirty radio
DRADIO=80
## dirty backgriound radio
DBRADIO=30
## vfs cache pressure
VFSCP=10
## dirty expire centisecs
DEC=1000
## dirty writeback centisecs
DWC=1000
## laptop mode value 0 or 1
LAPTOPM=0
## oom kill allocating task value 0 or 1
OOMKAT=1
## panic on oom value 0 or 1
POOOM=0
Here's the log:
please set DISABLE in swapon.conf to 0 or 1
swap disabled in case of wrong DISABLE value
Sent from my Milestone using xda app-developers app

[MOD] 1-Click Flashable exFAT + NTFS + EXT4 support for CM10.1/AOSP + Partitioned SD!

August 4th 2013 - This script has not been maintained in a while. A big thank you to Captain_Throwback for providing continued support.
This is now minimally supported. Now that CM is adding native NTFS/exfat support, the only thing my script handles is multiple partitions.
July 21 2014 - Thank you n01ce! Please see n01ce's post for a "6.5 Alpha" that may solve some checksum problems with exFAT. I have changed devices, so this thread is for historical purposes/legacy support.
"HELP! I accidentally made my exFat card unreadable!!" -- or-- "I can't see more than 1 partition in windows!!"
Please read the instructions at the bottom of THIS POST HERE. No data will be lost!
"My card was working up until a moment ago but now the phone is showing "card damaged!!"
Re-run the script by typing "fuse-mountsd.sh" as root. The script will attempt to repair and re-mount.
If that fails, run "chkdsk /f" in Windows. Do not reformat until it is the last resort!​
TL;DR: (Flash this), put exFat/FAT32/NTFS/EXT4 sdcard in, reboot.​To remount, type "fuse-mountsd.sh" in a console (or) run using RomToolbox Lite (in /system/xbin/)
Needs to be run every time card is ejected + reinserted -- including when UMS is used
To unmount, type "fuse-mountsd.sh umount" (or if 1 partition) use Storage Manager
Non-customized multi-partitions mounted in /storage/<their name>
​
Uses init.d to fix/mount at boot
Scans for/mounts all useable block devices (with safety checks)
User-specifiable dynamic mount points
~~Create a ".mounthere" file in the partition with the first line "/location/to/mount/at"
~~Use the first line "skip" or "SKIP" to bypass that partition
Rescans for media when you re-mount
Repairs typical exFat damage caused by CM10.1 (with safety nets)
FAT32 support
NTFS-3g support (noatime set to reduce wear)
EXT4/3/2 support (*fuse built into JB/CM10.1) <- (MTP+EXT4 permissions need to be set to media_rw:media:rw 775!!))
Cleans up after itself: disables/enables ADB/root-security to what you set
BUGS:
All -- ntfsfix does not work. Binaries need to be recompiled. Not a major issue only dead weight.
exFAT may prevent deep-sleep. (NTFS on GS3 doesn't seem to have this issue.)
If you use EXT4/3/2, you need to run the following commands to allow the card to be accessed by the mobile-user:
Code:
find /storage/sdcard1/ -print0 | xargs -0 chown media_rw:media_rw
chmod -R 775 /storage/sdcard1/
(or)
find /storage/sdcard1/ -print0 | xargs -0 chown root:media_rw
Other phones -- Post a debug.txt if it works for you.
CM10 (4.1.x) -- Support is experimental. Use at your own risk.
CM 10.1 (4.2.x) -- Implemented RSA Key Signing Fix, works with BOOTICE.exe partitioned cards.
EXPERTS:
Everything is softcoded thanks to the $SECONDARY_STORAGE, $ANDROID_DATA, $ANDROID_STORAGE, $ANDROID_CACHE env variables and get/setprop command. Some locations are hardcoded in the script's "analyzePhone" function as fallbacks.
To custom-map mountpoints, create a ".mounthere" file in the root of each partition. "skip" or "SKIP" = ignore partition at mount, "/your/path/here" will use that path (or the default if bad). Defaults to "$ANDROID_STORAGE/device_id" if directory is invalid. Removes any temporary directories (in /storage/ only) at unmount. YOU HAVE TO CREATE ANY CUSTOM DIRECTORIES OUTSIDE "/storage" YOURSELF -- I set it like that as a security precaution.
To disable "Directory Creation Security", edit the line at the top of the script to say "dirSECURITY=0". This script will remount / and /storage as RW if needed.​
Here is a quick rundown of typical use-cases:
You want one large (exFat/NTFS/ext4) partition:
No customization needed, just flash and go
You want a small FAT32 partition (p1) at the beginning (for firmware/CWM/TWRP) with another big ext4 partition (p2) for your SD card mount. [ Your ROM's vold will mount (p1:fat32) as /storage/sdcard1 automatically. To get it to swap over: ]
Create a ".mounthere" file on (p2) "big" partition with the text "/storage/sdcard1"
This will override Vold and mount the (p2) as external storage. The FAT32 partition will be mounted in /storage/mmcblk1. If you want to mount it elsewhere (even /data/media/0/extSD ! ) simply add another ".mounthere" on the FAT32 partition. (The directory must already exist -- you must make it beforehand -- or disable Directory Security feature.) Be warned - Vold will mount the first partition as /storage/sdcard1 any chance it gets -- even in the background -- unless there is something mounted there already (by this script).
You have (1) partition for a game app you play (internal storage) that you want to rebind, (2) another part you want to rebind OVER an existing directory, and (3) your main storage.
Create a ".mounthere" on (1) with text "/location/of/your/game/app/data"
".mounthere" on (2) with text "/folder/you/want/substituted"
".mounthere" on (3) with text "/storage/sdcard1"
You are a long-hair-hippie Linux developer with 4 partitions, each in a different filesystem, and want them mounted hidden from apps and listed by block device so you know what partition you are on:
No customization needed, just flash and go
SUPPORT:
I can only provide support if you supply me with logs. Do so by typing "fuse-mountsd.sh > /sdcard/debug.txt 2>&1" and opening the Debug.txt in your phone's storage.
It's all automatic now - so if it mounts your modem as writeable and kicks your dog don't blame me. (It excludes dangerous block devices automatically [mmcblk0, /system, mtdblock, etc], but there is always a 1% chance it will miss something.) If it does, report it here so I can fix it.
If you intend to use this with a other ROMs/phones, IT SHOULD STILL WORK. Post any errors or weird behavior.
Code:
Changelog
[I]7.0 - TBA (Make GUI? Fix ext4 permissions automatically? Get paid?)[/I]
6.4 - No longer uses "mount" output (wasn't acting standard-ly. Using /proc/mounts instead)
- [COLOR="Red"]Got rid of conv=notrunc[/COLOR]. Be careful!
6.3 - Bugfix to scrubMount code
6.2 - No longer Experimental / final unstable
- added rough ext2/3 support
6.1 - mount command bugfix
6.0 - Added a bypass for Directory Security, fixed some bugs.
5.9 - Rewrote NOGO code from scratch -- UUIDs ignored
5.8 - (??)
5.7 - Support for Note2 formatted exFat cards + more (0xf4 bug)
5.6 - bug fixed: no longer detects zram/assumes multimount
5.5 - [COLOR="Red"]Experimental support for weird devices[/COLOR]
5.4 - [b]Major bugfix!![/b] Fix fixmyexfat.sh coding fail
5.3 - Fixed "vffat" support. Undid HARD QUIT on bad Nogo, made it a soft one.
5.2 - Increased logging of tables, HARD QUIT if Nogo not found
5.1 - Quick patch to fix dm-* device blacklist
5.0 - [b]SUPPORTS MULTI-PARTITIONED CARDS! Autoscans for block devs! Complete rewrite![/b]
4.1 - Quick patch to check mmcblk1
4.0 - [B]WORKS 100% ON 4.2.2!![/B] My script is the first to achieve this AFAIK
3.3 - fixed a bug detecting existing mounts (related to "non-persistent mount points" issue)
3.1 - added dynamic exFAT repair code
3.0 - added NTFS/ext4 support
1.0 -> 2.0 <Removed>
Attribution credits:
Original thanks go to originator of the method, smitna in the Galaxy S2 forum. Additional thanks go to shardul_seth (Post 23) for compiling the latest version of the fuse-exfat and ntfs-3g binaries for ARM, and of course Andrew Nayenko for his efforts in creating GPL'd exFat code (fuse-exfat on google code).
[HOWTO][exFAT][WORK IN PROGRESS] Mount exFAT formatted drives and cards - smitna
Full NTFS Read Write support for Android (ARM) - shardul_seth
[HOWTO][exFAT][CM10.1] Working 64GB ext sdcard with fuse-exfat (1.0.1) + FIX broken (my original Dev thread)
I believe the term is I "kanged" their binaries. The rest is mine. This is a "mod"/"hack" until CM adds native support. (If ever: exFat)​
DONATIONS:
https://supporters.eff.org/donate , or help a noob by linking to a solution in their thread. :good:
https://plus.google.com/+CyanogenMod/posts/ib5wz8jk1JyOne of the CM Team has flesh eating bacteria! Keep CM alive! (Literally)​
I'm a noob, this looks scary to me. Either way, I needs me some exfat cuz my movies are too large for fat32.
My only question is: Even though this is written for CM10.1 on Verizon s3, might this also work on T-mobile s3 with an AOSP (Android 4.2.2) ROM?
Here's what I'm running:
SGH-T999 (d2tmo)
Android 4.2.2
Kernel: 3.0.62-cyanogenmod-g137df31
ROM: Liquid-JB-v2.1-RC1
Build:liquid-d2tmo-userdebug 4.2.2 JDQ39
I've spent the last 2 days searching and testing to no avail. My sdcard is running hot trying to get files larger than 4gb on it. I've tried formatting to exfat, ntfs, ext4, even hfs+, no success. Paragon and ntfssd apps couldn't mount it either.
Any help on this matter would be greatly appreciated!
Even though this might not work on T-mobile, thank you either way, I'm glad there are people like you developing for 64gb cards.
I wouldn't say I'm a developer, just a scripter with a lot of time on her hands.
lordazoroth said:
My only question is: Even though this is written for CM10.1 on Verizon s3, might this also work on T-mobile s3 with an AOSP (Android 4.2.2) ROM?
Click to expand...
Click to collapse
MAKE A NANDROID. This mod should do nothing permanently harmful anyway: it looks for EXFAT before writing anything.
Carrier doesn't matter. It only depends (1) if your kernel has FUSE support, (2) if it has init.d support and (3) what your Block device is.
I think Google added FUSE by default in JB, and anything based off CM10.1 will have it
Type "echo $SECONDARY_STORAGE" in a terminal emulator. If it displays ANYTHING other than blank it should work.
The Block device is trickier. Type "blkid" as root with with your FAT32 card in and out. The one that disappears is your Card's Block device, and should be /dev/block/mmcblk1p1.
If you have any doubts, don't do it.
HMkX2 said:
I wouldn't say I'm a developer, just a scripter with a lot of time on her hands.
MAKE A NANDROID. This mod should do nothing permanently harmful anyway: it looks for EXFAT before writing anything.
Carrier doesn't matter. It only depends (1) if your kernel has FUSE support, (2) if it has init.d support and (3) what your Block device is.
I think Google added FUSE by default in JB, and anything based off CM10.1 will have it
Type "echo $SECONDARY_STORAGE" in a terminal emulator. If it displays ANYTHING other than blank it should work.
The Block device is trickier. Type "blkid" as root with with your FAT32 card in and out. The one that disappears is your Card's Block device, and should be /dev/block/mmcblk1p1.
If you have any doubts, don't do it.
Click to expand...
Click to collapse
Awesome instructions, very much appreciate it. Looks like it's time to get to work. I checked the zip file thoroughly and cross-checked it with my root directories to see if it overwrites anything and it looks like it just adds stuff. From what I've seen, this is the only game in town so I'll post back once I'm done.
If this does work, this is a godlike zip file and it does something nothing else can do right now
Ok still not mounting properly.
Here's what I did:
Typed "echo $SECONDARY_STORAGE" in a terminal emulator, showed "/storage/sdcard1"
Typed "blkid", showed "/dev/block/mmcblk1p1" only when sd card was inserted under fat32 file format
Formatted sd card to exFAT on PC, inserted back into s3
Flashed CM10.1_exFAT-mountsd_2.0_HMkX2.zip
Ran terminal emulator, typed su >> exfat-mountsd.sh got this:
[email protected]:/ $ su
[email protected]:/ # exfat-mountsd.sh
[exfat-mountsd v2.0] exFat autorepair and mount script for CM10.1 (HMkX2 CORE//XDA)
Automated mounting script for exFat on GS3
/storage/sdcard1 is not mounted. (OK)
Calling [fixmyexfat] on /dev/block/mmcblk1p1 (if needed)
Broadcasting: Intent { act=android.intent.action.MEDIA_CHECKING dat=file:///storage/sdcard1 }
Broadcast completed: result=0
[fixmyexfat v2.0] exFat header repair tool (HMkX2 CORE//XDA)
More robust than before!
Usage: /system/xbin/fixmyexfat.sh <block device, eg /dev/block/mmcblk1p1>
[fixmyexfat] Manual target is /dev/block/mmcblk1p1
1+0 records in
1+0 records out
512 bytes transferred in 0.166 secs (3084 bytes/sec)
Segment 1 (0:4) (BAD)
4+0 records in
4+0 records out
4 bytes transferred in 0.012 secs (333 bytes/sec)
Segment 2 (484:4) (BAD)
4+0 records in
4+0 records out
4 bytes transferred in 0.007 secs (571 bytes/sec)
Segment 3 (508:4) (BAD)
4+0 records in
4+0 records out
4 bytes transferred in 0.005 secs (800 bytes/sec)
Check complete!
Check complete, mounting and initializing...
########################## ATTEMPTING COMMAND ##########################
mount.exfat-fuse -o rw,dirsync,umask=0 /dev/block/mmcblk1p1 /storage/sdcard1
Attempting bypass...
* daemon not running. starting it now on port 5038 *
* daemon started successfully *
connected to localhost:5556
List of devices attached
localhost:5556 device
Running ADB commands
FUSE exfat 1.0.1
ERROR: invalid VBR checksum 0xa04b8eb5 (expected 0x804d6ce4).
Broadcasting: Intent { act=android.intent.action.MEDIA_MOUNTED dat=file:///storage/sdcard1 }
Broadcast completed: result=0
Process complete!
[email protected]:/ #
Not sure how to read this...
Afterwards my notification panel says: "Damaged SD card : SD card is damaged. Try reformatting it."
Tried restarting s3, mounting in storage settings, reformatting in PC. Ran script 4 times on a fresh exFAT format with the same notification error (format was unrecognizable by s3 and PC after running terminal command "exfat-mountsd.sh" [don't worry didn't lose any data ]).
After each format to exFAT on my PC I placed a few images on the card to ensure it was functioning properly, /storage/sdcard1 directory is always empty.
Mounting in settings >> storage generates the same notification error: "Damaged SD card : SD card is damaged. Try reformatting it."
Any ideas?... it is detecting an SD there after mount attempts (despite exFAT format) interestingly enough. Though nothing is detected after a reboot unless another script or settings >> storage mount attempt is performed.
I should mention that I ran a "quick" format when formatting the SD card from Fat32 to exFAT, not sure if that might be relevant.
Hm... well, I can tell you what it means. Quick formatting is fine, I actually prefer it since flash memory has a limited life. Second, "chkdsk /f" in windows will repair your card + data -- the card isn't "damaged", it's just that 4 letters at the beginning were changed. (See: Segment1, Segment2, Segment 3 messages.) My scripts change those 4 letters back, in a safe-ish way.
Unfortunately, without having a hex-dump of your working exFat header I can't say what those four letters should be. I got mine using a program called Hex Editor Neo on what I had available, a Sandisk 64gb class-10, and are what I included in the script. When the letters don't line up like it expects, you get a checksum error.
Without that, there is one single thing you can try - but has a high likelyhood of success.
Use RootBox explorer, navigate to /system/xbin/ and DELETE the file called "fixmyfat.sh".
Turn your phone OFF. Eject the SD card
chkdsk /f the card or quick format it to fix it, put a test file on it from Windows
Put the card in your phone, turn on.The card must be in the phone before it is turned on.
If that works for you, and the card works, you can give me a hex dump pretty easily so I can edit the script. IF it works, and I highly suspect it will, get a hex dump by typing EXACTLY:
dd if=/dev/block/mmcblk1p1 bs=1 count=512 of=/sdcard/working_sd.bin​ <- corrected
That will place a text file in your internal sd card than you can post/send me. Again, thanks for bearing with me, this started out as something for myself then made better in the hopes other people could use it. If you could re-corrupt the card (by unplugging/replugging it while the phone is on) and send me a hex dump of the "Card Damaged" state, even better.
O.O... you are awesome!
I'll get on this right away, and I'd be happy to help any way i can
---------- Post added at 09:19 PM ---------- Previous post was at 08:52 PM ----------
OMG IT WORKS!!! the card mounted
I tried the line of code and it gave me an error:
[email protected]:/ $ su
[email protected]:/ # dd if=/dev/blk/mmcblk1p1 bs=1 count=512 of=/sdcard/working_sd.bin
/dev/blk/mmcblk1p1: cannot open for read: No such file or directory
1|[email protected]:/ #
My /sdcard directory seems to be a redirect to /storage/sdcard0 (i think), i have a lot of these (what appear to be redirects) on my phone now after upgrading from android 4.0.4 to 4.2.2. If I changed the end of that line of code to something like "of=/storage/sdcard0/0//working_sd.bin" (or any similar working directory), might that solve the problem or am I reading that wrong?
Thank you so much, this is... very powerful!
Great work on this!
Double post.
Please check my post for the correct DD command - I typed /blk instead of /block due to habit.
I'm glad it works. As long as you don't re-plug the card while it is on, you will have no problems. If you accidentally DO "corrupt" the card, just "chkdsk /f" in Windows, turn the phone off, put the card in, and turn it on.
And the biggest help you can give would be those headers. (I was looking at the exfat.fsck-fuse code, apparently even THAT can't fix it!) For the time being, I will re-do the scripts to display more information so I can troubleshoot more easily.
HMkX2 said:
Please check my post for the correct DD command - I typed /blk instead of /block due to habit.
I'm glad it works. As long as you don't re-plug the card while it is on, you will have no problems. If you accidentally DO "corrupt" the card, just "chkdsk /f" in Windows, turn the phone off, put the card in, and turn it on.
And the biggest help you can give would be those headers. (I was looking at the exfat.fsck-fuse code, apparently even THAT can't fix it!) For the time being, I will re-do the scripts to display more information so I can troubleshoot more easily.
Click to expand...
Click to collapse
Sounds bad, I don't know why all these companies are sticking with Fat32 after all these years. Fat32 has been obsolete since like 2000, don't we have open source formats like ext4 now? - that's my rant lol. Either way, it works and I got the file. Btw, this file acts strangely on my device, I couldn't see it in windows explorer during plugin and It wouldn't copy to my sd card even though other files seem to be copying fine. Had to email it to myself from my phone. Thank you so much for all your help, let me know if you need anything else
Rename the file and remove .rar extension before use, xda doesn't allow .bin extensions to be uploaded.
Quick question: If I shut the phone down and pull the SD, can I turn the phone back on and use it without the SD while I load the SD up with files, then power off, re-insert the SD and power on again? (like will it automount again?)
Yay!
HMkX2 said:
Please check my post for the correct DD command - I typed /blk instead of /block due to habit.
I'm glad it works. As long as you don't re-plug the card while it is on, you will have no problems. If you accidentally DO "corrupt" the card, just "chkdsk /f" in Windows, turn the phone off, put the card in, and turn it on.
And the biggest help you can give would be those headers. (I was looking at the exfat.fsck-fuse code, apparently even THAT can't fix it!) For the time being, I will re-do the scripts to display more information so I can troubleshoot more easily.
Click to expand...
Click to collapse
Very interesting. I can go on the hunt for headers if you like. I have loads of sd cards.
Oddly enough, I switched to FAT32 even though I'm on a TouchWiz ROM, cause exFAT does not use alternating file allocation tables. When exFAT gets borked, it gets super borked and you have to use chkdsk (or some other brutish method) to retrieve files. When FAT32 gets borked, you can load the last table that was working and elegantly pull your files off the card (no need to muddle through a pile of chkdsk files and find the correct extensions).
Any possibility that this method could be used to mount a more robust file system like ext[2,3,4]? Journaling would be nice. Or some transaction safe file system.
Ta very much,
ALQI
Re: [MOD] Flashable exFAT support for CM10.1 / AOSP roms (external SD)
Great.I'll try it.
Sent from my SCH-I535 using xda premium
lordazoroth said:
Sounds bad, I don't know why all these companies are sticking with Fat32 after all these years. Fat32 has been obsolete since like 2000, don't we have open source formats like ext4 now?
Click to expand...
Click to collapse
Why we have 15 competing standards... "Never attribute to malice that which is adequately explained by stupidity."
Btw, this file acts strangely on my device, I couldn't see it in windows explorer during plugin and It wouldn't copy to my sd card even though other files seem to be copying fine.​Any files you create on the device without "Rescanning for media" will not be visible in the MTP (Mass Tranfer Protocol) "MP3 player-like" abstracted FUSE filesystem. (One reason why people want UMS (USB Mass Storage) "hard drive-like" support, you see things immediately/it's faster.) Get a free program called SDrescan from Google Play, or run the command below(?), to update the MTP index and see files you create ON the device.
Code:
am broadcast -a android.intent.action.MEDIA_MOUNTED -d file://$SECONDARY_STORAGE
am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///storage/sdcard0
...let me know if you need anything else Quick question: If I shut the phone down and pull the SD, can I turn the phone back on and use it without the SD while I load the SD up with files, then power off, re-insert the SD and power on again? (like will it automount again?)​Yes, the mount script will simply fail and there will be a silent error. (I need to code some error checking if you insert a non-exfat card...)
Like I said, if you could intentionally re-corrupt the header by using Storage Manager to "Unmount SD" then "Mount SD", then the DD command, (and rescanning media to copy the file off!) I'd appreciate it. Although, I have a second idea of how to get around that problem in mind.....
alquimista said:
Very interesting. I can go on the hunt for headers if you like. I have loads of sd cards.
Click to expand...
Click to collapse
Thanks but I think the bottom line is (1) there is no working open source exfat.fsck anyway and (2) headers are unique per-device. The proper fix is re-coding vold to not run fsck.msdos on a fsck.exfat card.
Oddly enough, I switched to FAT32 even though I'm on a TouchWiz ROM, cause exFAT does not use alternating file allocation tables. When exFAT gets borked, it getse that wa super borked and you have to use chkdsk (or some other brutish method) to retrieve files. When FAT32 gets borked, you can load the last tabls working and elegantly pull your files off the card (no need to muddle through a pile of chkdsk files and find the correct extensions).
Any possibility that this method could be used to mount a more robust file system like ext[2,3,4]? Journaling would be nice. Or some transaction safe file system.​Yep, that is all 100% true. But I've lost files on fat32 drives as well - and I'd hardly call multiple file tables elegant, especially when they become desynced. NTFS would be a better fix, except for the fact it is a magnetic-media filesystem with journaling/timestamps/excessive writes, and exFAT was designed for flash media in the first place!! Even EXT4 writes too much, EXT2 or EXT4 with journaling disabled is a better solution for integrity, but much worse for flash-life. Nowadays, the value of error-recovery outweighs the limited media life. (This discussion comes up a lot in custom Linux firmwares for routers: DD-WRT NVRAM/Flashdrives)
Shardul_seth, the gentleman that compiled these binaries, has made a package for full NTFS support already using ntfs-fuse3g. (<- link) NTFS-3g is very mature/stable at this point, and installation for our devices is even simpler since we already have FUSE support in the kernel. However, his scripts are to mount USB, not the SD card. Mine does the SD card - all those ADB workarounds - so absolutely could be adapted for mounting NTFS cards. I will work on that when I have some time -- I'd need to figure out how to identify a NTFS card on header alone.
Again, all these methods are HACKS, proper support should be added in the kernel at some point. Someone actually has, and I've been cheering for him. He added EXT4 support to CM10.1, his post and code are here. However, he says it "stalled in code review". For the time being, you have to do all this manually.
Why we have 15 competing standards... "Never attribute to malice that which is adequately explained by stupidity."
Click to expand...
Click to collapse
Nice post lol, I only meant why FAT32 of all choices, these companies must know we're gonna be packing large files at some point, why knee cap us at 4gb when so many formats don't? Universal would be nice but of course it's entirely impractical
Any files you create on the device without "Rescanning for media" will not be visible in the MTP (Mass Tranfer Protocol) "MP3 player-like" abstracted FUSE filesystem. (One reason why people want UMS (USB Mass Storage) "hard drive-like" support, you see things immediately/it's faster.) Get a free program called SDrescan from Google Play, or run the command below(?), to update the MTP index and see files you create ON the device.
Click to expand...
Click to collapse
Thanks for the media scan info, that'll help a lot, I'll try out your suggestions tonight
Yes, the mount script will simply fail and there will be a silent error. (I need to code some error checking if you insert a non-exfat card...)
Like I said, if you could intentionally re-corrupt the header by using Storage Manager to "Unmount SD" then "Mount SD", then the DD command, (and rescanning media to copy the file off!) I'd appreciate it. Although, I have a second idea of how to get around that problem in mind.....
Click to expand...
Click to collapse
Will do, sounds interesting, will there be data loss or just header corruption? second idea in mind?
Also, each time I take the card out of my phone (properly after shutdown of phone) and place it in my computer (vista 64bit ultimate) It asks to check for errors, i'll click continue (confirmation to check), takes 3-5 seconds, finishes with no errors found. If I don't do this the card is write protected. I've made sure only to disconnect from PC after "safely removing hardware" so it appears that usage in the phone is generating the confusion. This doesn't seem to be an issue but I thought it might be worth mentioning
do you enter it correctly?
I get this when running the script:
Code:
BREAK! /dev/block/mmcblk1p1 is not a block-special file/device, do you enter it correctly?
How do I find what block file I need to change to script to?
Thanks for your work
boricua1213 said:
How do I find what block file I need to change to script to?
Click to expand...
Click to collapse
Safest (not easiest) way is to insert your FAT32 card, type "mount|grep vfat". The one you are looking for says "/dev/block/vold___:__" . (Shortcut: "mount|grep vold");
Then type "blkid". The one that's listed twice (UUID or Label) as "vold" is your block device's other name. (/mnt/block/mmc_somethingorother) Both names lead to the same spot.
(or)
Type "blkid" with your card in. Make a list. Remove your card. Type "blkid" again. The one that dissapears is your block device.
Ok got the file, I created 2 files, 1 before and 1 after the force unplug, just in case.
Remember to rename the files without the .rar extension before use
Re: [MOD] 1-Click Flashable exFAT + NTFS + EXT4 support for CM10.1 / AOSP (external S
I am about to embark on this journey and make another attempt at ditching TouchWiz. Does this script make it as if everything is normal as far as apps accessing the SD card go? I assume so, but I'm specifically wondering if I'll still be able to use Directory Bind and if I'll be able to create symbolic links to redirect Google Music to the external SD.
Getting ready to flash and try anyway but figured I'd ask to see if someone knows the answer all ready.
I'll be the first to admit the problem is almost certainly user error on my part but I have been wholly unsuccessful with this mod. I have tried it on Carbon Rom and Paranoid Rom. I guess they both have FUSE support, I couldn't find any confirmation of that on the Rom threads....particularly Carbon.
I flashed the zip in the OP in CWM after installing both Roms clean. I tried installing the zip as soon as I installed the Rom and I tried installing it after doing a full boot up first. Ran the chkdks /f command probably 12 times after each successive failed attempt to get my 64 exFAT card recognized. Said Damaged SD no matter what I tried. I saw the post on Page 1 about deleting the fixmyfat file....tried that too and no go. That tip may no longer be relevant since you've updated the script.
Is there something I am missing? There are lots of posts in this thread about mount commands and adb, but it seems from the OP none of those things are supposed to be necessary.
spearoid said:
Does this script make it as if everything is normal as far as apps accessing the SD card go? I assume so, but I'm specifically wondering if I'll still be able to use Directory Bind and if I'll be able to create symbolic links to redirect Google Music to the external SD.
Click to expand...
Click to collapse
In short, it should. However, exFAT/FAT32 don't support permissions/softlinks like ext4 does. So if you use ext4, just remember to set permissions appropriately! When in doubt, set permissions to 755 root:sdcard_rw or root:media_rw on the external sd.
I have tried it on Carbon Rom and Paranoid Rom. I guess they both have FUSE support, I couldn't find any confirmation of that on the Rom threads....particularly Carbon​Type "mount | grep fuse" in console. If you see "fuse" listed anywhere in the text, you have it. Google added it to JellyBean.
I flashed the zip in the OP in CWM after installing both Roms clean. I tried installing the zip as soon as I installed the Rom and I tried installing it after doing a full boot up first. Ran the chkdks /f command probably 12 times after each successive failed attempt to get my 64 exFAT card recognized. Said Damaged SD no matter what I tried. I saw the post on Page 1 about deleting the fixmyfat file....tried that too and no go. That tip may no longer be relevant since you've updated the script.
Is there something I am missing? There are lots of posts in this thread about mount commands and adb, but it seems from the OP none of those things are supposed to be necessary.​Do me a favor... open a terminal, type "su", then type "fuse-mountsd.sh > /sdcard/debug.txt 2>&1" (no spaces in 2>&1). It will make a "debug.txt" file in the root of your internal storage. Paste the output here. I am 90% certain you have the wrong block device set. 9% certain it is the 4.2.2 ADB thing.
You do not need to delete "fixmyfat.sh" -- those instructions are very old. Was the phone *physically off* when you plugged the SDcard in? Ignore the mount commands/ADB - you should not have to deal with them if you only plug in/unplug the card when the phone is off.
I am nigh certain it has to do with 4.2.2 messing with ADB. Like I said, for now, put in a *working* sd card *before* the phone is turned on and you won't run into that issue.

Categories

Resources