Link2SD on Amazon Fire TV - Fire TV General

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.

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

External card as ext2?

Can I have external card mounted as ext2? I have files names not supported by fat and sync'ed with dropbox
Yes, you can but afaik there is no easy way to do this.
I formatted my sdcard to ext2 (because I wanted to put large file (image for wikipedia offline) on my sdcard).
I formatted the beginning (~30MB) of my sdcard to fat32 so that the Nook detect the sdcard and does not trigger an error and the remaining part to ext2.
Then I used a script that mount manually the ext2 partition to /sdcard on boot.
This generally works but I have sometimes a few bug in some applications, especially when I connect and disconnect my Nook to my computer...
The best solution would be to find a way so that Android can automount a ext2 partition by itself but I don't know how to do it.
Instead of using the whole card I partitioned the first 4gb as fat16 (msdos) and then set the rest to ext3. When the fat16 space runs out I'll look into making some sort of script to try to mount the second partition. At the moment with the card acts like a normal 4gb card.
is it possible to repartition the nook to be able to use the space that b&n reserves for its contents? I heard that the space for our files is just 250 mb.
user4242 said:
is it possible to repartition the nook to be able to use the space that b&n reserves for its contents? I heard that the space for our files is just 250 mb.
Click to expand...
Click to collapse
yes of course. If you're used to linux repartitioning and the dd command then it's a breeze. If you're a Windows user who've never done partitioning or disk imaging then you can easily mess up.
I'll assume the former.
It's just a case of:
boot with a noogie.img that you've written to a sdcard (root of card, not partition 1)
then plug it in
now you can see all the nook partitions like it's an external USB drive and fdisk, cfdisk, partitionmagic or whatever you want
Obviously you're gonna want to backup first because if you mess up the only way to restore would be asking one of us off this forum to break the distribution laws and send you a 2gb (or whatever it is) image.
All the details on this forum
Has someone tried editing /system/etc/vold.conf to get a ext-formated SD-Card mounted?
mali100 said:
Has someone tried editing /system/etc/vold.conf to get a ext-formated SD-Card mounted?
Click to expand...
Click to collapse
I checked, I had modified it adding a line "partition 2" in the section "volume_sdcard2" so that Android does not show the message "SD card blank or has unsupported filesystem".
But I couldn't make it mount a ext2 sdcard itself. (if you know how to do it without using another script, I'm interested)
Time to resurrect this thread.
FAT is ugly. File timestamps are in local time (whatever that means, summer? winter?).
The Nook vfat implementation has problems with caching in and out directory info on vfat
and intermittently changes all the modify timestamps by 1, 4 or 5 hours.
This can play havoc if you are trying to keep things synchronized by filetime.
I've decided to have my SD card be ext3
Our volume demon, /system/bin/vold (which is ancient) uses /system/etc/vold.conf to configure automounting.
It presumes that all volumes are vfat.
It seems from a brief look inside that it does handle ext2 and ext3 somehow.
There is also the question of getting it to automount USB drives.
The easiest solution to ext3 on the SD card is to make it non-removable.
First, delete the second section out of vold.conf that relates to the SD card.
Then edit init.rc:
Code:
mkdir /sdcard 0777 system system
...
mount ext3 /dev/block/mmcblk1p1 /sdcard nosuid nodev noatime nodiratime uid=1000,gid=1015,fmask=117,dmask=007
chown system sdcard_rw /sdcard
chmod 0770 /sdcard
If you feel like having 12 partitions on your SD card you can.
That leaves vold only handling the mounting of /media
This exists so that you can serve /media as USB Mass Storage.
You could have /media be a fixed mount by doing what you just did to the SD card.
The only hiccup there would be the Adobe Digital Editions wants to see /media as UMS.
Note: To edit init.rc, download bootutil from the signature, extract, edit and replace init.rc in uRamdisk.
Make sure that you have a backup and a recovery!
Note: All of the above changes to init.rc are wrong.
I can get it to mount in a shell, but not in init.rc
Whoops.
Oops, this thread has been forgotten.
Yes, auto-mounting ext3 SDcards has been solved.
See: http://forum.xda-developers.com/showthread.php?t=2184495

Using B&N Storage normally

One of the biggest issues I had with my nook was the 16/1GB division between content I can load and content from B&N/etc. Not being able to use that 16GB how I wanted was something I set forth to fix. Here is my solution to make this usable to non-rooted apps.
1) Root if not already rooted.
2) Make a directory inside of /data. I chose /data/usrdata.
3) remount / as RW with the command mount -o remount,rw -t rootfs rootfs / (credit to whomever wrote the nook&zergy.bat 1 click root. Sorry, it's been a long night, just let me know who and I'll edit)
4) mkdir /mnt/internal . We need somewhere to mount /data/usrdata/ and /mnt is public enough.
5) busybox mount -o bind /data/usrdata /mnt/internal. Mounts /data/usrdata to /mnt/internal.
6) For good measure, chmod 777 /mnt/internal and chmod 777 /data/usrdata.
Now, /mnt/internal should have whatever free space /data has, and should be read/write accessible from any program. A quick test with touch+terminal emulator shows new files as being created with RW permissions for all.
Alternatives: When I was initially thinking about ways to do this, my first reaction was to just open up /data to be read only to all, then have my usrdata folder be read/write all. However, I know part of android's app security model depends on some of these permissions. While I can't think of anything breaking or sensitive data being leaked, I decided against it. If anyone has any thoughts as to that scenario, I am very interested in hearing about it.
USB support: This will *not* be mountable under USB. Unfortunately you are still limited to transfering the data from a computer to the B&N internal storage or SDcard first, then moving the data internally. The problem that I see with this is similar to my understanding of the galaxy nexus situation, where the system can't unmount its /data partition and let the USB host take over. Another alternative to this could be to write an image file and mount that over usb (I've done this on my Evo, it worked so-so). Problem with that is that it really wouldn't grow/shrink with the storage. I suppose you could do some shell trickery and pipe it through gzip somehow, but that wouldn't help very much.
Let me know what you think and if you have any ways to improve this.
UPDATE: Persistance:
To make this persistant across reboots, run these commands as root:
1) mount -o rw,remount -t ext4 /dev/block/platform/mmci-omap-hs.1/by-name/system /system
2) echo mount -o remount,rw -t rootfs rootfs / >> /system/bin/clrbootcount.sh
3) echo mkdir /mnt/internal >> /system/bin/clrbootcount.sh
4) echo busybox mount -o bind /data/usrdata /mnt/internal >> /system/bin/clrbootcount.sh
5) echo mount -o remount,ro -t rootfs rootfs / >> /system/bin/clrbootcount.sh
All this does is put the following at the end of clrbootcount.sh
mount -o remount,rw -t rootfs rootfs / #Remounts root as RW. Root is regenerated at each reboot, so /mnt/internal is never going exist on a fresh startup
mkdir /mnt/internal #make /mnt/internal, see above
busybox mount -o bind /data/usrdata /mnt/internal #Binds the directory
mount -o remount,ro -t rootfs rootfs / #remounts root as RO. Unsure if this is necessary, but since it runs as RO, its probably better safe than sorry.
Thanks to eded333 for mentioning a good place for the script.
Edit: Doh, can a mod please move this to the nook tablet general forum? I must have failed reading...
This file autostarts each time you boot:
/system/bin/clrbootcount.sh
Add what you want at the end, and it will autoexecute it.
Wouldn't it be easier to just make a symbolic link to any partition you want to use?
Edit:
XD, didn't read you'r edit, , anyway maybe this works also for you.
Out of curiosity, what would symlinking to /sdcard do exactly? I don't think I'm quite following what you're saying. If I'm linking a directory to /sdcard, that would just go to the microsd card slot, which isn't what I was intending to do. The Nook tablet (I accidently posted this in the wrong forum, that much helps too) has 16GB of storage that is internal on /data, and can't be used through normal means. My goal was to be able to use this 16GB of data outside of rooted apps. Maybe I'm not understanding completely as I am a bit sleep deprived at the moment.
Thanks for the recommendation for the startup script though! I will definitely give that a shot and see if that makes this persist across reboots.
Yeah, I though you were talking about the NST which only has 2gb of internal memory and 200 mb left to use if you dont repartition, dont really know how the partitioning is on the nook color but just symlinking (hardlinks) the folder you want on a partition to another folder on another partition which has more space would resolve the issue.
Edit:
If i'm not getting it wrong and you want more space than the nook gives you, to store content. This should work, hope I'm not wrong
Yeah sorry about that. I thought I was in the nook tablet section and when I went back because I got new email, it looked very different. Imagine what posting in the wrong forum can do...
By default the nook tablet has 16GB of NAND, with 14 or 15GB set as /data and 1GB as /media thats accessible over usb. I've read a lot of people disliking the idea of wasting all that space, myself included, so that's what spurred it. Initially I was going to have the remount command ignore FS permissions since it was public anyway, but I couldn't do that with bind.
gameman733 said:
Yeah sorry about that. I thought I was in the nook tablet section and when I went back because I got new email, it looked very different. Imagine what posting in the wrong forum can do...
By default the nook tablet has 16GB of NAND, with 14 or 15GB set as /data and 1GB as /media thats accessible over usb. I've read a lot of people disliking the idea of wasting all that space, myself included, so that's what spurred it. Initially I was going to have the remount command ignore FS permissions since it was public anyway, but I couldn't do that with bind.
Click to expand...
Click to collapse
Don't know if this sounds dumb, but you can try to mount as rw the partition you want to use, then use ln -s + the folders on the partitions you want to link and see if it works, add the commands at the end of the file I showed you and look if it works correctly. Make sure the folders you use have sufficient permissions and that the partition is mounted as rw.
Edit:
You could allways resize the partitions without any inherent problem, make a backup before trying this.
I found it
need help with /mnt/internal please
I have been troubleshooting this for several hours. I have rooted my NT with latest indirects n&Z .bat. Everything is fine with that. I followed the instructions from kenblat for mounting the reserved data space that is now accessible to me through Root Explorer and making it persist through reboot with the new clrbootcount.sh. Here is where things are falling apart for me....a directory called /internal is appearing as it should in /data/mnt, and I created an "audio" directory there, and I have been able to copy a few songs into it.....but, at some point, the whole system freezes, never finishes the "paste" part, and I have to force reboot in order to get anything running again. When reboot, any and all of the material that I did manage to copy/paste into the /mnt/internal directory is GONE. I have tried changing permissions, but so far I have gone through this at least 9 times (I am a very persistent person when it comes to this stuff) and always the system stops functioning in the middle of pasting. My /internal folder is set to RWall, /data is rwxrwx--x, usrdata is rwall. clbootcount.sh is set to ---rwxr-x. I can't imagine that it really is a permmissions problem because of the fact that i am able to copy SOME files, a few at a time, without a problem. Can anyone possibly help me? Thanks.
IT WAS NOT A PERMISSIONS ISSUE. DISCOVERED BUSYBOX WAS NOT INSTALLED. (DON'T KNOW HOW IT GOT UNINSTALLED) I OPENED NINJAMORPH AND IT DID ITS CHECKS AND THERE IT WAS, NO BUSYBOX INSTALLED. SO I REINSTALLED IT, NOW MOUNTS INTERNAL AND PERSISTS UPON REBOOT. NO WONDER I HAD PROBLEMS.
Need help.
I have been trying to everything step by step as it says here but it is not workign for me. I just recently rooted my nook tablet. I was wondering, maybe a video tutorial would more.

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+

Categories

Resources