[FIXED] full r/w access via overlay filesystem

Search This thread

Ireas

Senior Member
Oct 18, 2009
290
20
I see .... ok ok i misunderstood the whole situation.
So I need to edit 04modules (i know it was 03 in the example, but on my cyan its 04 for some reason) to load the aufs module on boot.
And and I need a ext partition for this~
 

totzkotz

Senior Member
Apr 30, 2010
74
1
still have the same problems with the newest cm6 nighlty (with a2sd+ and dalvik on ext partition)

what i've done:

in terminal emulator:
1. su
2. modprobe aufs
3. mount -t aufs -o br=/data/rw=rw:/system=ro none /system (with and without xino option)

when i then start an app the application proccess force closes...
 

jayshah

Senior Member
Jul 2, 2009
230
145
Well modeprobe aufs
doenst do give me any result~ just line skipping
That's good. No news is good news, as they say.

If you get no output, then it means no error. Try "modprobe helloxda" for an error message so you can see your modprobe does indeed work.
 

daveba

Senior Member
Mar 4, 2010
398
61
Dubai
not sure why you have an error, but the cm6 nightly builds already have an aufs.ko file in:
/system/lib/modules/2.6.34.2-cyanogenmod/kernel/fs/aufs/


i'd be very interested :)
a quick guide to creating and setting up the sysrw.fs file would be great too ;)

Creating the sysrw.fs file is just a ext* filesystem. You can do it via adb or a console like so (you don't need to be at recovery). This will have a 512Mb fs.

Code:
busybox dd if=/dev/zero of=/sdcard/sysrw.fs bs=512M seek=1 count=0
mke2fs -F /sdcard/sysrw.fs


This script should happily work even if people don't want to use it as it checks for the existence of /sdcard/sysrw.fs first. You can distribute a gizpped empty filesystem for users to unzip on their /sdcard that will then let this script spring into action.

Here it is i'm doing this from memory since i'm at work).
Code:
if [ -f /sdcard/sysrw.fs ]; then
 [ -d /mnt/system ] || mkdir /mnt/system

 # We need to find the next available loop device, but busybox
 # losetup is broken as it only looks in /dev and not /dev/block 
 # for loop devices so we need to do this manually
 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 /mnt/system
 
 if [ $? -eq 0 ]; then
  # ok, so we succeed all above, so now only modprobe aufs and overmount
  modrprobe aufs
  mount -t aufs -o br=/mnt/system=rw:/system=ro none /system
 fi

fi
 
Last edited:

daveba

Senior Member
Mar 4, 2010
398
61
Dubai
If you would use the FAT partition, you'd get a problem as soon as your device is connected to your PC and sharing it's data: the card gets unmounted. Thats why the "FroYo-way" of Apps2SD su*** - the apps become unavailable.

100% agree, but you'll run out of internal space very quickly as i mentioned. I hadn't seen the 'out of space' icon on my phone until i started running this for a few days, then i realised i'd filled up /data/rw with metamorhph and other apps that were installing on /system.

I use the Froyo app2sd and it's quite nice. I have no probs not unmounting my sdcard as you can do everything without it. There's of course the 'dual mount sd widget' or 'wifi explorer' or ssh, or adb to access the card easily. The benefit of a writeable /system and an inbuilt froyo a2sd outweighs the small negation of usb mounting. So are you saying if i pop the card out of my desire then the non-froyo app2sd still works ? I thought it needed a partition on the sdcard ?
 
Last edited:

Ireas

Senior Member
Oct 18, 2009
290
20
You can also use 'lsmod' as i showed in the first page to check whether the module loaded succesfully, but no output is good in this case meaning the command succeeded.

AH now we talk in the right direction ;)
Code:
# lsmod
lsmod
aufs 131835 0 - Live 0xbf066000
bcm4329 172947 0 - Live 0xbf039000
ipv6 222589 30 - Live 0xbf000000
Hrhr :D *is now creating an ext3 partition*
 

kingchris

Senior Member
Apr 17, 2007
310
13
so i finished my update.zip

for all the others:
things you have to do.

if u wand to create a seperate script in init.d for aufs

create a file (05aufs)
you have to chmod 750 05aufs
you have to chown root:shell 05aufs

then it will be executet on boot

my 05aufs looks atm like this
Code:
#!/system/bin/sh
#
# Load any extra modules

MODULES="aufs"

for i in $MODULES;
do
    modprobe $i;
done

mount -t aufs -o br=/data/rw=rw:/system=ro none /system;

and my updater-script like this:
Code:
mount("MTD", "system", "/system");
mount("MTD", "userdata", "/data");
package_extract_dir("system", "/system");
set_perm(0, 2000, 0750, "/system/etc/init.d/05aufs");
package_extract_dir("data", "/data");
delete("/data/rw/placeholder");
unmount("/userdata");
unmount("/system");

here the unsigned zip-file
http://www.multiupload.com/SNDKKW6LQK

edit: this will mount aufs to /data/rw.
feel free to modify!


@daveba cant you do the script like that?

Code:
if [ -f /sdcard/sysrw.fs ]; then
 [ -d /mnt/system ] || mkdir /mnt/system

 # We need to find the next available loop device, but busybox
 # losetup is broken as it only looks in /dev and not /dev/block 
 # for loop devices so we need to do this manually
 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 /mnt/system
 
 if [ $? -eq 0 ]; then
  # ok, so we succeed all above, so now only modprobe aufs and overmount
  modrprobe aufs
  mount -t aufs -o br=/mnt/system=rw:/system=ro none /system
 fi
 else
  busybox dd if=/dev/zero of=/sdcard/sysrw.fs bs=512M seek=1 count=0
  mke2fs -F /sdcard/sysrw.fs
fi
 
Last edited:

antweb

Member
Jan 26, 2010
24
0
Ok, which ROM shall I install to get it working ? Do we have a list of compatible ROMs ??

Thank you

All ROMs that use the stock 2.6.29 kernel from HTC are compatible with the files from the first post. But you still have to install the patched kernel first.
CM6 does already include an aufs-ready kernel and the module.
 

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.