[TUTORIAL] A BETTER Ubuntu on Android method - Android Software Development

As many of you have probably heard, you can load Ubuntu along side your Android OS. This has been confirmed on many devices, including N1, Desire, and Incredible. Here is the nexusonehacks post describing how to do it.
But I have found a better way to do it. Normally you mount ubuntu.img as a loopback and run from that. The problem with this is that is has very limited space (250mb or so) as you cannot exceed the size of the .img.
My method is to extract the contents of the .img and run it directly from the sdcard's filesystem.
Please be aware that if you use ClockworkMod Recovery, it will try to backup our new EXT2 partition! It thinks its an app-to-sd partition! I've yet to figure a way around this. Do not follow this tutorial if you make nandroids!
Requirements
- ubuntu.img (must be an ARM port)
- A Linux distro so you can 'cp' to your sdcard
- You will have to make a second partition on sdcard, ext2 type
- Patience and experience. This guide assumes you already know the basics of how to work with Linux
Step 1 Create the partition on sdcard
- Open your Linux distro and insert your sdcard (or enable disk drive on phone)
- Start GParted (or similar) and create an ext2 partition on your card. The partition should be as big as ubuntu.img. I recommend atleast 25% bigger so you have room to install packages and whatnot. FAT32 or NTFS will not work here!
Step 2 Mount ubuntu.img
- Mount ubuntu.img with the following commands (on the Linux distro, not phone):
Code:
sudo su
mkdir /mnt
mkdir /mnt/ubuntu
cd [B]/path/to/ubuntu/image[/B] **IMPORTANT!
mount -t ext2 -o loop ubuntu.img /mnt/ubuntu
Step 3 Copy contents of ubuntu.img to sdcard
- Make sure your new ext2 partition is mounted. We will assume its at /media/ext2sd
- Copy the contents. This will take a very long time depending on speed of card. Mine took roughly 70 minutes
Code:
cp -dRP --preserve=all /mnt/ubuntu/* /media/ext2sd/
Step 4 Update bootubuntu script
Here is a rundown of the modified script:
- Mount root as r/w
- Ensure /mnt/sdcard2 exists
- Mount the second sdcard partition
- Everything else, including chrooting to start Ubuntu! I use 'nice' to lower the priority of chroot so it won't make phone sluggish. Change this if you want.
Download the script
Step 5 Get Ubuntu running
- From here out its the same as any other tutorial. do a 'sh ubuntu.sh' to copy files to phone, then 'bootubuntu' to start it. Hopefully everything goes good for you! You now have much more room to do things!

Reserved..

Is it possible to use ext3/4 and would there be any performance gains?

ext3/ext4 use journaling. Unless you know for sure that your sdcard does wear-leveling, I would not advise using these as they may degrade the life of your card quickly. Another option would be to specifically make the partition without these options, but there is little to no performance gain as sdcards are already slow.

Related

(Q) A2SD: anyone interested in helping get a2sd to work.

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.

[HOWTO] Ideos S7 Froyo Android internal storage increase on stock ROM

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

Format & Use MicroSD W/ ext4?

Hey guys, for a couple reasons I'd like to be able to format my micro SD card with the ext4 file system.
I can format my card using a computer running Ubuntu, but the card will not mount.
I'm running CM10 on my P3113.
Is there any simple way to do this?
It seems like it'd be best to use vold to mount the sdcard, but that doesn't support ext4 I guess?
Just wondering...
Ext4 support has to come from kernel.
???
Literally every other mounted filesystem on the CM10 ROM I use is ext4...
I'm gonna try mounting via an init.d script.
We'll see if that works...
Solved this one, it was easier than I expected.
You need to format the card, and then mount it at boot via a script.
CM9 and 10 support init.d scripts, so I have a script file at /system/etc/init.d/95sdcardext4
with this contents:
Code:
#!/system/xbin/sh
# Mount SD Card Ext4 Script
mount -rw -t ext4 /dev/block/mmcblk1p1 /storage/sdcard1
This runs very early in the boot up process, and ext4 partitions mount basically instantly, so everything is working as expected so far.
More tests need to be done, but I'm fairly certain I can package this up in a flashable ZIP package.
Brilliant !
ext4 is anyways far better than fat32 except Windows/Mac compatibility.
Awaiting your stable work
It will work on a s5670 running cm10 jb4.1.1?
I just have to create a file with that lines and put it in /system/etc/init.d/95sdcardext4 ?????????
I cannot get link2sd to mount the ext4 partition.
Thx
DivinityCycle said:
Solved this one, it was easier than I expected.
You need to format the card, and then mount it at boot via a script.
CM9 and 10 support init.d scripts, so I have a script file at /system/etc/init.d/95sdcardext4
with this contents:
Code:
#!/system/xbin/sh
# Mount SD Card Ext4 Script
mount -rw -t ext4 /dev/block/mmcblk1p1 /storage/sdcard1
This runs very early in the boot up process, and ext4 partitions mount basically instantly, so everything is working as expected so far.
More tests need to be done, but I'm fairly certain I can package this up in a flashable ZIP package.
Click to expand...
Click to collapse
Sorry about that, I don't have one of these anymore. I had a P3113, but switched to a T869, which is a very similar device but has 4G and some different stuff going on under the hood.
My brief ext4 experiment was honestly not that big of a deal. I ended up going back to FAT32 because the benefits didn't outweigh the annoyances.
The biggest issue I had was I couldn't figure out how to make the file system permissions behave in the same highly permissive way that FAT32 does. I ran into several force closes and other things that resulted from apps not being to read / write stuff on the card that they should have been able to. I know you can CHMOD stuff, and a boot script could chmod everything on the card, but that seems like a bandaid.
Maybe there's a way to make the permissions behave a specific way via the mount parameters? I didn't investigate deeply enough because my life got busy, and during the changeover to the new tab it was just easier to go back to FAT32. Also my new tab has 16GB of internal storage, so I've been much less stressed about storage.
Ok folks.. ...reviving an ancient thread....from good ol days when it 'KISS' was common for Android.
What about android 7+ onward . All this stuff is deprecated. My 128gb is cut into 3 Ext4's.
(I need a journaled FS - that story a lil later )
I can mount easily but problem is apps cant see it and its all got to do with mount space concept.
I am Su'ed via Magisk
Can someone post a step by step guide to mount ext4 on 7+

howto: mount external sdcard as sdcard0

So, the Note 8.0 is a nice, fast, expensive device that had a big shortcoming for me: as shipped, the SD card is not useful as a place where application data easily lands - it's only intended for storing music and video files, or those chunks of data you manually target to it.
I fixed it, after a fashion, by mounting the card at boot time as sdcard0, which Samsung normally assigns to the (very limited) internal storage. The internal /data/media pool is treated as the external sdcard and very little installation data defaults to it. Apps2SD is still broken, but quite a lot of things simply default to using /sdcard0 as their preferred storage, which I find helpful.
You have to mount it at start time (init.d), and you have to mount it correctly (bind)
I figured out and set my device up this way by setting init.d scripts I learned about from threads by Ryuinferno (init.d) and mattiadj (rebinding in the Note 2) for this. Translation: none of this is my work, I just sounded out how others had done it and am assembling it here, since I know it will help other Note 8 folks.
I think that the init.d script support is very interesting - there are a lot of ROM tweaks that rely on init.d. You do not need a custom kernel for init.d to work the note 8 - which is nice, since we have no custom kernel
The outcome of this mod is that with an sdcard inserted, I get:
/storage/sdcard0 29.7G 3.68G 26.0G 32768
and
/storage/extSdCard 9.87G 1.78G 8.09G 4096
If I remove the card at boot, I still have apps (installed at /data/data) and the media
pool reverts to normal:
/storage/sdcard0 9.78G 1.78G 7.99G 4096
I wrote none of the scripts I'm using and will be the first to admit that I may have set them up stupidly.
Doing this voids your warranty and gives you pimples and a moon tan. But it does mean your sd card expands your storage and I hope that if there are better ways to do any of this, folks will chime in.
tools needed:
- knowledge of ADB and working ADB
- helps if you know how Unix and windows terminate lines differently, and can get your copy of Notepad++ to help you with the script, if you're trying this from Windows
- a note 8 running the 4.1.2 software - this approach is only tested there
- Kies
- Possibly Odin as a replacement for Kies (untested)
- understanding of how to put your device into recovery mode and trigger the Samsung recovery
- the US stock firmware for your device, for use with Odin (unless waiting on 1+ gig downloads if you screw something up is ok by you - the Kies method works, slooooowly.)
- Framaroot, to root your Note 8 (see the thread by tweebee)
- Busybox installed
Steps:
Install Framaroot
Root your device
Install busybox
Easy part done.
Next, you need to be able to run init.d scripts. At first I thought this might require a custom kernel, until I ran into Ryuinferno's excellent tool for enabling init.d without a custom kernel.
the thread I learned this from is by Ryuinferno at http://forum.xda-developers.com/showthread.php?t=1933849
I used term-init.sh from an ADB command line, but the thread has an APK in it called Uni-Init.apk that I would expect to work.
What you're doing is creating an install-recovery.sh script and telling it to go read /etc/init.d and run scripts there at boot.
Next, you want to create a simple script and drop it into /etc/init.d You can do this with an adb push; if you create the file in windows, though, you need to deal with the line endings correctly. You need the script to be executable and to be owned by root.
The one I'm using is this, from Mattiadj of the Note 2 community
in this thread: http://forum.xda-developers.com/showthread.php?t=2036796:
I call the script 07mount on my device, and a copy is attached to this post.
-----------------------script starts next line
#!/system/bin/sh
#extsd2internalsd is a modification that allows to switch internal sd to external sd
#and viceversa. With this you can use default internal sd only for app storage
#and the external sd to store all apps resource and all others stuff. The resut is a very
#big increase of installable apps on gnote2 and note8
#All credits to Mattiadj of xda forum for the idea and script and to mike1986 for
#the cmw zip. xda thread url
# at http://forum.xda-developers.com/showthread.php?t=2036796:
sleep 10
mount -o remount,rw /
mount -t vfat -o umask=0000 /dev/block/vold/179:17 /storage/sdcard0
sleep 30
mount -o bind /data/media /storage/extSdCard
chmod 777 /mnt/extSdCard
sleep 10
chown 1023:1023 /storage/extSdCard
chown 1000:1000 /storage/sdcard0
------------- end script on blank line above
You need /system remounted read/write, either in your favorite file explorer or via adb shell:
#mount -o rw,remount /system
to put the file in and
#chown root:root
the script itself
Now, put a fat32 formatted card into your sdcard, and reboot. When done, you should be able to see that your data storage has been remapped.
If you ever wanted to install a Samsung update, by the way, you'd need to completely unroot the device. I think the following would probably work:
- remove the su binary
- remove superuser from /system
- remove the busybox binaries
- remove install-recovery.sh from /etc and the /etc/init.d folder
If there was someting in an update you really wanted, you might do better to start by using the Samsung firmware downloaded from samfirmware.com, set your device all the way back to a clean install, then check for the OTA - Samsung does look at modifications and blocks updates to devices with changes to /system. My device is ineligible for OTA at this time.
That said, it appears that using Kies in emergency recovery mode can be used to reset your device to an as-shipped condition (I learned this when an early experiment resulted in my device being weirdly screwed up - bootable, but the network was down for the browser, etc. DNS and ping worked from an ADB prompt, though...)
You can download a copy of the script at http://www.mediafire.com/?2wbm439vlapb6om
I'm gonna try this when I have a full afternoon off as I tend to mess things up the first time I do them. But this will be super useful if I get it working. Hopefully when people start developing custom roms they can build this script in and save us all the trouble :highfive:
Haven't tried it yet, but it sounds like a custom recovery is very, very close. Once that happens, making this into a flashable modification will be trivial.
The very active Note II development is incredibly helpful, because our hardware and software are so similar to theirs.
I know this was something that users on the other Galaxy Note 2 threads were doing, and was wondering if at some point this will be an issue with say JB 4.2.2. I recall that Apps2SD would be an issue later on and wouldn't work, but I never got to that point. For me I am really in need of a 32GB tablet and just can't compromise even with a 64GB microSD card. I don't know why this tablet isn't supporting a 128GB microSD card, that would be awesome.
Upgrading internal storage by blending in sdcard
Just to be clear - this mod does not allow app2sd style migration of apps (in /data/app) to the sdcard.
Rather, it puts /data/media on the sdcard. A lot of apps use /data/media as their default for storage, though, so it's a helpful middle ground. Also, your apps are installed whether or not the sdcard is inserted, which is helpful.
I notice that the update includes a script called
install-recovery.sh - the same script that this method is using.
I have tested replacing a backed up copy of install-recovery and also
appending the command
run-parts /system/etc/init.d/ to the new file.
Using just a script to call run-parts or the stock install-recovery.sh works just fine.
I found a much easier way of doing this.
http://forum.xda-developers.com/showthread.php?t=2276193
hi friends & master
please help me
Is there any way to transfer games and apps to the internal storage with app2sd (moving apps & games in from system Rom to SD card(internal) no memory card)?
my system rom There is almost full
1.44 GB (148 MB free)
internal 12.6 GB (5.8 GB free)
SD card 12.5 GB (5.6 GB free)
I do not need to memory card

Link2SD on Amazon Fire TV

Problem statement
The Amazon Fire TV has a limited memory sotrage of less than 5GB.
FolderMount allows for moving App data/obb to a USB device. Remaining components of the App, which sometimes are the larger part of the app, can't be transfered using
These remaining components can be 100s of MB and even above 1GB (Sine Mora is 292MB, Walking Dead is 1.14GB)
Solution
Link2SD allows for moving these components to an external SD card in the phone world. Below I'll describe how to do this on the Amazon Fire TV with a USB device.
This post heavily relies on tweaking a post by sashavasko. Major kudos to him. Up to finding his post I was not successful in mounting in a way that Link2SD could see the mount. This was due to a change in Android 4.2+ where one App's mounting isn't seen by others.
Below is a step by step guide for running this. I've posted a script for automating this here : http://forum.xda-developers.com/showpost.php?p=54601505&postcount=33
Requirements: Root, Mouse, Terminal Application
Step 0 - Preparations : Format a USB device to the Ext4 File system and install Link2SD
Ext4
Link2SD refers to parititoning your SDcard to both Ext4 and FAT, this is not required on our USB device. All we need is an Ext4 partiton we can mount for Link2SD.
I had a high end USB device I used for FolderMount. For testing, I got a 16GB Lexar Jump Drive, which got decent reviews. $8 at Staples ( even less with the right coupon. Other sizes are also cheap). Both went into my Powered USB hub.
You can also partition a single FAT32 USB device to two partitons - FAT32 and Ext4. I have verified both options. Please note that for this second option, if you already have files on your FAT32 USB device, you'd have to first copy them to a backup, as the partitioning trashes your data. You will then need to restore the backed up files to the FAT partition.
Format/Partition your USB device to Ext4 using free MiniTool Partition Wizard Home Edition on your Desktop/Laptop. Below is a nice post on this (Refer only to step 1), you can find others. Please note that this refers to an SDCard. We will be doing this on a USB device.
http://forum.xda-developers.com/showpost.php?p=37405779&postcount=1
In partitioning, please verify the partitions are created as Primary. Also, not sure is this is required, but I didn't name my partitions.
There are also linux commands to do this - I didn't investigate these.
Stick the Ext4 partitoned USB device into your Amazon Fire TV and power it up. We will need the device in for Step 2.
Link2SD
Download Link2SD from the Google Play store, or sideload it
Make the directory Link2SD requires
Code:
su
mkdir /data/sdext2
exit
Step 1 - Fix adb localhost
Follow step 1 in sashavasko's post
http://forum.xda-developers.com/showpost.php?p=45102645&postcount=1
Note1:
You will need a terminal app for this
Note2:
This step should only be run once. Running multiple times can mess the /data/misc/adb/adb_keys file as the key values will concatenate with sashavasko's method. This will cause mounting at boot not to work. If you did this or not sure if you've done this, just erase the duplicate keys from the /data/misc/adb/adb_keys file (the end of a single key is "[email protected] ). Or, better yet, if you aren't seeing any other different keys there - simply su and copy /sdcard/.android/adbkey.pub onto this file.
Step 2 - Install scripts
Follow step 2 in sashavasko's post
http://forum.xda-developers.com/showpost.php?p=45102645&postcount=1
Note 1
Look for your Ext4 partitoned device after running:
Code:
adb shell cat /proc/partitions
You should find the Ext4 device under /device/block starting with sd.
For example: My first USB device is sda1, the Ext4 partitoned one was sdb1 (sdb2 when the Lexar drive was partitoned to FAT32 and Ext4).
You should be able to recognize the devices according to their partition sizes.
Note 2
The msd2.sh file should be changed to be:
Code:
#!/system/bin/sh
mount -t ext4 [COLOR="Purple"]/dev/block/[/COLOR][COLOR="Red"]sdb1[/COLOR][COLOR="purple"] /data/sdext2 [/COLOR]&& sleep 5 && /system/bin/vold
where the sdb1 device should be replaced by the device you located in Note 1.
Step 3 - Test the script and grant su permissions
Run this (no su command required, no path to the sd.sh file is required)
Code:
sd.sh
Verify you aren't seeing any errors. You will be granting SU permissions.
Run Link2SD. Go to the menu at the top right. Select "Storage Info" - Verify Link2SD recognizes the Ext4 partiton in the third line (under SD Card 2nd Part. ).
Step 4 - Auto Mount at initialization
For this I'm using the /system/etc/install-recovery.sh script which you should already have. This script loads at boot and calls /system/etc/install-recovery-2.sh (a non existent file).
Create a file at /sdcard/install-recovery-2.sh which contains
Code:
#!/system/bin/sh
/system/xbin/sd.sh
Now move the file to its place:
Code:
su
mount -o rw,remount /system
cp /sdcard/install-recovery-2.sh /system/etc/
chmod 755 /system/etc/install-recovery-2.sh
mount -o ro,remount /system
exit
Now Reboot (Long press remote Select + Play)
Step 5 - Link2SD ready to go
Open Link2SD to verify (as you verified before) that after boot Link2SD sees the Ext4 partiton.
Start moving files using Link2SD :
Select an App
Go to "Create Link" - You will be asked which file types to move. Check them all (not the paid option if you haven't paid).
Link2SD will show "Creating Link...", then an advert (in the non payed version) and then: Application files linked and moved to SD card
Note the expected storage change in the Amazon Fire TV's "About" menu option will be seen after Rebooting.
"Remove Link" works properly
"Move to SD card" is not relevant
Final Words
Don't use this to move system apps, or system-like apps
Responsibly for running this is solely on you. I am only describing what works for me.
Works great thanks
I'd love to see a standalone app for installing this.
Sent from my SM-N900V using XDA Premium 4 mobile app
The msd2.sh file mentioned in Step2/Note2 is used to create a fake external SD Ext4 partition for Link2SD.
You can also use it to create a fake external SD FAT partition at /storage/sdcard1 for FolderMount.
FolderMount automatically recognizes this partition and suggests this as the initial path for its destination path suggestion.
In my case - sda1 is the FAT partition (For me - a USB stick fully formatted to FAT32), and sdb1 is the ext4 formatted USB stick. The same should work with a single partitioned USB stick (but different sd* device names - see original post).
The updated msd2.sh file looks like:
Code:
#!/system/bin/sh
[COLOR="DarkGreen"]mount -t vfat /dev/block/[COLOR="Red"]sda1[/COLOR] /storage/sdcard1[/COLOR] && mount -t ext4 [COLOR="Magenta"]/dev/block/[/COLOR][COLOR="Red"]sdb1[/COLOR] [COLOR="Magenta"]/data/sdext2[/COLOR] && sleep 5 && /system/bin/vold
SaltyCookie_OnLoan2FM_SVE said:
The msd2.sh file mentioned in Step2/Note2 is used to create a fake external SD Ext4 partition for Link2SD.
You can also use it to create a fake external SD FAT partition at /storage/sdcard1 for FolderMount.
FolderMount automatically recognizes this partition and suggests this as the initial path for its destination path suggestion.
In my case - sda1 is the FAT partition (For me - a USB stick fully formatted to FAT32), and sdb1 is the ext4 formatted USB stick. The same should work with a single partitioned USB stick (but different sd* device names - see original post).
The updated msd2.sh file looks like:
Code:
#!/system/bin/sh
[COLOR="DarkGreen"]mount -t vfat /dev/block/[COLOR="Red"]sda1[/COLOR] /storage/sdcard1[/COLOR] && mount -t ext4 [COLOR="Magenta"]/dev/block/[/COLOR][COLOR="Red"]sdb1[/COLOR] [COLOR="Magenta"]/data/sdext2[/COLOR] && sleep 5 && /system/bin/vold
Click to expand...
Click to collapse
The one annoying thing about this is during boot it will read the entire partition. This in turn in my case makes booting the Fire TV really slow. Lets hope I dont have to reboot much because it now takes around 2-3 minutes to boot up.
MadFlava said:
I'd love to see a standalone app for installing this.
Sent from my SM-N900V using XDA Premium 4 mobile app
Click to expand...
Click to collapse
I 2nd this. This is as close as we're gonna get to downloading Apps, ets., straight to an attached external drive but I know enough about this stuff to be somewhat intimidated by the initial instructions. Not that they're not clear, it just looks like I'd have too many avenues to brick my box.
Still...very good work OP. Thanks again.
MarkBP said:
I 2nd this. This is as close as we're gonna get to downloading Apps, ets., straight to an attached external drive but I know enough about this stuff to be somewhat intimidated by the initial instructions. Not that they're not clear, it just looks like I'd have too many avenues to brick my box.
Still...very good work OP. Thanks again.
Click to expand...
Click to collapse
Come on guys, this is XDA developers
OK, I have this brewing. Should post it by tomorrow.
awesome. how easy is it to reverse this entire process? I'd really like to know the risks before I take the plunge
I think the process can be greatly simplified. On my computer I created install-recovery-2.sh with the two lines below:
#!/system/bin/sh
mount -t vfat /dev/block/sda1 /storage/sdcard1 && mount -t ext4 /dev/block/sda2 /data/sdext2 && /system/bin/vold
Then I connected via adb to the fireTV from my computer.
Then an adb push of install-recovery-2.sh to /sdcard and then did an adb shell to the fireTV from my computer and su once there.
Copied from install-recovery-2.sh from /sdcard to /system/etc
Did a chmod 755 on the file to make it executable and then rebooted and all seems to be working well with partitions recognized.
tselling said:
I think the process can be greatly simplified. On my computer I created install-recovery-2.sh with the two lines below:
#!/system/bin/sh
mount -t vfat /dev/block/sda1 /storage/sdcard1 && mount -t ext4 /dev/block/sda2 /data/sdext2 && /system/bin/vold
Then I connected via adb to the fireTV from my computer.
Then an adb push of install-recovery-2.sh to /sdcard and then did an adb shell to the fireTV from my computer and su once there.
Copied from install-recovery-2.sh from /sdcard to /system/etc
Did a chmod 755 on the file to make it executable and then rebooted and all seems to be working well with partitions recognized.
Click to expand...
Click to collapse
Just tried this, didn't work for me (mount not detected).
- tselling, is Link2sd working with this ?
- If someone is working succesfully with Link2sd using tselling's method please report back. This is indeed a shorter route.
failed for me for tselling method
SaltyCookie_OnLoan2FM_SVE said:
Just tried this, didn't work for me (mount not detected).
- tselling, is Link2sd working with this ?
- If someone is working succesfully with Link2sd using tselling's method please report back. This is indeed a shorter route.
Click to expand...
Click to collapse
Link2sd found ok and I linked sevzero without problems. Should note that I use sda1 and sda2 for fat32 in first primary partition and ext4 on second primary pzrtition of same usb flash drive. Any other setup would need to have different script to match your drive setup.
Sent from my SAMSUNG-SGH-I497 using Tapatalk
why does this need more than 1 partition to work anyways? Is it just because the app requires it for some weird reason?
edit: also which partition needs to be the bigger one? do the sizes matter? and does stickmount need to be disabled for this to work?
desc
meadtj said:
why does this need more than 1 partition to work anyways? Is it just because the app requires it for some weird reason?
edit: also which partition needs to be the bigger one? do the sizes matter? and does stickmount need to be disabled for this to work?
Click to expand...
Click to collapse
why does this need more than 1 partition to work anyways? - Link2sd description in play store:
What you need for linking apps:
● root permission.
● a second partition on your SD card.
You should have two partitions on SD card and both should be primary.
The first FAT partition is your standard SD card storage. The second partition is used for application files and can be ext2, ext3, ext4, f2fs or FAT.
You need to use a non-FAT file system (ext2, ext3, ext4 or f2fs) on your second partition in order to link app's private data files. Because the FAT file system (FAT16, FAT32 or exFAT) does not support UNIX file ownership or permissions and will cause a security breakdown of app's private files.
Link2SD Plus can move app's private data files if you have a non-FAT partition
Click to expand...
Click to collapse
So we may be able to use FAT (haven't tried it) but we will lose some moving capabilities.
From my testing - FolderMount does work with the ext4 partiton, so I need two partitions (or 2 usb sticks).
also which partition needs to be the bigger one? - No restriction. Allocate as per your decision and experience with storage costs of apps.
do the sizes matter? - Don't believe her. It does.
Sorry. Uncalled for. Apologies. Not personal. I just had to.
and does stickmount need to be disabled for this to work? - No, it doesn't
983
tselling said:
Link2sd found ok and I linked sevzero without problems. Should note that I use sda1 and sda2 for fat32 in first primary partition and ext4 on second primary pzrtition of same usb flash drive. Any other setup would need to have different script to match your drive setup.
Click to expand...
Click to collapse
Ok, let's try and minimize this. Could it be due to tselling using a single partitioned USB drive, while I'm using two drives ?
I need a report back from someone with a single USB drive who tried tselling's simpler approach. If it failed - Maybe tselling added something along that he wasn't aware of. If it passed - Maybe that's a requirement for the simpler approach.
In other news, the script to automate this is take slightly more than I thought, due to unix-android differences (I come from a unix background). That, and the fact that we may have a simpler solution is delaying me. Oh, also had to stay late at work yesterday, Oooh and the dog ate my laptop.
What about Foldermount?
What about FolderMount for Data and OBB files? Can I still use it with Link2SD on same card?
SaltyCookie_OnLoan2FM_SVE said:
Ok, let's try and minimize this. Could it be due to tselling using a single partitioned USB drive, while I'm using two drives ?
I need a report back from someone with a single USB drive who tried tselling's simpler approach. If it failed - Maybe tselling added something along that he wasn't aware of. If it passed - Maybe that's a requirement for the simpler approach.
In other news, the script to automate this is take slightly more than I thought, due to unix-android differences (I come from a unix background). That, and the fact that we may have a simpler solution is delaying me. Oh, also had to stay late at work yesterday, Oooh and the dog ate my laptop.
Click to expand...
Click to collapse
I think it has to do with the mount points. I have the ext4 partition mounted to /data/ext2 where I think link2sd looks. I think that you could use an entire usb stick with one partition as ext4 mounted to /data/ext2 but your script would change
FROM
##############################################################################################
#!/system/bin/sh
mount -t vfat /dev/block/sda1 /storage/sdcard1 && mount -t ext4 /dev/block/sda2 /data/sdext2 && /system/bin/vold
#############################################################################################
TO
###################################################
#!/system/bin/sh
mount -t ext4 /dev/block/sda1 /data/sdext2 && /system/bin/vold
###################################################
However, I have not tried this. I may try this later today since I have a second fireTV and usb stick arriving today.
also, I am planning to use foldermount with the first fat32 partition I created, but I haven't gotten that far as I want to use the Pro version but need the play store loaded first.
OOPS, I did forget one part "mkdir /data/sdext2" (otherwise the mount fails).
tselling said:
I think it has to do with the mount points. I have the ext4 partition mounted to /data/ext2 where I think link2sd looks. I think that you could use an entire usb stick with one partition as ext4 mounted to /data/ext2 but your script would change
FROM
##############################################################################################
#!/system/bin/sh
mount -t vfat /dev/block/sda1 /storage/sdcard1 && mount -t ext4 /dev/block/sda2 /data/sdext2 && /system/bin/vold
#############################################################################################
TO
###################################################
#!/system/bin/sh
mount -t ext4 /dev/block/sda1 /data/sdext2 && /system/bin/vold
###################################################
However, I have not tried this. I may try this later today since I have a second fireTV and usb stick arriving today.
also, I am planning to use foldermount with the first fat32 partition I created, but I haven't gotten that far as I want to use the Pro version but need the play store loaded first.
Click to expand...
Click to collapse
tselling said:
OOPS, I did forget one part "mkdir /data/ext2" (otherwise the mount fails).
Click to expand...
Click to collapse
i did that too but still didnt work, maybe bc i have 3 partitions. Fat then Ext2 then NTFS
meadtj said:
i did that too but still didnt work, maybe bc i have 3 partitions. Fat then Ext2 then NTFS
Click to expand...
Click to collapse
Sorry, the directory is /data/sdext2
Your mount command is:
mount -t ext4 /dev/block/sda2 /data/sdext2 && /system/bin/vold
Also I am not 100% sure that ext2 filesystem works. ext4 works for sure.

Categories

Resources