Creating Android's very own SDCard filesystem - HD2 Android Q&A, Help & Troubleshooting and Genera

If I were to create a 1.5gb fakesd.img ext2 file
done once, on computer
dd if=/dev/zero of=fakesd.img bs=1048576 count=1536
mke2fs -F fakesd.img
--------
done in rootfs-init
losetup /dev/block/loop2 /sdcard/fakesd.img
mount -t ext2 -o noatime,nodiratime /dev/block/loop2 /fakesd
change " symlink /mnt/sdcard /sdcard/ " in rootfs-init.rc
symlink /mnt/sdcard /fakesd/
probably want to avoid changing the external path from /mnt/sdcard/ to anything.. for compatibility sake..
I have my windows stuff on my card. I want android to index as little as possible yet still be able to access my sd card at /sdcard.. Will this work?
I have a feeling that someone is just going to tell me to partition card. I don't feel like it right now..

Partition the card Just kidding, but I like your thinking.

Trying to test it out post boot.. My router has more command line functionality, thanks Google.

Related

[fix new sdcard] little Solution (Partitioning)

hi
I have two 8GB class4 memory card but when I'm just a partition're doing very bad work
Android is reset
apps are broken
High and low speed is
And ...
But when a 2GB partition, I just work very well
Benchmarking partition is much better!
no more problem in android!
So I decided two partitions 2 and 6 GB and the second partition so I just do mount
Method:
1- Memory partitioning (first partition 2gb fat32)
2- copy android in first partition & run it
3- in android terminal type:
Code:
ls /dev/block/m*
or adb
Code:
adb shell ls /dev/block/m*
result like this:
Code:
/dev/block/mmcblk0
/dev/block/mmcblk0p1
/dev/block/mmcblk0p2
/dev/block/mmcblk0p3
Partition testing can be yours for the mount
1- make a folder (not in /sdcard & /mnt/sdcard)
Code:
mkdir /mnt/sd2
now test (for fat32): (just change mmcblk0p2)
Code:
mount -t vfat -o fmask=0000,dmask=0000,rw,flush,noatime,nodiratime /dev/block/mmcblk0p2 /mnt/sd2
(for ext2)
Code:
mount -t ext2 -o noatime,nodiratime /dev/block/mmcblk0p2 /mnt/sd2
Now the partition should be on the /mnt/sd2 mounted
and you can mount in boot
backup /init
open init and past mount cammand below this line :
Code:
PATH=/sbin:/system/sbin:/system/bin:/bin:/system/xbin:/system/xbin/bb:/data/local/bin
now we have auto mount partition
but we have one problem! we should link /mnt/sd2 > /mnt/sdcard
Who s the solution?
interesting idea. will try out.

Alternative to Apps2SD

After looking at the file system of the X10 and noticing lots of empty space on the /system partition and the fact I wanted more space for apps but didn't want to use my class 2 SD card (that is already pretty full!), I decided to try moving some of my larger apps and pointing to the new location using symlinks (like what apps2sd does). Got over 70mb extra space and no probs no far. New apps will just be installed in /data/app/ as before.
Goes without saying that you do this at your own risk and to make a backup first!
This hack of course requires root! And busybox installed.
First copy the apk file to /system/app2/ say (/system/app/ is already used for some system apps so I decided not to copy their so I could keep them separate.)
Check this is done correctly (I used root explorer) but if the command completed with no errors it should be ok. May need to mount /system as read/write.
Then delete the original file and create a symlink to the new file. (If the first step was done incorrectly this step will remove the app!)
I used an app called Scripter to read QR codes I generated from http://qrcode.kaywa.com/ (use text mode) with the code I wrote on my PC, just scan your comp screen with phone camera and it gives you the option to execute the text. (Or you could spend hours typing it in by hand.) adb didn't work for step 2 when I tried it (access denied).
If step 1 says access denied use root explorer to mount /system as read write and try again or use adb to copy the apps ("adb shell" then use the "busybox cp /data/app/com.rovio.angrybirds.apk /system/app2/com.rovio.angrybirds.apk" command)
Example with angrybirds:
First find the name of the .apk file (I used root explorer and navagated to /data/app/ and ordered by size) in this case "com.rovio.angrybirds.apk"
Copy it:
busybox cp /data/app/com.rovio.angrybirds.apk /system/app2/com.rovio.angrybirds.apk
Delete old file and create symlink:
busybox rm /data/app/com.rovio.angrybirds.apk
busybox ln -s /system/app2/com.rovio.angrybirds.apk /data/app/com.rovio.angrybirds.apk
I used notepad "find and replace" to change "com.rovio.angrybirds.apk" to the name of a different app and repeated.
Here are the names of the apps I moved (to save you typing out the names, all near the top of the list in terms of size).
com.polarbit.krazyracers.apk
com.rovio.angrybirds.apk
com.skype.raider.apk
com.fring.apk
com.qype.radar.apk
com.galcon.igalcon.apk
Hope this helps people who like me want more space for apps without using their SD card. Any probs ask here and hopefully I or someone else can help.
Shaun
i wonder if this really works
not calling into question what you say but I think in the long run is able to consume more resources (or at least the same) due to the fact that they also use a folder within the system...
just a thought
but hey, if it works ... WOW
I'd like to see it implemented in a sh script, accepting app name to move as a command line argument.
Or, even better - an apk, which lists all apps installed, and does moving selected ones. Should not be difficult to implement.
thanks for this, but can i do it on HTC Wildfire where it could actually matter?
and btw, currently my system folder has 175MB free space, how low do you think would be too low? how much free space really has to be free?
If by more resources you mean phone memory? Then yes it consumes the same amount of memory but as /system is on a different partition it consumes the memory in a different place (kind of like a different hard drive in your comp, google partitioning).
I'd love to make this into an app but have no idea where to start, prob wouldn't be too hard though, just a gui that passes busybox commands to the shell, with maybe some safe guards, say leave 50meg free, check its copied correctly ect, wonder if other phones have free space in /system as well? No idea with the script either or how to build a safeguard if command 1 fails don't do 2 and 3, but if someone can run a script they can prob do this.
Yeah should work on other phones if /system is mounted on a different partition and has free space. Run "df" (without quotes) in terminal or using adb run "adb shell" after you've connected to your phone and then "df" and post your output here and I'll let you know. My phone starts to complain (memory low message in status bar) and drop sms messages (really bad bug/feature!) when I get below 50meg, hence the reason for me doing this.
I tried to do the same thing but use /nand (internal storage) and link is created in /data/app but doesnt appear in drawer
It looks permission are the problem
have you tried Link2SD?
This is the only thing that is simple enough for everyone
Adolf1994 said:
have you tried Link2SD?
This is the only thing that is simple enough for everyone
Click to expand...
Click to collapse
Tried and couldnt have my SD recognize by my tablet after making the second partition.
I really like to make link2sd work but as soon I create the secont FAT32 or ext2 or ext3 card disapear
enotar said:
Tried and couldnt have my SD recognize by my tablet after making the second partition.
I really like to make link2sd work but as soon I create the secont FAT32 or ext2 or ext3 card disapear
Click to expand...
Click to collapse
tablet? what kind of tablet? if you partitioned the card wrong, it could cause unexpected things. I prefer to do it with SuperOS(formerly Super Ubuntu) distro or any kind of Ubuntu.
if that tablet is 2.1 then this should work, but if it's 2.2+ then app2sd is exactly you need.
Adolf1994 said:
tablet? what kind of tablet? if you partitioned the card wrong, it could cause unexpected things. I prefer to do it with SuperOS(formerly Super Ubuntu) distro or any kind of Ubuntu.
if that tablet is 2.1 then this should work, but if it's 2.2+ then app2sd is exactly you need.
Click to expand...
Click to collapse
Tablet: HSG-X5A-G 2.1
I format with a PC with Ubuntu and not recognize I even try with minitool on another PC
I did on ubuntu with 8gb SD Card X6 and gparted:
delete all partition on SD card apply
create a partition (1) of 8gb primary FAT32 apply
resize to 7.5gb this partition apply
create 0.5gb partition (2) with the free space after resize primary FAT32 apply.
set partition (1) active
put the card in tablet
and no detection of the card.
If I delete the 500 meg (2) partition the sdcard is imediately recognize after putting back in the tablet.
I even try second partition with ext2 or ext3 try too formating with clockwork recovery menu.I try too to copy to the new formated SD the dir Android, Android-secure and Lost.Dir...... Nothing work.
The second partition make my SD unrecognizable.
I even try to create a linux swap file of 32 meg and no chance too.
If someone can explain me why?
did you use cwm to format things? for now avoid things like this
if you have root(have you?), then please download irssi connectbot from market, open it, set the pulldown list to 'local' at the bottom and give it a name, enter.
then open the newly created connection, issue these commands and post the results here(with the sd card working):
Code:
$ su <- after this allow superuser access
# mount
Adolf1994 said:
did you use cwm to format things? YES
if you have root(have you?), YES
Click to expand...
Click to collapse
Result with my working 16gb card:
rootfs / rootfs ro 0 0tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
tmpfs /broadcasting tmpfs rw,size=1024k 0 0
/dev/block/mtdblock2 /system yaffs2 ro 0 0
/dev/block/mtdblock5 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock4 /cache yaffs2 rw,nosuid,nodev 0 0
/dev/block/ndda1 /nand vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fma
sk=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
if you put in the partitioned card, does Android notifies you to format it or doesn't even do that?
if it notifies you, please try to issue this command as superuser:
Code:
mount /dev/block//vold/179:1 /sdcard -t vfat -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro
Adolf1994 said:
if you put in the partitioned card, does Android notifies you to format it or doesn't even do that?
Click to expand...
Click to collapse
Dont even do that, no message at all
then issue the command anyway, and see if it works, if not, then post the results here
I create the second partition on the card (space was free) as primary and FAT32 put back the card in the tablet.
As the card was not recognize i use PC with adb:
adb remount
adb shell
su
mount /dev/block//vold/179:1 /sdcard -t vfat -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro
I get :
mount /dev/block//vold/179:1 /sdcard -t vfat -o rw,dirsync,nosuid,nodev,noexec,u
id=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset
=iso8859-1,shortname=mixed,utf8,errors=remount-ro
Usage: mount [-r] [-w] [-o options] [-t type] device directory
oh, the sequence that matters!
then type this:
Code:
mount -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro -t vfat /dev/block//vold/179:1 /sdcard
Adolf1994 said:
oh, the sequence that matters!
then type this:
Code:
mount -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro -t vfat /dev/block//vold/179:1 /sdcard
Click to expand...
Click to collapse
Result:
Usage: mount [-r] [-w] [-o options] [-t type] device directorymount -o rw,dirsyn
c,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,c
odepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro -t vfat
/dev/block//vold/179:1 /sdcard
Usage:: not found
Re runing give me this now:
mount -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,
allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=
remount-ro -t vfat /dev/block//vold/179:1 /sdcard
[1] + Stopped (signal) mount -o rw,dirsync,nosuid,nodev,noexec,uid=1000,g
id=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-
1,shortname=mixed,utf8,errors=remount-ro -t vfat /dev/block//vold/...
well, it looks like it's too high for me.
try to find the tablet's subforum and/or another senior member with the same tablet.
hope you can solve it
and please post here the things you found
Thank you very much to try....

[HOW-TO] Make Ext4 from Recovery Without Losing FAT32 Data

I've seen a lot of threads detailing how to create an Ext4 partition using Gparted but if you don't want to download the image and would rather do it all on your phone, here's how:
This entire procedure should take less than 5min so you can go back to messing with your phone in other ways.
REQUIRES:
CLOCKWORK MOD RECOVERY
ADB
FINGERS
I am not responsible for any damage done to your phone doing this process. =.=
1. Download the zip file provided.
2. Extract the zip file to the same folder you have ADB in. (You should now have a folder named ext4 in the same folder you have ADB)
3. Reboot the phone into MAGDLR. Then select the option to boot into the recovery.
4. Make sure that /system/ is mounted using the option to mount partition in Clockwork Recovery.
5. Open a command (cmd) prompt and cd into your folder with ADB.
6. Run these commands in the command prompt. (Commands are in BOLD)
adb push ext4 /system/etc/
adb shell
parted /dev/block/mmcblk0
print (make note of the total size of your partition here)
resize 1 0 xxxx (where xxxx is the size you want for your FAT32 partition. It should equal total size of your partition that you gleaned from print minus 1024 for the ext4 partition you're about to set up)
mkpartfs primary ext2 xxxx yyyy (where xxxx is where your previous partition ended and yyyy is the total size of your sdcard)
.... (Let it do its thing. Shouldn't take more than a minute)
print (Make sure that everything is correct: You have a fat32 partition running from 0 to xxxx and an ext2 partition running from xxxx to the total size of your partition)
quit
Now to utilize the two files we previously pushed to /system/etc/
chmod 777 /system/etc/tune2fs
chmod 777 /system/etc/e2fsck
/system/etc/tune2fs -j /dev/block/mmcblk0p2 <- You now have ext3
/system/etc/tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p2 (Note: CAsE SEnSitiVE)
/system/etc/e2fsck -fpDC0 /dev/block/mmcblk0p2 (Note: CAsE SEnSitiVE) <- You now have ext4
7. You can check that it's truly ext4 by:
parted /dev/block/mmcblk0
print (It should now read that you have a FAT32 and an ext4 partition.)
quit
You're all done! Now you have a 1GB ext4 partition for all your data and apps. If you know what you're doing, these same steps can be modified so that you have two ext4 partitions if you'd like. You can also alter the size of your ext4 partition to something smaller if you don't have that many apps to install or have a smaller SDcard (512MB should be sufficient in most cases, 1GB is slightly overkill IMO)
i will try with my HD2. I need more space to install app on sd not on phone. Thanks so much
Hi, I follow your instruction but when I get a "Permision deined" error when I type in the following commond
/system/etc/tune2fs -j /dev/block/mmcblk0p2
Can you please help?
Many many thanks!!
justj said:
Hi, I follow your instruction but when I get a "Permision deined" error when I type in the following commond
/system/etc/tune2fs -j /dev/block/mmcblk0p2
Can you please help?
Many many thanks!!
Click to expand...
Click to collapse
Crap. I forgot a step. You have to type
chmod 777 /system/etc/tune2fs
chmod 777 /system/etc/e2fsck
prior to using those files. That should fix the permission denied error.
I've edited the OP to reflect the changes, thanks for pointing that out.
Thanks man
Thanks Bro I have successfully make ext4 and I am enjoying my new Rom
Using HTC Desire runnymede 5.0
Amazing. I will keep it for future reference, although I partitioned my SD with CWM recovery and Gparted.
What kind of partition is made when using CWM? I made a 1GB partition on my card that way, and it works great. But I've heard good things about having it as ext4. How does this guide reflect the fact that I already have an SD-EXT on my card that's not necessarily ext4?
Thanks!
please help
please help me i cant get it to work... its same with /system mounted and unmounted...not even one 3rd app is working for me on my win 7 64x when i want to create ext4 this is my last hope. card is brand new 8gb ultra speed its working fine so cant be problem there. it seems like chmod 777 will delete that file..
Code:
C:\Users\OgziR\Desktop\adt-bundle-windows-x86_64-20130522\sdk\platform-tools>adb
push ext4 /system/etc/
push: ext4/tune2fs -> /system/etc/tune2fs
push: ext4/e2fsck -> /system/etc/e2fsck
2 files pushed. 0 files skipped.
1573 KB/s (603400 bytes in 0.374s)
C:\Users\OgziR\Desktop\adt-bundle-windows-x86_64-20130522\sdk\platform-tools>adb
shell
~ # /system/etc/tune2fs -j /dev/block/mmcblk0p2
/system/etc/tune2fs -j /dev/block/mmcblk0p2
/sbin/sh: /system/etc/tune2fs: Permission denied
~ # chmod 777 /system/etc/tune2fs
chmod 777 /system/etc/tune2fs
~ # /system/etc/tune2fs -j /dev/block/mmcblk0p2
/system/etc/tune2fs -j /dev/block/mmcblk0p2
/sbin/sh: /system/etc/tune2fs: not found
~ #
Hye... I have 2 question...
My phone is a HTC HD2 running an NexusHD2.ICS.CM9.HWA.V2.3 ROM... The cmd prompt cant seem so fine my device. Do have any advice on this???
Secondly, what do i do with the ext4.zip file??? I mean, do it extract it, or put in same folder with ADB??
Btw, i am Super Noob on this, so i apologize if my question offends anyone... 1000 apologizes...
OK, first of all, do you have adb installed correctly? If cmd prompt can't find your device that is the most likely problem.
As for what to do with ext4.zip, you need to extract it to your adb folder.
Sent from my Vivid 4G using xda app-developers app

[HOWTO] Loop mount

OK, I spent a couple of hours figuring out how loop mounting works. The problem is that the mount command in both toolbox and busybox supports only one loop device. I modified the toolbox version to allow the specification of a new loop device.
Here is how to make a 500mb loop-mounted ext2 system at /mnt/myloop , with the system being stored in /storage/sdcard/myext2system.img
Step 1. Make sure you have root. Download bettermount*.zip to your PC from here. Copy the "bettermount" file from the zip file to /data/local/ (or some other location). One way of doing that is with:
Code:
adb push bettermount /data/local
on the PC. Or you can mount your device to USB, copy bettermount to storage, and then in a root shell copy it to /data/local. Or if you have RW root, you can install bettermount in /bin or some other convenient location.
Start a shell on the device, either via adb or an on-device terminal (not recommended unless you have an external keyboard). Switch to root:
Code:
su
Then make bettermount executable:
Code:
chmod 755 /data/local/bettermount
The following steps assume you're still in your root shell.
Step 2. Create ext2 file system in a file. (Skip this if you already have one.)
Code:
dd if=/dev/zero of=/storage/sdcard/myext2system.img bs=1M count=500
mke2fs /storage/sdcard/myext2system.img
mke2fs will give you a warning that this isn't a block special device, but just press "y" and "enter".
Step 3. Create a loop device node for the ext2 file system. The problem here is that the OS uses loop device nodes for apps moved to external storage and one for the system squashfs, and it only has enough loop device nodes for those purposes--any loop device nodes in /dev/block are already in use. On the assumption that you aren't going to have more than 253 apps moved to storage, we're going to create a loop device node numbered 255. If you like, you can check that there isn't already one with that number with
Code:
ls /dev/block/loop*
So, let's create the loop device node:
Code:
mknod -m640 /dev/block/loop255 b 7 255
Step 4. Create a mount point:
Code:
mkdir /mnt/myloop
Step 5. Mount myext2filesystem.img:
Code:
/data/local/bettermount -t ext2 -orw,exec,noatime,nodiratime,sync,loop=/dev/block/loop255 /storage/sdcard/myext2system.img /mnt/myloop
Enjoy your new file system at /mnt/myloop !
You will have to repeat Steps 3-5 after every boot, or else you can make a script that runs every time you boot. You could simply put the commands for 3-5 into a Script Manager script set to run on boot, or there may be some better, more unixy way (but I haven't had any luck editing startup scripts).
What to do with your shiny new filesystem? Well, you could move not just apps but also their libraries to external storage (you can also do that by remounting your external storage in exec mode).
arpruss said:
OK, I spent a couple of hours figuring out how loop mounting works. The problem is that the mount command in both toolbox and busybox supports only one loop device. I modified the toolbox version to allow the specification of a new loop device.
Here is how to make a 500mb loop-mounted ext2 system at /mnt/myloop , with the system being stored in /storage/sdcard/myext2system.img
Step 1. Make sure you have root. Download bettermount*.zip to your PC from here. Copy the "bettermount" file from the zip file to /data/local/ (or some other location). One way of doing that is with:
Code:
adb push bettermount /data/local
on the PC. Or you can mount your device to USB, copy bettermount to storage, and then in a root shell copy it to /data/local. Or if you have RW root, you can install bettermount in /bin or some other convenient location.
Start a shell on the device, either via adb or an on-device terminal (not recommended unless you have an external keyboard). Switch to root:
Code:
su
Then make bettermount executable:
Code:
chmod 755 /data/local/bettermount
The following steps assume you're still in your root shell.
Step 2. Create ext2 file system in a file. (Skip this if you already have one.)
Code:
dd if=/dev/zero of=/storage/sdcard/myext2system.img bs=1M count=500
mke2fs /storage/sdcard/myext2system.img
mke2fs will give you a warning that this isn't a block special device, but just press "y" and "enter".
Step 3. Create a loop device node for the ext2 file system. The problem here is that the OS uses loop device nodes for apps moved to external storage and one for the system squashfs, and it only has enough loop device nodes for those purposes--any loop device nodes in /dev/block are already in use. On the assumption that you aren't going to have more than 253 apps moved to storage, we're going to create a loop device node numbered 255. If you like, you can check that there isn't already one with that number with
Code:
ls /dev/block/loop*
So, let's create the loop device node:
Code:
mknod -m640 /dev/block/loop255 b 7 255
Step 4. Create a mount point:
Code:
mkdir /mnt/myloop
Step 5. Mount myext2filesystem.img:
Code:
/data/local/bettermount -t ext2 -orw,exec,noatime,nodiratime,sync,loop=/dev/block/loop255 /storage/sdcard/myext2filesystem.img /mnt/myloop
Enjoy your new file system at /mnt/myloop !
You will have to repeat Steps 3-5 after every boot, or else you can make a script that runs every time you boot. You could simply put the commands for 3-5 into a Script Manager script set to run on boot, or there may be some better, more unixy way (but I haven't had any luck editing startup scripts).
What to do with your shiny new filesystem? Well, you could move not just apps but also their libraries to external storage (you can also do that by remounting your external storage in exec mode).
Click to expand...
Click to collapse
Which version of busybox were you testing with? I haven't had a problem with multiple loop devices...
I've been using the stock busybox: 1.7.2.
Do you use -oloop=/dev/block/loopNN to specify the device?
I just tried 1.16.0 from the Titanium Backup website. No luck. I created /dev/block/loop222. Then:
Code:
# /tmp/busybox mount -t ext2 -oloop=/dev/block/loop222 /storage/10.img /mnt/myloop
mount: can't setup loop device: No such file or directory
# bettermount -t ext2 -oloop=/dev/block/loop222 /storage/10.img /mnt/myloop
# (works!)
I also tried just plain -oloop, without the =/dev/block/loop222, and it didn't work.
arpruss said:
I've been using the stock busybox: 1.7.2.
Do you use -oloop=/dev/block/loopNN to specify the device?
I just tried 1.16.0 from the Titanium Backup website. No luck. I created /dev/block/loop222. Then:
Code:
# /tmp/busybox mount -t ext2 -oloop=/dev/block/loop222 /storage/10.img /mnt/myloop
mount: can't setup loop device: No such file or directory
# bettermount -t ext2 -oloop=/dev/block/loop222 /storage/10.img /mnt/myloop
# (works!)
I also tried just plain -oloop, without the =/dev/block/loop222, and it didn't work.
Click to expand...
Click to collapse
I can't remember if mount was symlinked to busybox at the time, but I just used the standard "mount -o loop disk1.img /mnt/disk". I may have even been on a custom kernel and had a crosscompiled mount, so good work, this is probably going to be a common problem for people.
The problem with busybox seems to be that it thinks /dev/block/loop0 is free, but it's not. Doing losetup -f returns /dev/block/loop0.
If you could mount the loopdevice in init.rc this would be the easiest way to expand the 300MB /data problem with archos.
Also it might be the best way in CM7 until its stable for the persistent Data between revisions.
fzelle said:
If you could mount the loopdevice in init.rc this would be the easiest way to expand the 300MB /data problem with archos.
Also it might be the best way in CM7 until its stable for the persistent Data between revisions.
Click to expand...
Click to collapse
I have had no luck adding anything to init.rc with the rw root.
Moreover, /storage and /storage/sdcard get mounted quite late in the boot process--late enough that I think one can't just move the /data directory there. I suppose one might be able to mount them earlier in the process, but I haven't been able to figure out how to run anything in an init script. If anybody knows how to do it, please speak up!
What one could do, however, is mount the loop from an app's on-boot notification, and then symlink individual app files.
It looks like with a better busybox than the one included with the device, one can also use losetup to specify the loop device--see here.
I built a full 1.18.5 version of Busybox, and it does loop mounting just right. You can replace Step 1 of my HOWTO with fetching my modified busybox and putting it in /data/local, from http://code.google.com/p/busybox-for-android/downloads/list
Then step 3 is not needed.
Step 4 should be replaceable with the very simple:
Code:
/data/local/busybox mount -orw,exec,noatime,nodiratime,sync,loop /storage/sdcard/myext2system.img /mnt/myloop
Or if you're pressed for time, and want to use default mount options:
Code:
/data/local/busybox mount -oloop /storage/sdcard/myext2system.img /mnt/myloop
But if you want to implement this is inside an app, depending on your license needs, you may want to use the longer method, since busybox is GPL while bettermount is Apache 2.

How to use the internal memory

1.First crate a 5G disk file called sdfs.img(or other) in the /data/local directory and make it to vfat(or other) file system
su
dd if=/dev/zero of=/data/local/sdfs.img bs=1024 count=5242880
busybox mkfs.vfat /datd/local/sdfs.img
2.Crate a file in /system/etc/init.d to mount it to /mnt/sdcard/mydata(or other) on boot
The file contents are as follows
#use sleep 50s(less or more) to wait the sdcard be mouted
busybox sleep 50s
umount /mnt/sdcard/mydata
losetup -d /dev/block/loop0
mount -o loop,umask=702,uid=1000,gid=1015 -t vfat /data/local/sdfs.img /mnt/sdcard/mydata
Then you can use the internal memory
Sorry for my poor english
alan101 said:
1.First crate a 5G disk file called sdfs.img(or other) in the /data/local directory and make it to vfat(or other) file system
su
dd if=/dev/zero of=/data/local/sdfs.img bs=1024 count=5242880
busybox mkfs.vfat /datd/local/sdfs.img
2.Crate a file in /system/etc/init.d to mount it to /mnt/sdcard/mydata(or other) on boot
The file contents are as follows
#use sleep 50s(less or more) to wait the sdcard be mouted
busybox sleep 50s
umount /mnt/sdcard/mydata
losetup -d /dev/block/loop0
mount -o loop,umask=702,uid=1000,gid=1015 -t vfat /data/local/sdfs.img /mnt/sdcard/mydata
Then you can use the internal memory
Sorry for my poor english
Click to expand...
Click to collapse
Cool, I'll try.
alan101 said:
1.First crate a 5G disk file called sdfs.img(or other) in the /data/local directory and make it to vfat(or other) file system
su
dd if=/dev/zero of=/data/local/sdfs.img bs=1024 count=5242880
busybox mkfs.vfat /datd/local/sdfs.img
2.Crate a file in /system/etc/init.d to mount it to /mnt/sdcard/mydata(or other) on boot
The file contents are as follows
#use sleep 50s(less or more) to wait the sdcard be mouted
busybox sleep 50s
umount /mnt/sdcard/mydata
losetup -d /dev/block/loop0
mount -o loop,umask=702,uid=1000,gid=1015 -t vfat /data/local/sdfs.img /mnt/sdcard/mydata
Then you can use the internal memory
Sorry for my poor english
Click to expand...
Click to collapse
It didn't work here
I got this: mkfs.vfat: lseek: Value too large for defined data type
edgaredgar said:
It didn't work here
I got this: mkfs.vfat: lseek: Value too large for defined data type
Click to expand...
Click to collapse
because the busybox does not support
use this busybox

Categories

Resources