find out FUSE mountpoints - Android Software/Hacking General [Developers Only]

hi guys.
i'm developing the gentoo extractor of dSploit and i've found a problem.
now that user can choose a custom directory for the gentoo root,
we must ensure that we can make symlinks in that folder.
from android 4.2 and above, the storage infrastructure uses FUSE.
create symlink where the ext FS is mounted on is fine.
create symlink where the FUSE is mounted on will fail.
Code:
[email protected]:/ # ln -s /system /storage/emulated/0/gentoo/test
link failed Function not implemented
[email protected]:/ # ln -s /system /data/media/0/gentoo/test
this happens because /storage/emulated/0 is a fuse bind mount of /data/media/0.
i think that the solution is to find what is mounted where and how.
how can i get FUSE mounts ?
/proc/mount will show /dev/fuse as source block device.
i need to have something that say:
Code:
source destination
/data/media/0 /storage/emulated/0
in order to replace "/storage/emulated/0" with "/data/media/0" and got symlink to work
thanks in advance for any help and suggestion.
-- tux_mind

Related

using the internal memory as a virtual sdcard

I managed to break my micro sd card in half today and I wasn't able to pickup a class 10 or 6 replacement locally so I thought I could use some of the 6gb of internal memory as a virtual filesystem to get me out of trouble.
So, after quickly looking at the android docs and the supported busybox commands I created a 2gb sdcard.img in /data and mounted to /sdcard. I copied some files to it with astro filemanager and fired up raging thunder 2 and it went ahead and downloaded the game data to /sdcard/ and worked correctly.
But, a few apps won't recognise it as an sdcard (Motorola SD card and phone storage settings applet) as well as things like PlayPro (states I have no sdcard present). I thought perhaps I could modify the /etc/vold.fstab file to auto mount the sdcard.img I created using vi but I'm a bit clueless as to what I should change on the dev_mount /sdcard line to get it automounted at boot and hopefully fool the rest of the apps into thinking it is a physical sdcard.
Can anyone possibly point me in the right direction? Not sure how to invoke cmd mode in vi using the milestone qwerty either but I'll keep digging.
What I did (roughly), maybe I'm going about it wrong but any advice would be appreciated.
1. rooted device
2. installed the free terminal app from the market
3. fired up the terminal shell
4. su
5. dd if/dev/zero of=/data/sdcard.img bs=1024 count=1 seek=2000000
6. busybox mkfs.vfat /data/sdcard.img (didn't seem to support -F 32)
7. busybox mount -o loop /data/sdcard.img /sdcard/
+ 1 for this, it would be great to can use internal storage for user data
Why do you let this nice post die.. so "flibbulator" found anything more out?.. I'd like to know more.. like if you got it to work with Music Players and Video players??
Try to mount /data/sdcard.img to /mnt/sdcard (/sdcard is a link to /mnt/sdcard)
or try "export EXTERNAL_STORAGE /sdcard"
I made in a different way: created a 4GB storage.img in /data and mounted it in /sdcard/storage, so internal storage is finally usable for user data
the problem was to set mount point on boot, I can't find a way to execute a script on boot (you can't permanently modify init.rc)
flibbulator said:
What I did (roughly), maybe I'm going about it wrong but any advice would be appreciated.
1. rooted device
2. installed the free terminal app from the market
3. fired up the terminal shell
4. su
5. dd if/dev/zero of=/data/sdcard.img bs=1024 count=1 seek=2000000
6. busybox mkfs.vfat /data/sdcard.img (didn't seem to support -F 32)
7. busybox mount -o loop /data/sdcard.img /sdcard/
Click to expand...
Click to collapse
I have actually tried this on my Droid2Global, and I get the error "unknown operand if/dev/zero" I feel like I am missing the point or do not fully understanding how to use the "dd" command?
the correct syntax is:
dd if=/dev/zero of=/data/sdcard.img bs=1024 count=4194340
4194340 --> 4GB
patton82 said:
the correct syntax is:
dd if=/dev/zero of=/data/sdcard.img bs=1024 count=4194340
4194340 --> 4GB
Click to expand...
Click to collapse
Thank you bro.
Quick question I keep getting these errors. I do have a folder in "/" named "sdcard-int"
Better Terminal Emulator Pro
/ # busybox mount -o loop /data/sdcard.img /sdcard-int/
mount: can't setup loop device: No such file or directory
/ # busybox mount -o /data/sdcard.img /sdcard-int
mount: can't read /etc/fstab: No such file or directory
/ #
Sent from my DROID2 GLOBAL using Tapatalk
you can't place anything in root folder, /sdcard is a link to /mnt/sdcard and is created by init.rc (you can't edit init.rc, it's provided by boot.img, so need to extract from boot.img and repack)
I made in this way but I have to manually execute a script or a command from terminal after every boot to mount storage.img
mkdir /sdcard/storage
su
dd if=/dev/zero of=/data/storage.img bs=1024 count=4194340
busybox mkfs.vfat /data.storage.img
mount -o loop -t vfat /data/storage.img /sdcard/storage
Will be lost anything after reboot when use this storage?
Sent from my MotoA953 using XDA App
all the stuff in img file will not be lost, as long as you put it in /data/
on the contrary the mount point must be restored after reboot
patton82 said:
you can't place anything in root folder, /sdcard is a link to /mnt/sdcard and is created by init.rc (you can't edit init.rc, it's provided by boot.img, so need to extract from boot.img and repack)
I made in this way but I have to manually execute a script or a command from terminal after every boot to mount storage.img
mkdir /sdcard/storage
su
dd if=/dev/zero of=/data/storage.img bs=1024 count=4194340
busybox mkfs.vfat /data.storage.img
mount -o loop -t vfat /data/storage.img /sdcard/storage
Click to expand...
Click to collapse
Thank you, I will use the Thank you button when I login via PC.
I still get the same error, I know that I'm doing something incorrectly or maybe I don't understand "mount" comment correctly?
/ $ su
/ # mkdir /sdcard/storage
/ # dd if=/dev/zero of=/data/storage.img bs=1024 count=41943404194340+0 recordsn
4194340+0 records out
4295004160 bytes (4.0GB) copied, 339.823883 seconds, 12.1MB/s
/ # busybox mkfs.vfat /data/storage.img
/ # mount -o loop -t vfat /data/storage.img /sdcard/storage
mount: can't setup loop device: No such file or directory
/ #
I am using my sdcard also, I'm not too sure if that makes any difference?
Sent from my DROID2 GLOBAL using Tapatalk
Better terminal pro uses BASH shell, I presume
try to switch to android shell, in preferences
or to use terminal emulator (free) from market
Okay, I tried Android Terminal Emulator, and this is a new error.
export PATH=/data/local/bin:$PATH
$ $ su
# mount -o loop -t vfat /data/storage.img /sdcard/storage
ioctl LOOP_SET_FD failed: Device or resource busy
#
Not too sure where to go now. I thank you again for all your help, and time.
Sent from my DROID2 GLOBAL using Tapatalk
resource busy, you have to reboot the phone
I use Gscript lite, add a script with the string
mount -o loop -t vfat /data/storage.img /sdcard/storage
and create a shortcut to homescreen, so when I reboot, I can mount the img file in one click
Cool mod for my ROM. Could I take it??
sure, they are simple shell commands
the best would be to do what happen with Samsung Galaxy S: internal storage mounted as sdcard and physical sdcard mounted in a folder /sdcard/sd
storage.img is 3-4 times faster than my peak 8GB class 6
There is an application "Autostart" in the market, which can automatially execute a script with root after boot up.
I up because I'm now also interested in making profit of the huge internal storage. I'd like to put my wikipedia data from wikidroyd to the internal storage. Hopefully I'm skilled enough to follow the given steps...I doubt that though
fKngFtd said:
Okay, I tried Android Terminal Emulator, and this is a new error.
export PATH=/data/local/bin:$PATH
$ $ su
# mount -o loop -t vfat /data/storage.img /sdcard/storage
ioctl LOOP_SET_FD failed: Device or resource busy
#
Not too sure where to go now. I thank you again for all your help, and time.
Click to expand...
Click to collapse
Guys, I need your help! I have exactly. The same problem:
Every time I try to mount my storage.img I get
Ioctl LOOP_SET_FD failed: Device or resource busy.
I rebooted several times and also tried to mount smaller images (first I tried 3gb then I tried 1mb).
Any solution?
Edit: I solved it myself. I always forgot to punch in busybox before the command. Now it worked for me!!
I do have a question now. With help of Gscript I made a shortcut to mount the storage.img to my sdcard. But my pc wont recognise the sdcard as long as the image is mounted. What is the command to unmount the partition so I wouldnt have to reboot my phone before connecting it to the pc...?
Any help is much appreciated! Thx
(Something like busybox unmount -o loop -t vfat...?)
Sent from my MotoA953 using XDA App

Link2SD says Remove Link Failure

When I try to remove a link in Link2SD I will have the message
Remove link failure
rm failed for /data/sdext2..... Read-only file system
All files I can se have RW. Can it be a problem with the SD-card?
Is is not possible to make any new links either.
beani45 said:
When I try to remove a link in Link2SD I will have the message
Remove link failure
rm failed for /data/sdext2..... Read-only file system
All files I can se have RW. Can it be a problem with the SD-card?
Is is not possible to make any new links either.
Click to expand...
Click to collapse
It sounds like the partition got mounted to /data/sdext2 as read-only somehow. It doesn't matter what the actual file permissions are if the partition is not mounted as read/write. Try one of the following commands to see how it is mounted:
Code:
#If using a terminal emulator on your phone
mount
#If using adb on your computer
adb shell mount
#Here's the output I get:
rootfs on / type rootfs (ro)
tmpfs on /dev type tmpfs (rw,mode=755)
devpts on /dev/pts type devpts (rw,mode=600)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /mnt/asec type tmpfs (rw,mode=755,gid=1000)
tmpfs on /mnt/obb type tmpfs (rw,mode=755,gid=1000)
/dev/block/mtdblock3 on /system type yaffs2 (ro)
/dev/block/mtdblock5 on /data type yaffs2 (rw,nosuid,nodev)
/dev/block/mtdblock4 on /cache type yaffs2 (rw,nosuid,nodev)
/dev/block/mmcblk0p2 on /sd-ext type ext2 (rw,noatime,nodiratime,errors=continue)
/dev/block/mtdblock4 on /data/dalvik-cache type yaffs2 (rw,nosuid,nodev)
/dev/block/mmcblk0p2 on [B][COLOR="Red"]/data/sdext2[/COLOR][/B] type ext2 ([B][COLOR="Red"]rw[/COLOR][/B],noatime,nodiratime,errors=continue)
/dev/block/vold/179:4 on /mnt/sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,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:4 on /mnt/secure/asec type vfat (rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /mnt/sdcard/.android_secure type tmpfs (ro,size=0k,mode=000)
If yours says "ro" instead of "rw", you might have to modify the link2sd mounting script in /etc/init.d/
I would also suggest posting this in the Link2SD thread so more people, including the dev, can help you figure it out.
I too am having a similar problem, except when trying to create a link. The message i get is:
"Create Link Failure
: cannot create /data/sdext2/sampleapp.apk: read-only file system"
I checked to see if my sdext2 partition is RO - and it is. How do I fix this? I found the link2sd mounting script in the init.d directory, but I have no clue as to how to edit it in order to get things working. I checked in the link2sd thread u posted above, but found no answer to this problem after reading thru 94+ pages.
Help...please...
Bling_Diggity said:
The message i get is:
"Create Link Failure
: cannot create /data/sdext2/sampleapp.apk: read-only file system"
I checked to see if my sdext2 partition is RO - and it is. How do I fix this? I found the link2sd mounting script in the init.d directory, but I have no clue as to how to edit it in order to get things working.
Click to expand...
Click to collapse
Please post the output from the mount command so it will help us figure out how the link2sd script needs to be modified if that is the problem. It would be good if you could attach or post the contents of the link2sd script also. The easiest way might be to just open up either a terminal emulator or use an adb shell through your computer for two commands(filling in the appropriate script name):
Code:
su
cat /etc/init.d/LINK2SD_SCRIPT_NAME
Copy that output and post it here. If you get a read-only error, look below on how to remount /system as r/w and try again.
The script's mount command might use /dev/block/mmcblk0p2 instead of /dev/block/vold/179:2 as well as -o options and/or -t type possibly being specified but it should be similar to the following:
Code:
mount /dev/block/vold/179:2 /data/sdext2
#Only guessing until I get more info but you could try one of these:
mount -o rw /dev/block/vold/179:2 /data/sdext2
mount -o rw -t TYPE /dev/block/vold/179:2 /data/sdext2
#TYPE will be the format of your 2nd partition: ext2 or ext3 or ext4 or vfat(if fat32)
To edit the link2sd script, Root Explorer would work if you have it. If so, you can navigate to /system/etc/init.d/, click on the "mount rw" button at the top right, then long click on the link2sd script, choose "open in text editor" and make your changes. Another option is using adb. You can pull a copy of the script to your computer, edit it, then push it back. From a terminal/cmd prompt on your computer with adb set up:
Code:
#pull script to your current directory
adb pull /etc/init.d/LINK2SD_SCRIPT_NAME
#now edit the script then push it back and give correct permissions
adb push ./LINK2SD_SCRIPT_NAME /etc/init.d/
adb shell
su
chown 0:2000 /etc/init.d/LINK2SD_SCRIPT_NAME
chmod 750 /etc/init.d/LINK2SD_SCRIPT_NAME
Another option would be to use a terminal emulator on your phone:
Code:
su
cp /etc/init.d/LINK2SD_SCRIPT_NAME /sdcard/
#access the sdcard using a usb cable with your computer, edit the script, and disconnect from the computer
cp /sdcard/LINK2SD_SCRIPT_NAME /etc/init.d/
chown 0:2000 /etc/init.d/LINK2SD_SCRIPT_NAME
chmod 750 /etc/init.d/LINK2SD_SCRIPT_NAME
If you get read-only errors while trying to do any of the steps, you'll need to remount the /system partition as read/write. From terminal emulator or in adb shell:
Code:
su
mount -o remount,rw /system
Problem solved. Apparently something happened that caused Clockworkmod to create my partition in Read-Only mode. Couldn't figure out how to change that to R/W, so I did a complete wipe of everything (including SD card), changed over to Amon Ra, repartioned using it, reloaded everything back on to the SD card, re-flashed CM7/gapps, then booted and reinstalled L2SD. Works perfectly now. Not sure why CWM created my partition in read-only mode...but Amon Ra didn't have that issue...so I guess I'll be sticking with it from now on.
MongooseHelix said:
The script's mount command might use /dev/block/mmcblk0p2 instead of /dev/block/vold/179:2 as well as -o options and/or -t type possibly being specified but it should be similar to the following:
Code:
mount /dev/block/vold/179:2 /data/sdext2
#Only guessing until I get more info but you could try one of these:
mount -o rw /dev/block/vold/179:2 /data/sdext2
mount -o rw -t TYPE /dev/block/vold/179:2 /data/sdext2
#TYPE will be the format of your 2nd partition: ext2 or ext3 or ext4 or vfat(if fat32)
Click to expand...
Click to collapse
i seem to be getting closer with this solution but in terminal emul i'm entering
#mount -o rw -t vfat /dev/block/vold/179:2 /data/sdext2
and i'm getting failed device or resource busy
blkwhk said:
#mount -o rw -t vfat /dev/block/vold/179:2 /data/sdext2
and i'm getting failed device or resource busy
Click to expand...
Click to collapse
vfat? Obviously wrong, isn't it?
Getting a read-only mount probably means that the filesystem is corrupted (which would exactly match my experience regarding the partitioning/formatting capabilities of CWM... has nothing but trouble with that one).
doktornotor said:
vfat? Obviously wrong, isn't it?
Getting a read-only mount probably means that the filesystem is corrupted (which would exactly match my experience regarding the partitioning/formatting capabilities of CWM... has nothing but trouble with that one).
Click to expand...
Click to collapse
vfat because i used minitools to create a 2nd fat32 partition. the ext2,3,etc didn't work for me in link2sd
blkwhk said:
vfat because i used minitools to create a 2nd fat32 partition. the ext2,3,etc didn't work for me in link2sd
Click to expand...
Click to collapse
Well, FAT32 is extremely bad choice. They did not work for you pretty much for the reason stated above - you are using a broken tool to partition/format them. Forget about CWM, simply do it on PC or use AmonRA.
doktornotor said:
Well, FAT32 is extremely bad choice. They did not work for you pretty much for the reason stated above - you are using a broken tool to partition/format them. Forget about CWM, simply do it on PC or use AmonRA.
Click to expand...
Click to collapse
didn't use CWM, used minitools on PC
FYI
mount -t vfat -o rw,remount /dev/block/vold/179:2 /data/sdext2
worked for me
blkwhk said:
didn't use CWM, used minitools on PC
Click to expand...
Click to collapse
Never heard about minitools. Try something better next time. In case you wonder why FAT32 sucks then, first of all, it has no concept of permissions at all, so any process can write and delete the files there, and second, the filesystem gets corrupted all the time on unclean unmount.
blkwhk said:
didn't use CWM, used minitools on PC
FYI
mount -t vfat -o rw,remount /dev/block/vold/179:2 /data/sdext2
worked for me
Click to expand...
Click to collapse
I used minitools as well to create a FAT32, but still keep getting I/O mount-script-creation error when trying to load up link2sd.
I will say it again - do NOT use the fricking FAT32.
Same for me
Well, i just had the same problem.
To solve it, i just rebooted my cellphone (cuz i'm a lazy boy who doesn't like code lines^^).
I had the same problem and found the folder in /data/sdext2 listed as RO on my phone. I set it on RW and the problem was solved for me.
Hopefully it'll work for you guys too.
link2sd failure
Erikdeperik said:
I had the same problem and found the folder in /data/sdext2 listed as RO on my phone. I set it on RW and the problem was solved for me.
Hopefully it'll work for you guys too.
Click to expand...
Click to collapse
still failure when create link manually or automatic,...
......................................................................
any other sollution???
Uppppppppp. SAME problem.
I also noticed my error says /data/sdext2, but my partition type if ext4. Should that be a red flag?
I was getting an error specific to the dalvik-cache (/data/sdext2/dalvik-cache) claiming that it was read only. I used root explorer to try and change permissions for the folder, but root explorer was unable to (on a side note I WAS able to change permissions for the /data/sdext2 folder). I ended up using root explorer to edit the link2sd script..
MongooseHelix said:
To edit the link2sd script, Root Explorer would work if you have it. If so, you can navigate to /system/etc/init.d/, click on the "mount rw" button at the top right, then long click on the link2sd script, choose "open in text editor" and make your changes.
Click to expand...
Click to collapse
turns out my script included the /dev/block/vold/179:2 line AS WELL AS the /dev/block/mmcblk0p2 line.. however both were showing "rw". I removed the /dev/block/mmcblk0p2 line and added mount -t vfat -o rw /dev/block/vold/179:2 /data/sdext2/dalvik-cache
works like a charm now =D
Thank you MongooseHelix and everyone else for your help!
blkwhk said:
didn't use CWM, used minitools on PC
FYI
mount -t vfat -o rw,remount /dev/block/vold/179:2 /data/sdext2
worked for me
Click to expand...
Click to collapse
Worked for me too...No formats no nothing...thanks!
Solved ! Failure Link2SD package invalid
For friends who are having problems with the "Create Link" in Link2SD, here I will try to help resolve the problem, because some days I also mess around with "Failure Link2SD package invalid" on my phone. And here's how:
previously, ROM I use is miniROM with Stock Kernel, and Sandisk 8Gb MicroSD Class10
1. Create Partition as follows:
• FAT32 = 6.50 Gb *create as primary
• Ext2 = 600MB *create as primary
• Linux Swap = 200MB *create as primary
#Put MiniTool to create partitions, search on google for a tutorial
2. Link2SD *can use whatever version, I use the latest version V3.7.3
Download Link2SD only from Playstore, do not use version Link2SD Cracked / Mod, remember only from Playstore. If you are using a version of Crack / Mod then bound to fail in the Create Link in Link2SD, and it is based on my experience these days.
If you want Link2SD full version, try using Lucky Patcher. But I do not use it that way, because this is enough for me.
Sorry for my bad english, i used Google Translate to translate my language, (Indonesia to English) :silly:
#Screenshot 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"
}
Click to expand...
Click to collapse

HTC Sensation, Cyanogenmod 9.1, /sd-ext Encryption with Cryptsetup

Having encrypted /data, I'd been interested in encrypting the SD card, either in full, or a full partition. As a new poster to xda, posting without citing reference links does prove a bit more challenging, but here goes:
Given an HTC Sensation, rooted, with Cyanogenmod 9.1 (ICS), and Clockwork Recovery, I partitioned (thru Clockwork) the SD card into FAT32, ext, and swap. Your milage may vary on the next step, but using Fedora, I accessed the SD card, deleted the ext partition, and recreated as an encrypted partition, type ext4. (read up on cryptsetup for alternative ways to create this) For the sake of this post, we'll use the password, "ChangeMe".
I installed LUKS Manager from Google Play, which provides lm.cryptsetup, a renamed binary of Guardian Project's cryptsetup. I didn't use LUKS Manager's implementation of creating encrypted folders, instead, the whole sd-ext partition has been encrypted.
To mount the device at startup, I have the script 99sd-extLUKinit, located at /system/etc/init.d/
#!/system/bin/sh
# Not quite sure what these do, but kept them in
sync;
setprop lk.filesystem.ready 1;
# Remount the root file system to allow changes
mount -o remount,rw rootfs /
# Create the mount point and create a symbolic link
mkdir /mnt/sd-ext
ln -s /mnt/sd-ext /sd-ext
# Decrypt the SD card via cryptsetup, device resides on /dev/block/sd-ext
# Hopefully prompt user for password, but for now, echoed in
echo ChangeMe | lm.cryptsetup luksOpen /dev/block/mmcblk1p2 sd-ext
# Clean errors
e2fsck -y /dev/mapper/sd-ext
# Mount the SD Card via cryptsetup block device
mount -t ext4 -o noatime,nodiratime,barrier=1 /dev/mapper/sd-ext /mnt/sd-ext/
# Remount the root file system to prevent changes
mount -o remount,ro rootfs /
Once verified that the system will automount the encrypted ext4 /mnt/sd-ext partition:
ls /sd-ext
should return with lost & found directory
I moved /data/app and /data/app-private to the encrypted partition:
cp -a /data/app /sd-ext/app
rm -r /data/app
ln -s /sd-ext/app /data/app
cp -a /data/app-private /sd-ext/app-private
rm -r /data/app-private
ln -s /sd-ext/app-private /sd-ext/app-private

[Completed] Cyanogenmod 12 and 2nd partition in Sdcard

Any one can tell me what I make round. I have cyanogenmod with one sdcard with 2 partitions the first is mount with ext4 and the second I try fat32 ext4 ext3 ...
I no found fuse.ko in the system but internal partition and storage is mount with fuse in /storage/....
I try to mount the second partition by many difference ways . Always is mount and show up
I copy files from internal memory or sdcard first partition to the second partition
But if I try to open the files I got permission errors . Very possible is a Selinux problem but I have in permissive mode
I look with rootexplorer and files a copy in the 2nd partition in the sdcard for the owner only can read or write
Any ideas how to make the correct mounts for the 2nd Partition on SD card
I make a simple script for make test that is the last configuration I make but still only the owner can read or write that means any app can't open the files if is not root
that is the configuration I use
#!/system/bin/sh
# Mount SD Card Ext4 Script
mkdir /storage/sdcard2
mount -r -w -o exec,dev,suid,rw -t ext4 /dev/block/vold/179:66 /storage/sdcard2
mount -r -w -o exec,dev,suid,rw -t ext4 /dev/block/mmcblk1p2 /storage/sdcard2
chown media_rw:media_rw /storage/sdcard2
chmod g+w /storage/sdcard2
ln -s /storage/sdcard2 /mnt/media_rw/sdcard2
ln -s /storage/sdcard2 /mnt/sdcard2
chown media_rw:media_rw /mnt/sdcard2
chmod g+w /mnt/sdcard2
Hi there,
I'm sorry but I can't find anything related to your question.
Please post that in the forum bellow for more answers from the experts:
> Android Development and Hacking > Android Q&A, Help & Troubleshooting
Good luck

Ascend G6 L11 -- use whole internal memory for apps+data

Note: This is probably only helpful for people with a computer science or linux hacking background!
We all know the single biggest issue with this phone is the lack of internal memory for apps and app data. The internal partitioning looks like this:
/system 1 GB
/data 2 GB
sdcard0 4 GB -- lots of space that competes with external SD! Let's use it!
other stuff (tmp, boot, etc.) 1 GB
persona78 provided an excellent mod of the (most recent) stock ROM that gives you root and a working init.d:
https://forum.xda-developers.com/ascend-g6/general/root-upadtekinguser-zip-modded-extras-t3349679
This mod also enables to move apps to a new ext4 partition on the external SD card. My experience however is:
dalvik cache and app data (e.g. some social media apps caching videos etc.) will still fill up the /data partition
access to external SD, even a fast one, is much slower
if you also move app data to external SD, the phone becomes unusable (slow)
So I propose the following solution, successfully tested on my phone, that will use just short of 6 GB on the internal SD card for dalvik cache, apps and their data!
This is how to do it:
backup everything important from the phone
unlock bootloader and install the ROM from persona78, linked above. Make sure root works, adb works.
connect to a Linux machine via USB that has adb installed
select mass storage mode on the phone in the USB settings
Now in mass storage mode do the following:
the phone exposes a block device without partitioning (e.g. /dev/sdb) and a block device with partitioning (e.g. /dev/sdc, /dev/sdc1). the former is the internal storage (sdcard0), the latter external storage (sdcard1).
mount /dev/sdb to /mnt/internal and /dev/sdc1 to /mnt/external
rsync -a /mnt/internal/ /mnt/external/
umount /dev/sdb
mkfs.vfat -C /var/tmp/vfat 256000
dd if=/var/tmp/vfat of=/dev/sdb bs=1M (you can delete /var/tmp/vfat after this)
losetup /dev/loop0 /dev/sdb -o 262144000
mkfs.ext4 /dev/loop0
On the phone you can now change back the USB mode to MTP (but not to charge only -- a data mode is needed for adb to work).
Now run adb shell and obtain root in the shell via 'su'. In the adb root shell:
mkdir -p /data/sdext4
losetup -o 262144000 /dev/block/loop7 /dev/block/mmcblk0p25
mount -t ext4 /dev/block/loop7 /data/sdext4
in /data/sdext4, create two directories called 'data-app' and 'data-data'. Give them the respective permissions and group,ownership as with the current /data/app and /data/data directories.
cp -a /data/app/* /data/sdext4/data-app
cp -a /data/data/* /data/sdext4/data-data
rm -r /data/app/* /data/data/*
mount -o remount,rw /system
edit /etc/init.d/01AOBoot as follows
Content of /etc/init.d/01AOBoot:
#!/system/bin/sh
CONCURRENCY=makefile
# mount sdext4
losetup -o 262144000 /dev/block/loop7 /dev/block/mmcblk0p25
mount -t ext4 /dev/block/loop7 /data/sdext4
mount -o bind /data/sdext4/data-app /data/app
mount -o bind /data/sdext4/data-data /data/data
# change dalvik permissions
chmod 773 /data/dalvik-cache
# change scaling_min_freq to 300000
echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
Click to expand...
Click to collapse
Now run adb reboot. It is done.
Explanation: Apps and their data need to reside on an ext4 partition. sdcard0 however has to be vfat, otherwise the phone will always complain and ask to format it. We can also not change the internal storage partitioning. Therefore we simply hide a large ext4 filesystem behind a small vfat filesystem on the same partition. Apps will startup fast and run fast, and all media files can be put on the external sd card.
I know this is very exotic to most, but maybe there are a few people like me with the necessary background who would like to follow my example. Happy hacking!
Are you kidding me?
This is a great work that you did. My phone keeps complaining about low disk space but I was gonna use parted to resize the data partition.

Categories

Resources