[Android Software/Hacking General [Developers Only]] lousou76:
Dear developer,

At first I want to thank you for this great app. It does the job easilly and with many options, logging style etc. It looks great!

(Until now I used to boot to recovery and tar everything from my data to my formated /sd-ext and then add a mount command on /system/etc/install-recovery.sh to mount /data to sd-ext)

I have come accross a problem though and it is a bug on your script (or the rom's bug).

I am using a NeoV xperia device, and Viper v5 ics rom.

Although the ext4 partition is 1GB clean formated and able to mount from adb, your script give error that it cant be used as data and I have to try another filesystem 2/3/4.

I can mount it with "/system/xbin/busybox mount -o noatime,nodiratime,relatime,noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue,nosuid,nodev -t auto /dev/block/mmcblk0p2 /sd-ext" as your script tries to do.

I also edited your script and removed the

if $bb [ $status -gt 0 ] || $bb [ ! -f $(doProp get status.destination.external)/writeTest ]; then
doLog e script "The sd-ext file system type cannot be used as an data partition. Please switch to something like Ext(2/3/4)!"
mountAction="skip"

$bb umount $(doProp get status.destination.external)

break 2
fi

and it worked fine, mounting /data and doing everything right.

The log file doesn't help much

v883b21e9/script883b21e9/Preparing configurations883b21e9/
d883b21e9/script883b21e9/Moving property %arg1 into %arg2883b21e9/m2sd.enable_reversed_mount='0'ad4ebc50//props/
d883b21e9/script883b21e9/Moving property %arg1 into %arg2883b21e9/m2sd.enable_sdext_journal='0'ad4ebc50//props/
d883b21e9/script883b21e9/Moving property %arg1 into %arg2883b21e9/m2sd.enable_swap='1'ad4ebc50//props/
d883b21e9/script883b21e9/Moving property %arg1 into %arg2883b21e9/m2sd.move_apps='1'ad4ebc50//props/
d883b21e9/script883b21e9/Moving property %arg1 into %arg2883b21e9/m2sd.move_dalvik='0'ad4ebc50//props/
d883b21e9/script883b21e9/Moving property %arg1 into %arg2883b21e9/m2sd.move_data='0'ad4ebc50//props/
d883b21e9/script883b21e9/Moving property %arg1 into %arg2883b21e9/m2sd.no_tmpfs_cache='0'ad4ebc50//props/
d883b21e9/script883b21e9/Moving property %arg1 into %arg2883b21e9/m2sd.run_sdext_fschk='1'ad4ebc50//props/
d883b21e9/script883b21e9/Moving property %arg1 into %arg2883b21e9/m2sd.script='1'ad4ebc50//props/
d883b21e9/script883b21e9/Moving property %arg1 into %arg2883b21e9/m2sd.set_sdcard_readahead='512'ad4ebc50//props/
d883b21e9/script883b21e9/Moving property %arg1 into %arg2883b21e9/m2sd.set_sdext_fstype='ext4'ad4ebc50//props/
d883b21e9/script883b21e9/Moving property %arg1 into %arg2883b21e9/m2sd.set_swap_level='0'ad4ebc50//props/
d883b21e9/script883b21e9//system/bin/servicemanager is running, disabling property %arg1 to prepare safe-mode883b21e9//data/property/m2sd.move_dalvik
d883b21e9/script883b21e9//system/bin/servicemanager is running, disabling property %arg1 to prepare safe-mode883b21e9//data/property/m2sd.move_data
d883b21e9/script883b21e9//system/bin/servicemanager is running, disabling property %arg1 to prepare safe-mode883b21e9//data/property/m2sd.enable_reversed_mount
i883b21e9/script883b21e9/The script is running in safe-mode!883b21e9/
v883b21e9/script883b21e9/Waiting for sdcard to initiate883b21e9/
d883b21e9/script883b21e9/Preparing try number %arg1 for locating the sdcard883b21e9/1
d883b21e9/script883b21e9/Checking device type on %arg1883b21e9//sys/block/mmcblk0
v883b21e9/script883b21e9/The sdcard device was located at %arg1883b21e9//dev/block/mmcblk0
d883b21e9/script883b21e9/The sdcard MM number was located at %arg1883b21e9/179:0
v883b21e9/script883b21e9/Setting sdcard readahead to %arg1883b21e9/512Kb
v883b21e9/script883b21e9/Checking sdcard partitions883b21e9/
d883b21e9/script883b21e9/Looking for device file %arg1883b21e9//dev/block/mmcblk0p1
v883b21e9/script883b21e9/Using %arg1 as %arg2883b21e9//dev/block/mmcblk0p1ad4ebc50/fat32 (sdcard)
d883b21e9/script883b21e9/Looking for device file %arg1883b21e9//dev/block/mmcblk0p2
v883b21e9/script883b21e9/Using %arg1 as %arg2883b21e9//dev/block/mmcblk0p2ad4ebc50/ext4 (sd-ext)
d883b21e9/script883b21e9/Looking for device file %arg1883b21e9//dev/block/mmcblk0p3
d883b21e9/script883b21e9/Device file %arg1 does not exist883b21e9//dev/block/mmcblk0p3
v883b21e9/script883b21e9/Running file system check on sd-ext883b21e9/
v883b21e9/script883b21e9/Setting optimized mount parameters on sd-ext883b21e9/
d883b21e9/script883b21e9/%arg1 file system detected, checking journal settings883b21e9/Ext4
d883b21e9/script883b21e9/Starting mount operating on sd-ext883b21e9/
d883b21e9/script883b21e9/Trying to mount sd-ext as %arg1 on %arg2 with options '%arg3'883b21e9/ext4ad4ebc50//sd-extad4ebc50/noatime,nodiratime,relatime,noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue,nosuid,nodev
d883b21e9/script883b21e9/The sd-ext partition was mounted, now testing writeable state883b21e9/
e883b21e9/script883b21e9/The sd-ext file system type cannot be used as an data partition. Please switch to something like Ext(2/3/4)!883b21e9/
e883b21e9/script883b21e9/The sd-ext partition could not be mounted!883b21e9/
v883b21e9/script883b21e9/Optimizing the internal nand partitions883b21e9/
d883b21e9/script883b21e9/Located the device %arg1 belonging to %arg2883b21e9//dev/block/mtdblock0ad4ebc50//system
d883b21e9/script883b21e9/Located the device MM number %arg1 belonging to %arg2883b21e9/31:0ad4ebc50//system
v883b21e9/script883b21e9/Setting %arg1 nand readahead to 4kb883b21e9//system
v883b21e9/script883b21e9/Setting optimized mount parameters on %arg1883b21e9//system
d883b21e9/script883b21e9/Located the device %arg1 belonging to %arg2883b21e9//dev/block/mtdblock3ad4ebc50//data
d883b21e9/script883b21e9/Located the device MM number %arg1 belonging to %arg2883b21e9/31:3ad4ebc50//data
v883b21e9/script883b21e9/Setting optimized mount parameters on %arg1883b21e9//data
d883b21e9/script883b21e9/Located the device %arg1 belonging to %arg2883b21e9//dev/block/mtdblock2ad4ebc50//cache
d883b21e9/script883b21e9/Located the device MM number %arg1 belonging to %arg2883b21e9/31:2ad4ebc50//cache
v883b21e9/script883b21e9/Setting optimized mount parameters on %arg1883b21e9//cache
v883b21e9/script883b21e9/Looking for new system apps in %arg1 to link to %arg2883b21e9//data/app-systemad4ebc50//system/app
d883b21e9/script883b21e9/Running S-On test on /system883b21e9/
d883b21e9/script883b21e9/Checking SWAP partition and SWAP settings883b21e9/
w883b21e9/enable_swap883b21e9/Did not find any SWAP partition!883b21e9/
d883b21e9/script883b21e9/Handling the Cache partition and it's settings883b21e9/
d883b21e9/script883b21e9/The cache stettings are set to auto and internal cache storage is %arg1, leaving cache untouched883b21e9/Mb
d883b21e9/script883b21e9/Examining how to handle %arg1883b21e9//data/data/com.android.providers.downloads/cache
d883b21e9/script883b21e9/The cache folder %arg1 is not available. Trying again on next boot883b21e9//data/data/com.android.providers.downloads/cache
v883b21e9/script883b21e9/Changing permissions on %arg1883b21e9//data/local/tmp

I can also see the writetest file in my /sd-ext which was written correctly.

After changing your init.d script the app complained that it is outdated and wanted to update it. So it removed my changes and my device didn't mount /data on next boot.

Can you figure out what's wrong?

[EDIT]

Ok I just found what is wrong.

grep -w doesn't wotk on this rom, grep does not recognize it.

You do a cat /proc/mounts | grep -w /dev/block... and it gives error so your script thinks the card didn't mount.

It would be nice if you would give a WARNING to update busybox before using mount2sd or at leaste checking for a correct version?

After installing newest busybox from market your script worked.