Related
I was just curious if anyone would be interested in making a step in the right direction dog such a new device. I have worked with a2sd on several other android phones(most of which already had froyo ported). I also have some experience in porting Roms to other devices. If anyone else that has already bought a flipside, and at least a pretty decent understanding on how the OS works and how to stuff like that. Also... it would be a huge plus if someone has experience in building Roms, as well as dumping them from our devices.
I'm planning on starting off with a clean and fast ROM for our phones... and hopefully with a2sd built in as well, or at least installable.
If you are interested then send me a PM and we can get to work... the sooner the better!
Looking at /proc/filesystems it seems that the stock kernel only has support for yaffs2 and vfat. The stock image doesn't include any .ko files so I'm assuming all of the needed functionality is compiled into the kernel with no support for external module loading.
Using Busybox 1.18 from the Market I can loop mount vfat images without any problem (I had partitioned my SD card under Linux but it seems that init and motobox are hard-coded to load mmcblk0p1 at /sdcard and then it kept unmounting /sdcard randomly when I had extra partitions after it... so loop-mounting is safer without breaking things).
The problem is of course permissions since vfat doesn't support ugo-style permissions. We can't loop mount yaffs2 images since the emulated block device is not NAND flash... and that's also the reason we can't just dd a yaffs2 filesystem into a partition on the SD card.
I'm going to experiment with init.rc a bit and see if I break anything by forcing it to mount /sdcard immediately after /system (because that's where it should be mounting /data). I don't want to run the risk of loop mounting a file from /sdcard onto /data only to have it forcibly unmounted when vold gets enumerated and remounts /sdcard.
It's really unfortunate that there's so little space on the internal memory of this device... /cache is ~140 Mb, /system is ~180 Mb, and /data is ~160 Mb, so even if we were to lean out /system and swap it around with the others, we only get 20 Mb more on /data... that's way too much work for such little gain.
OT - Why is there so much hatred against this device? It's more than fast enough to play Quake 3 and I'd trade all the screen real estate in the world for a hardware keyboard... oh, and the phone actually fits in my pocket (unlike my friend's Droid X which is so huge and unwieldy...). Anyway, I just think it's odd.
Update: It seems that the device checks that boot and recovery images are signed with a Motorola digital certificate at runtime... I can flash the partitions just fine, but it just boot-loops with "Error CC00 DBAD" and then eventually drops back to the bootloader. Unfortunately this means that I can't test any changes to mount points in init.rc at this time. Since I don't have any means to recover the device from a bad bootloader flash, this will have to be the end of the road for me at this time. Some other brave soul will have to experiment with replacing mbmloader or lbl to allow loading custom images signed with test certificates from the SDK.
EDIT: I should mention that I had to use sbf_flash to upload images since fastboot won't work until we have an unlocked bootloader on the device. I wish I had read up on and-developers.com before discovering all of this stuff the hard way. Oh well. Even the ramloader from the SBF image is signed with a Motorola digital certificate so I'm not sure that using sbf_flash (I haven't tried RDSlite, don't have Windows) is the way forward either. I don't think we can just dd the new images for the bootloader either since not all of the MTD partitions are exposed to the OS. This is going to be harder than I expected.
Init.rc executes /system/etc/install-recovery.sh as a privileged user. Lucky for us, this is at the end of the init script once everything is up and running and AT&T/Motorola have removed the file so we don't have to alter anything of value. I've tested it and adding install-recovery.sh will run commands as root. This is our way in.
Hopefully we can get apps stored on the SD card soon.
EDIT: The contents of this post are now deprecated and remain here for historical purposes only! Please see the posts below for the "proper" scripts.
So after playing with it some more, mounting a vfat filesystem on /data simply doesn't work because permissions and ownership can't be set. Even setting the most relaxed permissions possible I found bizarre side effects like apps won't install from the Market and wifi can't be toggled on/off. I found an ext2.ko compiled for the Milestone stock rom (I've attached it here for convenience, but I found it on android-hilfe.de) works just fine though, so now we can use a proper filesystem.
Right now I'm mounting a 512 MB ext2 filesystem onto /data and everything works great. The biggest problem I'm having though is that switching to USB Mass Storage mode forcibly unmounts my filesystem so that obviously causes problems, but I don't really see a way around this since UMS mode offers up the entire MMC device so there's no way to just pick one partition to expose...
I'm going to test more things to make sure nothing has broken before I post a full write up on this, but if you know what you're doing, it shouldn't be hard to figure it out on your own. I know most of the Apps2SD projects are using an application to manage data then setting up a separate partition on the SD card, but it usually relies on some custom recovery image and the goal for me is to do this against a stock rom. I'm also using a loop-mounted filesystem because it makes it easier to migrate to a new SD card without having to worry about partitions and what-not.
EDIT: Here's a quick-n-dirty version for those of you who would like to try it. This will show the proof of concept and let you see if it works for you without breaking anything major. All changes to /data will be undone on the next reboot. If you know what you're doing, then I would recommend making the changes permanent by mounting /data in install-recovery.sh. This is assuming you have rooted your phone (I used z4root) and have Busybox installed (I used 1.18 from the Market) and at least 512 MB free on your SD card.
Code:
adb push ext2.ko /sdcard
adb shell
su -
/system/bin/busybox mount -o rw,remount /system
/system/bin/busybox cp /sdcard/ext2.ko /system/lib/modules
/system/bin/busybox chown 0.0 /system/lib/modules/ext2.ko
/system/bin/busybox chmod 0644 /system/lib/modules/ext2.ko
/system/bin/busybox mount -o ro,remount /system
/system/bin/busybox insmod /system/lib/modules/ext2.ko
/system/bin/busybox dd if=/dev/zero of=/sdcard/userdata.ext2 bs=1M count=512
/system/bin/busybox losetup /dev/block/loop0 /sdcard/userdata.ext2
/system/bin/busybox mkfs.ext2 /dev/block/loop0
/system/bin/busybox mount -o rw,remount /
/system/bin/busybox mkdir /userdata
/system/bin/busybox mount /dev/block/loop0 /userdata
/system/bin/busybox chown 1000.1000 /userdata
/system/bin/busybox chmod 0771 /userdata
cd /data
/system/bin/busybox cp -r -f -H -p . /userdata
cd /
/system/bin/busybox umount /userdata
/system/bin/busybox rmdir /userdata
/system/bin/busybox mount -o ro,remount /
/system/bin/busybox umount -l /data
/system/bin/busybox mount /dev/block/loop0 /data -o rw,sync,nosuid,nodev,noatime,nodiratime
If you've done everything right, "lsmod" and "cat /proc/filesystems" will show "ext2", "mount" will show /dev/block/loop0 on /data, and "df" will show more space available on /data. You should also see the extra space in Settings -> SD card & phone storage -> Internal phone storage.
My install-recovery.sh currently looks like this:
Code:
#!/system/bin/sh
if [ -e /system/lib/modules/ext2.ko ] && [ "`/system/bin/busybox lsmod | /system/bin/busybox grep -c ext2`" -eq "0" ]
then
/system/bin/busybox insmod /system/lib/modules/ext2.ko
fi
# wait 30 seconds, /sdcard is being re-mounted by vold...
/system/bin/busybox sleep 30
if [ -s /sdcard/userdata.ext2 ] && [ "`/system/bin/busybox cat /proc/filesystems | /system/bin/busybox grep -c ext2`" -eq "1" ]
then
/system/bin/busybox losetup -d /dev/block/loop0
/system/bin/busybox losetup /dev/block/loop0 /sdcard/userdata.ext2
/system/bin/busybox umount -l /data
/system/bin/busybox mount /dev/block/loop0 /data -o rw,sync,nosuid,nodev,noatime,nodiratime
fi
You don't have to use this as-is, but it's at least a starting point.
UPDATE: Seems like we need a Busybox with a proper tune2fs utility as the one in the Market is pretty useless (only changes volume labels...). You'll want to run "tune2fs -c 0 -i 0 /dev/block/loop0" to disable mandatory fsck'ing, otherwise the kernel will reject the mount after a few times because it's dirty. Something funky is happening because any apps that I install once the image is mounted will not show up after reboot, but the files are there and they continue to take space. Maybe I'm breaking something with the lazy umount?
At the risk of sounding like I'm only talking to myself, I'll post another update...
I found that most of my troubles were stemming from waiting so long to remount /data, so I caved and put an ext2 partition on my SD card so that I don't have to wait 30 seconds before mounting over /data.
Oddly enough, mounting a native ext2 partition for /data from the SD card was actually MUCH slower than the loop mounted image. I should note that I'm not mounting the partition with the 'sync' option. I could get away with that on the loop device since it's just doing it in memory anyway and changes are only being written on the default commit interval for the host filesystem. Anyway, I'm using a 4 GB class 10 SD card, but it's still much slower than the internal flash. Just to confirm my results, I tried with a native ext2 partition on a 2 GB class 2 SD card... the phone took nearly 5 minutes finish booting to a responsive home screen!
But, at least I can mount /data right away when I'm using a physical partition... So I've done the best of both worlds by creating a ext2 partition on my SD card and then loop mounting an ext2 image onto /data. The result: I'm running my entire /data on a class 2 SD card and it's much faster than a native partition on a class 10! In fact, the difference in boot time compared to internal storage is only a few seconds! Now that I'm mounting /data right away I no longer have problems with missing apps or data after reboots. The only drawback is that you have to waste a bit of space to do it this way since the filesystem reserves 10% for itself, you need a 560 MB partition to hold a 512 MB image (in my case I'm actually running a 384 MB image since I don't really need that much space anyway). Personally, I don't mind since I'm running it off of a cheapo class 2 device and having everything in a single image file makes it super simple to migrate to a different SD card if I want to.
I'll keep running this setup for a couple days now to make sure that there's nothing else broken, but for right now I've got it setup just how I want it: no extra application to manage which apps are where and no random force closing from applications running off of SD card that weren't meant to be. Oh yeah, and I don't have to worry about dalvik-cache cannabilizing my internal storage either.
If anyone else is following along, I'd like to hear your experiences with this too. I'll post the final write-up once I'm certain that nothing else is broken.
I'm definitely following along appreciatively, but will have to wait for the step by step to give it a try.
Sent from my Liberty using Tapatalk
Well, here is the much-awaited write-up...
First, acknowledgements. This would not have been at all possible without the ext2 module provided by user Fnordi on android-hilfe.de. Unfortunately I can't read German so I have no idea if he actually compiled it for the Milestone or somebody else did, but I grabbed the file from his post about loading Debian Linux on the Milestone, so kudos to him and whomever else was involved. I also wouldn't have been able to write this up so neatly without the sdparted script by 51dusty. I had to make a few alterations because we're not running on CyanogenMod Recovery, but it's still mostly his work nonetheless. The parted and tune2fs binaries are from j_r0dd's Recovery image for the Motorola Backflip. Also, cheers to the folks on android-dls.com wiki, even though the information is mostly targeted at the G1 and ADP, it was still very good reading.
WARNING WARNING WARNING
I have not yet devised a way to migrate the SD card data back to internal storage! Once you've migrated /data to the SD card, anything new from that point forward will stay on the SD card. Additionally, I will not be providing support for anyone who deviates from the process outlined here. If you're clever enough to do it some other way, then you're clever enough to get out of trouble on your own. Do this at your own risk, I am not responsible for any harm or loss of data that may occur as a result of following this procedure. You have been warned!
WARNING WARNING WARNING
Requirements: Android SDK installed with working ADB, root access on your Motorola Flipside and Busybox 1.18 installed from the Market. There is plenty of information available on the forum on how to do these things so please don't post here asking how to root the phone. The assumption is that you know how to gain root access and that you're comfortable with ADB. If you're struggling with doing any of these things, then you should reconsider if you want to attempt this at all.
1. Backup your SD card and format it so that it's completely clean and has only a single, empty, FAT32 partition on it.
2. Grab the attached ZIP file and extract the files directly into the SD card (no sub-folders). Make sure these are the only files on there, everything else will be erased!
3. Set your phone's USB connection to "Charge Only".
4. Connect via ADB using "adb shell".
5. Now run the following:
Code:
su -
cp /sdcard/setup.sh /data/local
/data/local/setup.sh
6. The script will now setup a 512MB partition on your SD card with a 448MB image for /data. All of the other data on your SD card will be lost!
7. After the script is finished, restore any files that you backed up before to the FAT32 partition of your SD card.
8. Set your phone's USB connection to "Charge Only" and never change it again!
9. You should now have a lot more space for apps!
Please note that the phone will feel a little sluggish for a little bit after boot, but soon it will have everything buffered in memory and it will feel very smooth again.
Enjoy!
EDIT: I should mention, if you want to undo the changes, either shut down the phone and remove the SD card or delete /system/etc/install-recovery.sh. Either way, the phone will revert back to internal storage automatically on the next boot.
EDIT 2: I noticed that the Market install of Busybox doesn't link any existing commands, only new ones. I've been using the 1.18 binary from the Market but I had used my own script to link everything properly (mostly to replace "sh" since no tab completion was killing me!). I've now included the install script in the zip. So install the Busybox 1.18 from the Market, then run my install-busybox.sh, then reboot and follow the instructions above. Sorry for the mix-up!
Alright, just making sure. You're last Edit:, you said that we have to run your "install busy-box.sh". To run it, is it in the script in your post above, or is there some other way? I'm pretty new to runnin' all these scripts since I'm on a Captivate which is far easier than this (I'm doin' this for my girlfriends Flipside).
Just in general, what are the steps you run your install busy-box?
Thanks ahead of time.
thank!!!!!!!
can anybody help me do this because when i do it at the bottom it says failed
You leave it on "Charge Only" because otherwise it will unmount the /data image and cause it to crash.
This was stated previously in my posts. Please read carefully next time.
ErebusRaze said:
Just in general, what are the steps you run your install busy-box?
Click to expand...
Click to collapse
1. Install Android SDK on your computer.
2. Hook up via ADB and install z4root.
3. Run z4root on your phone. It will root the phone and reboot.
4. Install Busybox from the Market.
5. Copy the contents of the zip file to your SD card.
6. Log in as root via ADB ("adb shell" then "su -").
7. busybox mount -o rw,remount /system
8. cp /sdcard/install-busybox.sh /data/local
9. busybox sh /data/local/install-busybox.sh
10. reboot
11. Log in as root via ADB ("adb shell" then "su -").
12. ls -la /
If everything is done properly, the last step should result in an expanded directory listing in a color terminal. You can now proceed with the rest of the tutorial.
ok after i reboot i got look at my phone storage and it is still the same it didnt increase or anything
the method you've presented here sounds interesting, but i'd really hate to lose the memory card access function of my phone (i use it quite often...very often in fact). so i have a question or two:
would it be possible to get a bigger sdcard(say a 4GB or 8GB sdcard), and dd my current sdcard's partition to the new card, and then create another partition on the rest of the new card and have this method utilize that new partition in the manner described here? would the entire sdcard still get unmounted if i set the phone to memory card access?
<edit>: never mind...it seems this question would be answered by: "The script will now setup a 512MB partition on your SD card with a 448MB image for /data".....so apparently yes the sdcard would still be unmounted :/
igetsosickofregistering said:
the method you've presented here sounds interesting, but i'd really hate to lose the memory card access function of my phone (i use it quite often...very often in fact). so i have a question or two:
would it be possible to get a bigger sdcard(say a 4GB or 8GB sdcard), and dd my current sdcard's partition to the new card, and then create another partition on the rest of the new card and have this method utilize that new partition in the manner described here? would the entire sdcard still get unmounted if i set the phone to memory card access?
<edit>: never mind...it seems this question would be answered by: "The script will now setup a 512MB partition on your SD card with a 448MB image for /data".....so apparently yes the sdcard would still be unmounted :/
Click to expand...
Click to collapse
why would you even bother?...
search: link2sd
nuff said
I backed up my sdcard and copied the files over. I have busybox and it is rooted.
I accessed superuser and copied the files over per the write-up.
When I ran setup.sh, it gave me the following error:
----
busybox found.
Usage: mount [-r] [-w] [-o options] [-t type] device directory
grep: not found
:bad numbergrep: not found
:bad numbermodule insertion failed, aborting!
rm failed for /system/lib/modules/ext2.ko, Read-only file system
Usage: mount [-r] [-w] [-o options] [-t type] device directory
----
I understand that it is a read only error, but not sure how to edit the script (or if I even need to) to get it to work. It looks like the first line of the script remounts the system properties to -rw, but it still failed to write.
After setting up my wife's A7 and using it for three weeks, I have decided to open mine up. I waited because I wanted to see if CES had anything I wanted more. I decided they didn't.
So, I am starting from scratch again.
The main issue I've had with my wife's A7 has been the lack of storage space for apps, especially the big games.
Bazbob seems to have a solution by partioning the microSD card and using Apps2sd.
I took a new Class 10 16GB microSD card.
I downloaded and burned Ubuntu onto a CD from here: http://www.ubuntu.com/desktop/get-ubuntu/download
Put the card in my laptop, restarted it into Ubuntu.
Ran gparted.
Shrunk the Fat32 partition to just under 8GB and added another partion as ext2 primary.
When I restarted my laptop, my sd reader in the laptop doesn't work.
When I put it into the A7, it says the SD card has Total Space of 7.73GB.
At this point, I'm not sure what to do next.
Help is appreciated!
jazzbone said:
After setting up my wife's A7 and using it for three weeks, I have decided to open mine up. I waited because I wanted to see if CES had anything I wanted more. I decided they didn't.
So, I am starting from scratch again.
The main issue I've had with my wife's A7 has been the lack of storage space for apps, especially the big games.
Bazbob seems to have a solution by partioning the microSD card and using Apps2sd.
I took a new Class 10 16GB microSD card.
I downloaded and burned Ubuntu onto a CD from here: http://www.ubuntu.com/desktop/get-ubuntu/download
Put the card in my laptop, restarted it into Ubuntu.
Ran gparted.
Shrunk the Fat32 partition to just under 8GB and added another partion as ext2 primary.
When I restarted my laptop, my sd reader in the laptop doesn't work.
When I put it into the A7, it says the SD card has Total Space of 7.73GB.
At this point, I'm not sure what to do next.
Help is appreciated!
Click to expand...
Click to collapse
You needed to make a second partition EXT2 and format it. You then need to mount the partition. I did this by using the install-recovery.sh that it located in /system/etc. I used the following tutorial and it worked. I got over 12gb of space to install apps.
http://forum.xda-developers.com/showthread.php?t=832799
I did try to mount the new partition to /storage which is also /sdcard and i was still not able to use titanium backup to move apps. The only way i have alot of space is use this method.
I'm also mounting the fat32 partition to location /storage so that when i download apps thats where they are stored until you install them. Also Titanium backup dumps the backups here. This is done with a custom mod of Dexters 1.0c mod.
I did not use adb, i used a app called quicksshd which allows you secure ftp into the tablet and make changes. I suggest using a windows programs called winscp and putty.
Thanks for replying rfisher.
Turns out that my laptop lost the drive letter for the sd card. That's fixed now. When I insert the card into my laptop, it says that you need to format the card in the drive to use it. Any idea why?
I am confused by your instructions.
You said
You needed to make a second partition EXT2 and format it.
Click to expand...
Click to collapse
I did that. First partition is FAT 32, and second partition is EXT2, primary.
Maybe I didn't format the partition? I just created it.
I'll install busybox and see how far I can get with it.
With the other A7, I was never able to work with ADB.
This device really makes me feel like an idiot.
Still can't believe I was the first to get Google Apps working on my wife's tablet!
no adb
Well, the hours of frustration have returned...
I can't get adb running on my laptop.
I installed Android SDK.
When I type adb in the cmd window on my laptop, I get
"adb" is not recognized as an internal or external command, operable program or batch file"
I have tried moving the ADK folder to c:\
and
to:
C:\Users\Bucks HP
No luck.
I added the path c:\android-sdk-windows\platform-tools
to the environment variables in my system properties.
My head is going to explode!
Well, I got adb working, I think...
Problem was in the cmd window. I had to change the path.
Now, I can't install busybox. I followed the instructions from the wiki.
When I type "adb push busybox /data/local"
it returns: cannot stat 'busybox' : no such file or directory.
I pasted the busybox file in the
C:\android-sdk-windows\platform-tools
folder.
Was that the right place for it?
Is the busybox file just a text file?
Also, mine is named busybox-armv6l
Should it be renamed? I tried "adb push busybox-armv6l /data/local"
and got the same result...
I gave up on installing busybox via the wiki instructions.
I installed Titanium Backup and installed busybox through it.
Now, when I type: cd /system
mkdir sd
I get :
mkdir failed for sd, read-only file system
What does that mean and how do I fix it?
Thanks
The saga continues...
With the busybox from Titanium Backup installed,
I needed to type:
adb shell
su
mount -o remount,rw /dev/block/mmcblk3p1 /system
exit
exit
Then, following the tutorial, I am up to step 12:
12) Now comes the tricky part: making Android mount your new partition at boot time. All the hard work would be useless if Android discarded the mount points every time we restarted our phones. To do this we’ll need to create 2 scripts and store then into /system/etc. Obviously the scripts should be started by init.rc and need to run as root. Fortunately Android’s init.rc have a gap that makes this possible. The scripts are named install-recovery.sh and init-sd2.sh.
My question is: How do you create scripts?
You would create them with notepad++ which is a windows program. Then using adb push them to the /system/etc directory.
I used a app called quicksshd and a windows program called winscp to copy the files to the directory. If you used my method you first need to make the /system directory rw before it will let you copy the files. It worked for me, the only thing i did differently is edit init.rc to mount the first partition of the sd card to /storage, but this was creating a modded 1.0c rom. So the result is about 4gb for my sd memory and 12gb for installing apps.
jazzbone said:
The saga continues...
With the busybox from Titanium Backup installed,
I needed to type:
adb shell
su
mount -o remount,rw /dev/block/mmcblk3p1 /system
exit
exit
Then, following the tutorial, I am up to step 12:
12) Now comes the tricky part: making Android mount your new partition at boot time. All the hard work would be useless if Android discarded the mount points every time we restarted our phones. To do this we’ll need to create 2 scripts and store then into /system/etc. Obviously the scripts should be started by init.rc and need to run as root. Fortunately Android’s init.rc have a gap that makes this possible. The scripts are named install-recovery.sh and init-sd2.sh.
My question is: How do you create scripts?
Click to expand...
Click to collapse
Hi rfisher
Thanks for replying!
While waiting, I opened Notepad++, copied the text in the tutorial window into it and saved the file as Unix.
Then, I copied it to a USB drive, put it in the A7, and copied to the system/etc folder.
Is that acceptable?
Then, I followed steps 13-15.
I think I did something wrong. I am not seeing it in Root Explorer. What should I be looking for?
Was I supposed to install Apps2SD already?
I got winscp and quicksshd working. YEAH!
Used them to copy the files as you did.
Restarted A7.
Still don't see the other partition.
PS. I was just rereading your earlier post and you mentioned:
I did try to mount the new partition to /storage which is also /sdcard and i was still not able to use titanium backup to move apps. The only way i have alot of space is use this method.
I'm also mounting the fat32 partition to location /storage so that when i download apps thats where they are stored until you install them. Also Titanium backup dumps the backups here. This is done with a custom mod of Dexters 1.0c mod.
Looking on my A7, I don't see a location that is /storage
My tablet is fresh out of the box, without any firmware updates yet.
Hi all, originally intending to post this tutorial to Ideos S7 Android Development but got a nice greeting from xda-developers.com unallowing newbies to post there
So I just got a brand-new-in-a-box, dead cheap, Ideos S7 tablet -- my first android tablet, and my second android device. I brought my last device about 2 years ago, a G1 that I only kept for a week and sold it afterwards. I was thinking that at that time Android isn't ready yet for replacing my E71.
Back to the Ideos S7, mine is already preloaded with TRZ-mod-0.2 ROM, which is nice. However, I had some issue with wireless network. Whenever I disable my wifi, I would ge trouble activating it as it constantly disabled by itself. Thus, I decided to go back to available stock ROM. Long story short, I've chosen the Froyo 2.2.2 Sweden coded S7V100R001C63B110, and made myself comfortable with repeating Huawei's flashing process.
The firmware seems more stable, and does not have the wireless network activation/deactivation issue. Stock ROM lover anyone
However, the stock ROM doesn't have apps2d+ or whatever that was called, to extend the internal storage. 137MB of free space is really pity for such device. I couldn't run Data2Ext* script successfully, as the default shell /system/bin/sh doesn't seems to support square brackets on scripts conditional parts. Busybox 1.18 supports it, but somehow it would cause all the commands executed in the script to ran by Busybox, causing "applet not found" errors. The other option would be Link2SD, which could probably saved me 10+ hours of hacking. It had its drawback though, the current version on the market expects the extended internal tablet storage partition to reside on the external SD card. Some hacking to mount the internal SD partition works, but not sure whether it would got correctly mounted on boot.
Also, the most important thing: nothing feels better than looking at "Available space" on "Internal tablet storage" of 5.5GB
So here it is, the tutorial for extending the internal storage. Most of the information used are gathered from various sources, and rewritten here for your enjoyment!
REQUIREMENTS:
=========
a) All hardware: Ideos S7 -- should work on Slim as well, data cable, charger, a living being..
b) Rooting -- I've used Gingerbreak from the market
c) Terminal Emulator -- Android Terminal Emulator works fine. Irritating blue background though.
d) Busybox -- 1.18 version is working fine
e) Root explorer -- Optionally used, for easier file editing and copying.
STEPS:
=========
0) Backup your data, as all data in internal storage will be lost!
---------
Well honestly I didn't do this as I got my contacts and mail synced on the internet. My S7 only got 5 days of lifetime so not much data there yet. Sorry no guide on how to do this
1) Partition the internal SD (or external SD card if you intend to do so).
---------
It is recommended to use a good class of memory card when using external SD card for the tablet storage partition.
There's possibly partitioning tools available for the architecture, but I did it with EASUS Partition Master on a Windows system. Mac OS's Disk Utiliy should work as well. Don't worry too much about the partition type, we'll reformat it later with busybox later anyway.
To partition the internal (or external) SD card, connect your data cable to your phone. When the USB connection notification came up, activate the USB storage mode. You don't need to install the Huawei S7 (or adb) drivers.
Fire up your partitioning application, and identify your storage. Delete (or) resize the existing FAT partition. Create another primary partition afterwards, with ext2 filesystem. ext3 and ext4 isn't supported in the stock ROM, so you probably have to either install a kernel module for the ext3,4 or replace your boot.img. Hey but that's not going to be a stock ROM
2) Root the device
---------
Install Gingerbreak from the market. Enable USB debugging in Settings -> Application -> Development, or else it won't work. Run Gingerbreak, root your device! The device will restart after successful process, and you are ready to modify your root filesystem.
3) Prepare the required tools
---------
You'll optionally need busybox to format and edit the files. Copy over the busybox binary file to /system/xbin/. The terminal login path would automatically points there so you can run busybox from anywhere inside the terminal.
4) Prepare the new data directory
---------
Fire up your terminal emulator. You'll need to be logged in as root to do the whole operation mentioned. Thus, type in:
Code:
su
Mount the new partition you've prepared on step (1). For internal SD, it's going to be /dev/block/mmcblk0p2 device, or for external SD, /dev/block/mmcblk1p2. You can also use other shorthand such as /dev/block/vold/179:2. But for simplicity, I'll use mmcblk*p* throughout the tutorial.
Prepare the mount point for your prepared data partition, and mount it. If it's currently mounted, unmount it first.
Code:
umount /dev/block/mmcblk0p2
mkdir /system/sd
You can also format the partition now if you didn't specify the partition type during the partition creation.
Code:
busybox mke2fs -m0 -b4096 /dev/block/mmcblk0p2
Now mount the extended data partition.
Code:
mount -t ext2 /dev/block/mmcblk0p2 /system/sd
We'll still need to be able to access the original data partition now and later, so, prepare the mount point and mount it as well.
Code:
mkdir /system/internal
mount -t yaffs2 /dev/block/mtdblock4 /system/internal
At this stage, you'll need to copy over all files inside the original /data directory to your new sd directory. You'll also need to make sure that the permissions isn't changed during the process. To do this, just tar the entire original data directory to your new one.
Code:
cd /system/internal
busybox tar -cvf /system/sd/old-data.tar *
cd /system/sd
busybox tar -xvf old-data.tar
busybox rm old-data.tar
The initialization for the new data directory mounting in the boot process does not modifies the boot image's init.rc. Thus, it seems that the initialization process is called after the radio initialization. I can't get my GSM to work without this step. We'll need to symbolic-link back the /system/sd/radio directory to the original internal storage /data/radio directory. And remember that on the boot process, we'll need to mount /system/internal *before* /system/sd.
Code:
cd /system/sd
busybox rm -rf radio
ln -s /system/internal/radio /system/sd/radio
After fiddling for several hours, I realized that the date and time settings gets reset on each boot. Fixed by symlinking the /data/date.time back to the internal storage.
Code:
cd /system/sd
busybox rm -rf date.time
ln -s /system/internal/date.time /system/sd/date.time
5) Prepare the boot init script
---------
The Froyo boot process runs init.rc script, which is replaced by the boot.img when system boots. So we can't put our new /data directory mount commands there, unless we extract, unpack, modify, repack the boot.img. Ok so I decided that modifying boot.img will be the last step if I can't get it working without it. There must be an easier way!
Also, there aren't any rc.d, rc3.d, bla bla directory in which we can put our custom initialization script.
Luckily, there is a script that is called from the init.rc script during boot, which is stored on the root filesystem and can be customized. It's called /system/etc/install-recovery.sh. Thus, we'll put the initialization script there. If you already got a /system/etc/install-recovery.sh, you can just add our initialization script in the beginning of the. Alternatively, you can create a separate script to perform init, and call it from your modified /system/etc/install-recovery.sh.
There will be drawback, for example, it seems that the script is called after radio initialization, so we'll need to use the old /data/radio directory from the original /data directory, prepared on step (4).
So now you'll need to create (or copy) the install-recovery.sh script. You can use vi from the busybox, or easier is to just copy and paste the install-recovery.sh script provided in this post. In case you're a vi expert, fire up these commands. Don't forget to remount the root filesystem as rw first!
Code:
busybox vi /system/etc/install-recovery.sh
Write in the install-recovery.sh script:
Code:
#!/system/bin/sh
mount -t yaffs2 /dev/block/mtdblock4 /system/internal
mount -t ext2 /dev/block/mmcblk0p2 /system/sd
mount -o bind /system/sd /data
Don't forget to set executable and readable attribute at least for root user, or else the system can't run the script!
Code:
chmod 755 /system/etc/install-recovery.sh
So now you're ready to reboot the system. Double check the install-recovery.sh script, make sure all commands mounts the partition exactly to where you intend it.
6) Reboot your Ideos S7!
---------
Reboot and enjoy the trendemous increase on your internal tablet storage
WARNING!!! Do not attempt to perform factory data reset while running with /data mounted. It seems that S7 will format the /data partition as yaffs2, not sure as I haven't checked it. But it worth to try to change the install-recovery.sh script to mount the data partition as yaffs2, and then performing factory data reset.
Sorry I can't post either an image or attachment yet
watch_mania said:
Sorry I can't post either an image or attachment yet
Click to expand...
Click to collapse
Btw, if someone with account capable of posting images and files would like to help, I can send the image links and files to your e-mail, so you can post it here
Should've post the title with [HOWTO] prefix. Sorry about the newbie-ish thing
Hey, sure i can post them! I've set up a site for the "Install GNU/Linux" anyway. I'll be looking to follow this howto sometime in the future. Tell ya what tho, i'd have saved 10+ hours hacking had i known gingerbreak was in market also!
threader said:
Hey, sure i can post them! I've set up a site for the "Install GNU/Linux" anyway. I'll be looking to follow this howto sometime in the future. Tell ya what tho, i'd have saved 10+ hours hacking had i known gingerbreak was in market also!
Click to expand...
Click to collapse
Unfortunately I don't own the Ideos anymore
Good luck on your site!
can you make a simple tutorial to us? i need it badly.
Could you help me.... do I have to label the drives as "mmcblk..." because it's not recognizing the directory
---------- Post added at 12:22 PM ---------- Previous post was at 12:21 PM ----------
I'm stuck after entering su in the emulator...please help
Nice guide
work perfectly on S7 slim
i do all the steps using sshdroid and putty so i can use cut&paste from web page
the only think that i've to add is mount syster as readwrite:
mount -o rw,remount -t yaffs2 /dev/block/XXXXXXX /system
Thanks for this guide i will do the same on all my device
i'm triing to increase internal memory on stock rom.
I successfully done on S7 slim (i found i guide writen by watch_mania) but on Vodafone Smart i've some trouble (i use sshdroid and putty).
I do the following step :
1) Partiton the external SD with two filesystem the the first one FAT32 the second one ext2
this is the output of fdisk :
/system/sd # fdisk -l /dev/block/mmcblk0 Disk /dev/block/mmcblk0: 7969 MB, 7969177600 bytes
255 heads, 63 sectors/track, 968 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 509 4088511 83 Linux
/dev/block/mmcblk0p2 510 968 3686917+ b Win95 FAT32
2) mount system as read-write and create new mount point
mount -o rw,remount -t yaffs2 /dev/block/mtdblock4 /system
mkdir /system/sd
mkdir /system/internal
3) format ext2 partition created at 1)
mke2fs -m0 -b4096 /dev/block/mmcblk0p1
4) mounting the "original" /data on /system/internal and new ext2 partition on /system/sd
mount -t yaffs2 /dev/block/mtdblock6 /system/internal
mount -t ext2 /dev/block/mmcblk0p1 /system/sd
5) copy the content on "original" /data on /system/sd
cd /system/internal
tar -cvf /system/sd/old-data.tar *
cd /system/sd
tar -xvf old-data.tar
rm old-data.tar
6) create boot init script
vi /system/etc/install-recovery.sh
and write inside :
#!/system/bin/sh
mount -t yaffs2 /dev/block/mtdblock6 /system/internal
mount -t ext2 /dev/block/mmcblk0p1 /system/sd
mount -o bind /system/sd /data
Originally in the guide for S7 slim you have to do :
cd /system/sd
rm -rf radio
ln -s /system/internal/radio /system/sd/radio cd /system/sd
rm -rf date.time
ln -s /system/internal/date.time /system/sd/date.time
BUT if i try to do that the device does not recognize the sim.
If i try to don't do that the device loop during boot.
on S7 Slim in /system/internal/radio i found this file :
srwxrwxrwx 1 0 0 2048 Dec 31 06:49 qmux_connect_socket
the same file on vodafone smart is located in /system/internal/local/tmp/
but if i try to link it does not work and the device loop.
Will this also work on altek A14 LEO(an Android 2.1 phone)? It has less than 100MB internal storage, although it built-in dtapps2sd with the newest stock firmware, "/data/data" is still stored in internal storage. Because the version of dtapps2sd in stock firmware is not latest version, no "/data/data" mount on SD-EXT support. And I can't upgrade dtapps2sd myself due to no reflash tool for this phone.
Thank for the niec post, i,ll try it shortly
Increasing Internal Memory
Hi,
Has anyone tried a superb "setinstalllocation-xxx.apk" available in xda-developers.
I have been using it and it is really good. But as mentioned by watch-mania that 139 or 140 MB of available storage is a pity.
Your device must be rooted to use the above apk. You can successfully use gingerbreak available from this excellent forum.
more info
watch_mania said:
Hi all, originally intending to post this tutorial to Ideos S7 Android Development but got a nice greeting from xda-developers.com unallowing newbies to post there
So I just got a brand-new-in-a-box, dead cheap, Ideos S7 tablet -- my first android tablet, and my second android device. I brought my last device about 2 years ago, a G1 that I only kept for a week and sold it afterwards. I was thinking that at that time Android isn't ready yet for replacing my E71.
Back to the Ideos S7, mine is already preloaded with TRZ-mod-0.2 ROM, which is nice. However, I had some issue with wireless network. Whenever I disable my wifi, I would ge trouble activating it as it constantly disabled by itself. Thus, I decided to go back to available stock ROM. Long story short, I've chosen the Froyo 2.2.2 Sweden coded S7V100R001C63B110, and made myself comfortable with repeating Huawei's flashing process.
The firmware seems more stable, and does not have the wireless network activation/deactivation issue. Stock ROM lover anyone
However, the stock ROM doesn't have apps2d+ or whatever that was called, to extend the internal storage. 137MB of free space is really pity for such device. I couldn't run Data2Ext* script successfully, as the default shell /system/bin/sh doesn't seems to support square brackets on scripts conditional parts. Busybox 1.18 supports it, but somehow it would cause all the commands executed in the script to ran by Busybox, causing "applet not found" errors. The other option would be Link2SD, which could probably saved me 10+ hours of hacking. It had its drawback though, the current version on the market expects the extended internal tablet storage partition to reside on the external SD card. Some hacking to mount the internal SD partition works, but not sure whether it would got correctly mounted on boot.
Also, the most important thing: nothing feels better than looking at "Available space" on "Internal tablet storage" of 5.5GB
So here it is, the tutorial for extending the internal storage. Most of the information used are gathered from various sources, and rewritten here for your enjoyment!
REQUIREMENTS:
=========
a) All hardware: Ideos S7 -- should work on Slim as well, data cable, charger, a living being..
b) Rooting -- I've used Gingerbreak from the market
c) Terminal Emulator -- Android Terminal Emulator works fine. Irritating blue background though.
d) Busybox -- 1.18 version is working fine
e) Root explorer -- Optionally used, for easier file editing and copying.
STEPS:
=========
0) Backup your data, as all data in internal storage will be lost!
---------
Well honestly I didn't do this as I got my contacts and mail synced on the internet. My S7 only got 5 days of lifetime so not much data there yet. Sorry no guide on how to do this
1) Partition the internal SD (or external SD card if you intend to do so).
---------
It is recommended to use a good class of memory card when using external SD card for the tablet storage partition.
There's possibly partitioning tools available for the architecture, but I did it with EASUS Partition Master on a Windows system. Mac OS's Disk Utiliy should work as well. Don't worry too much about the partition type, we'll reformat it later with busybox later anyway.
To partition the internal (or external) SD card, connect your data cable to your phone. When the USB connection notification came up, activate the USB storage mode. You don't need to install the Huawei S7 (or adb) drivers.
Fire up your partitioning application, and identify your storage. Delete (or) resize the existing FAT partition. Create another primary partition afterwards, with ext2 filesystem. ext3 and ext4 isn't supported in the stock ROM, so you probably have to either install a kernel module for the ext3,4 or replace your boot.img. Hey but that's not going to be a stock ROM
2) Root the device
---------
Install Gingerbreak from the market. Enable USB debugging in Settings -> Application -> Development, or else it won't work. Run Gingerbreak, root your device! The device will restart after successful process, and you are ready to modify your root filesystem.
3) Prepare the required tools
---------
You'll optionally need busybox to format and edit the files. Copy over the busybox binary file to /system/xbin/. The terminal login path would automatically points there so you can run busybox from anywhere inside the terminal.
4) Prepare the new data directory
---------
Fire up your terminal emulator. You'll need to be logged in as root to do the whole operation mentioned. Thus, type in:
Code:
su
Mount the new partition you've prepared on step (1). For internal SD, it's going to be /dev/block/mmcblk0p2 device, or for external SD, /dev/block/mmcblk1p2. You can also use other shorthand such as /dev/block/vold/179:2. But for simplicity, I'll use mmcblk*p* throughout the tutorial.
Prepare the mount point for your prepared data partition, and mount it. If it's currently mounted, unmount it first.
Code:
umount /dev/block/mmcblk0p2
mkdir /system/sd
You can also format the partition now if you didn't specify the partition type during the partition creation.
Code:
busybox mke2fs -m0 -b4096 /dev/block/mmcblk0p2
Now mount the extended data partition.
Code:
mount -t ext2 /dev/block/mmcblk0p2 /system/sd
We'll still need to be able to access the original data partition now and later, so, prepare the mount point and mount it as well.
Code:
mkdir /system/internal
mount -t yaffs2 /dev/block/mtdblock4 /system/internal
At this stage, you'll need to copy over all files inside the original /data directory to your new sd directory. You'll also need to make sure that the permissions isn't changed during the process. To do this, just tar the entire original data directory to your new one.
Code:
cd /system/internal
busybox tar -cvf /system/sd/old-data.tar *
cd /system/sd
busybox tar -xvf old-data.tar
busybox rm old-data.tar
The initialization for the new data directory mounting in the boot process does not modifies the boot image's init.rc. Thus, it seems that the initialization process is called after the radio initialization. I can't get my GSM to work without this step. We'll need to symbolic-link back the /system/sd/radio directory to the original internal storage /data/radio directory. And remember that on the boot process, we'll need to mount /system/internal *before* /system/sd.
Code:
cd /system/sd
busybox rm -rf radio
ln -s /system/internal/radio /system/sd/radio
After fiddling for several hours, I realized that the date and time settings gets reset on each boot. Fixed by symlinking the /data/date.time back to the internal storage.
Code:
cd /system/sd
busybox rm -rf date.time
ln -s /system/internal/date.time /system/sd/date.time
5) Prepare the boot init script
---------
The Froyo boot process runs init.rc script, which is replaced by the boot.img when system boots. So we can't put our new /data directory mount commands there, unless we extract, unpack, modify, repack the boot.img. Ok so I decided that modifying boot.img will be the last step if I can't get it working without it. There must be an easier way!
Also, there aren't any rc.d, rc3.d, bla bla directory in which we can put our custom initialization script.
Luckily, there is a script that is called from the init.rc script during boot, which is stored on the root filesystem and can be customized. It's called /system/etc/install-recovery.sh. Thus, we'll put the initialization script there. If you already got a /system/etc/install-recovery.sh, you can just add our initialization script in the beginning of the. Alternatively, you can create a separate script to perform init, and call it from your modified /system/etc/install-recovery.sh.
There will be drawback, for example, it seems that the script is called after radio initialization, so we'll need to use the old /data/radio directory from the original /data directory, prepared on step (4).
So now you'll need to create (or copy) the install-recovery.sh script. You can use vi from the busybox, or easier is to just copy and paste the install-recovery.sh script provided in this post. In case you're a vi expert, fire up these commands. Don't forget to remount the root filesystem as rw first!
Code:
busybox vi /system/etc/install-recovery.sh
Write in the install-recovery.sh script:
Code:
#!/system/bin/sh
mount -t yaffs2 /dev/block/mtdblock4 /system/internal
mount -t ext2 /dev/block/mmcblk0p2 /system/sd
mount -o bind /system/sd /data
Don't forget to set executable and readable attribute at least for root user, or else the system can't run the script!
Code:
chmod 755 /system/etc/install-recovery.sh
So now you're ready to reboot the system. Double check the install-recovery.sh script, make sure all commands mounts the partition exactly to where you intend it.
6) Reboot your Ideos S7!
---------
Reboot and enjoy the trendemous increase on your internal tablet storage
WARNING!!! Do not attempt to perform factory data reset while running with /data mounted. It seems that S7 will format the /data partition as yaffs2, not sure as I haven't checked it. But it worth to try to change the install-recovery.sh script to mount the data partition as yaffs2, and then performing factory data reset.
Sorry I can't post either an image or attachment yet
Click to expand...
Click to collapse
can you make a video about how increase the internal memory? i trying but at final step after restart my ideos nothing happens, or screenshots, please i have 4 for weeks looking for a solution about the low memory on my ideos, i install joenilan rom but dont like me the launcher, please and sorry for my bad english.
This is one good tutorial that I missed
Sent from my Ideos S7 using XDA App
HELP
Hi, i followed the steps, and my ideos keep looping at the ideos start screen
is there anything i can do?
zonyman said:
Hi, i followed the steps, and my ideos keep looping at the ideos start screen
is there anything i can do?
Click to expand...
Click to collapse
Reflash with new program,search it ..
My way !
My device : Huawei S7-105
Another way to increse internal memory :
1 flash with stock rom 2.2.2 norvegian
2 flash trizetmod v3
3 with MiniTool Partition Wizard Home Edition i've made 3 partitions on internal memory ( s7-105 using mass storage options )
- 1.2 Gb fat32
- 6 Gb ext4
- 157 Mb swap linux partition
This was one of many attempts to increase memory , and at the end i was happy with that result ! I think that you can make your own partitions , as you wish ! I have seen many movies on youtube .
Most important thing to remember : first you create fat32 partition and make it primary , second is ext4 partition also primary and the last swap partition !
After you create the partitions , reboot in recovery and make a factory reset , and your S7 has 6Gb program memory !!!!!!
Another important thing : I am a newbie in " Android world " , so I do not know how correct is what I did but one thing is certain : I HAVE 5.28 Gb and I got rid of that annoying message LOW MEMORY !!!!!!
I hope I posted in the right place , so i ask an admin to check ! Thx
in summary of this post..
all you have to do is to backup ur current rom via cwm by goodane..
make a 2nd primary partition formatted ext2/ext4 (for ext2 supports 2GB or less.. ext4 for 2GB or higher)
flash trizet's v3 rom
-THE END :good:
Hello guys!
I have a Huawei Ideos S7 Slim too,
Specifications
- Model: Huawei Ideos S7 Slim
- Version: 202u
- Intermal memory: 160 mb
I'm trying to do the steps to increase the internal memory
I don't getting success with the process
I wonder if the process works with the model Huawei Ideos S7 Slim 202u
Thank you
Can I change the mount point of the External SD card (microsd) from
/mnt/external_sd
to
/mnt/sdcard/MicroSD
I tried changing the entry in vold.fstab to no help. it wasn't mounted to /mnt/external_sd but it also wasn't mounted to the MicroSD folder i made on /mnt/sdcard
This would let any program that doesn't have the ability to handle the external SD card to be able to access it as it wouldn't know where it was. I could then do this to USB drives plugged in as well.
Nova5 said:
Can I change the mount point of the External SD card (microsd) from
/mnt/external_sd
to
/mnt/sdcard/MicroSD
I tried changing the entry in vold.fstab to no help. it wasn't mounted to /mnt/external_sd but it also wasn't mounted to the MicroSD folder i made on /mnt/sdcard
This would let any program that doesn't have the ability to handle the external SD card to be able to access it as it wouldn't know where it was. I could then do this to USB drives plugged in as well.
Click to expand...
Click to collapse
This might not exactly be the route you wanna take, but have you tried adding a symlink? Might do the trick, then again, I'm having a little issue with the same thing right now. Looks like this has been a popular subject lately
symlinks seem to be inoperable in HC.
Found this on another forum
Have you tried "bind" mounting?
Doesn't wok for me as I have a stock (unrooted) transformer...
cd /mnt/sdcard
mkdir MicroSD
mount -o bind /mnt/external_sd /mnt/sdcard/MicroSD
Click to expand...
Click to collapse
Works fairly well. Doesn't effect the storage count for the internal memory however. if we could actually mount it to a folder inside the scdard mount then it may show up as extra space, but i kinda doubt that bit.
Those system files are overwritten on each reboot so you have to "mount -o bind" on every reboot.
If you find a way to make this mount point permanent let me know, I am looking for a way as well.
If you're rooted, I think USB Mount All did this.
powercat_ said:
Those system files are overwritten on each reboot so you have to "mount -o bind" on every reboot.
If you find a way to make this mount point permanent let me know, I am looking for a way as well.
Click to expand...
Click to collapse
What system files? Its simply a mount point created and handled in memory. its never added to a file. I forget what the start up command file is in linux that is the sister of DOSs Autoexec.bat. It would need to be added to that as the last command. Now i have read this is a risky command to run as it can create a endless loop if something attempts to scan the directories it can run into a recursive loop. Now I believe this is because most instances of this command tend to be used to bring a directory onto the desktop thats a few steps above it. Considering that the way I am using it is to link a directory that is outside the scope of another, it shouldn't ever cause this and be a pretty safe way to do it. The BIND command creates a hard link between the two locations. the /mnt/sdcard/MicroSD is a directory I created. when I bind it to the /mnt/external_sd directory the files appear in both places at the same time as MicroSD is simply a... tunnel as it were into External SD. But the programs are convinced its MicroSD. So those that can't use the external sd slot now can through this "tunnel". The same trick can also be applied to the directory for the USB thumb/flash drives.
Just create a directory for it on /mnt/sdcard
fermunky said:
If you're rooted, I think USB Mount All did this.
Click to expand...
Click to collapse
why pay when you can enter a command and its done?
Yes, mount -o bind works, but if you reboot, the mount point is no longer there.
Sure, we can add an entry to fstab, but the file is overwritten by a reboot
the autostart file is init.rc, which is overwritten by a reboot as well, so that rules out using it to auto mount this bind.
let me know if you find other information as I would very much like this to work.
FYI I started a thread about this command a few days back but never got any pertinent information:
http://forum.xda-developers.com/showthread.php?t=1287522
(this was before 3.2 when you couldn't access the SD card from usb)
Nova5 said:
why pay when you can enter a command and its done?
Click to expand...
Click to collapse
Because it is only a few bucks, and it will do it for you without having to manually do it. I know it's quite a simple task, but I say best out of sight/out of mind.
its overwrites those huh? that bites..
fermunky said:
Because it is only a few bucks, and it will do it for you without having to manually do it. I know it's quite a simple task, but I say best out of sight/out of mind.
Click to expand...
Click to collapse
Just takes a bit to track where we can stick the commands to get an auto start. I may make a simple script file to leave on the home screens. tap and done.
Okay it seems the location where the init.rc is stored is volatile. I created a test file in there and rebooted the tablet, file is gone. So its less overwriting and simply copying out of its hidden location to a usable one. sdcard in there is just a mount point for the actual hardware address location of the sdcard. So if we want to get the autostart we would have to discover where HC pulls that data from on boot.
Bind will fail if the location that actually holds the data is not present/ready. usb_storage is more affected by this as a user doesn't normally leave a flash drive in the port. Script manager can auto-execute a script on boot. Works well enough.
hmm...
It appears if you remove the usb drive after making the bind, the bind is broken. So while its workable, its not perfect. Of course since the microsd card is rarley removed, this isn't much of an issue. If we could get the script to also run on insertion of the USB drive that would then make it work better.
SCript Manager allows one to create a direct shortcut to execute a specific script. So you can swap USB drives, tap the script icon and then access the script through the bound directory.
I use the following program created by RubberBigPepper from an alternative russian site about android apps and devices.
Any interesting effect I've noticed, any time the script runs it creates a new mount entry for the bind command, even if that bind already exists. OfficePro5 shows this by listing MicroSD for each bind entry. So I had 13 entries of MicroSD as it ran that many times, due to a setting I shouldn't have checked... Run on Net Change. But it pointed out this interesting effect.
I now see the need for this as one of my apps does not natively see the ext sd card.
OK I tried the apk above and it does not seem to work. I get a folder called ex_sdcard but it is empty and does not reflect the sd card contents.
Nova, you found another way yet you could share, or do I just need to manually create symlinks after every boot?
mountmicrosd.sh
Code:
# Note : Super user required. Your Tablet MUST be rooted!
# Removing the card will disrupt the bind. And Require running script again when plugged back in.
echo Breaks any existing Bind mount to avoid creating duplicate Bind entries. a "failed" response is acceptable as is no response.
umount /mnt/sdcard/MicroSD
echo execute Micro SD mount - card must be plugged in or Invalid Argument error will occur.
mount -o bind /mnt/external_sd /mnt/sdcard/MicroSD
Place the above in a text file with the extension .sh Download from the Market a program called Script Manager. Place the sh file in your SD card root. Run script manager, select that file and check two boxes. Run on Boot, Run as Root. Also create the directory of "MicroSD" Just as its typed. Linux is very caps sensitive. now every time you boot it will automatically run the script and bind the ExSD to the MicroSD directory.
This one will do the USB drive.
mountusb.sh
Code:
# Note : Super user required. Your Tablet MUST be rooted!
# Removing the drive will disrupt the bind. And Require running script again when plugged back in.
echo Breaks any existing Bind mount to avoid creating duplicate Bind entries. a "failed" response is acceptable as is no response.
umount /mnt/sdcard/USBDrive
echo execute USB Drive mount - drive must be plugged in or Invalid Argument error will occur.
mount -o bind /mnt/usb_storage /mnt/sdcard/USBDrive
Create a widget with ScriptManager to have a touchable icon on your screen to run this one. Note it must have the folder "USBDrive" created on the sdcard.
It is unimportant if you use the same filename.sh i did. That is just so I knew at a glance what it does. # is a comment and Echo prints the text following it to the screen. I found a way around the mutiple bind entries by simply unmounting it before making the mount bind. You might see a Failed error, this is just fine. it just means there was no mount for it to undo on its first run. this will be more helpful on the USB drive script than the MicroSD card one.
Very cool, Nova5!
Thanks for taking the time to research it further.
I tested your solution and it works fine!
I updated it with a fix to prevent the multiple entries. You'll need to update your files to reflect the changes I made. a reboot will be the simplest way to ensure it starts with a clean slate. Notice I removed the comment about Running it once only, due to the umount command preceeding the mount command. This removes the bind from memory and then when its created again you don't have the problem of 13 entries of MicroSD in OfficePro like I ran into.
Alright, I think its as good it is going to get. You could put them in the same files but for simplicity and being able to swap USB drives without affecting the ExSD card two files is best.
Wait... debug time. I goofed something.
Okay fixed up and working right. Remember what I mentioned about linux and capitals? oops. Echo is not echo.
Shucks, im not rooted.
Okay, I've literally been working on this for the last 2 days, tried everything I've found so far, and the most progress I've made was (somehow) making both sdcard and extsdcard show the same storage mount, but I have no clue what change made that occur for one reboot. So far, I've tried the following:
vold.fstab editing
build.prop editing
FolderMount (desparate...)
I've even tried the debuggerd script I found in this other forum, and yes I edited the script to point to the correct vold blocks (in my case they're 179:96 and 179:97 for the internal and external storage, respectively)
While I'm not against using a fully custom rom for these tablets (I have two), the dilemma is that my 4-year-old sons use them, so the KidsMode needs to function properly. They've run out of storage space on these due to three FREAKING HUGE games they absolutely insist on keeping on the tablets at all times, and apps like GL to SD need to be run and remounted on every reboot, so it isn't a suitable solution...
Best case, I would love a boot.img swap so it'll be zero-maintenance. I've been searching and so far I haven't turned up anything I can use... I'm a long-time "power user" with several devices running custom kernels, various builds of CM, and even a modded version of CM12 on my tablet I compiled myself. I'm not a beginner, but I'm definitely out of my league on this one.. Any assistance will be appreciated.
UPDATE
I'ne partially succeeded. I've figured out how to remount /sdcard to the external sd card, but it's not a perfect redirect. It shows in file managers, but not in the Settings under Storage, and the free space shown in Application Manager is blank (crashes in a few seconds), or it continues to show the real internal sd card info. I used the following single command in the debuggerd.mnt file:
Code:
mount -t vfat -o rw /dev/block/vold/179:97 /storage/sdcard0
no luck
No luck with the swap... The only option I believe I have at this point is to either install a custom rom (but I haven't found a single one...), or I need to pull the boot.img to edit it. So far I've not been able to find the boot partition, and the "by-name" list doesn't mention anything related to "boot"
My last thought is to try to extract it from a stock firmware. Is that possible? I don't have linux running, and all boot devices are disabled on my work laptop so a live distro isn't an option...
Any help or opinions will be greatly appreciated...