How I Can Do Adoptable Storage On OREO[PRA-LX1] - P8 Lite (2017) Discussion

I can do it on Android 7.0
adb shell
sm list-disks
sm partition disk:179:192 mixed 20
it's work 7.0 but doesnt work on 8.0
Please Help

hellp

https://preview.ibb.co/f5gRn8/2018_06_23_14_41_21.png
its error.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

same here, any updates?
would like to have a crDroid 4.3 ROM without Treble for my PRA-LX1....
migrate data works fine there

Solution
Copied this solution from another thread
Disable encryption to use Adoptable Storage (or just because you can)
open /vendor/etc/fstab.hi6250
make a backup just in case
find "/dev/block/bootdevice/by-name/userdata /data f2fs nosuid,nodev,noatime,discard,inlinedata,inlinexatt r wait,check,fileencryption=aes-256-xts:aes-256-cts"
remove ",fileencryption=aes-256-xts:aes-256-cts"
factory reset via stock recovery

mustafademiral said:
I can do it on Android 7.0
adb shell
sm list-disks
sm partition disk:179:192 mixed 20
it's work 7.0 but doesnt work on 8.0
Please Help
Click to expand...
Click to collapse
if its still on 7 remove sd card and do the update it carries over with not much issues
had it done successfully on my brothers device on mine i was too late since i tried to start fresh after doing the update. which clearly is blocked.
"Error: java.lang.IllegalStateException: command '15 volume partition disk:179:192 mixed 90' failed with '400 15 Command failed'"
i'm probably going to get my device rolled back to 7 and redo it now
i had to format my device since i only had about 2gb on my original internal storage so figured id sd partition as well start fresh with 90-10% instead of my 50/50 partition for this unexpected oreo update XP <( T_T)> regret after 3 hrs

Mister746 said:
Copied this solution from another thread
Disable encryption to use Adoptable Storage (or just because you can)
open /vendor/etc/fstab.hi6250
make a backup just in case
find "/dev/block/bootdevice/by-name/userdata /data f2fs nosuid,nodev,noatime,discard,inlinedata,inlinexatt r wait,check,fileencryption=aes-256-xts:aes-256-cts"
remove ",fileencryption=aes-256-xts:aes-256-cts"
factory reset via stock recovery
Click to expand...
Click to collapse
fstab.hi650 missing in my phone. im using stock firmware

Mister746 said:
Copied this solution from another thread
Disable encryption to use Adoptable Storage (or just because you can)
open /vendor/etc/fstab.hi6250
make a backup just in case
find "/dev/block/bootdevice/by-name/userdata /data f2fs nosuid,nodev,noatime,discard,inlinedata,inlinexatt r wait,check,fileencryption=aes-256-xts:aes-256-cts"
remove ",fileencryption=aes-256-xts:aes-256-cts"
factory reset via stock recovery
Click to expand...
Click to collapse
do you try this solution. is it work ?

Muratia4141 said:
do you try this solution. is it work ?
Click to expand...
Click to collapse
Yeah it worked.

Mister746 said:
Yeah it worked.
Click to expand...
Click to collapse
Noob request!
Could one give more details on the steps/tools needed to do this. More if some one could make a tutorial for the rest of the people dealing with this issue or just post the source maybe it will provide the needed info!

daniel.dobrea said:
Noob request!
Could one give more details on the steps/tools needed to do this. More if some one could make a tutorial for the rest of the people dealing with this issue or just post the source maybe it will provide the needed info!
Click to expand...
Click to collapse
Hi, @daniel.dobrea!
Noob to noob, I think you'll need to root your device - I myself will be using the regular root tutorial from here - after unlocking your bootloader. After going through all of this you'll be able to use root file explorer apps to navigate into /system/vendor/ and the likes. (I personally use ES File Explorer Pro, but only because I got it cheap. I recommend something like 'File Explorer' from the Play Store.
Thanks

XDA XILFY said:
Hi, @daniel.dobrea!
Noob to noob, I think you'll need to root your device - I myself will be using the regular root tutorial from here - after unlocking your bootloader. After going through all of this you'll be able to use root file explorer apps to navigate into /system/vendor/ and the likes. (I personally use ES File Explorer Pro, but only because I got it cheap. I recommend something like 'File Explorer' from the Play Store.
Thanks
Click to expand...
Click to collapse
Thanks XDA XILFY,
I'll give it a try... first rooting then the above steps!
Could some one confirm the need of factory reset!
Thanks Daniel

Hello,
I've tried the proposed solution.
As one can see below, there are now 2 files in my /vendor/etc, which are :
/vendor/etc/fstab.hi6250 : the updated file with the encryption related part removed.
/vendor/etc/fstab.hi6250.old : the original file that I copied just before I modified it.
After doing this, I boot into the recovery (the stock one), I asked to wipe the data, and after the various confirmation, the device rebooted in order to perform the wipe.
So I had approximately the same screen than when it's updating the ROM, but with a red title stating that I should not hold and press the power button to keep things Ok (I don't remeber exactly), but... it stayed at 0% for about 1 hour when I gave up.
I then had to restore the /vendor partition I had backup-ed before doing the work in order to restore things to normal.
So either there is some trick that is not mentionned, or I screwed up, but in both case I'd suggest you not to perform this action.
Now, if you want my guess : the stock recovery might expect a not encrypted partition according to the fstab, although it is, and therefore is unable to perform the wipe...
I'll give it a try with a special TWRP (if such exists) to perform the wipe (which consists in a specific rm -rf in order to keep Huawei drivers in /data)
If you had better luck, let me know!
Code:
HWPRA-H:/ # cat /vendor/etc/fstab.hi6250
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait,avb
/dev/block/bootdevice/by-name/vendor /vendor ext4 ro,barrier=1 wait,avb
/dev/block/bootdevice/by-name/product /product ext4 ro,barrier=1 wait
/dev/block/bootdevice/by-name/version /version ext4 ro,barrier=1 wait
/dev/block/bootdevice/by-name/cust /cust ext4 ro,barrier=1 wait
/dev/block/bootdevice/by-name/odm /odm ext4 ro,barrier=1 wait
/dev/block/bootdevice/by-name/patch /patch_hw ext4 ro wait,verify
/dev/block/bootdevice/by-name/splash2 /splash2 ext4 rw,nosuid,nodev,noatime,data=ordered,context=u:object_r:splash2_data_file:s0 wait,check
/devices/hi_mci.1/mmc_host/mmc1/* auto auto defaults voldmanaged=sdcard:auto,noemulatedsd
/devices/platform/hi_mci.1/mmc_host/mmc1/* auto auto defaults voldmanaged=sdcard:auto,noemulatedsd
/devices/hisi-usb-otg/usb1/* auto auto defaults voldmanaged=usbotg:auto
/dev/block/bootdevice/by-name/userdata /data f2fs nosuid,nodev,noatime,discard,inline_data,inline_xattr wait,check
/dev/block/bootdevice/by-name/cache /cache ext4 rw,nosuid,nodev,noatime,data=ordered wait,check
/dev/block/bootdevice/by-name/secure_storage /sec_storage ext4 rw,nosuid,nodev,noatime,discard,auto_da_alloc,mblk_io_submit,data=journal,context=u:object_r:teecd_data_file:s0 wait,check
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
HWPRA-H:/ # cat /vendor/etc/fstab.hi6250.old
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait,avb
/dev/block/bootdevice/by-name/vendor /vendor ext4 ro,barrier=1 wait,avb
/dev/block/bootdevice/by-name/product /product ext4 ro,barrier=1 wait
/dev/block/bootdevice/by-name/version /version ext4 ro,barrier=1 wait
/dev/block/bootdevice/by-name/cust /cust ext4 ro,barrier=1 wait
/dev/block/bootdevice/by-name/odm /odm ext4 ro,barrier=1 wait
/dev/block/bootdevice/by-name/patch /patch_hw ext4 ro wait,verify
/dev/block/bootdevice/by-name/splash2 /splash2 ext4 rw,nosuid,nodev,noatime,data=ordered,context=u:object_r:splash2_data_file:s0 wait,check
/devices/hi_mci.1/mmc_host/mmc1/* auto auto defaults voldmanaged=sdcard:auto,noemulatedsd
/devices/platform/hi_mci.1/mmc_host/mmc1/* auto auto defaults voldmanaged=sdcard:auto,noemulatedsd
/devices/hisi-usb-otg/usb1/* auto auto defaults voldmanaged=usbotg:auto
/dev/block/bootdevice/by-name/userdata /data f2fs nosuid,nodev,noatime,discard,inline_data,inline_xattr wait,check,fileencryption=aes-256-xts:aes-256-cts
/dev/block/bootdevice/by-name/cache /cache ext4 rw,nosuid,nodev,noatime,data=ordered wait,check
/dev/block/bootdevice/by-name/secure_storage /sec_storage ext4 rw,nosuid,nodev,noatime,discard,auto_da_alloc,mblk_io_submit,data=journal,context=u:object_r:teecd_data_file:s0 wait,check
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
HWPRA-H:/ # [email protected]: ~/android/essai_adb $>adb shell
daniel.dobrea said:
Thanks XDA XILFY,
I'll give it a try... first rooting then the above steps!
Could some one confirm the need of factory reset!
Thanks Daniel
Click to expand...
Click to collapse

Briked?bricked!XD said:
if its still on 7 remove sd card and do the update it carries over with not much issues
had it done successfully on my brothers device on mine i was too late since i tried to start fresh after doing the update. which clearly is blocked.
"Error: java.lang.IllegalStateException: command '15 volume partition disk:179:192 mixed 90' failed with '400 15 Command failed'"
i'm probably going to get my device rolled back to 7 and redo it now
i had to format my device since i only had about 2gb on my original internal storage so figured id sd partition as well start fresh with 90-10% instead of my 50/50 partition for this unexpected oreo update XP <( T_T)> regret after 3 hrs
Click to expand...
Click to collapse
Has this worked? Because I can't set my sd as adoptable storage (emui 8 android 8.0.0) because I have my disks encrypted.

Mister746 said:
Copied this solution from another thread
Disable encryption to use Adoptable Storage (or just because you can)
open /vendor/etc/fstab.hi6250
make a backup just in case
find "/dev/block/bootdevice/by-name/userdata /data f2fs nosuid,nodev,noatime,discard,inlinedata,inlinexatt r wait,check,fileencryption=aes-256-xts:aes-256-cts"
remove ",fileencryption=aes-256-xts:aes-256-cts"
factory reset via stock recovery
Click to expand...
Click to collapse
Hi,
I have found the file and the text to remove.
My phone isn't rooted so I can only open the file as read only at the moment.
Once I sort out how to update the file and rewrite it, am I correct in thinking that all I do is the deletion you detailed above and factory reset and that's it?
How do I then make my SDCard as internal storage?
Normally there is an option on the phone to do this, which involves a reformat of the SDCard.

is there an update to this thread same error here i have the same model. i hope to fix this problem without rooting i cant unlock my bootloader due to no unlock code. thank you

On oreo 8 i can't still?

Briked?bricked!XD said:
if its still on 7 remove sd card and do the update it carries over with not much issues
had it done successfully on my brothers device on mine i was too late since i tried to start fresh after doing the update. which clearly is blocked.
"Error: java.lang.IllegalStateException: command '15 volume partition disk:179:192 mixed 90' failed with '400 15 Command failed'"
i'm probably going to get my device rolled back to 7 and redo it now
i had to format my device since i only had about 2gb on my original internal storage so figured id sd partition as well start fresh with 90-10% instead of my 50/50 partition for this unexpected oreo update XP <( T_T)> regret after 3 hrs
Click to expand...
Click to collapse
Hi,
I did rollback to Android 7 and did adoptable storage on SD card and disabled OS upgrades. But your solution with removal of SD card and upgrade o Android 8 is interesting.
- Is this removal necessary only for first upgrade to version 8 or it need to be removed for all of them? (there are some security updates also)
- You say 'it carries over with not much issues'. I'm also interested what are those issues?

So I tried upgrade from default Android 7 to 8 and all is working fine. Adoptable storage working for me so far. There was no need to remove SD card from device or anything.

Related

Tips for Increasing the internal memory (/data partition) to 1.5G

I had tried many ways including A2SD and stuffs. But the best way I found is mounting /dev/block/mmcblk0p2 -> /data. I had also modified some scripts and now my htc salsa is having huge internal memory over my sdcard. The methods are in my blog.
New URL: http://wiki.bluebert.info/index.php?title=HTC_Salsa_C510e_Rooting
Some of the details and images are from here and files too. The only difference is I am using the recovery method to alter some scripts and forever it will auto mount the second partition of my sdcard to /data and I will never ever worry about the internal memory issue for my htc salsa
Please update the link
hi,
Can you please update the link as i am not able to browse it.Thanks in advance
wiki.bluebert.info/index.php/HTC_Salsa_C510e_Rooting
If unable to view please let me know. Thanks.
Its nice Blog
Hi,
Thanks for updating the link.I read your blog and have few queries:-
What happens when you connect your device to PC. Memory card is unmounted.So your phone thinks that internal memory is unmounted?
Did you got my point?
Can you tell me what are these partitions?
/dev
/mnt/asec
/mnt/obb
These three partitions take 209mb individually.
What about the battery.How is your phone's battery backup?
chinu1984 said:
Hi,
Thanks for updating the link.I read your blog and have few queries:-
What happens when you connect your device to PC. Memory card is unmounted.So your phone thinks that internal memory is unmounted?
Did you got my point?
Can you tell me what are these partitions?
/dev
/mnt/asec
/mnt/obb
These three partitions take 209mb individually.
What about the battery.How is your phone's battery backup?
Click to expand...
Click to collapse
1. The memory card only will be unmounting the FAT32 partition but not the EXT3/EXT2 partition. It just thinks that is another disk Currently the latest file system I am using is ext3 instead of ext2.
2. /dev: is the folder that contains all the devices files and pointers.
/mnt/asec: is the mount point for the apps that had moved to SDCard. url: groups.google.com/group/android-porting/browse_thread/thread/38b1768ed6a5e1a8
/mnt/obb: StorageManager is the interface to the systems storage service. The storage manager handles storage-related items such as Opaque Binary Blobs (OBBs).
OBBs contain a filesystem that maybe be encrypted on disk and mounted on-demand from an application. OBBs are a good way of providing large amounts of binary assets without packaging them into APKs as they may be multiple gigabytes in size. However, due to their size, they're most likely stored in a shared storage pool accessible from all programs. The system does not guarantee the security of the OBB file itself: if any program modifies the OBB, there is no guarantee that a read from that OBB will produce the expected output.
What do you mean about the phone battery backup?
Basically, what I am doing is actually making sure that even I unplug my /data my phone still be able to start back and also I can have any size for my internal memory. Currently, I had migrated to a 16GB class 10 sdcard and it performs like a charm.
I had noticed on my 8GB class 4 SDCard a bit lagging. So try to get a high speed sdcard and it really helps on this case. So once you had done this mod and you still maintains the original HTC firmware yet you get a very large internal disk.
But remember, whatever you do on the phone, please backup the images using the ClockworkMod. It will save your life. Happy modding
Summarize of the increasing internal memory process...
1. Make sure S-OFF
2. Flash the recovery partition with the clockworkmod
3. Boot into clockworkmod recovery and backup the original /data /system and all the partitions using the clockworkmod recovery.
4. Install the root.zip using the clockworkmod for rooting it
5. If fails we still able to revert back to original firmware.
6. If everything good, you should be root now. Once you get the root, install busybox and superuser. This is needed for the partition process.
7. Reboot back to recovery and make another backup.
8. Make the new ext2 partitions using the busybox or you can do this on any linux terminals on your desktop pc.
9. Upload the modified htcfs and copy everything from /data -> new ext2 partition.
10. The htcfs will auto mount the /data before everything starts and there you go with your newly created partitions size. This is how you get the huge internal memory size on your sdcard.
2nd day of my usage of the /data on sdcard.
I had bought a 16GB class 10 SDCard and partitioned into 4GB for /data as ext3 and the rest for /sdcard as fat32. Currently, I am consuming only 342MB/3.6GB. Which I am quite happy with it.
Below are the things I had found out:
1. Sometimes when there are some heavy process on going it will be a bit slow. Especially when turning on the screen after the screen when to power saving mode. Not all the time but when it is heavily transferring something inside the /data which is the sdcard. This is why we need a high speed sdcard.
2. I am using ext3 instead of ext2. ext3 partition seems a bit stable than ext2. I am not sure yet but will keep on trying.
I will keep on posting and hopefully people out there can do the same on the phone for enjoying the huge internal data storage for the apps. Now I no longer need to remove my apps away from my phone anymore
this sounds like a fantastic idea
i have a questioned
i rooted my gf's phone,installed links2sd,created a ext2 partition and removed a whole bunch of bloat
would me using your method now cause problems or instability on her phone?
i'd love to try this out tonight if possible
vickyboicancan said:
this sounds like a fantastic idea
i have a questioned
i rooted my gf's phone,installed links2sd,created a ext2 partition and removed a whole bunch of bloat
would me using your method now cause problems or instability on her phone?
i'd love to try this out tonight if possible
Click to expand...
Click to collapse
It may unstable unless you are pretty clear what you are migrating and redo the softlink.
The best to try with a clean and possible a few important apps installed like the file expert, root checker, superuser and busybox then you copy the whole /data to the ext2 partition of the sdcard and mount it with my method.
Again, remember to back up everything before trying it.
http://www.facebook.com/pages/HTC-Android/265046560194954
This is my FB HTC page.
Found some minor bug but is repairable. As long as you do not eject the sdcard after power off the HTC (where I had already enabled the fastboot) then everything should be fine. But just in case, like my case I had switched off the phone then I eject my sdcard for copying some files and reinsert it back then power on the phone and all my apps become unstable and not usable. This is because I had enabled the fastboot and some files are reside in the memory.
What you can do is:
1. Do not panic. Let it starts. Everything still in the ext3 partition.
2. use the adb command and run as below:
# sudo adb shell
# /system/bin/fix_permissions
If you have encounter some cut command not found that is not a main issue. Is fixable. You just need to remount the /system folder as rw and softlink the busybox as cut. Something like below:
# su
# mount -o rw,remount dev/block/mtdblock3 /system
# cd /system/xbin/
# ln -s busybox cut
Once done, re-run the /system/bin/fix_permissions again.
3. Wait for the process the fix all the file permission issues.
4. Then reboot the phone again:
# adb reboot
What is the fix_permissions about? Below link is the details on it:
http://wiki.cyanogenmod.com/wiki/Fix_permissions
mount Internal to internal??
Hi,
In spite of mounting and external drive with ext-3 partition onto /data. cant me mount an internal drive may be /dev/obb onto /data?
What will be the advantages and disadvantages?
chinu1984 said:
Hi,
In spite of mounting and external drive with ext-3 partition onto /data. cant me mount an internal drive may be /dev/obb onto /data?
What will be the advantages and disadvantages?
Click to expand...
Click to collapse
Defeating the purpose. The reason why we need to mount to the sdcard is to get extra disk space. I am using this method to trick the system thinks that it have a very huge space and eventually all from the external sdcard partition.
The /dev/obb... is just a tmpfs. Try to do a mount command to get the output then you will get a clearer picture on this. For my case, is /mnt/obb and just a tmpfs which is useless.
tmpfs is a temporary file system where it will be gone after power off.
Hi,
Where can i get this XTC Clip to S-OFF??
chinu1984 said:
Hi,
Where can i get this XTC Clip to S-OFF??
Click to expand...
Click to collapse
Read my Facebook page on the last second post.
Below images are the screenshots from my HTC Salsa.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The above image is after the /data remounted to my sdcard. Originally was 150MB and now is 4GB.
After I had installed many apps I am still having lots of space.
I had simplified the process:
What I am intend to do is to extend the /data (internal memory) to sdcard.
1. Install Busybox.
2. Install Sudo Checker and all the sudo tools.
3. Once this done, we will need to partition the sdcard. Please be making sure all the data are backup. I am not going to be responsible on that
4. Use the hardware method by pressing the volume down and power button to enter the recovery mode or using the adb command "adb reboot recovery".
5. Use the recovery tool and backup the existing working image to the sdcard before proceeding next step. It will be useful to have the recovery image in hand. You will never know when you going to make the mistakes.
6. Once done, lets proceed with the adb command on the linux / windows terminal.
7. Before we start lets prepare some simple shell scripting. What we are trying to do here is to create a file and replaces the existing htcfs on the /system/bin/htcfs. I am not sure what is the use of mounting this htcfs on /data/htcfs and is empty. But I will put back this to my script in future. What I had done was move the original htcfs to htcfs.original and put my version of htcfs which it will auto starts every power off or reboot. Below are the codes:
Filename: htcfs
#!/system/bin/sh
/system/xbin/busybox mount -t ext2 /dev/block/vold/179:2 /data
/system/bin/htcfs.original $1 $2 $3 $4 $5 $6
8. Now lets rename the original htcfs in the phone before we copy our version into the phone. At the same time we do partitioning on the SDcard.
# adb shell
# mount -a
# cd /system/bin/
# busybox cp htcfs htcfs.original
# exit
# adb push htcfs /system/bin/
# adb shell
# cd /system/bin
# chmod 755 htcfs
# chown root.shell htcfs
# fdisk /dev/block/mmcblk0
# mkfs.ext2 -m 0 /dev/block/mmcblk0p2
# mount /dev/block/mmcblk0p2 /sd-ext
# cd /data
# busybox cp -a . /sd-ext
# sync
# cd /
# umount /sd-ext /sdcard /data /system
# exit
# adb reboot
The above steps are creating an EXT2 partition on the SDCard. My version I created a 1.5G as my /data space.
So, basically the htcfs is mounting the /data from my sdcard on every reboot before all the applications start up. There is a step to copy all existing /data to the sd-ext and that is the trick to make the phone thinks that is using the internal memory and we have no longer facing insufficient disk space on cheaper android phones or on some branded HTC phones with little amount of internal disk.
Remember, the above steps are only for rooted phones. My phone until now still working great and with 4GB internal memory (mounted from SDCard as ext3).
I am working on a Linux Terminal for the above steps.
I have problem to get XTC Clip.
Is it possible we can S-Off without using XTC Clip?
luxoriouz said:
I have problem to get XTC Clip.
Is it possible we can S-Off without using XTC Clip?
Click to expand...
Click to collapse
Not at the moment.

[MOD] Swap Internal & External SD [CM9, CM10, rooted stock XXLQ1 and probably more]

[MOD] Swap Internal & External SD [CM9, CM10, rooted stock XXLQ1 and probably more]
Hi folks!
Like many of you I'm sure, I had the problem of running out of space on the internal SD and all the existing tricks seemed to be too much work. So I took mattiadj's script and just made a few changes for the 7.7 on CM9, then CM10, then rooted stock XXLQ1. Thanks mattiadj for this one!
I've tested this on the 7.7 but I suspect it will work on all other devices and other ROMs too.
WARNING: I'm just tinkering, I don't have any solid experience with ROMs, and I certainly take no responsibility for any damage or injuries caused by the following instructions! I'm just passing on helpful hints
What does it do?
From what I understand the script remaps the SD directories, swapping the internal with the external.
init.d approach
Androguide.fr has been kind enough to convert the scripts into init.d scripts, check out the scripts here to test them out and let us know how you go!
What do you need?
- The script, either use one that is attached (extsd2internalsd_7.7cm9.txt or extsd2internalsd_7.7cm10.txt or extsd2internalsd_7.7RootedStockXXLQ1_v2.txt), or create your own.
- SManager to run the script.
- A file manager with root access to check the vold folder, the mounting points for the SD cards and to copy the script over.
Any Issues?
Only issue I have seen is sometimes the script is run (via SManager) after apps like swiftkey and so I temporarily get an error notification (language pack not found), but if you wait just a little while, SManager eventually runs the script and everything is back to normal.
[size=+2]What you need to do:[/size]
1) Confirm that the storage locations are:
/mnt/sdcard (internel) & /mnt/emmc (external) for CM9,
/storage/sdcard0 (internal) & /storage/sdcard1 (external) for CM10/JB,
/mnt/sdcard/ (internal) & /mnt/sdcard/extStorages/SdCard (external) for XXLQ1.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2) Confirm that the two files in /dev/block/vold are:
179:24 & 179:25 in CM9,
179:8 & 179:9 in in CM10,
179:8 & 179:9 in XXLQ1.
NOTE: If steps 1 or 2 show a different setup, follow the steps described in What I did listed below
3) Download or create appropriate script and copy to /data
4) Open the script using SManager, ENABLE Su, click save then run the script.
NOTE: if there is no output when you run the script then it probably means it was successful.
4b) ADDITIONAL STEP FOR ROOTED STOCK XXLQ1
After running the script once, you would have received one error message, the external SD is unlinked from /mnt/sdcard/extStorages/SdCard, and so the SdCard directory no longer exists.
Create a directory titled SdCard in /mnt/sdcard/extStorages and run the script again.
5) Check in Settings>Storage to see if the internal and external SDs have been swapped
NOTE: If the result is different for you, follow the steps described in What I did listed below
6) Go back to SManager and enable Su & Boot, then click Save
7) Reboot and check Settings>Storage again!
8) Feel smug about the fact you can install as many games as you want!!!
[size=+2]How it all works:[/size]
I picked up mattiadj's script for the S3 from his discussion thread [MOD] ExtSd2InternalSd v3|Increase your data storage|CMW zip|CM10|100% Working| and logically deduced the following format for the script:
mount -t vfat -o umask=0000 [EXTERNAL SD SOURCE LOCATION] [INTERNAL SD DESTINATION LOCATION]
mount -o bind [INTERNAL SD SOURCE LOCATION] [EXTERNAL SD DESTINATION LOCATION]
where:
[EXTERNAL SD SOURCE LOCATION] is the location where external sd can be referenced from. There are typically two files in /dev/block/vold/, one of those files is the external sd source location. For CM9 I set this to /dev/block/vold/179:25. For CM10 I set this to /dev/block/vold/179:9
[INTERNAL SD SOURCE LOCATION] is the location where internal sd can be referenced from. From what I understand, it is always /data/media.
[INTERNAL SD DESTINATION LOCATION] is the location where android will look for the internal sd. In CM9 I set this to /mnt/sdcard. In CM10 I set this to /storage/sdcard0.
[EXTERNAL SD DESTINATION LOCATION] is the location where android will look for the external sd. In CM9 I set this to /mnt/emmc. In CM10 I set this to /storage/sdcard1.
What I did:
1) I checked the storage locations to find that CM9 uses /mnt/sdcard (internel) & /mnt/emmc (external) for sd storage, and CM10/JB uses /storage/sdcard0 (internal) & /storage/sdcard1 (external).
2) Secondly I checked the /dev/block/vold to find two files, in CM9: 179:24 and 179:25, in CM10: 179:8 and 179:9.
3) To work out which vold file is correct I:
a) created a script using the information I found above
b) installed SManager
c) rebooted to ensure previous attempts didn't muck up the results
d) ran the script using SManager
e) checked Settings>Storage to confirm that script did in fact swap internal and external SDs.
After getting the correct vold file I:
4) Copied the script to /data/
5) Open the script in SManager and enabled Su and Boot (execute script on boot with SU permissions)
6) Rebooted and checked Settings>Storage once again.
Final scripts
FYI: The scripts attached contain the following:
===== 7.7 ExtSd2InternalSd for CM9 =======
mount -t vfat -o umask=0000 /dev/block/vold/179:25 /mnt/sdcard
mount -o bind /data/media /mnt/emmc
===== 7.7 ExtSd2InternalSd for CM10 =======
mount -t vfat -o umask=0000 /dev/block/vold/179:9 /storage/sdcard0
mount -o bind /data/media /storage/sdcard1
===== 7.7 ExtSd2InternalSd for rooted stock XXLQ1 version 2 =======
mount -t vfat -o umask=0000 /dev/block/vold/179:9 /mnt/sdcard
mount -o bind /data/media /mnt/sdcard/extStorages/SdCard
Like I said, I'm just a tinkerer, I'll be happy to help but keep in mind my expertise is limited. Let me know how you go!
Enjoy! And don't forget to swap the contents of the internal and external SD directories
Again all credits go to mattiadj and his thread [MOD] ExtSd2InternalSd v3|Increase your data storage|CMW zip|CM10|100% Working|
POST HISTORY
[UPDATE: I've made some changes to this post to make it a bit easier to read]
[UPDATE 2: I've added some instructions on how to make this work for rooted stock XXLQ1, an additional step has been added in What you need to do section]
[UPDATE 3: I missed an important step before running the script. You MUST enable Su (and save) in SManager before you run the script!]
[UPDATE 4: Moved instructions to top for better readability]
[UPDATE 5: Testing out init.d method]
This is awesome.. Thnx for sharing dude
This might be usefull for a dev. to enable in a Rom installer.
Regards
Axelman
Sent from my GT-P6800 using xda app-developers app
Gonna try this for sure....thank you!
this would be the PERFECT thing to fix superbricked tabs... is there any way to run a script like this from adb? surely you've read about the superbrick hardware bug. well, from what i can tell, my internal memory is FRIED.... so being able to swap out the memory would be AWESOME, but i need it to be a switch on a much deeper level than whether or not swiftkey will start before or after this script. like is there a way to change this thing permanently?
aletheus said:
this would be the PERFECT thing to fix superbricked tabs... is there any way to run a script like this from adb? surely you've read about the superbrick hardware bug. well, from what i can tell, my internal memory is FRIED.... so being able to swap out the memory would be AWESOME, but i need it to be a switch on a much deeper level than whether or not swiftkey will start before or after this script. like is there a way to change this thing permanently?
Click to expand...
Click to collapse
dunno how to write the script correctly but would love to have one made for stock ics, non cm9/10 users
aletheus said:
this would be the PERFECT thing to fix superbricked tabs... is there any way to run a script like this from adb? surely you've read about the superbrick hardware bug. well, from what i can tell, my internal memory is FRIED.... so being able to swap out the memory would be AWESOME, but i need it to be a switch on a much deeper level than whether or not swiftkey will start before or after this script. like is there a way to change this thing permanently?
Click to expand...
Click to collapse
I wouldn't know where to start, but mattiadjn has created a kernel mod for the s3 which works great, but doesn't work for cm10 (hence the script). http://forum.xda-developers.com/showthread.php?t=1772234
well it says my internal and external storage are swapped but not sure apps are being copied to the microsd actually, my external storage space is shrinking with all my installs (actually internal storage)... nice effort though.
johnnobts said:
well it says my internal and external storage are swapped but not sure apps are being copied to the microsd actually, my external storage space is shrinking with all my installs (actually internal storage)... nice effort though.
Click to expand...
Click to collapse
Never mind, I think it is working running CM10. Would still love to get this working using stock ROM.
johnnobts said:
Never mind, I think it is working running CM10. Would still love to get this working using stock ROM.
Click to expand...
Click to collapse
Which ROM? give me an example and I'll give it a go.
darz said:
Which ROM? give me an example and I'll give it a go.
Click to expand...
Click to collapse
the quicksilver pre 1.0 is one of my favorite custom ics roms. but also the P6800XXLQ2_P6800OXALQ2_ATO stock rom maybe?
johnnobts said:
the quicksilver pre 1.0 is one of my favorite custom ics roms. but also the P6800XXLQ2_P6800OXALQ2_ATO stock rom maybe?
Click to expand...
Click to collapse
I'll try that one a bit later, but I did try running it on a rooted stock XXLQ1 with partial success.
The /dev/block/vold folder contains files 179:8 and 179:9. 179:9 is the correct reference to the external SD.
The SD locations are /mnt/sdcard and /mnt/sdcard/extStorages/SdCard, but I couldn't get the mount to bind /mnt/sdcard/extStorages/SdCard, so I tried /mnt/sdcard/extStorages instead with partially successful results.
So the final script (attached) is
===== 7.7 ExtSd2InternalSd for rooted stock XXLQ1 =======
mount -t vfat -o umask=0000 /dev/block/vold/179:9 /mnt/sdcard
mount -o bind /data/media /mnt/sdcard/extStorages
The internal sd (now external SD card) works perfectly, shows up properly in Setttings>Storage.
The external sd (now internal SD) is accessible from /mnt/sdcard/extStorages, but it doesn't show up in Settings>Storage.
[FIX] I created the directory "SdCard" in /mnt/sdcard/extStorages and whalla, the internal storage is showing up as external SD in Settings>Storage.
Anyone care to add some insight why this is the case?
I suspect (with many assumptions) that I can't bind the mount to /mnt/sdcard/extStorages/SdCard because it doesn't initially exist, but I think Settings>Storage looks for that directory specifically.
darz said:
I'll try that one a bit later, but I did try running it on a rooted stock XXLQ1 with partial success.
The /dev/block/vold folder contains files 179:8 and 179:9. 179:9 is the correct reference to the external SD.
The SD locations are /mnt/sdcard and /mnt/sdcard/extStorages/SdCard, but I couldn't get the mount to bind /mnt/sdcard/extStorages/SdCard, so I tried /mnt/sdcard/extStorages instead with partially successful results.
So the final script (attached) is
===== 7.7 ExtSd2InternalSd for rooted stock XXLQ1 =======
mount -t vfat -o umask=0000 /dev/block/vold/179:9 /mnt/sdcard
mount -o bind /data/media /mnt/sdcard/extStorages
The internal sd (now external SD card) works perfectly, shows up properly in Setttings>Storage.
The external sd (now internal SD) is accessible from /mnt/sdcard/extStorages, but it doesn't show up in Settings>Storage.
[FIX] I created the directory "SdCard" in /mnt/sdcard/extStorages and whalla, the internal storage is showing up as external SD in Settings>Storage.
Anyone care to add some insight why this is the case?
I suspect (with many assumptions) that I can't bind the mount to /mnt/sdcard/extStorages/SdCard because it doesn't initially exist, but I think Settings>Storage looks for that directory specifically.
Click to expand...
Click to collapse
OK, I tried something different!
1) I ran:
mount -t vfat -o umask=0000 /dev/block/vold/179:9 /mnt/sdcard
to unlink the external sd from /mnt/sdcard/extStorages/SdCard
2) I created SdCard in /mnt/sdcard/extStorages/ (to have something to bind to)
3) Then I ran the following script:
===== 7.7 ExtSd2InternalSd for rooted stock XXLQ1 version 2 =======
mount -t vfat -o umask=0000 /dev/block/vold/179:9 /mnt/sdcard
mount -o bind /data/media /mnt/sdcard/extStorages/SdCard
And everything looks good! Not sure which approach is better but this seems to match the original setup more accurately.
darz said:
OK, I tried something different!
1) I ran:
mount -t vfat -o umask=0000 /dev/block/vold/179:9 /mnt/sdcard
to unlink the external sd from /mnt/sdcard/extStorages/SdCard
2) I created SdCard in /mnt/sdcard/extStorages/ (to have something to bind to)
3) Then I ran the following script:
===== 7.7 ExtSd2InternalSd for rooted stock XXLQ1 version 2 =======
mount -t vfat -o umask=0000 /dev/block/vold/179:9 /mnt/sdcard
mount -o bind /data/media /mnt/sdcard/extStorages/SdCard
And everything looks good! Not sure which approach is better but this seems to match the original setup more accurately.
Click to expand...
Click to collapse
great, so all i have to do is creat an SdCard folder in extStorages/ right, then run the script? thanks! i bet it works with the q2 version, will give it a go
johnnobts said:
great, so all i have to do is creat an SdCard folder in extStorages/ right, then run the script? thanks! i bet it works with the q2 version, will give it a go
Click to expand...
Click to collapse
Correct, but remember to run the first line of the script (or the whole script, you will just get an error for the second line of the script) before you create the folder.
Also note, I had made a mistake with the instructions, before you run the script in SManager, you must enable Su first. If you don't then it will not run properly.
Thanks a lot for the awesome script darz :good:
I modified it a little bit to make it work simply by putting it in /system/etc/init.d so that it will run at each boot without the user having to do anything. See attachements. (Couldn't test atm, but it should be working).
If someone could try it and give some feedback, would be nice.
I included your script in my "Pimp My Rom" aroma script, with proper credits, hope you don't mind.
Androguide.fr said:
Thanks a lot for the awesome script darz :good:
I modified it a little bit to make it work simply by putting it in /system/etc/init.d so that it will run at each boot without the user having to do anything. See attachements. (Couldn't test atm, but it should be working).
If someone could try it and give some feedback, would be nice.
I included your script in my "Pimp My Rom" aroma script, with proper credits, hope you don't mind.
Click to expand...
Click to collapse
Excellent! Much appreciated
Do you mind if I add them to the first post after we have confirmed they work?
I'll test a couple of them later today.
Androguide.fr said:
Thanks a lot for the awesome script darz :good:
I modified it a little bit to make it work simply by putting it in /system/etc/init.d so that it will run at each boot without the user having to do anything. See attachements. (Couldn't test atm, but it should be working).
If someone could try it and give some feedback, would be nice.
I included your script in my "Pimp My Rom" aroma script, with proper credits, hope you don't mind.
Click to expand...
Click to collapse
I can't get it to work on CM10 no matter what I do, I believe mattiadj is having the same problem for the s3.
darz said:
I can't get it to work on CM10 no matter what I do, I believe mattiadj is having the same problem for the s3.
Click to expand...
Click to collapse
+1 that's true, didn't think of trying on my s3, and doesn't work either.
Maybe a permission problem, i'll try to set_perm to 777 through pimp-my-rom's updater-script and see if it works.
Anyway your work is of great help for people with a superbricked tab (like me), kudos :good:
Androguide.fr said:
+1 that's true, didn't think of trying on my s3, and doesn't work either.
Maybe a permission problem, i'll try to set_perm to 777 through pimp-my-rom's updater-script and see if it works.
Anyway your work is of great help for people with a superbricked tab (like me), kudos :good:
Click to expand...
Click to collapse
I'm glad it helps!!
OK, I mucked around with the CM9 script a bit on my s3 and I _think_ it started running when I removed the .txt extension.
But only the internal sd was being mapped, which leads me to believe there's something wrong with "mount -t vfat -o umask=0000 /dev/block/vold/179:25 /mnt/sdcard" line.
What should be done to get the same results in galaxy note? I'm missing some of the numbers in the list, can I get them somehow?
Thanks,

/data on SDcard

Hello,
I'm quite new in android development, so sorry for dumb question.
I have new GT-S6102 (because of dualsim setup) and I'd be quite happy with the stock firmware (S6102XXMA2) if it wasn't of the 160M memory. What I'm trying to do is to modify init.rc in bootimage to mount /data on 4G second partition of my SDCard instead of 160M /dev/stl11.
I'm using a Ubuntu 12.04 machine for my experiments.
I've copied /dev/block/bml7 from my phone using ADB, extracted it using abootimg.
First (and I hope that main) trouble is that when I try to update the boot.img (abootimg -u boot.img -r initrd.img), even without modifying the ramdisk, the resulting image has few different bytes near the beginning of the file. Anyway when I flashed it back to phone, it booted normally.
Then I unpacked the ramdisk (using steps from here) and modified init.rc:
Code:
mount ext4 /dev/block/mmcblk0p2 /data nosuid nodev crypt check=no
# mount rfs /dev/stl11 /data nosuid nodev crypt check=no
I have a 32G uSD card with 28G FAT and 4G EXT4 primary partitions.
Then I've repacked it, made new boot.img, flashed with ODIN and it made a nice bootloop with Samsung bootanimation without usual sound.
What am I doing wrong?
Is this modification even possible?
Thanks for advice
P.S.
I've tried to extract the boot.img from S6102XXMA3_S6102DBTMA1_S6102XXMA2_HOME.tar.md5, but 7zip on Windows and TAR on linux complain that it isn't valid archive.
jelinek.01 said:
Hello,
I'm quite new in android development, so sorry for dumb question.
I have new GT-S6102 (because of dualsim setup) and I'd be quite happy with the stock firmware (S6102XXMA2) if it wasn't of the 160M memory. What I'm trying to do is to modify init.rc in bootimage to mount /data on 4G second partition of my SDCard instead of 160M /dev/stl11.
I'm using a Ubuntu 12.04 machine for my experiments.
I've copied /dev/block/bml7 from my phone using ADB, extracted it using abootimg.
First (and I hope that main) trouble is that when I try to update the boot.img (abootimg -u boot.img -r initrd.img), even without modifying the ramdisk, the resulting image has few different bytes near the beginning of the file. Anyway when I flashed it back to phone, it booted normally.
Then I unpacked the ramdisk (using steps from here) and modified init.rc:
Code:
mount ext4 /dev/block/mmcblk0p2 /data nosuid nodev crypt check=no
# mount rfs /dev/stl11 /data nosuid nodev crypt check=no
I have a 32G uSD card with 28G FAT and 4G EXT4 primary partitions.
Then I've repacked it, made new boot.img, flashed with ODIN and it made a nice bootloop with Samsung bootanimation without usual sound.
What am I doing wrong?
Is this modification even possible?
Thanks for advice
P.S.
I've tried to extract the boot.img from S6102XXMA3_S6102DBTMA1_S6102XXMA2_HOME.tar.md5, but 7zip on Windows and TAR on linux complain that it isn't valid archive.
Click to expand...
Click to collapse
OK, so it seems that I´ve managed to work it out at last.
The unpacking and repacking of bootimage was all right, trouble was in updating only the init.rc and probably using ext4. What I have done:
I replaced all mentions of mounting /dev/stl11 on /data by mounting /dev/block/mmcblk0p2 (that was in files fota.rc, init.rc, init.charge.rc, res/recovery.fstab). In res/recovery.fstab I also changed formatting type from rfs16 to rfs32 so it supports my 4.5G partition.
Then I flashed the bootimg in my phone and formatted the data partition in recovery (that was the only way to make it rfs I've found).
Maybe it would all work with changing the format and mount type to ext4, but I hoped for as little modification as possible.
Now it reports 4.25GB free space after all my apps are installed, hurray .
I have just to remember to never boot it up without SDcard inserted. Maybe it would work as a possibility to borrow the phone to somebody with another card.
The boot.img came from S6102XXMA3_S6102DBTMA1_S6102XXMA2_HOME.tar.md5, if someone wants to try it, it is here . It probably wouldn't touch the original /data partition, so it might be possible to try it and undo it by flashing original boot.img. It just requires to have a second primary partition on SDcard and formatting it in recovery before first boot.
i didnt know to do that boot "compiling" like u did, quite good for you, im using cronmod int2ext , i have 850mb internal. i use 'pimp my rom' to get init.d support.

ext2 formatted ext-sd mounting

I'm attempting to format my external sdcard to ext2, just one single partition (no apps2sd magic).
The reasons are to have the ability to store >4GB files on the card, faster read times, and not needing compatibility with any M$ systems/PCs/Junk, journaling (>ext2) is not needed.
At the moment, I'm running a CM based ROM (cyanfox) and will likely try this out on a moto/stock based ROM after.
Here is my progress so far :
I'm able to mount the SD manually, though with some hoops being involved. The bionic will not mount it automatically, and is constantly telling me that it is unsupported/empty/needs to be formatted in the storage menu, and a permanent notification.
In a terminal shell, I can mount the device (/dev/block/vold/179:97) by specifying the type only as ext4. This is definitely not ideal, but I get errors when the type is specified as ext2 or ext3. (error : mount: Operation not supported on transport endpoint ).
At the moment, I've made an init script to mount the sd at /storage/sdcard1 but this doesn't cause android to think that the actual sd is mounted properly (empty sd notification still exists). Though it is at least mounted.
And I have edited the fstab file at root to change the sd type from vfat to ext2, but this file rewrites itself at boot. Unfortunately I'm not able to set an immutable bit on the file.. (android is not a type writer).
The ext2 filesystem has been checked for errors, does have files written to it, and is able to be read/written to in android after manually mounting it. Android just insists on a fat partition though.
Any help/tips would be appreciated. I'll update this thread in case anyone else would like to apply this as well.
Also, if I'm missing something blatantly obvious, please let me know

[GUIDE][HOWTO] Multi-boot Android systems on Xperia TX

FIRST OF ALL, we should say thanks to @alvinhochun 's work on porting kexec hardboot patch to Xperia M. His original thread is here: http://forum.xda-developers.com/showthread.php?t=2568151
And @Tasssadar who has ported kexec hardboot patch on MSM chips. Original thread is here: http://forum.xda-developers.com/nexus-4/orig-development/kexec-hardboot-patch-t2472316/post46223952
As for the kernel patch and kexec binary for TX, they are here: http://forum.xda-developers.com/showthread.php?t=2747215
OK let's begin our tour on TX...
0. Disclaimer
This is a rather dangerous hack. I'm not responsible for data loss, broken SD cards, dead internal storage or bricked phones. Try this at your own risk. Proceed only when you know what you are doing.​
1. Requirements
a. ROM with “kexec hardboot” patched kernel. My OmniROM build will do the job. Since Alx31Tse is also using my kernel source for TX, the Carbon builds for TX may be capable of handling this as well. This ROM should be installed into internal storage : just flash it in recovery as usual.​b. External MicroSD card which is big enough for your ROMs. One ROM takes up ~4GB space.​c. Some basic knowledge of partitions, device nodes, ramdisk modding(check this thread by letama: http://forum.xda-developers.com/showthread.php?t=2418893).​
2. Partitioning the external sdcard
a. Plan the partitions​
Each ROM need three partitions : system, data and cache. You need at least 1.4GB system + 2GB data + 400MB cache for stock ROMs. The system partition for third-party ROMs can be shrinked to ~900MB. Of course you can set your own data partition size if 2GB does not suit your needs. The space left can be used for storing data just like a normal sdcard.
For example, I'm using a 16GB card and going to install two stock ROMs (9.1.B.1.67 + 9.2.A.0.295). So I have to create at least 6 partitions for them:
1.4GB system for 295
2GB data for 295
400MB cache for 295
1.4GB system for 67
2GB data for 67
400MB cache for 67
There is ~8GB left after all these partitions. This can be used as a normal sdcard. Just create another partition for it.​
b. Go partitioning it!​
Everyone has his own way of doing this. I prefer using a USB card reader and Disk Utility that comes with Ubuntu.
Erase the card and initialize it with GUID Partition Table (GPT). Of course you can use MBR, but I didn't test it. Be careful in the following steps if you choose MBR.
Create the “normal sdcard” partition. In my example, create a 8GB partition here and format it with FAT32. THIS PARTITION SHOULD BE THE FIRST ONE ON THE CARD! Otherwise Android system may not be able to recognize it.
Create the partitions for guest systems. There are no particular order for the partitions. Just make sure you remember their order. DO NOT FORMAT them for now.
In my example:
PART 1: 8GB, FAT32
PART 2: 1.4GB unformatted
PART 3: 2GB unformatted
PART 4: 400MB unformatted
PART 5: 1.4GB unformatted
PART 6: 2GB unformatted
PART 7: 400MB unformatted​
3. Kernel mods for guest systems
For each guest system:
a. Unpack its kernel.​
If you are going to install a full stock ROM, please choose a corresponding kernel with recovery built-in in Android Development section.
If you are going to install a third-party ROM (OmniROM, CM etc) or customized stock ROM (Rockers etc), chances are that their kernels have recovery built-in already and you can proceed.
Now unpack the kernel.
We have zImage(sec0.bin), ramdisk(sec1.bin) now. The rest can be ignored.​
b. Modify the mount entries in fstab (and other files)​
fstab is the file that suggests the real device for the /system, /data and /cache mount points. Modding it will make it possible to mount the partitions other than the ones in internal storage on /system /data and /cache, so that we can separate different systems into different partitions.
Now you have to be clear about “how the partitions on external card will be presented in your phone” (their device nodes). In my example (GPT with 7 partitions):
PART 1: 8GB → /dev/block/mmcblk1p1
PART 2: 1.4GB → /dev/block/mmcblk1p2
PART 3: 2GB → /dev/block/mmcblk1p3
PART 4: 400MB → /dev/block/mmcblk1p4
PART 5: 1.4GB → /dev/block/mmcblk1p5
PART 6: 2GB → /dev/block/mmcblk1p6
PART 7: 400MB → /dev/block/mmcblk1p7
As has been mentioned above, mmcblk1p1 is for normal file storage, p2~p4 is for 295, p5~p7 is for 67.
Files that need modding:
(sec1.bin/sbin/ramdisk.cpio) /fstab, /fstab.qcom, /init.target.rc
Click to expand...
Click to collapse
(sec1.bin/sbin/ramdisk-recovery.cpio) /fstab, /fstab.qcom, /etc/recovery.fstab, /etc/twrp.fstab
Click to expand...
Click to collapse
The fstabs are easy to deal with. Just change the block device name for /system /cache and /data to /dev/block/mmcblk1p* accordingly. The init.target.rc has only one line that should be modded. For example,
FOR 9.1.B.1.67 in my example:
ramdisk.cpio/fstab:
/data ext4 /dev/block/mmcblk1p6
/cache ext4 /dev/block/mmcblk1p7
/boot/modem_fs1 raw /dev/block/platform/msm_sdcc.1/by-name/modemst1
/boot/modem_fs2 raw /dev/block/platform/msm_sdcc.1/by-name/modemst2
Click to expand...
Click to collapse
ramdisk.cpio/fstab.qcom:
/dev/block/mmcblk1p5 /system ext4 ro,barrier=1,discard wait,check
/dev/block/mmcblk1p6 /data ext4 nosuid,nodev,noatime,barrier=1,noauto_da_alloc,discard wait,check,encryptable=footer
/dev/block/mmcblk1p7 /cache ext4 nosuid,nodev,noatime,barrier=1,discard wait,check
/dev/block/platform/msm_sdcc.1/by-name/SDCard /mnt/int_storage ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard wait,check
Click to expand...
Click to collapse
ramdisk.cpio/init.target.rc:
(SEARCH FOR /system)
on post-fs
mount ext4 /dev/block/mmcblk1p5 /system ro remount barrier=1
Click to expand...
Click to collapse
Just do the same for ramdisk-recovery.cpio. For example:
ramdisk-recovery.cpio/etc/recovery.fstab
/boot emmc /dev/block/mmcblk0p4
/system ext4 /dev/block/mmcblk1p5
/cache ext4 /dev/block/mmcblk1p7
/data ext4 /dev/block/mmcblk1p6 length=-16384
/sdcard ext4 /dev/block/mmcblk0p15
/external_sd auto /dev/block/mmcblk1p1 /dev/block/mmcblk1
Click to expand...
Click to collapse
And replace mmcblk1p5~p7 with p2~p4 then do it all again for 9.2.A.0.295's ramdisk.cpio & ramdisk-recovery.cpio
NOTE: All these fstab and rc files should be rw-r—r-- and owned by root:root. Otherwise the system may fail to boot.
Now repack the ramdisk.cpio, ramdisk-recovery.cpio and then the whole ramdisk.​
4. Installing the guest systems
Take notice of the texts in red. Change them to fit your needs.
a. Preparing the guest systems​If you are installing full stock ROM (FTF format), you can use Flashtool to dump the system image (Flashtool > Tools > Sin Editor, load system.sin from FTF archive and dump data). Then write the image to the sdcard by “dd if=system.ext4 of=/dev/sdb2“ on the computer.
If you are installing ROMs in ZIP format, you need to modify updater-script and replace all (for 9.1.B.1.67 in my example)
/dev/block/mmcblk0p12 or /dev/block/platform/msm_sdcc.1/by-name/System to /dev/block/mmcblk1p5
Click to expand...
Click to collapse
/dev/block/mmcblk0p13 or /dev/block/platform/msm_sdcc.1/by-name/Cache to /dev/block/mmcblk1p7
Click to expand...
Click to collapse
/dev/block/mmcblk0p14 or /dev/block/platform/msm_sdcc.1/by-name/Userdata to /dev/block/mmcblk1p6
Click to expand...
Click to collapse
And
remove /dev/block/mmcblk0p4 or /dev/block/platform/msm_sdcc.1/by-name/Kernel formatting/writing lines
Click to expand...
Click to collapse
Then repack the ROM and push it into phone's internal sdcard.​
b. Boot the guest kernel/system​Remember we have zImage and modded ramdisk for each guest system? adb push them to /data partition. The kexec binary is needed as well. Now you can use the kexec binary(check the beginning of this thread) to boot your guest kernel and then recovery.
For example:
I pushed 295 kernel zImage to /data/boot4.3/zImage-stock, modded ramdisk to /data/boot4.3/initrd-stock, and kexec binary to /data/kexec. Now execute as root:
Code:
cd /data
chmod 755 kexec
busybox sync
busybox mount -o remount,ro /system
busybox mount -o remount,ro /cache
busybox mount -o remount,ro /data
busybox sync
./kexec --load-hardboot [COLOR="Red"]./boot4.3/zImage-stock[/COLOR] –initrd=[COLOR="Red"]./boot4.3/initrd-stock[/COLOR] --mem-min=0x85000000 --command-line="`cat /proc/cmdline`"
busybox sync
./kexec -e # phone reboots and guest kernel (295) starts
NOTE: the guest kernel's cmdline may not be exactly the same as the host one. However, it doesn't matter much. 67 and 295 both boot fine using the same cmdline as OmniROM. Since bootloader will append some parameters to the command line, using guest's sec3 without appending these parameters manually is not a good idea.​
c. Preparing filesystems and installing ROMs in ZIP​After the phone reboots, press Vol buttons at purple LED to go into recovery. Now you are in the recovery for your guest system (295).
FORMAT (not wipe) /data and /cache there. For ZIP ROMs you need to format /system as well.
Then install the modded ZIP file if needed. You can also flash SuperSU or anything else to this guest system in the recovery (remember to check if there are wrong block device paths in updater-script).
After finishing the installation of one guest system, reboot and you will go into the host ROM. Execute the commands again and specific the next guest system's zImage and ramdisk to boot into the next guest system. Then do the formatting and flashing things as described above.​
5. Boot into guest systems
Once you finish installing all the guest systems, reboot. Then in the host ROM you can execute the commands in Step 4 again to boot into the corresponding guest system. Don't press any key after the reboot. If there's nothing wrong, you will see the bootanimation and then the Android system. Since external sdcards may not be as fast as internal storage, the first boot may take very long time. If you see the bootanimation, just be patient and it will boot up finally.​
===========================================================
I know I can't speak English well and it's hard to make myself clear. So if you feel confused, please post your questions here so that everyone who knows the answer will be able to help.
And if you are skilled in Android things, you can choose your own way to achieve the goal:
Partition the sdcard → Mod fstsb and rcs to mount partitions on sdcard to /system etc → Mod the ROM installation script → Boot into guest recovery to format(initialize) data & cache &system and flash ROM → Boot into the guest Android OS
Click to expand...
Click to collapse
This is a little bit complicated. But I do hope this will add more fun to our device
Thanks for your sharing
got it
Although this is labeled for the Xperia TX, after reading through everything, it looks like this works on all devices, you just have to change a few things. Good job putting this together! (Even though I don't have an Xperia TX)
r3pwn said:
Although this is labeled for the Xperia TX, after reading through everything, it looks like this works on all devices, you just have to change a few things. Good job putting this together! (Even though I don't have an Xperia TX)
Click to expand...
Click to collapse
Yeah, it seems that the guide applies to all devices with patched kernels
updateing said:
Yeah, it seems that the guide applies to all devices with patched kernels
Click to expand...
Click to collapse
This guide is nice, full of content, and detailed, but wouldn't it have been easier, though, to just make a MultiROM port?
r3pwn said:
This guide is nice, full of content, and detailed, but wouldn't it have been easier, though, to just make a MultiROM port?
Click to expand...
Click to collapse
I have thought of porting MultiROM, but I'm running a tight schedule...sorry
Whether this Xperia V can also be made from ??
Mircinko96 said:
Whether this Xperia V can also be made from ??
Click to expand...
Click to collapse
It's applicable to Xperia V in theory. But you need a kernel with kexec hardboot patch, which hasn't appeared yet (as far as I have seen). If you know how to compile a kernel, you can try patching the kernel yourself.
.........
do I need linux to unpack kernel?

Categories

Resources