Internal storage to external storage swap for cm11 (temporary workaround) - LG Optimus 2x

Hello friends..here i wanna share flashable zip to swap internal to external storage for cm11, works for me on tonyp cm11.
I'm not a dev..this is just edited script made by @Rox and @Souffre from xda cm11 thread,i just modify it a little for used in our device...
Flashable Zip on Attachment
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Att:
DWYOR, THIS SCRIPT IS NOT AS 4.4 STANDARD at least it works for me..
Sent from my LG-P990

Careful with that script, it's not totally conform to 4.4 standards.
Use it at your own risks.
Envoyé de mon GT-I8160 en utilisant Tapatalk

Souffre said:
Careful with that script, it's not totally conform to 4.4 standards.
Use it at your own risks.
Envoyé de mon GT-I8160 en utilisant Tapatalk
Click to expand...
Click to collapse
Yeah..that's why i tested myself...i hope better workaround to find..for now it's quite enough...everything works fine so far...
Sent from my LG-P990

your scripts is worked. i'm on cm11 20131226 tonyp. thx for the temp solution.

You're welcome..btw..if you wanna back into normal...you need to wipe all first...
Sent from my LG-P990

I have found an issue.
After I use this, All of not-English characters in file's name is showing '?'
For example, korean character '가' is showing '?' in file manager apps.
Sent from my LG-SU660 using xda app-developers app

mhkim4886 said:
I have found an issue.
After I use this, All of not-English characters in file's name is showing '?'
For example, korean character '가' is showing '?' in file manager apps.
Sent from my LG-SU660 using xda app-developers app
Click to expand...
Click to collapse
Hmmmmmmm..dunno about that...i'm using full character font for droidsansfallback...for general i'm not losing any character at all...
But you're using su660?are you sure the mount point is the same with p990?afaik a font character not related with sdcard...
Sent from my LG-P990

ivaneris said:
Hmmmmmmm..dunno about that...i'm using full character font for droidsansfallback...for general i'm not losing any character at all...
But you're using su660?are you sure the mount point is the same with p990?afaik a font character not related with sdcard...
Sent from my LG-P990
Click to expand...
Click to collapse
I'm using CM11 + LG Stock Font(which has full character fonts)
I'm using SU660 and probably same with p990's mountpoint.
I think that this issue is related with file system and characters encoding: because before I use this patch then non-English characters are OK.

mhkim4886 said:
I'm using CM11 + LG Stock Font(which has full character fonts)
I'm using SU660 and probably same with p990's mountpoint.
I think that this issue is related with file system and characters encoding: because before I use this patch then non-English characters are OK.
Click to expand...
Click to collapse
That's why it's strange..font should be unrelated to sdcard...unless there's a corupt in system partition...and cm11 stock font still noy full character..it's about ~3mb in size...full character is about ~9mb but still afaik stock droidsans still got korean character...why don't you try with restore your 'perfect settings' first...see if problem still exist...or...try to reflash rom and flash this patch (i'm using twrp and use batch flash install )
I'm still doubt it's related to swapping...unless it's corupt your system partition
Sent from my LG-P990

ivaneris said:
That's why it's strange..font should be unrelated to sdcard...unless there's a corupt in system partition...and cm11 stock font still noy full character..it's about ~3mb in size...full character is about ~9mb but still afaik stock droidsans still got korean character...why don't you try with restore your 'perfect settings' first...see if problem still exist...or...try to reflash rom and flash this patch (i'm using twrp and use batch flash install )
I'm still doubt it's related to swapping...unless it's corupt your system partition
Sent from my LG-P990
Click to expand...
Click to collapse
um, what did you mean 'perfect settings'?

mhkim4886 said:
um, what did you mean 'perfect settings'?
Click to expand...
Click to collapse
°º°=))Hªªhªªhªªhªª°°º...i mean your latest backup
Btw..still i'm not guarantee anything...
In worst case you'll need to clean install (i'm always restore my nandroid backup if anything bad happen thought..)
Sent from my LG-P990

ivaneris said:
°º°=))Hªªhªªhªªhªª°°º...i mean your latest backup
Btw..still i'm not guarantee anything...
In worst case you'll need to clean install (i'm always restore my nandroid backup if anything bad happen thought..)
Sent from my LG-P990
Click to expand...
Click to collapse
um.. I have installed patch after full wipe...
I just deleted your patch, then everything works fine.
I re-flashed your patch, the bug happened again.
The patch is the cause of this issue, I think.

mhkim4886 said:
um.. I have installed patch after full wipe...
I just deleted your patch, then everything works fine.
I re-flashed your patch, the bug happened again.
The patch is the cause of this issue, I think.
Click to expand...
Click to collapse
Strange...i have no prob it.....i can even read korean character...
Well just to make sure..check your mount point
Check in terminal
Mount | grep sdcard0
Mount | grep sdcard1
Sent from my LG-P990

ivaneris said:
Strange...i have no prob it.....i can even read korean character...
Well just to make sure..check your mount point
Check in terminal
Mount | grep sdcard0
Mount | grep sdcard1
Sent from my LG-P990
Click to expand...
Click to collapse
I checked:
Mount | grep sdcard0
Mount | grep sdcard1
then I can see the iocharset option setted isocharset=iso8859-1. I think this is the error: I'll try set it to utf8.
Add: I added option "iocharset=utf8" but this script not running: no switching (I think there is some error)

Let's see it again
Code:
#!/system/bin/sh
LOG=/data/extsd2.log
echo 'mark 1' > $LOG
umount /storage/sdcard0
umount /storage/sdcard1
umount /mnt/secure/asec
umount /mnt/media_rw/sdcard0
umount /mnt/media_rw/sdcard1
mount -t vfat -o umask=0000,uid=1000,gid=1015 /dev/block/vold/[COLOR="Red"]179:49[/COLOR] /mnt/media_rw/sdcard0 1>>$LOG 2>>$LOG
mount -t vfat -o umask=0000,uid=1000,gid=1015 /dev/block/vold/[COLOR="Red"]179:49[/COLOR] /storage/sdcard0 1>>$LOG 2>>$LOG
echo 'mark 2' >> $LOG
mount -t vfat -o umask=0000,uid=1000,gid=1015 /dev/block/vold/[COLOR="Purple"]179:11[/COLOR] /mnt/media_rw/sdcard1 1>>$LOG 2>>$LOG
mount -t vfat -o umask=0000,uid=1000,gid=1015 /dev/block/vold/[COLOR="Purple"]179:11[/COLOR] /storage/sdcard1 1>>$LOG 2>>$LOG
echo 'mark 3' >> $LOG
mount -t vfat -o umask=0000,uid=1000,gid=1015 /dev/block/vold/[COLOR="Red"]179:49[/COLOR] /mnt/secure/asec 1>>$LOG 2>>$LOG
How to get your own code number?
Like before..Just, run terminal emulator
tap this text
Su
mount | grep sdcard0
mount | grep sdcard1
See this number...dunno about su660 but afaik it had different partition layout:
179:49 = Number code for sdcard0 ,and
179:11 = Number code for sdcard1
And there is...p990 mount point red for sdcard 0 (wich actually external) and purple for sdcard1 (wich is actually internal)
Hope this'll help
Sent from my LG-P990

[email protected]:/ $ su
[email protected]:/ # mount | grep sdcard0
mount | grep sdcard0
/dev/block/vold/179:49 /mnt/media_rw/sdcard0 vfat rw,noatime,uid=1000,gid=1015,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
/dev/block/vold/179:49 /storage/sdcard0 vfat rw,noatime,uid=1000,gid=1015,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
[email protected]:/ # mount | grep sdcard1
mount | grep sdcard1
/dev/block/vold/179:11 /mnt/media_rw/sdcard1 vfat rw,noatime,uid=1000,gid=1015,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
/dev/block/vold/179:11 /storage/sdcard1 vfat rw,noatime,uid=1000,gid=1015,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
This is my result, no difference with p990. (After script run, so the result is switched) I think because I use p990-ICS partiton layout.
Sent from my LG-SU660 using xda app-developers app

mhkim4886 said:
[email protected]:/ $ su
[email protected]:/ # mount | grep sdcard0
mount | grep sdcard0
/dev/block/vold/179:49 /mnt/media_rw/sdcard0 vfat rw,noatime,uid=1000,gid=1015,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
/dev/block/vold/179:49 /storage/sdcard0 vfat rw,noatime,uid=1000,gid=1015,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
[email protected]:/ # mount | grep sdcard1
mount | grep sdcard1
/dev/block/vold/179:11 /mnt/media_rw/sdcard1 vfat rw,noatime,uid=1000,gid=1015,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
/dev/block/vold/179:11 /storage/sdcard1 vfat rw,noatime,uid=1000,gid=1015,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
This is my result, no difference with p990. (After script run, so the result is switched) I think because I use p990-ICS partiton layout.
Sent from my LG-SU660 using xda app-developers app
Click to expand...
Click to collapse
Yeah...it's the same...
Sent from my LG-P990

Related

moving apps to sd

it looks a bit different from G1
is this the correct "fstab" conf file to be modified ?
# cat /system/etc/vold.conf
## vold configuration file for Device
volume_sdcard {
## This is the direct uevent device path to the SD slot on the device
media_path /devices/platform/msm_sdcc.2/mmc_host/mmc1
emu_media_path /devices/platform/goldfish_mmc.0/mmc_host/mmc0
media_type mmc
mount_point /sdcard
ums_path /devices/platform/usb_mass_storage/lun0
}
unfortunately i can't find /system/init.rc
hope to inject a standard rom on this device soon !!!
At the moment we cannot get Apps working on the SD Card. Apps2SD won't work.
We are aware of this, and we understand that you'd like these features, but the hackers are currently busy working on exploits to install our own recovery for flashing baked ROMs.
init.rc is located on the top level of the root file system, under /init.rc . You need root to read the said file.
but ...
i'm used to linux and don't understand what we are missing in order to move apps to sd
since i'm root i should be able to do the extra mount of new partition, isn't it ?
actually, as far as understood, if android finds a new partition (either fat or ext) on the sd card it mounts it automagically
I have the same question, too.
Event we can't add extra mount in fstab. We could have the right to mount SD to /data/app, and just copying all apks to SD card, could we??
suoko,
I had done some tests today.
1. I format my sd card into ext3 format and copy all apks in /data/app into my sdcard.
2. mount my sd card on /data/app manually, and change the mode and owner of mounted folder and files.
You can install app into the sd card mounted on /data/app. But once you reboot them, (reset the /data/app), the market will be inconsistent with application list in settings. And I can't unmount the sd card after it mounted on /data/app.
So, I think it is still possible to use sd card for the app installation.
If you have any idea, please let me know... thanks
umount problem
by this "And I can't unmount the sd card after it mounted on /data/app." you mean you can't even access the sd vfat partition with your computer ?
i would only need vfat to be visible via pc not to screw installed apps
gonna try it too in a while
curiosity
as far you know, the install process of apks involves the "unzipping" of apks ?
or it's just a copy from the download apk folder to /data/app ?
what i would try is set a second app folder, this time in /sd/app
where /sd/app is an ext3 partition
so that we can leave main apps in internal memory and put extra apps in sd
the install process of apks is only to copy the app into /data/app folder. It is unzipped when the app is launched first time and cache them in another folder. So, we can found the dalvik-cache in the /data/ folder that the folder it unziped the dex files.
The test I had done is just mount the sd card on "/data/app" folder in android. So, if we want to add a second app folder, we need to change the app loader that I never did it before.
The unmount part means that I can mount the sd card on /data/app but I can't unmount that from /data/app, the message is "failed". The only way to unmount it is to reboot the tattoo. Once removing the sd card from tattoo, I can mount it to PC or tattoo again.
suoko
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This picture is that I mount the sd card(500MB) on /data. The displaying size of flash (that's my sd card) in tattoo is 361MB, sorry for all chinese, you can find the number in the second line from bottom to up.
I don't know where to change the fstab record in tattoo. But it may be possible to write an app who runs at the machine startup and does the "mount" staff before other apps in /data/app executing.
I had one Hero with Apps2SD installed. It mounts the sd card on /system/sd and /data/dalvik-cache. The apps are installed and launched at /system/sd/app. I think it is the same way like mime.
2 install folders in linux ???
you know what ? i guess in linux is not that easy to set up a second install folder.
I think we could sim link a /data/app/app folder to /sd/app but then the install process should do something:
check /data/app folder space left, and in case it's full, install to /data/app/app
Yes, right. That's the way I use. But I mount the sd card directly on /system. This makes android to calculate the left space of my sd card.
Currently, I need to modify the /init.rc to make it mount at the boot. But the /init.rc seems in the ramdisk image, so I can't modify it and store it back. I don't know where the ramdisk image is, it seems in one of partition 0, 1, 2. Any idea??
hello people
have you test this?
http://androidandme.com/2009/08/news/how-to-manually-partition-your-sd-card-for-android-apps2sd/
ok, trying now
formatted my 4gb sd to:
vfat: 3.4 GB
ext2: 508 MB
swap: 32 MB
i found partitions at:
mount -t ext2 /dev/block/mmcblk0p2 /data/myapp
swapon /dev/block/mmcblk0p3
must work on vold.conf now since ext2 on sd is not automatically mounted at /system/sd
another way ...
is create an ext2 img file to be mounted at boot using a loopback device.
no sd partitioning is needed then and the FULL-OF-APPS IMG FILE could be easily moved from one SD to another (aka to another android compatible phone).
modify /system/init.rc to mount an ext2 image on bootup.
http://forum.xda-developers.com/showpost.php?p=3402719&postcount=683
extra ext2 partition creation [750MB] (on ubuntu):
dd if=/dev/zero of=sd.img seek=749999999 bs=1 count=1
mke2fs -F sd.img
mounting it (on android):
[mkdir /data/myapp]
mount -o loop sd.img /data/myapp
current state:
mount: mounting /dev/block/loop0 on /data/myapp failed: Invalid argument
the ext2 loop partition was an end 2008 discussion
http://forum.xda-developers.com/showthread.php?t=463488&page=2
what i think now is extending the /data/app partition with the looped img file.
can we (without lvm) ?
I prefer the second install option
if android detects an extra ext2 partition or an ext2 img file, you can change the default install location in android preferences
Suoko, do your tattoo have /system/init.rc file??
In /init.rc, it doesn't import /system/init.rc. So, we can't use /system/init.rc to mount it.
currently, I need to compile my owned boot.img file. But the compiled file doesn't work. I don't know why. I following the following url to do so: http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images.
Any idea??
BTW, why do we need to mount /dev/loop0?? I just use mount -t ext3 /dev/block/mmcblk0p2 /data/app to do so.
why loop?
Cause you don't have to partition the sd this way.
You just create an img file which can be used as a partition.
Think this:
You have a 4 gb sd and want to change it to store more music/vids/maps with a 16 gb one
You take the file and move it from the old sd to the new one.
You want to increase the img file size?
You create a new larger file?
You create it and move old img file contents to it.
We can probably extends its size some way
ok I see. That's a good idea for expanding purpose.
BTW, I had solved the boot.img problems. It is caused by the wrong version I checked out from repo. I use the correct version to build mkbootimg and everything works.
current state:
trying to mount the /dev/block/mmcblk0p2 on /data at the boot time. but all trials failed.
succesfully mounted looped device
extra ext2 partition creation [350MB] (on ubuntu):
# dd if=/dev/zero of=sd.img seek=349999999 bs=1 count=1
# mke2fs -F sd.img
pushing ext2 partition to android [350MB] (on ubuntu):
# adb push ./sd.img /sdcard/sd.img
mounting it (on android) (DO NOT RUN BUSYBOX !!!):
# su
# export LD_LIBRARY_PATH=/system/lib
# export PATH=/system/bin
# insmod /data/local/bin/tattoo-hack.ko
# mount -o rw,remount /dev/block/mtdblock5 /data
# mount -o rw,remount /dev/block/mtdblock3 /system
# mkdir /data/myapp
# mount -o loop -t ext2 /sdcard/sd.img /data/myapp/
[now run busybox]
# /data/local/bin/sh
# df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 93.0M 0 93.0M 0% /dev
tmpfs 4.0M 0 4.0M 0% /sqlite_stmt_journals
/dev/block/mtdblock3 150.0M 135.7M 14.3M 90% /system
/dev/block/mtdblock5 165.1M 148.1M 17.0M 90% /data
/dev/block/mtdblock4 150.0M 3.7M 146.3M 2% /cache
/dev/block//vold/179:1 3.7G 3.5G 223.5M 94% /sdcard
/dev/block/loop0 323.2M 2.0M 304.5M 1% /data/myapp
re: boot.img problems
huchengtw said:
ok I see. That's a good idea for expanding purpose.
BTW, I had solved the boot.img problems. It is caused by the wrong version I checked out from repo. I use the correct version to build mkbootimg and everything works.
current state:
trying to mount the /dev/block/mmcblk0p2 on /data at the boot time. but all trials failed.
Click to expand...
Click to collapse
are you reading mainfram3 tips ?
http://forum.xda-developers.com/showthread.php?t=641731
i'm gonna look at android install process and SD settings

Is there a way to make apps use /sdcard/ApplicationData rather than /sdcard ?

Is there a way to make all applications store their data in a folder other than /sdcard (root folder on the sd card) ?
I'm planning on rooting and thought that this time round I can keep my sdcard nice and organized by creating an "ApplicationData" folder in the root of the sdcard and somehow configuring android to use that.
On a similar note, can I move the DCIM (camera photos) to a different location too?
Will the below change-mount-point idea work?
Maybe as root we can
1) un-define /sdcard (in /etc/fstab) //or wherever its defined
2) define /sdcard as /dev/<hdb0>/ApplicationData //change hdb0 to the appropriate device/partition
thanks.
Yeah, I see your point... but quite frankly, I believe it's upto the app developers [my knowledge of the Android world is still from the stone-age!!]... if the app specifies that it's data will be stored in /sdcard/AppName, there's not much you can do, unless you can modify the app...
I was thinking that maybe as root we can
1) un-define /sdcard (in /etc/fstab) //or wherever its defined
2) define /sdcard as /dev/<hdb0>/ApplicationData
edit: added to post#1
britoso said:
I was thinking that maybe as root we can
1) un-define /sdcard (in /etc/fstab) //or wherever its defined
2) define /sdcard as /dev/<hdb0>/ApplicationData
edit: added to post#1
Click to expand...
Click to collapse
I did think of this too...
/sdcard --> /sd/AppData
rest of sd card --> /sd
but I think it would mean some other changes as well... for example... the mount usb functionality would have to be modified to mount/unmount a different volume...
So heres the contents of my fstab file:
Code:
C:\>adb shell cat /system/etc/fstab
/dev/block/mtdblock3 /system yaffs2 rw
/dev/block/mtdblock4 /cache yaffs2 rw
/dev/block/mtdblock5 /data yaffs2 rw
/dev/block/mmcblk0p1 /sdcard vfat rw
/dev/block/mmcblk0p2 /system/sd auto rw
/system/modules/modules.sqf /system/modules squashfs ro,loop
/system/xbin/xbin.sqf /system/xbin squashfs ro,loop
I'll try changing line 4 (/sdcard), I'm guessing /system/sd is for when I apps2sd is enabled.
Question: How do I escape from INSERT/EDIT mode in VI? Tried pressing trackball+1, trackball+1+2...didnt work
Hey britoso!
Keep us updated with your accomplishments. I, personally, am very interested in being able to achieve this.
Good luck!
update: that didnt work.
Note: the way to get the ESCAPE character is CONTROL + [ (hold the trackball then press [ ). The control key is configurable and defaults to the Jogball/TrackBall
here are the contents of my fstab file, the camera app is still writing to the root of the sdcard (/sdcard/DCIM)
Code:
C:\>adb shell cat /system/etc/fstab
/dev/block/mtdblock3 /system yaffs2 rw
/dev/block/mtdblock4 /cache yaffs2 rw
/dev/block/mtdblock5 /data yaffs2 rw
/dev/block/mmcblk0p1 /sdcard/AppData vfat rw
/dev/block/mmcblk0p2 /system/sd auto rw
/system/modules/modules.sqf /system/modules squashfs ro,loop
/system/xbin/xbin.sqf /system/xbin squashfs ro,loop
Heres the output of "df"
Code:
C:\>adb shell df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 197600 0 197600 0% /dev
tmpfs 4096 0 4096 0% /sqlite_stmt_journals
/dev/block/mtdblock3 148480 100088 48392 67% /system
/dev/block/mtdblock5 200960 63752 137208 32% /data
/dev/block/mtdblock4 97280 39628 57652 41% /cache
/dev/block//vold/179:1
15643712 6843256 8800456 44% /sdcard
@britoso
This is what I found out about mounts in Android...
The init program directly mounts all filesystems and devices using either hard-coded file names or device names generated by probing the sysfs filesystem (thereby eliminating the need for a /etc/fstab file in Android).
And from what I see in your df output, it didn't mount /sdcard/AppData...
Have a few ideas in mind... gonna try 'em out now...
craigacgomez said:
gonna try 'em out now...
Click to expand...
Click to collapse
thanks for the info. Let us know how it works out.
Here's what I reached finally...
To achieve this, I have 2 ideas...
1. We gotta modify the init and change the SD mount point to AppData and add another for the rest of the SD... this however would require a rebuilt ROM (I can't edit init on the phone, need to edit init.c from the source)
2. We push some startup scripts to achieve this, but so far, I haven't been able to mount anything else on /sdcard (operation failed), but I think I'm doing something wrong...
Didn't get much time to experiment... and it mite be a busy end of week for me... but I'll try to squeeze in so time to get this...
Why not ask Cyanogen to do this for us in his next ROM?
Or your next favorite modder?
I'm sure they'll like this idea!?
theres a setting in /init.rc that may help
Code:
export EXTERNAL_STORAGE /sdcard
However / is mounted read-only
mount
rootfs on / type rootfs (ro,relatime)
Click to expand...
Click to collapse

[Help] Changing Around Mountpoints for sdcard and extSdCard?

Hey guys.
Some previous Samsung devices had no external storage at all but still mapped the biggest flash partition to /mnt/sdcard.
The Galaxy Tab 2 7.0 has a Micro SD card slot on it (one of the reasons I bought the thing!), but I guess for compatibility they still mount an internal flash storage partition to /sdcard. The actual micro SD card gets mounted to freaking /mnt/extSdCard.
Why does this matter?
Basically, tons of stuff in Android is setup to dump the large files to /sdcard by default. Things like games that require an extra download, the Camera app, etc. I've got a 32GB microSD card in there, and it makes me really frustrated that stuff won't just automatically use that.
So. What I'm looking to do is switch them around, so the internal fake flash partition ends up mounting to /mnt/extSdCard and the REAL microSD card mounts to /mnt/sdcard. That way my big huge card is where most data will end up automagically. Ultimately if I could just dump the internal "sdcard" partition and give that space to other parts of the system, that'd be sweet, but at this point I'm still kindof in la la land with Android, so I'll be happy just to get the mounts flipped around.
I do Linux stuff for work, and use a 5-disk file server at home running Ubuntu Server, so I approached this problem in a Linux way: why not mount via fstab??
Turns out Android doesn't actually directly have a /etc/fstab. Instead you've got /system/etc/vold.fstab.
From my brief research, this file appears to work pretty much the same way as fstab in Linux.
However, the stock one doesn't contain any mountpoint for the fake internal sdcard. vold.fstab seems to tell the vold executable what to do during boot-time.
My first problem: the vold.fstab file on my device doesn't contain any mount instructions for the /sdcard device.
Not a problem, I have SSH and WinSCP working, so I got a read on the mount points likeso:
Code:
127|[email protected]:/dev/block # cat /proc/mounts
rootfs / rootfs ro,noatime 0 0
tmpfs /dev tmpfs rw,nosuid,noatime,mode=755 0 0
devpts /dev/pts devpts rw,noatime,mode=600 0 0
proc /proc proc rw,noatime 0 0
sysfs /sys sysfs rw,noatime 0 0
none /acct cgroup rw,noatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,noatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,noatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,noatime,cpu 0 0
/dev/block/platform/omap/omap_hsmmc.1/by-name/FACTORYFS /system ext4 ro,noatime,barrier=1,data=ordered 0 0
/dev/block/platform/omap/omap_hsmmc.1/by-name/DATAFS /data ext4 rw,nosuid,nodev,noatime,barrier=1,data=ordered,noauto_da_alloc,discard 0 0
/dev/block/platform/omap/omap_hsmmc.1/by-name/CACHE /cache ext4 rw,nosuid,nodev,noatime,errors=panic,barrier=1,nomblk_io_submit,data=ordered 0 0
/dev/block/platform/omap/omap_hsmmc.1/by-name/EFS /efs ext4 rw,noatime,barrier=1,data=ordered 0 0
/sys/kernel/debug /sys/kernel/debug debugfs rw,noatime 0 0
/dev/fuse /mnt/sdcard fuse rw,nosuid,nodev,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/block/vold/179:25 /mnt/extSdCard vfat rw,dirsync,nosuid,nodev,noexec,noatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
OK. so the vold.fstab file contains:
Code:
## Vold 2.0 Generic fstab
## - San Mehat ([email protected])
##
#######################
## Regular device mount
##
## Format: dev_mount <label> <mount_point> <part> <sysfs_path1...>
## label - Label for the volume
## mount_point - Where the volume will be mounted
## part - Partition # (1 based), or 'auto' for first usable partition.
## <sysfs_path> - List of sysfs paths to source devices
######################
# external sdcard
dev_mount sdcard /mnt/extSdCard auto /devices/platform/omap/omap_hsmmc.0/mmc_host/mmc1
#usb host device
dev_mount usbdisk /mnt/usbdisk auto /devices/platform/omap/musb-omap2430/musb-hdrc/usb1
So, I have made a backup of my vold.fstab file, but I'm a little gun shy about making changes to it, particularly adding a new line for the "internal" sdcard. I know there are a couple of other ways to probably do this, like an init.d shell script that just executes the needed mount commands, and I'm honestly not sure if putting an entry for /mnt/sdcard into vold.fstab will override the mounts that are (I guess?) coming from the ramdisk init sequence. Any input, XDA devs?
Go for it :thumbup:
Sent from my GT-P3100 using xda app-developers app
I have the same Problem on my Galaxy Tab2 7.0 WIFI (GT-P3110 8 GB). I found a temporary Soloution for me. The App that i use is LINK2SD. You should have two partitions on SD card and both should be primary.
The first FAT partition is your standard sdcard (mountetd on extSdCard). The second partition /data/sdext2 is used for application files and can be ext2, ext3, ext4 or FAT32. Here are more informations about it: http://rootzwiki.com/topic/24500-if...move-apps-to-sd-card/page__st__10#entry701146
In this thread are the same Question: http://forum.xda-developers.com/showthread.php?t=1679037
I think it will read the changes. For example on the htc rezound the firmware update for ics changed the mount points from what was used in gb.So in order to run a gb Rom on ics firmware and vice versa the Fix was swaping vstab. Figure as long as u only mess with the sd mounts internal and ext. It will still boot and u can swap file as needed for testing.
Sent from my ADR6425LVW using xda premium
I'll try and figure it out.
Already found one thing: running the mount command with no switches will list all current mounts (can't believe I forgot that!).
DivinityCycle said:
I'll try and figure it out.
Already found one thing: running the mount command with no switches will list all current mounts (can't believe I forgot that!).
Click to expand...
Click to collapse
Im workin on it too. Im used to seeing them on separate lines. Ill let u know if i beat ya to it lol
Sent from my GT-P3113 using xda premium
Something else useful that I found:
Code:
[email protected]:/dev/block # cat /proc/partitions
major minor #blocks name
179 0 7634944 mmcblk0
179 1 20480 mmcblk0p1
179 2 2048 mmcblk0p2
179 3 2048 mmcblk0p3
179 4 8192 mmcblk0p4
179 5 8192 mmcblk0p5
179 6 8192 mmcblk0p6
179 7 716800 mmcblk0p7
259 0 20480 mmcblk0p8
259 1 1433600 mmcblk0p9
259 2 4886511 mmcblk0p10
259 3 524288 mmcblk0p11
179 16 2048 mmcblk0boot1
179 8 2048 mmcblk0boot0
179 24 30318592 mmcblk1
179 25 30314496 mmcblk1p1
and
Code:
[email protected]:/dev/block # df
Filesystem Size Used Free Blksize
/dev 347M 48K 347M 4096
/mnt/asec 347M 0K 347M 4096
/mnt/obb 347M 0K 347M 4096
/system 1G 259M 1G 4096
/data 4G 2G 2G 4096
/cache 688M 58M 630M 4096
/efs 19M 4M 15M 4096
/mnt/extSdCard 28G 13G 15G 32768
/mnt/sdcard 4G 2G 2G 4096
I'm pretty sure the partitions listed are found at /dev/block/mmcblk0pX, so maybe that's what needs to be mounted. I've not been successful yet in mounting anything manually but I just found this stuff, so hopefully will have it soon.
Hey DivinityCycle,
This post and tool in the S3 forum might be useful to you as it does the exact same thing in the GS3.
http://forum.xda-developers.com/showthread.php?t=1772234
If I recall correctly it needs a kernel with init.d support. But I think it will definitely help.
Rgrds
Sent from my GT-I9300
I have this in mine i didnt see it in yours
#storage_struct = series, "/mnt/sdcard/extStorages"
#storage_struct = parallel
Making progress, I was able to mount the "external" sdcard to my test mountpoint using:
mount -t vfat -o umask=0000 /dev/block/vold/179:25 /mnt/testing
So, that's part of the puzzle figured out. Now, just need to sort of out the internal "sdcard" device path and then I guess I can try throwing stuff into vold.fstab
OK I believe I have a solution will work, based on the init.d script inside the package Mattiadj made and Rostol linked me to (thanks!).
I modified his init.d script likeso:
Code:
sleep 2
mount -o remount,rw /
mkdir -p /data/internal_sd
mount -o bind /mnt/sdcard /data/internal_sd
mount -t vfat -o umask=0000 /dev/block/vold/179:25 /mnt/testing
mount -o bind /data/internal_sd /mnt/extSdCard
vold has to be used for external storage. The internal storage isn't very flexible, which is why that guy's script just binds it up during boot time rather than some other method of mounting it.
I have just run the commands in a terminal one by one and they all appear to do exactly what they "should", and I have verified that the result is the "real" sdcard being mounted to /mnt/sdcard, which ALSO makes it accessible at /sdcard (which I think is just a symlink). That's the default target for most apps, so after installing this init.d script I think everything should "just work".
Obviously you could adjust the mount point for the "internal" sdcard space as needed.
Working on the script and installation bit now.
/mnt/sdcard
/dev/fuse fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other
---------- Post added at 11:55 PM ---------- Previous post was at 11:54 PM ----------
Nice
OK I am having some problems getting the init.d script to work properly.
My working code is:
Code:
#!/system/bin/sh
LOG=/data/local/tmp/sdcard.txt
exec 3>&1 4>&2 >$LOG 2>&1
echo "Script start"
echo "Sleeping 2 seconds"
sleep 2
echo "Now attempting to remount root filesystem RW"
mount -o remount,rw /
echo "Make the internal_sd directory"
mkdir -p /data/internal_sd
echo "Bind the internal sdcard to the new folder"
mount -o bind /mnt/sdcard /data/internal_sd
echo "Mount the real sdcard"
mount -t vfat -o umask=0000 /dev/block/vold/179:25 /mnt/sdcard
echo "Bind the internal_sd directory to the extSdCard mountpoint"
mount -o bind /data/internal_sd /mnt/extSdCard
echo "Script done"
Basically I am logging the output to /data/local/tmp/sdcard.txt, so I can debug.
In that log, it gets as far as the first mount command, and then things go off the rails:
Code:
Script start
Sleeping 2 seconds
Now attempting to remount root filesystem RW
Make the internal_sd directory
Bind the internal sdcard to the new folder
mount: Invalid argument
Mount the real sdcard
mount: No such file or directory
Bind the internal_sd directory to the extSdCard mountpoint
Script done
What's messed up is, the same mount command (with the bind) works fine once the device is all the way booted up.
Its just during the "init" sequence that it has a problem. I have no idea why
We had a similar thing for my Droid x2. You my want to check out this thread http://forum.xda-developers.com/showthread.php?p=16875467 and contact the dev.
Sent from my GT-P3113 using xda premium
That guy did it via vold.fstab, which is interesting.
The relevant stuff:
Code:
# external sd card
dev_mount sdcard /mnt/sdcard:none:lun1 auto /devices/platform/tegra-sdhci.2/mmc_host/mmc2 /devices/platform/tegra-sdhci.2/mmc_host/mmc1
# internal eMMC
dev_mount sdcard_ext /mnt/sdcard-ext 18 /devices/platform/tegra-sdhci.3/mmc_host/mmc0
I am honestly not too sure what I'm looking at there, so I'm gonna try some stuff in vold.fstab next.
OK, I am too tired to keep messing around with this for tonight, so I am trying out a new method: I moved my init script over to /data and then used Script Manager to make it run as root as boot time.
This is obviously not a permanent fix, but should be OK for tonight.
Basically my big problem is I don't know the syntax for vold.fstab to mount the internal sdcard to a new mount point...
Ahh the joys of doing weird hacky stuff to your tablet... I pretty much gave up on the vold.fstab working in the short term, and instead just tried setting my init script up as just a regular "run at launch" script using Script Manager.
The version of my script that I posted had unforeseen consequences. For whatever reason, doing a "bind" of /mnt/sdcard like I was doing caused all sorts of things to stop working. Like, Script Manager was locking up, as was Root Explorer!
The best one was that when my alarm clock went to go off this morning it crashed, and I was late for work! LOL
Sooo yeah, that's pretty special. I had to use Terminal Emulator to fix my stuff on the bus on the way to work
I have revised my script and it now works perfectly with the caveat that I'm simply unmounting the internal "sdcard" partition and letting it sit there unused.
Code:
#!/system/bin/sh
LOG=/data/local/tmp/sdcard.txt
exec 3>&1 4>&2 >$LOG 2>&1
echo "Script start"
echo "Unmount internal sdcard"
umount /mnt/sdcard
echo "Mount the real sdcard"
mount -t vfat -o umask=0000 /dev/block/vold/179:25 /mnt/sdcard
echo "Script done"
I believe because of vold.fstab the microSD card still gets mounted to /mnt/extSdCard. My script puts it at /mnt/sdcard as well. This seems to work OK because then the few programs that are smart enough to access the card via /mnt/extSdCard still can get to it, but everything else that works on the regular sdcard also goes to the sdcard as well.
I have tested out the camera, music player, Root Explorer, Script Manager, etc. Everything I have tried works exactly as expected.
The next thing I'll need to test out is if this script can be used as an init.d script instead of needing Script Manager to set it up to run at boot.
I figure the only other things to do are:
1-figure out what's needed to be able to mount the internal "sdcard" partition to a different mount point
or
2-figure out how to delete the "sdcard" partition and then just give that extra space to one of the other flash partitions (probably /system?)
I really am hoping you get this figured out and it can be used by us common folk. (I'm no hacker) Lol :thumbup:
Sent from my GT-P3113 using xda premium
Wow, while working on my init.d script, I managed to make my system freeze at the bootup animation. I "unlocked" things by reflashing my ROM.
Good thing its a slow day at the office...
i really hope u can get this working, would love it

[q] [help]couldn't install in usb storage or sd card

I tried to install an app from PlayStore and got an error message: COULDN'T INSTALL IN USB STORAGE OR SD CARD.
After logcat I found these Errors:
Error creating imagefile(Read-only file system)
ASEC imagefile creation failed(Read-only file system)
Failed to create container smdl2tmp1
How do I fix this problem. Please help me.
I forgot to mention my device details, it's I9070 running CM-11 by TeamCanjica. I do not have an external SD card.
The error occured when i tried to install this app: https://play.google.com/store/apps/details?id=com.wordsmobile.soccerkicks
It also happens with some other apps.
PS:Since the logcat showed read only error I remounted asec with 0777 permissions and then i was able to install the app,
but the app vanished after a restart. I think it's because asec by default is mounted as tmpfs type filesystem. I don't know how to proceed now.
This happened to me too one time, resolved with wipe data/factory reset
Inviato dal mio GT-I9070
Tesla-MADAL93 said:
This happened to me too one time, resolved with wipe data/factory reset
Inviato dal mio GT-I9070
Click to expand...
Click to collapse
Thanks for the info, but i would prefer to not lose my data or spend time backing it up.
I am looking for an alternate way to fix this.
I forgot to mention my device details, it's I9070 running CM-11 by TeamCanjica.
PS:Since the logcat showed read only error I remounted asec with 0777 permissions and then i was able to install the app,
but the app vanished after a restart. I think it's because asec by default is mounted as tmpfs type filesystem. I don't know how to proceed now.
UNiQ!0 said:
Thanks for the info, but i would prefer to not lose my data or spend time backing it up.
I am looking for an alternate way to fix this.
I forgot to mention my device details, it's I9070 running CM-11 by TeamCanjica.
PS:Since the logcat showed read only error I remounted asec with 0777 permissions and then i was able to install the app,
but the app vanished after a restart. I think it's because asec by default is mounted as tmpfs type filesystem. I don't know how to proceed now.
Click to expand...
Click to collapse
.android_secure folder is linked to ASEC, you can make an init.d script to remount it as 0777 at every boot
Code:
#!/system/bin/sh
#
mount -o remount,rw /mnt/asec
chmod 0777 /mnt/asec
Save it as 05asecrw for example, apply 0755 permission and owner 0 group 2000
Tesla-MADAL93 said:
.android_secure folder is linked to ASEC, you can make an init.d script to remount it as 0777 at every boot
Code:
#!/system/bin/sh
#
mount -o remount,rw /mnt/asec
chmod 0777 /mnt/asec
Save it as 05asecrw for example, apply 0755 permission and owner 0 group 2000
Click to expand...
Click to collapse
Tried it. Didn't work.
chmod 0777 /mnt/asec didn't change asec's mode to 777.
/mnt/asec is mounted by deafult (by init.rc) as tmpfs filesystem with mode=0755 and gid=1000
UNiQ!0 said:
Tried it. Didn't work.
chmod 0777 /mnt/asec didn't change asec's mode to 777.
/mnt/asec is mounted by deafult (by init.rc) as tmpfs filesystem with mode=0755 and gid=1000
Click to expand...
Click to collapse
When android boots yes, once booted you can change its permission, maybe you can do something with Smanager or Tasker/Automagic

Cannot format /data using TWRP 3.0.2[Solved]

I have a problem ... i'm trying to install Android MM using TWRP 3.0.2 but i can't because i can't format.
When i'm trying to format it shows this error: E:Unable to wipe '/data' -- unknown file system 'auto'
Unable to format to remove encrytion
Do i need to use another recovery?
Can someone tell me how to solve this?
I had the same problem, for some reason TWRP is unable to format encrypted partitions.
It can be solved using adb shell or using the terminal in TWRP (it's under the advanced tab).
To format the partition you have to know which device it is, to find out type this inside the terminal:
Code:
cat /etc/fstab
In my case the output is:
~ # cat /etc/fstab
/dev/block/mmcblk0p13 /system ext4 rw 0 0
/dev/block/mmcblk0p14 /cache f2fs rw 0 0
/dev/block/mmcblk0p15 /data f2fs rw 0 0
Which means that my /data is on device /dev/block/mmcblk0p15 and uses the f2fs filesystem. If you're on f2fs then you can format the partition using
Code:
mkfs.f2fs /dev/block/mmcblkXXXX
if you're on ext4 then use
Code:
make_ext4fs /dev/block/mmcblkXXXX
Where XXXX is whatever is in your fstab. After this TWRP should be able to mount /data.
It worked,thank you!
Ok, now i have another problem ... every time i'm trying to install(flash) a zip with TWRP it's rebooting again in TWRP and can't install anything ... I had this problem in the past and i solved it but i forgot how i did that .. anyone knows?
Solved: i had to format my sd card.
penn.gwyn said:
I had the same problem, for some reason TWRP is unable to format encrypted partitions.
It can be solved using adb shell or using the terminal in TWRP (it's under the advanced tab).
To format the partition you have to know which device it is, to find out type this inside the terminal:
Code:
cat /etc/fstab
In my case the output is:
~ # cat /etc/fstab
/dev/block/mmcblk0p13 /system ext4 rw 0 0
/dev/block/mmcblk0p14 /cache f2fs rw 0 0
/dev/block/mmcblk0p15 /data f2fs rw 0 0
Which means that my /data is on device /dev/block/mmcblk0p15 and uses the f2fs filesystem. If you're on f2fs then you can format the partition using
Code:
mkfs.f2fs /dev/block/mmcblkXXXX
if you're on ext4 then use
Code:
make_ext4fs /dev/block/mmcblkXXXX
Where XXXX is whatever is in your fstab. After this TWRP should be able to mount /data.
Click to expand...
Click to collapse
I did that but I am getting only this
/3rdmodem ext4 rw 0 0
/cache ext4 rw 0 0
/data f2fs rw 0 0
and so on
/dev/block/mmcblkXXXX is missing My TWRP version is 3.1.1-1-frd any help would be greatly appreciated.
penn.gwyn said:
I had the same problem, for some reason TWRP is unable to format encrypted partitions.
It can be solved using adb shell or using the terminal in TWRP (it's under the advanced tab).
To format the partition you have to know which device it is, to find out type this inside the terminal:
Code:
cat /etc/fstab
In my case the output is:
~ # cat /etc/fstab
/dev/block/mmcblk0p13 /system ext4 rw 0 0
/dev/block/mmcblk0p14 /cache f2fs rw 0 0
/dev/block/mmcblk0p15 /data f2fs rw 0 0
Which means that my /data is on device /dev/block/mmcblk0p15 and uses the f2fs filesystem. If you're on f2fs then you can format the partition using
Code:
mkfs.f2fs /dev/block/mmcblkXXXX
if you're on ext4 then use
Code:
make_ext4fs /dev/block/mmcblkXXXX
Where XXXX is whatever is in your fstab. After this TWRP should be able to mount /data.
Click to expand...
Click to collapse
I tried this but now i cant fully install roms correctly. However i did this to more than just data
Hi, I tried this, but it's telling me : "need size of filesystem"
Do you have an idea of what's going wrong ? thanks
BTW : i have : /dev/block/dm-0 /data ext rw 0 0
hi I need help. Tell me "need size of filesystem"
Please help me.
help me /sbin/e2fsck -fp /dev/block/sda18 process ended with ERROR: 8
Cannot format /data using TWRP
and
make_ext4fs /dev/block/mmcblkXXXX
tell me "need size of filesystem"
help me please
dont know how i got into this. perhaps its the twrp 3.5.2_9 issue.
my parition names are long. ../soc.0/f9824900.sdhci/by-name/userdata
there is no data partition.
any way to get out of this? i dont have anything on the phone so i just want to get back to clean start.

Categories

Resources