[FIXED] full r/w access via overlay filesystem

Search This thread

billias

Senior Member
Nov 28, 2008
81
2
So with AUFS we have
2 FS in one.
Simple thought:
We can have the base system and aufs contains the changes
it is combining the two systems and shows the newest content?
 

kingchris

Senior Member
Apr 17, 2007
310
13
Yup, but i'm at work now and that script was from memory. Will try when i get a chance. If you have more time on your hands feel free to plagarize it and bundle it in a .zip

i tried it, my problem atm is that you cant create a directory on /mnt/
bcause it is ro-filesystem and in recovery /mnt/ doesn't exist
 

daveba

Senior Member
Mar 4, 2010
398
61
Dubai
android.process.acore allways force closes so the system gets unuseable until reboot...

BUT

touch /system/fileXYZ ... runs fine ^^

On what ROM ? Must be unrelated issue with the FC. I've had this working for days with no issue whatsoever, installing updates, deleting apps, etc. But i'm on CM6 nightly.
 

totzkotz

Senior Member
Apr 30, 2010
74
1
On what ROM ? Must be unrelated issue with the FC. I've had this working for days with no issue whatsoever, installing updates, deleting apps, etc. But i'm on CM6 nightly.

i am on CM6 nightly too (Latest 10/08/2010)

edit: could it be an issue with a notification icon maybe free task manager ...? i could try to disable all notification icons and reboot und try the overlay fs again to see if it still happens
 
Last edited:

nagylaci

Member
Jul 6, 2010
12
0
Everyone who are having FC-s:

Don't know if it helps, but you can't use this method as long as you're using A2SD(+), and the ext partition is mounted somewhere under /system, for example /system/sd. After you mount the aufs filesystem over /system, all symlinks from /data become invalid (/data/app, /data/app-private, /data/dalvik-cache), and all hell breaks loose :).
 
Last edited:

totzkotz

Senior Member
Apr 30, 2010
74
1
Everyone who are having FC-s:

Don't know if it helps, but you can't use this method as long as you're using A2SD(+), and the ext partition is mounted somewhere under /system, for example /system/sd. After you mount the aufs filesystem over /system, all symlinks from /data become invalid (/data/app, /data/app-private, /app/dalvik-cache), and all hell breaks loose :).

i think this is the problem
 

nagylaci

Member
Jul 6, 2010
12
0
How will aufs handle the fact that there is another fs mounted under it? I mean if we have the ext partition on /system/sd, what happens if I do a "touch /system/sd/test"? will aufs leave it alone, or will it create a corresponding file on the writable /system location (2x the data)?

Isn't it easier to move the mountpoint out of /system, as I did?
 

daveba

Senior Member
Mar 4, 2010
398
61
Dubai
How will aufs handle the fact that there is another fs mounted under it? I mean if we have the ext partition on /system/sd, what happens if I do a "touch /system/sd/test"? will aufs leave it alone, or will it create a corresponding file on the writable /system location (2x the data)?

Isn't it easier to move the mountpoint out of /system, as I did?

Clearly it won't handle it as expected as mentioned. You (we) need to ensure the overlay is in place before the a2sd script runs.

Actually thinking more about this, if we already have some variant of a2sd/app2sd (but not the froyo builtin one) then the start script for aufs should not do anything else but reuse the existing mount point. So we should check for a mountpoint /system/sd or /sd-ext and then use that if it is in /proc/mounts. This will save us all the silliness of where to create/store the overlay (we really should minimise on mount points to save kernel memory), and then if those mount points doesn't exist, then use my loopback mount as shown earlier.
 
Last edited:

nagylaci

Member
Jul 6, 2010
12
0
I meant the following situation:

Lets presume we have a fresh C6 rom, with everything else wiped.

1., mount aufs over real /system, and set /data/sysrw folder as the writable location
2., run A2SD script
2a., The script creates the folder: /system/sd/app
2b., ...and links /data/app to it.

Now. If we do a "touch /system/test" then the corresponding file in "/data/sysrw" is created. This is how aufs works.

My question is: If we install a 100kB small apk into "/data/app", will aufs leave it, or will it create a "/data/sysrw/sd/app/something.apk"? Will it duplicate the file?

ps.: sorry if it's not understandable... i have my problems with english :)
 

daveba

Senior Member
Mar 4, 2010
398
61
Dubai
I meant the following situation:

Lets presume we have a fresh C6 rom, with everything else wiped.

1., mount aufs over real /system, and set /data/sysrw folder as the writable location
2., run A2SD script
2a., The script creates the folder: /system/sd/app
2b., ...and links /data/app to it.

Now. If we do a "touch /system/test" then the corresponding file in "/data/sysrw" is created. This is how aufs works.

My question is: If we install a 100kB small apk into "/data/app", will aufs leave it, or will it create a "/data/sysrw/sd/app/something.apk"? Will it duplicate the file?

ps.: sorry if it's not understandable... i have my problems with english :)

Since i'm unfamiliar with a2sd script, i'm assuming in 2a the folder /system/sd is probably a mount point to a ext{2,3} partition on your sdcard, so /system/sd/app is on your sdcard. So creating a file in /data/app which is a link to /system/sd/app will create it in the sdcard. If /system/sd is not a mount point then it will be created in the writeable bit of the overlay - i.e. /data/sysrw
 

nagylaci

Member
Jul 6, 2010
12
0
Since i'm unfamiliar with a2sd script, i'm assuming in 2a the folder /system/sd is probably a mount point to a ext{2,3} partition on your sdcard, so /system/sd/app is on your sdcard. So creating a file in /data/app which is a link to /system/sd/app will create it in the sdcard. If /system/sd is not a mount point then it will be created in the writeable bit of the overlay - i.e. /data/sysrw
Ahh.. good point. Wasn't thinking it over completely. Thanks. But I still think it clears things up if we just change the /system/sd mountpoint into something else (like /mnt/sd or simply /sd).
 

kingchris

Senior Member
Apr 17, 2007
310
13
for some reason i dont unterstand, i get a

I//system/xbin/run-parts( 63): losetup: /dev/block/loop8: No such file or directory

in logcat after adding

this
Code:
 i=0 && while [ -b /dev/block/loop$i ]; do i=$((i+1)); done

 mknod /dev/block/loop$i b 7 $i
 losetup /dev/block/loop$i /sdcard/sysrw.fs;
 mount /dev/block/loop$i /data/sysrw;
to the 05aufs of init.d

if i try this 3 lines after the system is booted there is no problem and the loop8 is available too

if someone wants to work on: here is what i have atm http://www.multiupload.com/TAE19XS02O
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Hi all ;)

    Try several time but can't remount the system :/

    I run my personal rom with kernel 2.6.35.6 (with aufs 2.1)

    the log

    Code:
    Filesystem           1K-blocks      Used Available Use% Mounted on
    tmpfs                   208080        12    208068   0% /dev
    tmpfs                   208080         0    208080   0% /mnt/asec
    /dev/block/mtdblock3    256000    117992    138008  46% /system
    /dev/block/mtdblock5    151168     13112    138056   9% /data
    /dev/block/mtdblock4     40960      1260     39700   3% /cache
    /dev/block/mmcblk0p2    703028    101853    563667  15% /sd-ext
    /dev/block/mmcblk0p1   7018488   6647016    371472  95% /mnt/sdcard
    ------------------------
    rootfs on / type rootfs (ro,relatime)
    tmpfs on /dev type tmpfs (rw,relatime,mode=755)
    devpts on /dev/pts type devpts (rw,relatime,mode=600)
    proc on /proc type proc (rw,relatime)
    sysfs on /sys type sysfs (rw,relatime)
    tmpfs on /mnt/asec type tmpfs (rw,relatime,mode=755,gid=1000)
    /dev/block/mtdblock3 on /system type yaffs2 (ro,relatime)
    /dev/block/mtdblock5 on /data type yaffs2 (rw,nosuid,nodev,relatime)
    /dev/block/mtdblock4 on /cache type yaffs2 (rw,nosuid,nodev,relatime)
    /sys/kernel/debug on /sys/kernel/debug type debugfs (rw,relatime)
    /dev/block/mmcblk0p2 on /sd-ext type ext2 (rw,noatime,nodiratime,barrier=1,data=ordered)
    /dev/block/mmcblk0p1 on /mnt/sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
    ------------------------
    /sbin:/system/sbin:/system/bin:/system/xbin:/data/local/sysro/xbin
    /system/etc/init.d/02aufssetup: /sysro/xbin/busybox: not found
    /system/etc/init.d/02aufssetup: /data/local/sysro/xbin/busybox: not found
    /system/etc/init.d/02aufssetup: /system/xbin/busybox: not found
    ------------------------

    Thx for any help ... :)

    Clearly you can't find the busybox binary in your ROM. Install it and all should be fine.

    However no one should use this method anymore since SPL-OFF is now available for the Desire - both CDMA and GSM. So this method is no longer recommended.