Partition SD card - XPERIA X1 Android Development

Is there any way to partition storage card, so WM will show it as 2 storage cards? My SD card is currently big mess because of android stuff and i wish to split it to android and data part.

I think best way will be boot Android with folder from SD Card (for example Storage Card/Android -> and put all files in that folder)

radzix27 said:
I think best way will be boot Android with folder from SD Card (for example Storage Card/Android -> and put all files in that folder)
Click to expand...
Click to collapse
android has to be in the root of the sd card

leemoss84 said:
android has to be in the root of the sd card
Click to expand...
Click to collapse
I know but maybe somebody can change something for boot from any folder (if it's possible)

radzix27 said:
I know but maybe somebody can change something for boot from any folder (if it's possible)
Click to expand...
Click to collapse
pretty sure the reason for having to have it in the root is because of speed.if you start puting it into folders its just gonna slow it down.

leemoss84 said:
pretty sure the reason for having to have it in the root is because of speed.if you start puting it into folders its just gonna slow it down.
Click to expand...
Click to collapse
Maybe something is with it

It is possible to create more than one partition on an sd-card. I do not know, how wm handles this. When i found my old micro-sdcard i will give that a try
Anyway, it might be easier to put android into a folder. IMHO this will not impact performance. With some linux knowledge it should be possible by modifying the boot-scripts in initrd.gz and rootfs.img. There are also options in the startup.txt

vdelf said:
It is possible to create more than one partition on an sd-card. I do not know, how wm handles this. When i found my old micro-sdcard i will give that a try
Click to expand...
Click to collapse
Any progress on running it from native partitions?
I have a spare SD card partitioned and ready

vdelf said:
Anyway, it might be easier to put android into a folder.
Click to expand...
Click to collapse
As it turns out, it is ALOT easier to put it into a folder. Because you already can
I just looked into the scripts, and both already check for "/" or "/android/" for most of the files needed. So just create a folder named "android" on your sd-card, put most of the android-files there and you are done.
You can not put all files there because some are hard-coded to root. I am not sure about calibration (i left it in root and wlan worked), but modules-*.tar.gz has to stay there. Well, you CAN remove it after first startup as the modules are copied. Same goes to the AndroidApps-folder. My android-folder now contains data.img, haret.exe, initrd.gz, rootfs.img, STARTUP.TXT, system.sqsh and zImage.
Surprisingly no modification on startup.txt was needed. Are these path-options used at all

Mic159 said:
Any progress on running it from native partitions?
I have a spare SD card partitioned and ready
Click to expand...
Click to collapse
I tried that last week, but android loops at some point during startup animation. Always get the same results when i modify the system.sqsh. Dont know, what i am missing

hi guys,
for running on partition try with this configuration :
example 8 Gb SD card :
1. partition 1 -> fat32 -> 7 GB
2. partition 2 -> ext2 / ext3 -> 512 mb
3. partition 3 -> linux swap
extract system.sqsh into partition2.
@vdelf
man, you should erase some line init file in rootfs. erase everything script contains pointing file data.img. change it to your /dev/mmc1blkp2.
latest build phhusson rootfs.img will error on load wifi calibration.
cheers,
fatsal.

What do u think under extract ? move whole file to ext2 or decompres it to separate files ?

Devaster said:
What do u think under extract ? move whole file to ext2 or decompres it to separate files ?
Click to expand...
Click to collapse
I think he means unsquashfs the file.
Can we just write the data.img that we already have generated? ie. dd if=data.img of=/path/to/sdcard/partition?
Then we need a new rootfs without the creation & mounting of data.img?
And obvoiusly an update to STARTUP.txt

I hope there will be solution to that problem soon.
I currently have all files that were before on storage card in \Card folder. So android is in root and all other files are in separate folder. Which works great at start, but then windows start creating other folders like DCIM, Program Files, Application Data etc. and is again mess.

can someone prepare a package for easy instalation on partitioned card ?

AFAIK you cannot install to partitioned card because WM can display only 1 partition. That means you can't see either android or other files.

fatsal said:
hi guys,
for running on partition try with this configuration :
example 8 Gb SD card :
1. partition 1 -> fat32 -> 7 GB
2. partition 2 -> ext2 / ext3 -> 512 mb
3. partition 3 -> linux swap
extract system.sqsh into partition2.
Click to expand...
Click to collapse
You could try running a swapfile instead of a swap partition.
in your favorite linux
> dd if=/dev/zero of=/target/swapfile bs=1024 count=262144
> mkswap /target/swapfile
> swapon /target/swapfile
I use
1. partition 1 -> fat32 -> 4 GB
2. partition 2 -> ext2 -> 4 GB (currently trying to get Debian to talk to my network )
3. linux swap on /swapfile
fatsal said:
@vdelf
man, you should erase some line init file in rootfs. erase everything script contains pointing file data.img. change it to your /dev/mmc1blkp2.
latest build phhusson rootfs.img will error on load wifi calibration.
cheers,
fatsal.
Click to expand...
Click to collapse
Or to be more specific.
You can point to any partitions in startup.txt. My debian startup.txt (networking still not working ) **
set cmdline "root=/dev/mmcblk0p2 rootwait msm_fb.fix_x=1 console=tty0 msmsdcc_id=3 imgdevnum=1 imgdir=/ msmts_calib=0xc5.0x399.0x367.0x4d wifi.mac=00:23:45:39:0e:a1 mddi.width=480 mddi.height=800 board-htcraphael-navi.inversion=1 pm.sleep_mode=3 pm.debug_mask=2 lcd.density=240 msmvkeyb_toggle=on fbcon=rotate:3 clock-7x01A=528"
so I replaced "init=/ imgdevname=/dev/mmcblk0p1" with "root=/dev/mmcblk0p2 rootwait msm_fb.fix_x=1"
** for original info (step 6) http://forum.xda-developers.com/showpost.php?p=5579798&postcount=458
Michael

Related

How to install apps on the SD card using JFvMOD by LucidREM

http://forum.xda-developers.com/showthread.php?t=480582
so the only things you have to do is this??
because as i read down the thread people are talking about some 'links' or something i dont get it.
can anyone help?
LucidREM said:
a new update file was created by me utilizing JFs build environment .. you can use this to modify your update to pretty much anything you can imagine .. so long as you know what you're doing .. otherwise you might end up on the flashing android .. so here's the deal
PREREQUISITE:
1. you rooted your phone
2. you created the FAT32 / EXT2 combo partitions
SPECIAL NOTE:
EXT2 seems to have problems bigger than 2G .. recommended not to exceed 1.5G .. 500M is actually more than enough for most people
MicroSD should be 2G/4G/8G class6 .. without class6 you should not bother moving apps to the SD
this update can help you .. it contains the modified init.rc, mountd.conf files necessary to load the EXT2 partition to /system/sd .. JFs normal update contains the original files and thus your /system/sd/ folder will not show up .. good news .. if you updated with JFs update and have not wiped your /data then you can just reflash my modified update and regain your phone
NOTE: if you WIPE your phone YOU MUST have the EXT2 on your MicroSD to use this modified update.zip
INSTRUCTION:
1. Have/Create the FAT32 / EXT2 Partitions on the MicroSD
2. Download Modified Update to the MicroSD FAT32
JFv1.42_RC33
JFv1.43_RC9
JFv1.43_ADP1.1H
3. Rename To "update.zip" & Flash the G1
4. Moved /data/app, /data/app-private, and/or /data/data (optional) to the SD in Terminal:
a. $su
b. #copy.sh app
c. #copy.sh data (OPTIONAL)
5. Enjoy!
Click to expand...
Click to collapse
oh **** i just did this and all my apps are gone x(
installing a buttload of apps and using very very mininal internal memory! how awesome xD
I did this a few days ago, works great.
I downloaded the trial version of Paragon Partition Manager.
Created an EXT2 partition (it's very easy to do and intuitive once you open the program) of around 450 MB (don't think I'll ever need more than this).
Flashed the update (renamed it update.zip, booted into recovery mode and did the whatever the alt+_ command was to flash it).
Ran all three scripts in the terminal (not recommended to move data unless you have a Class 6 card).
Works well so far.
can you install themes on this?
Why are you posting another thread in the apps forum instead of posting in the original thread?

Question - migrating memory cards

I'm currently using a 2GB MicroSD card with an apps2SD partition (Ext2) and a storage partition (FAT32)
I have a 4GB card that I'd like to move everything to. I could surely partition it the same way I did my 2GB card, but then it would be a blank, partitioned card. What's a good way to get all my apps and such moved over, as I'm running windows (which won't read the Ext2 partition)
Would Norton Ghost do it?
no try Ext2IFS_1_11a
can't remember where it is: if it doesnt work DL linux and boot into it from disc (no need to install) and copy onto disc from there...
Use linux.
plug in uSD card, do NOT mount. If it automounts, UNMOUNT it. Check device name "tail dmesg".
If device name is for example, sdb, then copy contents to hard disk;
"dd if=/dev/sdb of=~/sdbackup" -- this will create a file in your home directory called "sdbackup".
pull card, insert new card. If it mounts, unmount it. Again check device path.
"dd if=~/sdbackup of=/dev/sdb"
Now pull card, the data on the new card mirrors the old card. Plug back in. Note: we pull and then reinsert to make sure that the kernel reloads the partition table. There are other ways of forcing this, but this is the easiest and most fool-proof.
You have unpartitioned free space at the end of the card.
Use a combination of "parted" and "resize2fs" to resize/move partitions, or just use gparted to handle these operations graphically.
jook11 said:
I'm currently using a 2GB MicroSD card with an apps2SD partition (Ext2) and a storage partition (FAT32)
I have a 4GB card that I'd like to move everything to. I could surely partition it the same way I did my 2GB card, but then it would be a blank, partitioned card. What's a good way to get all my apps and such moved over, as I'm running windows (which won't read the Ext2 partition)
Would Norton Ghost do it?
Click to expand...
Click to collapse
Thanks for your help.
lbcoder said:
Use linux.
plug in uSD card, do NOT mount. If it automounts, UNMOUNT it. Check device name "tail dmesg".
If device name is for example, sdb, then copy contents to hard disk;
"dd if=/dev/sdb of=~/sdbackup" -- this will create a file in your home directory called "sdbackup".
pull card, insert new card. If it mounts, unmount it. Again check device path.
"dd if=~/sdbackup of=/dev/sdb"
Now pull card, the data on the new card mirrors the old card. Plug back in. Note: we pull and then reinsert to make sure that the kernel reloads the partition table. There are other ways of forcing this, but this is the easiest and most fool-proof.
You have unpartitioned free space at the end of the card.
Use a combination of "parted" and "resize2fs" to resize/move partitions, or just use gparted to handle these operations graphically.
Click to expand...
Click to collapse
Are these directions explicit/comprehensive? Will I need to partition first? I don't know very much at all about linux, but I've got an ubuntu cd downloading. I've poked at it a little before - I can at least get a terminal and follow your directions, if this is all there is to it.
edit
I'm trying copying things manually in ubuntu's file.. explorer.. thingy. Then I'll partition the new memory stick with gparted and copy the files there.
This seems more natural to me, since I'm not familiar with command-line operations much anyway. Personally, I don't see why it won't work.
edit again:
I don't have permission to copy the folders "app" "app-private" or "dalvik-cache"
How can I do this?
edit edit again
google found me a "sudo nautilus" command which seems to open a file browser window with more permissions. I still can't actually copy the folders I mentioned before, but I recreated them in my backup location and I can copy the contents. Maybe this will take care of it.
update:
nope, that worked for "app" and some (but not all) of "dalvik-cache" but not "app-private"
How do I gain permission to copy it?
I'm willing to go back to the terminal, but I get an error on the tail command. There's nothing found, or somesuch. Sorry, I meant to copy the message exactly but I forgot before I rebooted the computer I was doing it with.
Can anybody help me out a little more with this?
The error I get right off the bat is "tail: cannot open 'dmesg' for reading: no such file or directory"
The only access to linux I have is an ubuntu live CD
Code:
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
[email protected]:~$ tail dmesg
tail:cannot open `dmesg' for reading: No such file or directory
[email protected]:~$ _
MontAlbert said:
no try Ext2IFS_1_11a
can't remember where it is: if it doesnt work DL linux and boot into it from disc (no need to install) and copy onto disc from there...
Click to expand...
Click to collapse
How do I make use of this? It sounds like it should make Ext2 partitions appear in Windows Explorer just like anything else...
I installed it, but the Ext2 partition still doesn't show when I plug in the SD card. Do I need to do something particular?
I have rebooted.
Can anyone please give me more information on this, please? I've been poking at it different ways and still can't get it to work. Who knows something I don't?
jook11 said:
Can anyone please give me more information on this, please? I've been poking at it different ways and still can't get it to work. Who knows something I don't?
Click to expand...
Click to collapse
Code:
dmesg | tail
All the information to do this has been stated in this thread by now.

Running android from sd card

hello guys,
i want to share how to running android from sdcard, last time before i lose my X1 it's already running well on my X1.
here's the step :
requirement :
1. linux (mine ubuntu 9.10)
2. for ubuntu do "sudo apt-get install squashfs-tools" for getting unsquashfs (for extract system.sqsh)
prepared equipment :
1. 8gb SDCard (for good starting but you can also using 2 gb or 4gb)
2. partition your sdcard like this (8gb configuration) you can using gparted :
1. 5.5 gb format using fat32 this called : mmcblk0p1
2. 1 gb format using ext2/ext3 for /system this called : mmcblk0p2
3. 1 gb format using ext2/ext3 for /data this called : mmcblk0p3
4. 512 mb format using linuxswap for /swap this called : mmcblk0p4
installation :
1. do execute on terminal : unsquashfs <your system.sqsh directory> after extraction you will see directory called "squashfs-root"
2. copy all files from "squashfs-root" directory into your SD Card /system partition or mmcblk0p2.
3. copy startup.txt, haret.exe, modules<build>.gz, zImage from vdelf build onto your root SDCARD fat32 or mmcblk0p1
4. download and copy/replace rootfs.img from here into your root SDCARD fat32 or mmcblk0p1.
5. execute haret.exe and then wait and pray.
@vdelf :
man...your the best, with this configuration you can easly changes or edit an android modules.
cheers,
fatsal
man u are the 1
so is it only possible to set this up with linux, windows won't work?
CowMix said:
so is it only possible to set this up with linux, windows won't work?
Click to expand...
Click to collapse
same question?
But after all, why ask those questions every time? Get yourself DamnSmallLinux and qemu emulator.. It will be about 60 Mb download total and you'll never have problems with ext2 filesystem and permissions
sp3dev thanx for the hint i was looking for small distro ...
Thanks fatsal, almost there.
But one thing u missed in your first post, was to copy initrd.gz in step 3 (copy it to the fat32 partition)
Otherwise HARET says "/Storage Card/initrd.gz" not found.
But i get stuck in the boot screen (the android loading image with the X).
It just sits there forever. It shows a bit of the animation, then stalls for a second then skips back to the start of the animation...
Not sure whats wrong.
Mic159 said:
Thanks fatsal, almost there.
But one thing u missed in your first post, was to copy initrd.gz in step 3 (copy it to the fat32 partition)
Otherwise HARET says "/Storage Card/initrd.gz" not found.
But i get stuck in the boot screen (the android loading image with the X).
It just sits there forever. It shows a bit of the animation, then stalls for a second then skips back to the start of the animation...
Not sure whats wrong.
Click to expand...
Click to collapse
Yes, i have that problem too!
any help is appriciated!
i've definately done it all correct because when i insert the sd card the /data partition is filled with android files!
but the x just loops, freezes then continues to do that! :S
I have and 8GB SDHC card class 6, but i only ever have 7.42GB available, even when the card is empty. Is this normal?
Also i have tried to use Gparted to partition my SD card following the instructions aove, but i get an error message, can anyone tell me what im doing wrong. See attached for details.
Thanks in advance.
yes the 7.42 gb is normal, i cannot help you with the error though
but until we can get to fully boot up theres no point anyway!
Mic159 said:
But i get stuck in the boot screen (the android loading image with the X).
It just sits there forever. It shows a bit of the animation, then stalls for a second then skips back to the start of the animation...
Click to expand...
Click to collapse
I never managed to get past that. I got the same effect when i modified the system.sqsh. I ASSUME, that a file link is broken or some file permissions are not correct. I am sure, it is something trivial, but no idea how to find out.
fatsal said:
hello guys,
Click to expand...
Click to collapse
Nice to see you around, again!
CowMix said:
so is it only possible to set this up with linux, windows won't work?
Click to expand...
Click to collapse
It is MUCH EASYer to set this up with linux. It is possible using windows, but you have to use some black magic. Windows will not allow you to create more than one partition on an sdcard or usb-drive. Maybe some 3rd-party-partition-program can, but i dont know of one. It is possible to fool windows to think that the sdcard is a fixed disk. Then you can create more partitions.
The next problem is to create the ext2-filesystem in windows. There are drivers to read/modify ext2, but creating it? Maybe that 3rd-party-partition-program can...
we need fatsal's help! :|
vdelf said:
I never managed to get past that. I got the same effect when i modified the system.sqsh
Click to expand...
Click to collapse
Any progress on it?
What are the permissions supposed to be like?
Is there any way to debug the boot process when it wont boot?
can we put something in the eclare config to output the logs to a file?
Mic159 said:
Any progress on it?
What are the permissions supposed to be like?
Is there any way to debug the boot process when it wont boot?
can we put something in the eclare config to output the logs to a file?
Click to expand...
Click to collapse
unfortunately no, and i don't think there will be until an android SD xpert comes along or fatsal himself decides to chek xda
vdelf said:
It is MUCH EASYer to set this up with linux. It is possible using windows, but you have to use some black magic. Windows will not allow you to create more than one partition on an sdcard or usb-drive. Maybe some 3rd-party-partition-program can, but i dont know of one. It is possible to fool windows to think that the sdcard is a fixed disk. Then you can create more partitions.
The next problem is to create the ext2-filesystem in windows. There are drivers to read/modify ext2, but creating it? Maybe that 3rd-party-partition-program can...
Click to expand...
Click to collapse
Ask and ye shall receive
This is the Hitachi fixed-disk filter driver - if you put your device id in the inf file, you can partition your SD card like a normal fixed disk.
NOTE: I take NO responsibility if this driver eats your first-born child, or opens a trans-dimensional portal and sucks you into oblivion. You are on your own for support. If you are unsure what you are doing, DON'T USE THIS - get a live CD linux distro and boot that instead.
If you want to read-write ext2 partitions under windows, use something like http://www.fs-driver.org/ - again if it turns your computer into a smouldering pile of vomit, it's YOUR responsibility!
But have fun anyway!
sp3dev said:
But after all, why ask those questions every time? Get yourself DamnSmallLinux and qemu emulator.. It will be about 60 Mb download total and you'll never have problems with ext2 filesystem and permissions
Click to expand...
Click to collapse
i got damn small linux
how to make partition to my SD card by using the dsl?
thank u in advance
Most linux distributions have cfdisk. Look at the linux log to find the device name for your sd-card. It should be something like /dev/sdb. Run cfdisk /dev/sdb as root, and you can manage partitions on that device. Be carefull not to edit the wrong disc
For partitioning i mostly use gparted. Bigger download, but very comfortable and powerful partitioning system.

Installing tremers Froyo on ext2 partition

I found tutorial how to use ext2 partition on SDCARD for haret.
http://android-devs.org/forum/viewtopic.php?f=56&t=194
I created this
2 GB Fat32
1 GB ext2
1 GB ext2
so i have 4 GB disk and 3 partition just as its on tutorial
But after launching haret it should asked me
Press VolDn to launch Installer (to use ext2)
just after the
Checking for partitions
but in my case it just continue with installing without asking me and its uning only fat32
Any suggestion???
our rootfs doesn't have the install function, someone must edit the rootfs to boot into EXT partitions first!
I just copy rootfs to the / of the ext2 and system to /system, and then edit the init script so it remounts properly.
When I start doing partitioned releases I'll try and make it easy, probably by distributing prebuilt images by card size (4G, 8G etc.)
Tremere said:
When I start doing partitioned releases I'll try and make it easy, probably by distributing prebuilt images by card size (4G, 8G etc.)
Click to expand...
Click to collapse
I talked to phh yesterday.. he said ext2 and NAND booting have no effect on stability, performance and battery life. (rhod nand booting has been working for one month)
Performance could change but it would be less than 20%.
So I pray that someone will find the standby killer
So i need only one ext2 partition
Tremere said:
and then edit the init script so it remounts properly.
Click to expand...
Click to collapse
if i knew how and what to edit. Nevermind its not that important. You just focus on your work.
Matzemink said:
I talked to phh yesterday.. he said ext2 and NAND booting have no effect on stability, performance and battery life. (rhod nand booting has been working for one month)
Performance could change but it would be less than 20%.
So I pray that someone will find the standby killer
Click to expand...
Click to collapse
True. I think they also had an incorrect mount option on the rootfs until recently that slowed loopback performance. I think my last (unstable) release contained the fix for that.
For my own AOSP device tree I'm determined to start fresh without the rootfs and loopback crap. Maybe not a big performance gain but easier to 'get around' system wise.
if i knew how and what to edit. Nevermind its not that important. You just focus on your work.
Click to expand...
Click to collapse
off the top of my head, init.etc/init.froyo.rc and there is a line which tries to mount root as yaffs (flash). Not too hard to find.
You might want to have another ext2 for /data though.
How do I partition my micro sd card?
please excuse my bad English
I use translator
The easyest way for me. Download a release of Ubuntu from ubuntu.com and burn it to cd or make bootable USB. Boot live cd and partition from there.
wouldn't it be easier to download a live CD of gparted?
Jonny4911 said:
wouldn't it be easier to download a live CD of gparted?
Click to expand...
Click to collapse
System Rescue CD is my favorite for partitioning tasks. Should work on your sdcard.
Over in the raph forum, e334 posted a guide on partitioning ext2 from Windows

Sony Xperia ZR – Mount ExternalSD2InternalSD

Hi,
This is my first android device, so am pretty much a newbie for android.
Have created this mod to mount external SD card partition as internal partition.
I took pointers from a lot of threads on xda forums to get this working, so I feel bound to share it.
Note: Have only tested it with Android 4.1.
(I'm not responsible for any Damage to your phone. Use at your own risk.)
Note: This will likely result in data loss. Backup!
Required :
1. Root Access
2. init.d support click here
3. Root Browser click here
4. SManager click here
5. An sd card (duh!) (with class 10 SD cards preferable)
6. Some way to partition your SD Card (like MiniTool Partition Manager)
Install instructions:
1. Create two ‘fat32’ partitions on SD card(EDIT: PS: both partitions should be Primary). Your first partition will be mounted as normal extSd card, and your second partition will be mounted as internal SD Card for your apps. (I partitioned my 64GB(10^9 bytes) sd card with ~16 GB 1st partition and ~42 GB 2nd partition)
2. Copy and paste “mountSd” to etc/init.d folder. (If you don’t have such a folder, means you lack init.d support. click here and follow instructions to enable it) This script creates another mount point called ‘sdcard2’ and mounts current internal sd card there. It also tries to mount second partition to ‘sdcard0’ location, but seems to fail some times (as fat32 is not natively supported linux partition it seems, but could be wrong), so step 3 is required.
3. Copy ‘mountSdFailSafe.txt’ to your phone’s ‘/data’ folder. Now with ‘SManager’, register this file as script with ‘su’ and ‘boot’ selected. (click and hold script -> in context menu click ‘Open As..’ -> ‘Script/Executable’ -> Is Script = true, select ‘su’ and ‘boot’ buttons)
4. Restart.
This should do it. Once restarted, second partition will be shown as internal memory.
Note:
You will lose all app data and other app related customizations. You may be able to restore it by simply copy pasting ‘Android’ folder from ‘/storage/sdcard2’ to ‘/storage/sdcard0’. This has not been tested by me but should work theoretically (as I started with a blank phone, and so did not need to back up my app data). Or you could use Titanium Backup.
Some Issues that occur due to this mod:
I have been using this mod since the past 2 weeks, and the phone is quite stable with this mod.
The only issue I have faced is that when connected to PC (Windows 8) through USB, ‘My Computer’ keeps crashing unless and until you disconnect the phone. Otherwise it seems to be working fine. To circumvent this issue I have been using Samba to share files between PC and my phone.
Please share how it works out for you guys.
Other Notes:
I tried to get this working with ext4 partition, which has a +ves that it will not require step ‘3’ of install instructions and supports file sizes >4GB, but there are loads of permission issues happening, which I could not solve.
(Thought of setting “set GID” bit and then finding and adding all users to root group but failed. Also tried to set owner group ‘sdcard_rw’ without much success. May be someone who knows linux better may know how to solve this, Could not find much help on the forums as it seems others are facing a similar problem see more)
Thanks to:
For basic idea (PS: do not use the given method exactly as you will end up in a boot loop. For some reason, ‘sdcard1’ mount point has to be mounted by system only and can’t be mounted any other way, it seems.)
http://forum.xda-developers.com/showthread.php?t=2180733
Edit:
Simplified installation if you do not care for easy accessibility to your orig internal memory:
Use this video tutorial by ashwin123:
The only exceptions are that, you need to partition your card,
and you have to use the file 'mountSdFailSafe.txt' instead of the file in the package mentioned by him.
Nice
Waiting for someone to test it n confirm it successfully works
Still here
N!geR -> E!ch0
NisJ said:
Hi,
This is my first android device, so am pretty much a newbie for android.
Have created this mod to mount external SD card partition as internal partition.
I took pointers from a lot of threads on xda forums to get this working, so I feel bound to share it.
Note: Have only tested it with Android 4.1.
(I'm not responsible for any Damage to your phone. Use at your own risk.)
Note: This will likely result in data loss. Backup!
Required :
1. Root Access
2. init.d support click here
3. Root Browser click here
4. SManager click here
5. An sd card (duh!) (with class 10 SD cards preferable)
6. Some way to partition your SD Card (like MiniTool Partition Manager)
Install instructions:
1. Create two ‘fat32’ partitions on SD card. Your first partition will be mounted as normal extSd card, and your second partition will be mounted as internal SD Card for your apps. (I partitioned my 64GB(10^9 bytes) sd card with ~16 GB 1st partition and ~42 GB 2nd partition)
2. Copy and paste “mountSd” to etc/init.d folder. (If you don’t have such a folder, means you lack init.d support. click here and follow instructions to enable it) This script creates another mount point called ‘sdcard2’ and mounts current internal sd card there. It also tries to mount second partition to ‘sdcard0’ location, but seems to fail some times (as fat32 is not natively supported linux partition it seems, but could be wrong), so step 3 is required.
3. Copy ‘mountSdFailSafe.txt’ to your phone’s ‘/data’ folder. Now with ‘SManager’, register this file as script with ‘su’ and ‘boot’ selected. (click and hold script -> in context menu click ‘Open As..’ -> ‘Script/Executable’ -> Is Script = true, select ‘su’ and ‘boot’ buttons)
4. Restart.
This should do it. Once restarted, second partition will be shown as internal memory.
Note:
You will lose all app data and other app related customizations. You may be able to restore it by simply copy pasting ‘Android’ folder from ‘/storage/sdcard2’ to ‘/storage/sdcard0’. This has not been tested by me but should work theoretically (as I started with a blank phone, and so did not need to back up my app data). Or you could use Titanium Backup.
Some Issues that occur due to this mod:
I have been using this mod since the past 2 weeks, and the phone is quite stable with this mod.
The only issue I have faced is that when connected to PC (Windows 8) through USB, ‘My Computer’ keeps crashing unless and until you disconnect the phone. Otherwise it seems to be working fine. To circumvent this issue I have been using Samba to share files between PC and my phone.
Please share how it works out for you guys.
Other Notes:
I tried to get this working with ext4 partition, which has a +ves that it will not require step ‘3’ of install instructions and supports file sizes >4GB, but there are loads of permission issues happening, which I could not solve.
(Thought of setting “set GID” bit and then finding and adding all users to root group but failed. Also tried to set owner group ‘sdcard_rw’ without much success. May be someone who knows linux better may know how to solve this, Could not find much help on the forums as it seems others are facing a similar problem see more)
Thanks to:
For basic idea (PS: do not use the given method exactly as you will end up in a boot loop. For some reason, ‘sdcard1’ mount point has to be mounted by system only and can’t be mounted any other way, it seems.)
http://forum.xda-developers.com/showthread.php?t=2180733
Click to expand...
Click to collapse
Am interested to try this but before I do, just wanted to check when you say data is lost, is it due to the lost of the original /data partition? Or just due to the sd card's partition?
What's the outcome when this is done, I mean do we have two data partitions one from the original phone's memory and another with the sdcard? And in the settings menu, will we get to choose to send apps over to sd? Thanks
grim_ripper said:
Am interested to try this but before I do, just wanted to check when you say data is lost, is it due to the lost of the original /data partition? Or just due to the sd card's partition?
What's the outcome when this is done, I mean do we have two data partitions one from the original phone's memory and another with the sdcard? And in the settings menu, will we get to choose to send apps over to sd? Thanks
Click to expand...
Click to collapse
Your application data will be lost in a way, as orig internal sd card will be mounted to 'sdcard2' mount point(newly created). All your app data will be installed to your memory card's second partition, which is now the new internal sdcard. To access your orig data, you will have to go to it through a file manager, and apps or media scanner will not be able to access this memory any more.
The scripts provided will not format your internal memory.
Still apk files, dalvik cache etc, will still take up your original internal memory's space.
Partitioning your sd card will probably format it as well unless you take special precaution (ie. through shrink volume).
Hope it makes sense...?
NisJ said:
Your application data will be lost in a way, as orig internal sd card will be mounted to 'sdcard2' mount point(newly created). All your app data will be installed to your memory card's second partition, which is now the new internal sdcard. To access your orig data, you will have to go to it through a file manager, and apps or media scanner will not be able to access this memory any more.
The scripts provided will not format your internal memory.
Still apk files, dalvik cache etc, will still take up your original internal memory's space.
Partitioning your sd card will probably format it as well unless you take special precaution (ie. through shrink volume).
Hope it makes sense...?
Click to expand...
Click to collapse
It makes sense, just am confused on how the system will still recognize the original storage when the sd card's storage is supposingly replacing it. Could you post a screen shot of your storage from settings?
grim_ripper said:
It makes sense, just am confused on how the system will still recognize the original storage when the sd card's storage is supposingly replacing it. Could you post a screen shot of your storage from settings?
Click to expand...
Click to collapse
Here you go....
PS: third image shows that internal storage is still accessible, just not to apps. Only apk files, and other android files go there go there. sdcard2 in 4th image is newly created mount point for your orig internal storage, but is ignored by most of the apps...
NisJ said:
Here you go....
PS: third image shows that internal storage is still accessible, just not to apps. Only apk files, and other android files go there go there. sdcard2 in 4th image is newly created mount point for your orig internal storage, but is ignored by most of the apps...
Click to expand...
Click to collapse
Can u do a tutorial video how to install this script bro?
Cuz the installation steps r bit complicated
Still here
N!geR -> E!ch0
NisJ said:
Here you go....
PS: third image shows that internal storage is still accessible, just not to apps. Only apk files, and other android files go there go there. sdcard2 in 4th image is newly created mount point for your orig internal storage, but is ignored by most of the apps...
Click to expand...
Click to collapse
Phone keeps rebooting now, couldn't copy it to /etc/init.d
I think it has something to do with having data running in the background, now I don't know what to do with my phone
EDIT: Ok, manage to recover from the reboot state, had to deny root access to my file explorer. I think the reboot was caused when I set permission to write for /system. Anyway, everytime I keep trying to copy to /etc/init.d, I get a permission denied so am not sure what I should do now.
grim_ripper said:
Phone keeps rebooting now, couldn't copy it to /etc/init.d
I think it has something to do with having data running in the background, now I don't know what to do with my phone
EDIT: Ok, manage to recover from the reboot state, had to deny root access to my file explorer. I think the reboot was caused when I set permission to write for /system. Anyway, everytime I keep trying to copy to /etc/init.d, I get a permission denied so am not sure what I should do now.
Click to expand...
Click to collapse
When ever you copy something to init.d it will reboot, or does it go into boot loop?
To check if it worked correctly, see if new mount point storage/sdcard2 was created..
EDIT: If it worked correctly, then you could move to next step.
else you could also skip it, and goto the next step of SManager, but in that case you will lose access to your original internal storage as it wont be mounted to sdcard2.
E!ch0 said:
Can u do a tutorial video how to install this script bro?
Cuz the installation steps r bit complicated
Still here
N!geR -> E!ch0
Click to expand...
Click to collapse
Creating a video will take time at least til sat... prob more.
Will see if I can create a simplified install instructions once i reach home.
NisJ said:
When ever you copy something to init.d it will reboot, or does it go into boot loop?
To check if it worked correctly, see if new mount point storage/sdcard2 was created..
EDIT: If it worked correctly, then you could move to next step.
else you could also skip it, and goto the next step of SManager, but in that case you will lose access to your original internal storage as it wont be mounted to sdcard2.
Click to expand...
Click to collapse
What happens is that everytime I try to mount /system as writable, it reboots and hence I can't copy either files to their designated location
EDIT: Also, now everytime I reboot, there's a popup that says USB connectivity has stopped, and if I go under settings->storage, settings fc. I'm thinking this has something to do with two partitions on the sd card so I hope it all goes away when this works or I revert back to as it was.
EDIT 2: So I managed to get all the files to the appropriate place using terminal and managed to get the script to run at boot. Alas, the phone doesn't detect my sdcard at all now and still throws the USB connectivity error at boot. Once I removed the sdcard, everything works alright. Also, I figured the solution to the reboot (haven't tested it yet as I wanted to resolve my sdcard first):
http://forum.xda-developers.com/showthread.php?t=2317432
EDIT 3: Got the reboot solve, but the sdcard can't be read and I tried plugging it into my other phone, the first partition is only read. I can't get minitool to even find the 2nd partition. I am thinking I need to get a card reader to plug it into my laptop. Anyway, I went through your script and open the log file it used, says that there's an invalid argument for mount. Any idea?
Final Edit: Got it working! I had to re-partition my sdcard and made both partitions primary so maybe you might want to add that in OP as MiniTool by default selected the 2nd partition as logical
grim_ripper said:
What happens is that everytime I try to mount /system as writable, it reboots and hence I can't copy either files to their designated location
EDIT: Also, now everytime I reboot, there's a popup that says USB connectivity has stopped, and if I go under settings->storage, settings fc. I'm thinking this has something to do with two partitions on the sd card so I hope it all goes away when this works or I revert back to as it was.
EDIT 2: So I managed to get all the files to the appropriate place using terminal and managed to get the script to run at boot. Alas, the phone doesn't detect my sdcard at all now and still throws the USB connectivity error at boot. Once I removed the sdcard, everything works alright. Also, I figured the solution to the reboot (haven't tested it yet as I wanted to resolve my sdcard first):
http://forum.xda-developers.com/showthread.php?t=2317432
EDIT 3: Got the reboot solve, but the sdcard can't be read and I tried plugging it into my other phone, the first partition is only read. I can't get minitool to even find the 2nd partition. I am thinking I need to get a card reader to plug it into my laptop. Anyway, I went through your script and open the log file it used, says that there's an invalid argument for mount. Any idea?
Click to expand...
Click to collapse
Why are you trying to mount /system as rw?
for getting init.d support you just have to download the apk from mentioned thread and install it, and then fallow instruction in app.
you can mount root as rw with the foll command if you want, and that is exactly what is done in he scripts as well if you will check:
Code:
mount -o remount,rw /
also to check if partition is created on sd card, type the command:
Code:
blkid
and see if
Code:
/dev/block/vold/179:34
is listed
if not post the output and i'll see what i can do.
grim_ripper said:
Final Edit: Got it working! I had to re-partition my sdcard and made both partitions primary so maybe you might want to add that in OP as MiniTool by default selected the 2nd partition as logical
Click to expand...
Click to collapse
EDIT: Correct, you need both the partitions to be primary. got out of my mind when posting the tutorial.
NisJ said:
Why are you trying to mount /system as rw?
for getting init.d support you just have to download the apk from mentioned thread and install it, and then fallow instruction in app.
you can mount root as rw with the foll command if you want, and that is exactly what is done in he scripts as well if you will check:
Code:
mount -o remount,rw /
also to check if partition is created on sd card, type the command:
Code:
blkid
and see if
Code:
/dev/block/vold/179:34
is listed
if not post the output and i'll see what i can do.
EDIT: Correct, you need both the partitions to be primary. got out of my mind when posting the tutorial.
Click to expand...
Click to collapse
For whatever reason, my /etc folder is actually a link from /system/etc
Could you post a way to revert back? I think my apps are acting all funny now and just want to revert back to before. Thanks!
grim_ripper said:
Could you post a way to revert back? I think my apps are acting all funny now and just want to revert back to before. Thanks!
Click to expand...
Click to collapse
The apps are behaving funny because you have lost their data as I had warned in the original post.
To fix do either of the foll:
1. reinstall app, and start fresh.
or
2. restore from Titanium backup if you had created...
or
3. copy paste 'Android' folder from sdcard2 if it is created to 'sdcard0'
To remove and revert, just delete the files from int.d, and stop scheduling it in SManger.
Note: to un schedule it from smanager, you first have to remove memory card, un schedule and then put in your memory card (this is coz when phone boots up, it is in standard way, with 8gb internal but, after script is executed SManager looses its data too.
How complicated will it be to make this compatible with 4.2.2?
grim_ripper said:
How complicated will it be to make this compatible with 4.2.2?
Click to expand...
Click to collapse
Ideally should be possible, unless something has changed majorly, but I haven't tried it, as am waiting for OTA update. If it is not forth coming in 2-3 weeks, may be tempted to flash nordic rom and try.
NisJ said:
Ideally should be possible, unless something has changed majorly, but I haven't tried it, as am waiting for OTA update. If it is not forth coming in 2-3 weeks, may be tempted to flash nordic rom and try.
Click to expand...
Click to collapse
I did try but nothing happened, am guessing it has permission issues or something on those lines
grim_ripper said:
I did try but nothing happened, am guessing it has permission issues or something on those lines
Click to expand...
Click to collapse
Could you be more specific? Like system restarts etc...
Else in terminal try out what I Gave in post no 12 and give me what the output is for both the commands in the terminal.
Note: execute them with super user credentials.
Thanks
NisJ said:
Could you be more specific? Like system restarts etc...
Else in terminal try out what I Gave in post no 12 and give me what the output is for both the commands in the terminal.
Note: execute them with super user credentials.
Thanks
Click to expand...
Click to collapse
on the 4.2.2 update, it doesnt recognize the second partition even if it is formatted to primary and set to active. there r definitely some updates done in that field and plus i cant get the init.d rights on the phone as the test.log file is absent in the data folder..no matter what i do i just cant get it straight with the present procedure. please try it on 4.2 and there r more frequent updates on the nordiac then the local version. so i decided to flash it rather than waiting for ota update

Categories

Resources