Jump to content

link2sd not using partition2 on sdcard


Guest spicysomtam

Recommended Posts

Guest spicysomtam

This is an odd one. I have reformatted my SD card under Linux and have tried setting the 2nd partition to fat32, ext2 and ext3, and link2sd insists on putting things on the 1st partition. The 'Recreate mount scripts' should remap it to the fs type you have for the 2nd partition? I played around with adb and it seems link2sd puts moved files under /mnt/secure/asec. When I check mount, it says:

/dev/block/vold/179:1 /mnt/sdcard vfat

If I unmount this and remount it as

/dev/block/vold/179:2 /mnt/sdcard ext2

It then picks up the 2nd partition, and when I move an app it then goes to the right partition. After moving the app works, so moved it back.

So for some strange reason the 'Recreate mount scripts' is not working correctly and is mapping the 1st partition. How can I frig this manually? I have looked at the startup scripts /init.rc and /init.paso.rc. Some mounting goes on here, but I am not familiar with the Andriod boot process (I am more of a Linux sysadmin). Specifically, what is the mount script it modifies so I can tweak it?

This is for the ginger_dmd_4.000.07_EMEA_GEN1 rom.

Need to grab some tea; may continue with this later!

Edited by spicysomtam
Link to comment
Share on other sites

Guest spicysomtam

This is for the ginger_dmd_4.000.07_EMEA_GEN1 rom.

Haven't had time to look at it again; got a Redhat kernel misbehaving :)

Edited by spicysomtam
Link to comment
Share on other sites

Guest spicysomtam

My first post should have referred to /data/sdext2 :( Sorry.

Ok I have got a bit further with this. The script link2sd creates is /etc/install-recovery.sh. It contains the following:


#!/system/bin/sh

#added by link2sd

sleep 2

mount -t ext2 -o rw /dev/block/vold/179:2 /data/sdext2


mount -t ext2 -o rw /dev/block/mmcblk0p2 /data/sdext2

The trouble is the /mnt/secure/asec mount that needs changing:

/dev/block/vold/179:1 /mnt/secure/asec

Should be

/dev/block/vold/179:2 /mnt/secure/asec


# mount |grep asec

tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0

/dev/block/vold/179:1 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

# df

Filesystem     		Size   Used   Free   Blksize

/dev           		181M	64K   181M   4096

/mnt/asec          	181M 	0K   181M   4096

/mnt/obb       		181M 	0K   181M   4096

/system            	198M   167M	30M   4096

/data              	185M   140M	44M   4096

/cache              	59M 	2M	56M   4096

/system/flex     		2M 	1M   768K   4096

/data/DxDrm/fuse: Permission denied

/mnt/sdcard          	7G 	3G 	3G   4096

/mnt/secure/asec 		7G 	3G 	3G   4096

/data/sdext2   		306M 	2M   304M   1024

I have tried adapting the script to do a mount and remount, but it doesn't executed or is in the wrong sequence in the boot process.

Need to go. Will spend some more time on this tomorrow. Some vold2 documentation would really help :angry:

Edited by spicysomtam
Link to comment
Share on other sites

Guest spicysomtam

Hi all. I managed to crack this now. I can blame this on lack of decent documentation in link2sd!!! WTF

Since Froyo, Andriod by default has supported moving apps to the SD card. By default it does this to the 1st partition on the sdcard AND you loose access to the app when you mount it to a PC/MAC. To ensure compatibility with this, link2sd cannot change how this works, instead, you need to use the Create Link option. What this does is uses the old method of moving the app to an sd card by moving it and then putting a symbolic link in. Here are the details:


# df

Filesystem 			Size   Used   Free   Blksize

/dev       			181M	64K   181M   4096

/mnt/asec          	181M 	0K   181M   4096

/mnt/obb   			181M 	0K   181M   4096

/system            	198M   167M	30M   4096

/data              	185M   130M	54M   4096

/cache              	59M 	2M	56M   4096

/system/flex 			2M 	1M   768K   4096

/data/DxDrm/fuse: Permission denied

/data/sdext2   		315M 	8M   307M   4096

/mnt/sdcard          	7G 	3G 	3G   4096

/mnt/secure/asec 		7G 	3G 	3G   4096

# ls -l /data/sdext2

drwxrwxrwx root 	root          	2011-11-11 11:35 data

drwxrwxrwx root 	root          	2011-11-11 11:35 dalvik-cache

-rwxrwxrwx root 	root  	7880919 2011-11-11 11:35 com.skype.raider-1.apk

# ls -l /data/app

lrwxrwxrwx root 	root          	2011-11-11 11:35 com.skype.raider-1.apk -> /data/sdext2/com.skype.raider-1.apk

-rw-r--r-- system   system	3323459 2011-11-08 18:25 com.google.android.apps.translate-1.apk

-rw-r--r-- system   system 	305977 2011-11-08 18:27 com.alensw.PicFolder-1.apk

Next thing is to ensure nandriod backup on the recovery backs up the apps, etc, on the sdcard. Let me do a test backup.

Edited by spicysomtam
Link to comment
Share on other sites

Guest spicysomtam

Running nandriod+ext backup it coughs and says I should run nandroid-mobile.sh from adb. So I do this, and get the following errors:


[linux] # adb shell

# /sbin/nandroid-mobile.sh -b --ext


nandroid-mobile v2.2.1


Using G1 keyboard, enter a prefix substring and then <CR>

or just <CR> to accept default:


Using - prefix to create a backup folder


mounting system and data read-only, sdcard read-write

checking free space on sdcard

Dumping splash1 from device over tcp to /sdcard/nandroid/352809040598227/BCDEMRS12-20111111-1300/splash1.img...done

Dumping splash2 from device over tcp to /sdcard/nandroid/352809040598227/BCDEMRS12-20111111-1300/splash2.img...done

Dumping boot to /sdcard/nandroid/352809040598227/BCDEMRS12-20111111-1300/boot.img...done

Dumping recovery to /sdcard/nandroid/352809040598227/BCDEMRS12-20111111-1300/recovery.img...done

Dumping misc to /sdcard/nandroid/352809040598227/BCDEMRS12-20111111-1300/misc.img...done

Dumping system to /sdcard/nandroid/352809040598227/BCDEMRS12-20111111-1300/system.img...done

Dumping data to /sdcard/nandroid/352809040598227/BCDEMRS12-20111111-1300/data.img...done

Dumping cache to /sdcard/nandroid/352809040598227/BCDEMRS12-20111111-1300/cache.img...done

Storing the ext contents in the backup folder.

Warning: --ext specified but unable to mount the ext partition.

Seems like you need a /system/sd directory. How to fix via adb when booting the recovery:

[linux] # adb reboot recovery

[linux] # adb shell

# mount /system

# mkdir /system/sd

# <CTRL-D>

[linux] # adb reboot recovery

[linux] # adb shell

/ # /sbin/nandroid-mobile.sh -b --ext


nandroid-mobile v2.2.1


Using G1 keyboard, enter a prefix substring and then <CR>

or just <CR> to accept default:


Using - prefix to create a backup folder


mounting system and data read-only, sdcard read-write

checking free space on sdcard

Dumping splash1 from device over tcp to /sdcard/nandroid/352809040598227/BCDEMRS12-20111111-1436/splash1.img...done

Dumping splash2 from device over tcp to /sdcard/nandroid/352809040598227/BCDEMRS12-20111111-1436/splash2.img...done

Dumping boot to /sdcard/nandroid/352809040598227/BCDEMRS12-20111111-1436/boot.img...done

Dumping recovery to /sdcard/nandroid/352809040598227/BCDEMRS12-20111111-1436/recovery.img...done

Dumping misc to /sdcard/nandroid/352809040598227/BCDEMRS12-20111111-1436/misc.img...done

Dumping system to /sdcard/nandroid/352809040598227/BCDEMRS12-20111111-1436/system.img...done

Dumping data to /sdcard/nandroid/352809040598227/BCDEMRS12-20111111-1436/data.img...done

Dumping cache to /sdcard/nandroid/352809040598227/BCDEMRS12-20111111-1436/cache.img...done

Storing the ext contents in the backup folder.

./com.skype.raider-1.apk

./dalvik-cache/

./dalvik-cache/data@[email protected]@classes.dex

./data/

./data/com.skype.raider/

./data/com.skype.raider/lib/

./data/com.skype.raider/lib/libpcmhost.so

./lost+found/

generating md5sum file...done

unmounting system, data and sdcard

Backup successful.

/ #                                                    	

Tested it from the recovery menu nand+ext backup; its fine. Tested restore; ext partition files are restored. Excellent! I used ext2 for the 2nd partition, but fat32 should be fine. Just need to remember to select the right backup.

Edited by spicysomtam
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.