yashsingh1/xdaforums huggingface dataset:
[Galaxy S I9000 Android Development] Leonick:
Running "/sbin/ext/busybox mount -t ext4 /dev/block/loop7 /cache" gave the same error, "mount: mounting /dev/block/loop7 on /cache failed: No such device".
[Galaxy S I9000 Android Development] stratosk:
One more thing (I run out of ideas):

Try the same set of commands on loop6 or loop5
[Galaxy S I9000 Android Development] Leonick:
Didn't work either, same error, did losetup and mount for both loop6 and 5.

Edit: Well now I can run the script-file, I where using ./change-cache to run it (what I am used to in linux environments) which gave permission denied, doing "sh change-cache" runs it, still get the same error when it tries mounting though.

Guess I'll have to use the other method and make a symlink between some location with more free space and /cache... Anyone know if /cache is used for anything else than market downloads?
[Galaxy S I9000 Android Development] lucbl1:
I've flashed the cwm version and cache is 50mb. I can use system info i just cannot download it from market. Gives me a "package not signed properly" issue. I use SGS I9000, S.U.R.F.A.C.E Rom JVQ, Semaphore kernel 1.3.3
[Galaxy S I9000 Android Development] corgar:
That problem is not tweak related. Try to download that app again. Or ask dev to resign that app properly.

Tapatalked, powered by Corgar Slim Rom GB Edition.
[Galaxy S I9000 Android Development] lucbl1:
Yes i was about to edit my original post. My bad!
[Galaxy S I9000 Android Development] stratosk:
Even the stock kernel supports ext4. But anyway i will check this when I find some time.:)
[Galaxy S I9000 Android Development] Leonick:
OK, here's an update.

It seems like the filesystem created by mke2fs is not an ext4 filesystem.

I tried mounting without the "-t ext4" and it worked, when I type in mount again and look at /dev/block/loop7 it is listed as having an ext2 filesystem mounted.

Now, why mke2fs doesn't create an ext4 filesystem I can't answer.

After looking at the up the man page for mke2fs I would say it was because "-T ext4" doesn't actually make it a ext4 filesystem, at least not if I am reading the man correctly

but it works for you so I really have no clue at all, if you who obviously know all of this a lot better than I do have a clue it would love to know :p

(check if it actually makes a ext4 filesystem, maybe the version you have a newer version of mount that ignores the faulty "-t ext4"? Just a wild guess :p)

Working script below

#!/system/bin/sh

#
# stratosk - 27/07/2011
# leonick - 05/08/2011 (removed ext4 parameters making it galaxy tab compatible)
#
# Remount /cache partition with a larger one (64MB)

# create a file 64 MB
dd if=/dev/zero of=/data/local/cache.img bs=1024 count=65536

# create ext4 filesystem
mke2fs -F /data/local/cache.img

umount /dev/block/stl11

# mount
losetup /dev/block/loop7 /data/local/cache.img
mount /dev/block/loop7 /cache

chown system.cache /cache
chmod 770 /cache
[Galaxy S I9000 Android Development] stratosk:
Thanks Leonick!

I will also check this and let you know.
[Galaxy S I9000 Android Development] Leonick:
I looked around a bit and I found a few interesting things.

First the CF-Root kernel I used to get root doesn't have ext4 support on the Galaxy Tab (CF-Root for the Galaxy S does though).

So for the Galaxy Tab ext4 support is a bit hit and miss.

Running gingerbread replacing the kernel is the only way to root, some kernels support ext4 some doesn't, not sure if CF-Root is the only kernel made for use with the stock rom, but I think so.

Users running Froyo (not that I know why they would) would most likely be rooting with SuperOneClick and are left with stock rom and no ext4 support.

It would seem that at least for the Galaxy Tab ext4 is best left out of the script.

Now, as I said in my last post, when not specifying ext4 when mounting the file successfully mounts but as ext2 so in my case mke2fs does not seem to have made it a ext4 filesystem, still waiting to hear if it did for you.

However, when looking at the different versions of ext to see if there really is any benefit to use ext4 or ext3 over ext2 for our small cache partition I found that it is actually possible to mount a ext2 filesystem as ext4 as ext4 is backwards compatible, might be why you could mount the file as ext4 even though it doesn't seem to end up with an ext4 filesystem.

Finally, while looking trough his thread I saw corgars modded script, he had moved cache to /dbdata which is located on OneNAND (according to him) as it would be faster.

I have a feeling this might be a very bad idea as we are creating a file on there with ext4 filesystem (well did at least), if you Google OneNAND, as I did to look it up, this (http://xdaforums.com/showthread.php?t=899610) is among the top results, seems like a bad idea to put the cache there, specially with ext4. Just saying :p
[Galaxy S I9000 Android Development] stratosk:
I didn't find time to look at this. But, if you managed to do this on ext2 no problem. Maybe as you mentioned the created partition is ext2 and mounted as ext4.

I use ext4 with no journal on my phone (something like ext2) for system and cache partitions. No problem.

I use ext4 on all partition for a long time without a single problem.
[Galaxy S I9000 Android Development] corgar:
a workaround is to use a nj fs in cache partition like ext2.

since cache is a volatile partition we can safely use a nj fs. I think we can still use dbdata but with a no-journal fs.

got this in adb:

/dev/block/loop7 /cache ext2 rw,relatime,errors=continue 0 0

will report back if something is wrong

new script with ext2 attached
[Galaxy S I9000 Android Development] Leonick:
You can remove "-T ext2" from mke2fs, it makes a ext2 filesystem without that part, it's the default setting for mke2fs.

Also I don't even think that one has anything to do with the filesystem type from looking at the man pages for mke2fs, see my post earlier on the page.

"-t ext2" can also be left out of mount, if you don't specify mount usually does a pretty good job of detecting the filesystem.

Oh, and corgar, as I wrote above, I am not so sure putting the file on dbdata (OneNAND) is such a good idea, no matter the filesystem, it's better left alone for the bootloader, kernel and other important stuff that is put there.

Here is what I'm using.

#!/system/bin/sh

#
# stratosk - 27/07/2011
# Corgar - 28/07/2011 ( changed location of cache in dbdata for onenand i/o, decreased cache dimension to 50mb )
# leonick - 05/08/2011 (removed unneeded ext4 parameters making it galaxy tab compatible)
# leonick - 07/08/2011 (using /data/local as location again, using OneNAND doesn't seem like an all too good idea)
#
# Remount /cache partition with a larger one (54.5MB)

# create a file 54.5 MB
dd if=/dev/zero of=/data/local/cache.img bs=1024 count=55808

# create ext4 filesystem
mke2fs -F /data/local/cache.img

umount /cache

# mount
losetup /dev/block/loop7 /data/local/cache.img
mount /dev/block/loop7 /cache

chown system.cache /cache
chmod 770 /cache
[Galaxy S I9000 Android Development] corgar:
/system (r/o), dbdata and cache are inside onenand by default, i don't think moving cache inside dbdata will be harmful.

edit: without "-T ext2" partition is no longer created. Talon kernel 0.4.4.9 busybox 1.18.4 atm.
[Galaxy S I9000 Android Development] Leonick:
Well, I'm no expert. I where going by this thread here.

http://xdaforums.com/showthread.php?t=899610

According to that the Nexus S, the Galaxy S and most likely the Galaxy tab too have a onenand used for bootloader, kernel, radio firmware, /system in the case of the Galaxy S and the cache partition, however cache and system isnt using ext as filesystem by default(YAFFS2), and going by that thread ext (at least ext4) on onenand as we do trough the file created isnt a very smart thing to do.

/data/ where stratosk originaly put it is on emmc.

Again, I'm no expert, far from :p

Just get a bad feeling about it :p
[Galaxy S I9000 Android Development] corgar:
in stock i9000 for cache partition we got RFS ( robust file system ) which use a very heavy journaling fs.

as stated here rfs use a lot of check for partition integrity:

btw i'm testing and some more and report back. Thx for you contribution Leonick
[Galaxy S I9000 Android Development] stratosk:
Thanks both of you guys for your effort.

I think the point is that the basic idea is working. ext2 or ext4 it doesn't matter in my opinion.

I will test on tiny thing in the script when I find sometime - to check if the cache.img exists and don't create a new one every time.
[Galaxy S I9000 Android Development] Leonick:
Great, was thinking about that too, seems like a waste to do that every time, takes 1

about 18 seconds after all. Only way I could think of would be to split the script in two, not that good with bash scripts so looking forward to see what you do.

Once that bit is done I'll make a post for the script over in the Galaxy Tab development forum, giving credit where credit is due of course.
[Galaxy S I9000 Android Development] stratosk:
The script untested (sorry for this)

#!/system/bin/sh

#
# stratosk - 27/07/2011
# Corgar - 28/07/2011 ( changed location of cache in dbdata for onenand i/o, decreased cache dimension to 50mb )
# leonick - 05/08/2011 (removed unneeded ext4 parameters making it galaxy tab compatible)
# leonick - 07/08/2011 (using /data/local as location again, using OneNAND doesn't seem like an all too good idea)
# stratosk - 07/08/2011 (create the cache.img file once)
#
# Remount /cache partition with a larger one (54.5MB)

if /sbin/ext/busybox [ ! -f /data/local/cache.img ];
then
# create a file 54.5 MB
dd if=/dev/zero of=/data/local/cache.img bs=1024 count=55808

# create ext4 filesystem
mke2fs -F /data/local/cache.img
fi;

# unmount the old one
umount /cache

# setup the loopback and mount
losetup /dev/block/loop7 /data/local/cache.img
mount /dev/block/loop7 /cache

# fix the ownership and permissions
chown system.cache /cache
chmod 770 /cache
[Galaxy S I9000 Android Development] Leonick:
That doesn't quite work... Here's what happens
[Galaxy S I9000 Android Development] stratosk:
if you change the first line to

#!/sbin/ext/busybox sh

?
[Galaxy S I9000 Android Development] Leonick:
That works.

I ran it, it created the file and mounted it.

I the unmounted /cache and mounted /dev/block/stl11 as cache again and tried the scrip again, first it said device busy and failed, tried again and it work.

I rebooted the device letting it set /cache back to /dev/block/stl11 itself and tried the script, the script ran and mounted our file without first creating it again.

Seem like it working just as intended. Sure cut down the scripts running time a lot :p
[Galaxy S I9000 Android Development] stratosk:
And now it can be user as boot script to have this partition always.

Thanks for the test!
[Galaxy S I9000 Android Development] corgar:
latest script doesn't work here. partition unmounted and no cache.img created.
[Galaxy S I9000 Android Development] demarton:
Didn't work, I change my busybox is installed on /system/bin

change this line to:

if /system/bin/busybox [ ! -f /data/local/cache.img ];

resulting in

not found

not found

syntax error : "fi" unexpected (expecting "then")

I've checked I do have busybox in /system/sbin.

not sure why it didn't work.
[Galaxy S I9000 Android Development] stratosk:
Did you also change the first line?
[Galaxy S I9000 Android Development] corgar:
for my rom this instead work, but busybox command are not executed

#!/system/bin/sh

#
# stratosk - 27/07/2011
# Corgar - 28/07/2011 ( changed location of cache in dbdata for onenand i/o, decreased cache dimension to 50mb )
# stratosk - 07/08/2011 (create the cache.img file once)
#
# Remount /cache partition with a larger one (54.5MB)

if /system/xbin/busybox [ ! -f /dbdata/cache.img ];
then

# create a file 54.5 MB
dd if=/dev/zero of=/dbdata/cache.img bs=1024 count=55808

# create ext4 filesystem
mke2fs -F -T ext2 /dbdata/cache.img

fi;

#unmounting old cache partition
umount /dev/block/stl11

# mount
losetup /dev/block/loop7 /dbdata/cache.img
mount -t ext2 /dev/block/loop7 /cache

chown system.cache /cache
chmod 770 /cache

busybox is installed inside system/xbin, oh and sry but i'm still using dbdata :P

already tried to add #!/system/xbin/busybox with no luck.
[Galaxy S I9000 Android Development] Leonick:
You say you tried "#!/system/xbin/busybox", does that mean you put "#!/system/xbin/busybox sh", note that it's a space between busybox and sh.

Just making sure.
[Galaxy S I9000 Android Development] corgar:
ok i'm a moron :D omitted xbin when typing

edit: doesn't work, busybox command are still not executed.
[Galaxy S I9000 Android Development] Leonick:
And it's written like I said above?

Looks like that script was only a bag of hurt :p

Maybe we should got for two separate scripts instead, one to run once that create the file and formats it and a second that can be run during boot that mounts the file.

Something like this

Preparation script:

#!/system/bin/sh
# create a file 54.5 MB
dd if=/dev/zero of=/data/local/cache.img bs=1024 count=55808

# create ext4 filesystem
mke2fs -F /data/local/cache.img

Boot script:

#!/system/bin/sh
umount /cache

# mount
losetup /dev/block/loop7 /data/local/cache.img
mount /dev/block/loop7 /cache

chown system.cache /cache
chmod 770 /cache

This way we'll only have to create the file once and avoid adding a long delay to the boot while avoiding any busybox compatibility issues. Just a thought.
[Galaxy S I9000 Android Development] mobidzid:
Sorry, I'm noob. How to make a script run at boot? Add it to init.d with proper name, like 'S91_mnt_cache'?

Hm, tried the script manually and can't unmount /cache - says it's busy?
[Galaxy S I9000 Android Development] Leonick:
For it to run at bott you should have it in the init.d folder yes, providing your kernel and rom support startup scripts.

You'll also have to give the script execution permissions which you might already know, can be done by "chmod 777 s91_mnt_cache" if you are standing in the init.d folder with the script already there.

As for your other question, did you try again? It sometimes does that it seems, usually works just a little while after that.
[Galaxy S I9000 Android Development] mobidzid:
Still doesn't work - neither manually nor in script.

I tried adding some ">> /sdcard/cachemnt.log" to save the output from each command while running the mounting script, but that doesn't work for some reason.

BTW: creation of the cache works only when run manually, command by command in Terminal.

Tried changing the shell path to "!/system/xbin/busybox sh" - nothing. (I checked first - I do have busybox there).
[Galaxy S I9000 Android Development] darckengel:
And what about trying to use the ykk_five method (modifying the pit file)?

http://xdaforums.com/showthread.php?t=1183249
[Galaxy S I9000 Android Development] demarton:
yeah change the first line too /system/bin sh.

not sure why it didn't work, beyond my logic.

I used busybox installer from market to install busy box 1.81 version.
[Galaxy S I9000 Android Development] mobidzid:
Ok guys, this is getting SERIOUS now! I can't upgrade Catan - Market tells me "not enough space". Help!....

The scripts do not work for me. I can only execute the commands from #94 manually in terminal, but not as a script. The img file is being created just fine then, but I still can't unmount /cache, no matter how many times I try. I tried '!/system/xbin/busybox sh' in the first line, too.

I'm on CM7#77 + Neo9 (if you are on tapatalk and don't see my sig).

Please help!
[Galaxy S I9000 Android Development] Leonick:
So "umount /cache" fails even if you do it manually?
[Galaxy S I9000 Android Development] mobidzid:
Yes, no matter how many time I try.

sent using xda premium from

sgs+cm7+neo16

jvk bl/jvr modem
[Galaxy S I9000 Android Development] Leonick:
Ok, what error do you get?

I presume you are running both the command and the script as root?
[Galaxy S I9000 Android Development] mobidzid:
'busy'

Sure, su always comes first. But, as I think of it now, I probably run the scripts as normal user simply from RE... *facepalm* ... ok, one thing less.. now, how to unmount busy /cache ?

sent using xda premium from

sgs+cm7+neo16

jvk bl/jvr modem
[Galaxy S I9000 Android Development] Leonick:
Try running "fuser -m /cache", should tell us what's using it.
[Galaxy S I9000 Android Development] mobidzid:
fuser -m /cache

6836 6758 6723 6651 6595 6531 6480 6472 6378 6222 6220 6123 6010 6001 5980 5830 5816 5163 5096 5052 4908 4296 4261 3341 2332 904 803 755 584 487 406 371 357 224 158

sent using xda premium from

sgs+cm7+neo16

jvk bl/jvr modem
[Galaxy S I9000 Android Development] Leonick:
ok... that gave us a whole lot more than I expected, every one of those numbers is a process using the /cache partition in some way and as long as they keep using it it'll stay busy...

I was under the impression that /cache was pretty much only used by the market.

Might be cyanogen doing something strange, I have no clue how that rom is set up. Odd that the cache issue isnt fixed in cyanogen really...

Now, you could use "fuser -k /cache" to simply kill all the processes that is using /cache, this might be abit risky though, could lead to some dataloss depending on what these processes are doing. I would at least check the contents of cache first, see what files you might have on there those processes are working with.

You could try running "lsof | grep /cache", might give you some hint to what processes all those are, the name of a process should be the first thing on every line (on our screens on line might cover several lines though).
[Galaxy S I9000 Android Development] madd0g:
I wonder how the "old" Market can download files larger then /cache partition, but the new one doesn't (version 3.0.27)? So Google could fix this using some other download location, if cache is small.
[Galaxy S I9000 Android Development] Leonick:
How old is "old"?

Sure, google could fix this by using another location, but I'd say it's rather unlikely since /cache is just that, a cache for market downloads. Why market can't just download the apk to wherever it's placed when done is a a good question.

Really, the problem here is that manufacturers are stupid enough to put a /cache partition on their devices that is smaller than Googles maximum allowed app size for the market, 50MB.

I've mailed Samsung and I'm hoping to get some kind of response on whether they'll fix this or not, no high hopes though, first answer I got was that the could not replicate the error on the Galaxy Tab 10.1 they tried it on... Yea, they tried on a Galaxy Tab 10.1 even though I had to put in model number to be able to send the mail and mention in the mail that it was a problem on the 7inch Galaxy Tab and the Galaxy S...
[Galaxy S I9000 Android Development] madd0g:
Old is the 2.x Market, without the Books & Videos and tiles. New is the one beeing pushed now and was presented on Google I/O. I didn't have any issues installing apps before, but new Market gives out "insufficient storage" error.

About the /cache size: Google's limit was 30MB last year, they pushed it up later. I think it's rather limiting to DL Market apps to 1 storage only, when there could be a more smart scripting involved.
[Galaxy S I9000 Android Development] Leonick:
I just uninstalled the 3.x market updated... Indeed, it does install apps larger than 30mb... I have only had my Galaxy Tab for 12 days, and I didn't use the original market app for many of those :p

I wonder why they change the way it downloads then, specially as they knew some devices had limited cache, they could respond to me within a few hours that the small cache put on the Galaxy Tab was the problem...

Why would the do that?! Sigh...

Oh well, thanks, now when Samsung can't replicate the problem on the correct Galaxy Tab I know to tell them to get the new market app and test with that or just trust me :p

EDIT: Wait! The old market app can't install apps 30mb plus either, it starts download but just as it's about to complete but it fails, at least for me. It's a different error though, just that it didn't install.
[Galaxy S I9000 Android Development] madd0g:
Ah you never tried with the old Market, hehe.

I noticed this when the new Marked leaked, .26 at the time and was hoping they're gonna change this when pushing the final. After the .27 was beginning to show, I installed it to check and still the same error. Today I got the update pushed to the phone, it was the .27 version and same issue. Then I just uninstalled it for the time beeing and started to look up how to mount cache elsewhere.

But it's sad that Google just ****s this up, I was thinking about posting a rant to Vic Gundotra's Google+ stream, because this is just a ****ing joke.

[edit]

Hm... But it did install Cordy, when the new Market displayed the error. Do you know a free game that's larger then 30mb ?
[Galaxy S I9000 Android Development] Leonick:
As I just edited, I couldn't install large apps now when I tried either they downloaded but on completion they failed without giving much reason.

It didn't seem to be using the cache though, didn't see any files on there or changes in free space.

When I ran the script to remount the larger cache however I could install larger apps again... Odd, specially as you say it has works fine for you with older market...
[Galaxy S I9000 Android Development] madd0g:
So which script is recommended for now? You proposed the preparation script to run once, or type the commands manually, and then just use the boot script every time. Does it work nicely ? I've got busybox tools in /sbin.
[Galaxy S I9000 Android Development] Leonick:
Well I haven't got it to run at boot myself yet, but there might be something more I have to do for that :p

Anyway, I'd say try the all in on script in post #91 first, if it give you trouble (the if part checking if the file is already there seem not to work for some and the script simply fails) go for the two script one I posted in post #94, run the prep script once and then use the mount script as a startup script if you know how to or run it when needed.
[Galaxy S I9000 Android Development] mobidzid:
That's odd... Output from Terminal:

export PATH=/data/local/bin:$PATH

$ export PATH=/data/local/bin:$PATH

$su

# lsof|grep /cache

lsof: not found

# /system/sbin/lsof|grep /cache

/system/sbin/lsof: not found

# echo $PATH

/data/local/bin:/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin

# id

uid=0(root) gid=0(root)

OK, I think I have it... wait... loooooots of output.... no chance to copy it here.

Never mind, I"ll post it on CM thread as a bug of too small /cache.
[Galaxy S I9000 Android Development] anoneemooz:
The script is working fine for me. :) No special things to do. Just flashed the cwm zip version and I checked my /cache which now says 50 mb free wooh! Now I'm less compelled to flash the old market which has been bugging out recently.

Using the latest market, running SURFACE 3.2 JVR, on Talon kernel :)

Try one of the Battle Bears -1 add on's. They're about 47ish mb :) I just downloaded it now.
[Galaxy S I9000 Android Development] Leonick:
Yea, Battle Bears is what I tested with too.

With old market and standard cache it downloads but fail at installing.

With new market it wont even download saying there is insufficient space.

With script it works.

Also, @ anoneemooz, you might want to try the newer script, if it works for you (it seems to be a bit hit and miss with it's if-clause) it is significantly faster for the device to execute as it wont be recreating the cache every time.

I made a flashable zip that you can try if you wish. I took corgars zip and updated the script it contained so it should work.

EDIT: Fixed zip.
[Galaxy S I9000 Android Development] anoneemooz:
Alright I'll try this out now. Thanks! I'll edit this in a bit after testing. Also there's something with the SGS (or maybe the new market but I think this did occasionally happen with the old one too) and not deleting cache files after installing apps. I have to manually clear it out almost everytime.

Edit:

Is the contents of the zip really supposed to be a .txt file?