yashsingh1/xdaforums huggingface dataset:
[Desire Android Development] billias:
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?
[Desire Android Development] fireball2k:
That's the way aufs and other UnionFS implementations work, yes.
[Desire Android Development] kingchris:
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
[Desire Android Development] daveba:
Yes, as i said from memory ;-)

Just create it elsewhere like on /sysrw or /data/sysrw
[Desire Android Development] totzkotz:
android.process.acore allways force closes so the system gets unuseable until reboot...

BUT

touch /system/fileXYZ ... runs fine ^^
[Desire Android Development] daveba:
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.
[Desire Android Development] totzkotz:
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
[Desire Android Development] daveba:
A dodgy contact ? http://code.google.com/p/android/issues/detail?id=2377

Do a logcat to see what's going on. Shouldn't be related to the aufs (the fact that you can still touch /system/xxx means the aufs hasn't crashed)
[Desire Android Development] nagylaci:
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 :).
[Desire Android Development] totzkotz:
ok but android.proccess.acore isn't the only process what is crashing...

when i try to start the taskmanager out of the notification his proccess is also crashing then
[Desire Android Development] totzkotz:
i think this is the problem
[Desire Android Development] daveba:
Possibly. I don't use a2sd*, only the froyo builtin one. We need to ensure the a2sd script runs after the aufs startup script - i.e. the /system overlay is in place before the symlinks are made.
[Desire Android Development] nagylaci:
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?
[Desire Android Development] daveba:
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.
[Desire Android Development] nagylaci:
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 :)
[Desire Android Development] daveba:
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
[Desire Android Development] nagylaci:
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).
[Desire Android Development] kingchris:
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

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
[Desire Android Development] Ireas:
OK used kingchris update script,

looks like all's fine. Saddly the root-explorer from the market cant delete apps from the system or even mount it R/W
[Desire Android Development] daveba:
I'll check when i get home and put the kids down.
[Desire Android Development] daveba:
The script must have failed clearly. If you open up a console app can you type 'mount' and see if /system is mounted correctly overlaid ?
[Desire Android Development] Ireas:
mount
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)
none on /acct type cgroup (rw,relatime,cpuacct)
tmpfs on /mnt/asec type tmpfs (rw,relatime,mode=755,gid=1000)
none on /dev/cpuctl type cgroup (rw,relatime,cpu)
/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)
none on /system type aufs (rw,relatime,si=ac01a358)
/sys/kernel/debug on /sys/kernel/debug type debugfs (rw,relatime)
/dev/block/vold/179:1 on /mnt/sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_ut
ime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/block/vold/179:1 on /mnt/secure/asec type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,all
ow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /mnt/sdcard/.android_secure type tmpfs (ro,relatime,size=0k,mode=000)
[Desire Android Development] Pyr0x64:
anybody made any more progress with the scripts? :p
[Desire Android Development] daveba:
Yes i've been looking at this further and come to the conclusion that this is overly complex to do what i originally proposed (i.e. mount from a loopback file on the sdcard). The problem is that now i remember, the issue is that vold which is in control of mounting the sdcard comes into play very late on in the boot process and thus is not accessible when the init.d/* scripts are read. There seems to be no way to trigger an action after the scard is mounted (well there is programatically but not by scripting if i'm correct), but by then it's quite late and you'd be stuck with filehandles in the underlying /system by processes (like a2sd mounts, etc). I did have it working correctly with a loopback image on the sd card but i had to jump thru hoops - i.e. i needed to mount the sdcard early which means taking it out of vold control and also editing init.rc to change the mount point and then symlinking over the place. This makes it somewhat nicer as users can't accidently umount the sdcard, but i was unhappy about releasing a zip that blatted so much of original scripts and filesystem.

So i've gone back to thinking the KISS way is to not be overly complex which leaves us with 2 options:

1. Leave the wirteable overlay on /data (as i initially did in the first page of these posts). This has the drawback that /data will get full quickly.

2. Check to see if /system/sd or /sd-ext exists (which is anyone who has a partitioned card in use for a*2sd) and then use that as the writeable overlay.

If it can't find any partitions from #2, then look on the card for any ext* partitions labelled with 'SYSTEMRW' (exactly that and only that so unlabelled partitions will not suddenly get used) and then use that early on as the overlay.

I'm just testing the latter now, but it requires e2fsck and a new busybox for getting the filesystem label to work correctly.

kingchris: the reason why you were getting the losetup error is that on bootup the kernel creates 8 loop devices (loop0-7) automatically but none of these are actually being used, so it was failing to dynamically allocate the 8th even though the block device loop8 was created correctly. In reality you can delete everything above the losetup and just use loop0 for your loop device, but in light of what i said above, the sdcard is not ready yet so unless you had a filesystem image somewhere (on /data perhaps) the loopback is not necessary. Now i realise why a*2sd requires a partition - so i answered my question i posed earlier about why they don't use loopbacked images from the sdcard FAT partition as it would be so much easier that partitioning for noobies - it still can be done, it's just more trouble than it's worth.

Ireas: everything looks correct. I will need to check when i get this script correct.
[Desire Android Development] Ireas:
Hey mate,

I've also done some checks with my system and it seems that only few apps have problem with the "mounting", i.e. the rootexplorer doesnt want to mount the system by typing on the "R/O R/W" button - but the ES Fileexplorer seems to work fine (after activating the root options), by fine I'm poiting to the fact that I could delete and paste files inside the /system/app

Also metamorph seems to work, atleast I have to reboot after each morph.
[Desire Android Development] shawe_ewahs:
Anyone test it on a 2.2 version?
[Desire Android Development] Pyr0x64:
after editing the rc2 apps2sd script to use /data/sd instead of /system/sd (just a search&replace), then adding a simple 09aufsmount file to modprobe aufs and mount /system to /data/sd/sysrw.

overlaying the filesystem on the ext partition of my sdcard seems to be working well with the 0812 cm6 nightly build :)

i've attached it to this post incase anybody else would like to try it.

it's working for me, but i take no responsibility if it messes up your phone. :p
[Desire Android Development] totzkotz:
ok ive tested this with a fresh install of cm6 latest nighty and full wipe

mounting the sd to /data/da ... ok

"a2sd cachesd" > runs fine on /data/sd/... too

modprobe aufs ... ok

but /data/sd/sysrw was not created automaticly so i did it by myself and now it works :) great work
[Desire Android Development] bunny0007:
None of all this seems to work on 2.2 sense.

Do not work on RoufianosV6 OTA 2.2.
[Desire Android Development] antweb:
How did you get aufs on a 2.2 Sense? The Desire 2.6.32 source isn't available yet or did I miss something?
[Desire Android Development] BlaY0:
You don't need the whole source to compile one module. You just need the headers from recent kernel with faked version and that's it.
[Desire Android Development] antweb:
But the module won't run on a stock kernel. You need a patched kernel with exported symbols.
[Desire Android Development] FloHimself:
I searched something similar but for the stock kernel. I`m out of time for today, so I post here something to play with: mini_fo kernel module for HTC stock kernel.

More info here: http://www.denx.de/wiki/Know/MiniFOHome
[Desire Android Development] daveba:
Hence you should lobby your ROM developers to add support for aufs.
[Desire Android Development] daveba:
Ok here's my 06aufs scripts.zip. IT IS NOT IN UPDATE.ZIP FORMAT. Someone else can create that as i'm not familiar with the process. The two binaries should be put in /system/xbin and the init script in /system/etc/init.d. Ensure the executable flag is present on all the binaries and scripts.

I moved it to a 06 script as i wanted it to run after a*sd script which mount their own partitions meaning if you already have a*sd running then this will reuse the mountpoint for the writeable overlay on /system. This should cover most of the people (i think but since i don't use a*sd then i can't verify). I guess i should also check if as mentioned in the previous post that some mounts are done on /system/sd so overlaying was causing strange FC's ? Someone needs to tell me what really is mounted in that situation and i can cater for it. So this script does the following:

1. Check for an already mounted ext* filesystem from an app2sd/a2sd variant. If it is mounted then create a directory in that called 'sysrw'.

2. If it doesn't find an existing partion in #1, then it searches the 4 partitions on your card for (since this is a fat card only primary partitions are checked) for a volume labelled 'systemrw' (exactly that in lowercase). It then checks the filesystem for errors and mounts that on /data/sysrw

3. If either #1 or #2 succeeded then the module gets loaded and the overlay is created.

I hope the script is fairly robust in the current state and i hope it does coexist with a*sd variants. If you have a problem please check /data/aufs.log and post it.

For noobies, if you haven't already partitioned you sdcard for a2sd, just pop it into the SD adapter and shrink the original FAT partition and add another partition (i created a 512MB partition on my 8GB card) using your favorite tools under windows/linux/mac after the original FAT partition number 1. Reinsert the sdcard in your phone reboot. Then open the phone root console and type

mkfs.ext2 /dev/block/mmcblk0pX

where the 'X' is the partition number. It is always NOT 1 as that is your FAT partition. Then run

e2label /dev/block/mmcblk0pX systemrw
[Desire Android Development] yulu1:
2.2cm6: fat32 not mounted,can't find sdcard .

/data/sd, ok.
[Desire Android Development] BlaY0:
Yes, you're right. I thought aufs is part of vanilla 2.6.32. Obviously I was wrong. And still no sign of FroYo kernel on developer.htc.com ?@#$$!
[Desire Android Development] BlaY0:
Hey antweb,

Those aufs utils in the first post are not for ARM, the are for x86-64. Have you forgotten to cross compile them?

Regards,

Blaz
[Desire Android Development] antweb:
They weren't? Maybe skipped a line or two on my build.

I'll upload a new one, check the first post or the project site on Google Code.
[Desire Android Development] Nekromantik:
wish this worked on 2.2 Sense :(
[Desire Android Development] daveba:
Devs are clearly building this for froyo. That's FR91 based.

$ jar tvf DeFroST_2.9a.zip |grep aufs
186915 Sun Aug 15 08:56:58 GST 2010 system/lib/modules/aufs.ko
[Desire Android Development] BlaY0:
Yes, but it is not based on HTC's kernel. It has 2.6.34 as title says.

Hmm, still not good:

auplink: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), for GNU/Linux 2.6.15, statically linked, stripped
[Desire Android Development] antweb:
You're right. Also checked myself.

Seems like the usual

make ARCH=arm CROSS_COMPILE=arm-eabi-

isn't working. I'm pretty new to this whole cross compile thing but I'll have a look into it.
[Desire Android Development] daveba:
Anyone who's running cm6 and has partitioned their sd card as per

http://xdaforums.com/showpost.php?p=7657386&postcount=117

with a ext2/3 partition labelled 'systemrw' or with a a2sd* variant, this flashable zip should give them a writeable /system. It doesn't provide a aufs.ko module for you as your ROM should support this. Please ask your ROM creator to support aufs if you need this functionality.
[Desire Android Development] Pyrojester:
Will this method work with Cyanogenmod 6.00 RC2?
[Desire Android Development] daveba:
I believe CM has aufs module included in the ROM so you don't need the aufs.ko provided in the first post. Just use the scripts or the update zip file provided in the previous post and you should be good to go.
[Desire Android Development] shawe_ewahs:
Tested for a friend on CM6.0-RC2 and can't write on /system.
[Desire Android Development] Naphtaline:
Same here but maybe I made something wrong (NeoPhyTe.x360's WhiteXperience)
[Desire Android Development] 77flem:
Same here on cm6 I have an ext3 partition, how can i check that its mounted and labelled correctly?
[Desire Android Development] daveba:
Post your /data/aufs.log file

You should just be able to run adb and use e2label on the ext3 partition.

adb shell
e2label /dev/block/mmcblkpX

Where X is your partition number. But the aufs.log will let you know what went wrong.
[Desire Android Development] 77flem:
here it is http://pastebin.com/ZDhWQZRA
[Desire Android Development] daveba:
Looks like no errors. Are you sure it's not working ? If you do

adb shell
touch /system/xyz
ls -l /system/xyz
rm /system/xyz

do you see an errors ? Also what does

adb shell
mount

say ?
[Desire Android Development] 77flem:
That seems working in fact you're right, strange i've tried to copy a file using root explorer but it stays at r/o even if i press r/w button.

# touch /system/xyz
touch /system/xyz
# ls -l /system/xyz
ls -l /system/xyz
-rw-rw-rw- 1 root root 0 Aug 20 18:49 /system/xyz
# rm /system/xyz
rm /system/xyz
# mount
mount
rootfs on / type rootfs (rw,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)
none on /acct type cgroup (rw,relatime,cpuacct)
tmpfs on /mnt/asec type tmpfs (rw,relatime,mode=755,gid=1000)
none on /dev/cpuctl type cgroup (rw,relatime,cpu)
/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)
/dev/block/mmcblk0p2 on /data/sysrw type ext2 (rw,relatime,barrier=1,data=ordere
d)
none on /system type aufs (rw,relatime,si=398b5beb)
/sys/kernel/debug on /sys/kernel/debug type debugfs (rw,relatime)
/dev/block/vold/179:1 on /mnt/sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,r
elatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,
iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)

/dev/block/vold/179:1 on /mnt/secure/asec type vfat (rw,dirsync,nosuid,nodev,noe
xec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=c
p437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)

tmpfs on /mnt/sdcard/.android_secure type tmpfs (ro,relatime,size=0k,mode=000)
[Desire Android Development] daveba:
Someone else mentioned this earlier in this thread also. Seems rootexplorer makes some assumptions and doesn't actually check for writeability of /system. Maybe it just parses /proc/mounts and since there's two entries for /system (as we're overmounting) it hits the first entry which is 'ro' and ignores the second which is 'rw'. A solution perhaps would be to use the --move flag to move the 'ro' /system to another path and not overmount.

So if you want to try, change the line in /system/etc/init.d/06aufs (in recovery mode) from

mount -t aufs -o br=$RWDIR=rw:/system=ro none /system >>/data/aufs.log 2>&1

to

[ -d /data/sysro ] || mkdir /data/sysro
mount --move /system /data/sysro >>/data/aufs.log 2>&1
mount -t aufs -o br=$RWDIR=rw:/data/sysro=ro none /system >>/data/aufs.log 2>&1
[Desire Android Development] popepope:
Hello, any chance to get access via serial with this development? Looking for some hints to reach the network lock area.
[Desire Android Development] daveba:
No, this doesn't circumvent any of the eng locks. It just mounts a translucent writeable filesystem ontop of the read-only /system so you can 'see' all the files and are able to 'delete' or overwrite any file on /system even though it is still infact read-only.
[Desire Android Development] BlaY0:
Hmm, but when you mount move /system to some other place, then you loose /system/bin/mount and can not execut next mount. So I think you should execute this mount by calling it with full path:

/data/sysro/bin/mount -t aufs -o br=$RWDIR=rw:/data/sysro=ro none /system

...or even better call mount from busybox and not from toolbox:

/data/sysro/xbin/mount -t aufs -o br=$RWDIR=rw:/data/sysro=ro none /system
[Desire Android Development] daveba:
Absolutely correct, my bad.

Anyone tried it ? Does it work for rootexplorer ?
[Desire Android Development] 77flem:
aufs log file says:

/system/etc/init.d/06aufs: /data/sysro/xbin/mount: not found
[Desire Android Development] daveba:
I think because mount is linked to busybox and now it can't call busybox either ;-(

So try

/data/sysro/xbin/busybox mount -t aufs -o br=$RWDIR=rw:/data/sysro=ro none /system

Or you can just add the new PATH to the top of the script (yet to be moved-to PATH)

PATH=$PATH:/data/sysro/xbin

and then just remove the explict path to mount/busybox and revert it to

mount -t aufs -o br=$RWDIR=rw:/data/sysro=ro none /system
[Desire Android Development] 77flem:
Tested with this one but seems not working

# touch /system/xyz
touch /system/xyz
touch: /system/xyz: Read-only file system
# mount
mount
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)
none on /acct type cgroup (rw,relatime,cpuacct)
tmpfs on /mnt/asec type tmpfs (rw,relatime,mode=755,gid=1000)
none on /dev/cpuctl type cgroup (rw,relatime,cpu)
/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)
/dev/block/mmcblk0p2 on /data/sysrw type ext2 (rw,relatime,barrier=1,data=ordere
d)
/sys/kernel/debug on /sys/kernel/debug type debugfs (rw,relatime)
/dev/block/vold/179:1 on /mnt/sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,r
elatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,
iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/block/vold/179:1 on /mnt/secure/asec type vfat (rw,dirsync,nosuid,nodev,noe
xec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=c
p437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /mnt/sdcard/.android_secure type tmpfs (ro,relatime,size=0k,mode=000)
/dev/block/dm-0 on /mnt/asec/com.shazam.android-1 type vfat (ro,dirsync,nosuid,n
odev,noexec,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso
8859-1,shortname=mixed,utf8,errors=remount-ro)

log file here http://pastebin.com/Kcw9ADFA

for this it says none invalid argument at the end of the log file.
[Desire Android Development] daveba:
Lemme look into it.
[Desire Android Development] BlaY0:
You should definitely call mount through /sysro/xbin/busybox becouse mount can also be an absolute symbolic link which always points to /system/xbin/busybox. Full path absolute symbolic links are mada when you install busybox with '--install -s' parameters and that is exactly how busybox is installed in latest kitchen. So unless you installed it with static links or by manually (relative) symlinking it through update-script, you will definitely have to call mount by invoking '/sysro/xbin/busybox mount'.

Android powah!
[Desire Android Development] BlaY0:
One more thing. That mount from toolbox doesn't support --move parameter, so you should use mount from busybox on first invocation too.

Android powah!