[HELP]Problem resizing partitions - LG Optimus 2x

I have a problem. I have try to resize the partition using nvflash. I have use guide from modaco and also the preconfigured files. The problem is that /system is always at ~360mb (stock size). All other partitions are resized propertly.
Any help?

doctoralex said:
I have a problem. I have try to resize the partition using nvflash. I have use guide from modaco and also the preconfigured files. The problem is that /system is always at ~360mb (stock size). All other partitions are resized propertly.
Any help?
Click to expand...
Click to collapse
I'm facing the same problem. I think I know what the problem is but I cannot solve it!
I currently have installed Stefan 28G ics rom (2nd edition) and my goal is to add about 100mb to the system partition, reducing internal /sdcard.
If I use fdisk command from adb shell I find out that the partion IS actually resized, but the file system on it isn't!!
So: partition now is 650Mb, but file system on it is 550Mb!
That's because nvflash simply makes a dd of the system.img (which has the old partition size) to the partition so in my opinion there are two solutions:
a) open system.img in a linux environment, add some stuff to reach 650Mb on it and repack it with the new size
b) backup system data, formata the partition (which is already resized) to get 650Mb file system and then restore your system data
I think that all "resizing guide" doesn't talk about this second step because in that case the system.img has always the right size.
Any ideas?

Raffaele80 said:
I'm facing the same problem. I think I know what the problem is but I cannot solve it!
I currently have installed Stefan 28G ics rom (2nd edition) and my goal is to add about 100mb to the system partition, reducing internal /sdcard.
If I use fdisk command from adb shell I find out that the partion IS actually resized, but the file system on it isn't!!
So: partition now is 650Mb, but file system on it is 550Mb!
That's because nvflash simply makes a dd of the system.img (which has the old partition size) to the partition so in my opinion there are two solutions:
a) open system.img in a linux environment, add some stuff to reach 650Mb on it and repack it with the new size
b) backup system data, formata the partition (which is already resized) to get 650Mb file system and then restore your system data
I think that all "resizing guide" doesn't talk about this second step because in that case the system.img has always the right size.
Any ideas?
Click to expand...
Click to collapse
I solved my problem!
As explained before I have just added some stuff to the system.img file and then resized the file system:
dd if=/dev/zero bs=4096 count=35328 >> system.img
e2fsck -f system.img
resize2fs system.img
PS: bs and count depend on the partition size that you have set before in the .cfg file
Then NVFlashing again solve the problem!

doctoralex said:
I have a problem. I have try to resize the partition using nvflash. I have use guide from modaco and also the preconfigured files. The problem is that /system is always at ~360mb (stock size). All other partitions are resized propertly.
Any help?
Click to expand...
Click to collapse
Backup your rom with cwm.
Format /system in cwm.
Restore your cwm backup.
Sent from my LG-P990 using xda app-developers app

Related

How to specify custom partition layouts?

I just saw an interesting thread in the development section that explains an alternative to the Death SPL. The method there lets you flash ANY rom on any SPL, but I dont really understand how it works.
The thread can be found here: http://forum.xda-developers.com/showthread.php?t=704560
So basically, you shrink the cache partition to allow for more room for the actual ROM(which partition does that go in?)?
To do this do we edit the boot.img in the ROM update.zip? What else do we do?
Could someone explain this in a way a 9th grader could understand?
kingkurry said:
Could someone explain this in a way a 9th grader could understand?
Click to expand...
Click to collapse
Take file by firerat, flash file. omgroflpartitons.
If you don't understand the instructions as they are, wait for it to be perfected before you try anything. This will probably end up being integrated into releases that need it, so you don't need to worry about the specifics at the moment.
Will that patch file work for all ROMs. He said its only been tested with CyanogenMod 5. And I want to understand what im doing, not just do it without thinking about it...
Also, does the recovery patcher decrease the size of the partition that holds the recovery image?
Does it permanently change the size of the recovery partition?
When you flash a ROM, what partition is it being flashed too? Is this the one being increased in size?
What does the boot.img in an update.zip package hold, and is that copied to the boot partition?
Sorry but my curiosity is killing me
OK well to break it down we have 6 partitions on the internal memory:
Misc - Here be dragons
Recovery - Contains recovery system (+seperate recovery kernel) - recovery.img lives here
Boot - Contains kernel & important initialization stuff - boot.img lives here
-------------
System - Contains the whole android system (the "ROM", if you like).. everything else from an update.zip apart from the boot.img
Cache - Used by system and recovery for temporary storage
Userdata - Contains all personal data, downloaded apps, settings etc.
The first three partitions must be left at the default size so don't worry about them.
What this patch does is pass a command to the kernel which remaps the 3 large partitions at boot time. Since we're flashing system images from recovery, we also need to pass the same command to the recovery kernel before attempting to flash the main system, or we'd be writing to one place then telling the kernel to look for it in another.. bad idea.
This method allows any partition setup you like, but the most useful at the moment (and this is the way firerat has set up his scripts to suit cm5) is to make the /system partition just the right size for the "ROM" with a bit of breathing space, make the /cache partition a minimal size for the recovery system to use, then have /userdata fill the remaining space so we can load it up with apps. Since we've reduced cache to a minimal size, it's redirected at boot time to a place on the sdcard instead.. this give us maximum space to divide between /system and /data with no wastage.
Does that help at all..?
Thanks dude. That does help a lot.
Just wondering though, how much breathing space do u need in the system partition?
What does the recovery system use the cache partition for and how do we know what "a minimal size for the recovery system to use" is?
Is it possible to reduce the userdata partition to the minimum possible size a partition can be(if i recall correctly it was 128kb) and use an ext partition on your SD card instead?
If we shrink the Cache partition a lot, does this mean we have to use linux swap to compensate for the lowered amount of cache?
Also do we have to remap the partitions every time we flash a new ROM?
And what are the "dragons"?
kingkurry said:
And what are the "dragons"?
Click to expand...
Click to collapse
He's saying that it's just there. There could be anything from nothing there to a text document containing the ingredients to the cure of AIDs.
Well what about every thing else? Can you guys help me with that? Also what is the total size of all 3 of the big partitions combined?

[Q] Problem with android installation to NAND - tar error: no space left on device

Hi, I have problem with installation android to my Kaiser (NAND). When I am installing it, It is normal formating system and data, but after attempt of install system it shows me message: tar error: extraction failed: no space left on device. I thought that it format memory, so it should be empty.. I dont get it. Anybody helps?
Thanks..
Mav3rick2 said:
Hi, I have problem with installation android to my Kaiser (NAND). When I am installing it, It is normal formating system and data, but after attempt of install system it shows me message: tar error: extraction failed: no space left on device. I thought that it format memory, so it should be empty.. I dont get it. Anybody helps?
Thanks..
Click to expand...
Click to collapse
The Kernel splits the NAND into 2 partitions (excluding the actual partition for the kernel). The default sizes is 101MB for /system and 150+MB for /data.
Make sure the androidinstall archive's /system folder is under 97MB in size or else the install will fail, or you can change the /system partition size using atools to a larger size while sacrificing /data partition size.
I tried to install Scoot_CyanogenMod_6.1_Rls5.5 (cca 90MB size of file) and same problem... If I tried Scoot_CyanogenMod_7_alpha_RLS1_All_Language (about 112MB size of file) and I set size of system partition to 128MB in atools to my nbh file, same problem.. Iam sad.. I want to use android but I can't... :-(
Have you checked how many bad blocks you have whenever the kernel formats the NAND? It should be disabled during the "Formating..." stage.
If you have excessive bad blocks, try increasing the /system partition as far as you can, then setting /data to your SD card. It's possible your device has too many bad blocks to install android with default settings.
i have a htc kaiser and i have the same problem.
how many mb should i put for data and system with atools?
and..when i save the install-seq.sh where do i put it? in the root of sd?
http://forum.xda-developers.com/showpost.php?p=12145518&postcount=461
please don't double post!!!
me too same probleme.
1) update NBH editor
a) set up all option
b) change System/Data size
c) set System - Nand 2
data SD - partition p2
swap - auto
storage8.static.itmages.com/i/12/1118/h_1353239270_8665672_135471dd01.png
* sd card have only 1 partition 50% fat32 and 50% free space
storage4.static.itmages.com/i/12/1118/h_1353239816_9273632_16b5ec517d.jpeg
2) boot script editor
System NAND p2 Erase
Data Sd partition p2 Erase
Actions: Install system, Fix Permission, Clear Davik chace, Use sd partition
storage6.static.itmages.com/i/12/1118/h_1353239950_6780632_54a5fa768b.png
3)Mixer set Working Dir
add androidinstall.tar
add Module update (for kernels after 23-11)
combine (debian icon)
and save androidinstall.tgz
storage5.static.itmages.com/i/12/1118/h_1353240546_2336238_466987bb88.png
4) copy to SD card
SD: KAISIMG.NBH
SD: andboot/androidinstall.tgz
SD: andboot/install-seq.sh
storage4.static.itmages.com/i/12/1118/h_1353240328_6642646_17fd7c2f78.png
good luck
yes i have solved yesterday with system 128mb to 165mb.
but i will try your setting, is good to make data with sd.
but is see on picture you choose donut, i have choise froyo setting but is good for Scoot_CyanogenMod_7.1 i use this android.

[Q] Mount Nandroid image?

As the title is it possible to mount the image Clockwork (nandroid?) .img files make. I have tested with deamon tools without any luck. Would be really great if someone could help me with this, i want to llok for files inside it.
Try renaming it to .Zip and open the archive
Sent from my LG-P990 using XDA Premium App
Not working
I was just wondering about the same thing, about how to mount the nandroid backup.
I have tried to rename the extension from .img to .zip, but Windows (winrar in my case) won't read the file.
Are there any other solutions on how to extract data from the backup under a Windows environment, or do I have to fire up a virtual linux machine to get my data?
They aren't archives, so WinZip/RAR isn't going to be able to handle them. You can mount them in Linux though.
Thanks for clarifying that for me. I'll do that then.
One last question: Are special tools required for mounting in linux? Or are there native support for the nandroid backup in linux?
It's all built in, Linux would be quite useless if it was unable to mount an EXT3/4 file system
I think the command (assuming EXT3 backup) is:
Code:
mount -t ext3 system.img /path/to/mount/folder -o loop
LOL, didn't realize that it was ext3/4. -I had an idea of that it was compressed to some special format.
Thanks again Rusty and thanks for the command.
are the images ext3 even though the system is yaffs2?
Just a thought, wouldn't it be possible (for us windows users) to mount the img files in android, then adb pull the files from the phone?
System isn't YAFFS on these, it's EXT3 or EXT4 if on MCR.

Dual boot from SD and EMMC with Windows

This is how I got dual booting from windows working and am now dual booting Nottachtrix4G from sdcard with stable
cam and WEBTOP along side AOKPCB
I was only able to achieve this after following sendust7 linux guide for dual boot and adapting to windows so all
credit goes to him.
Again these are the steps I took. If you try this and break something I'm not responsible.
Pre-requisites
Notepad++
Minitool partition wizard
Android SDK (google adb for dummies to get everything you need)
Cygwin (if you dont have it start install now and it might be done when its time to use it)
The rom zip you want on your sdcard and the rom zip you want on your phone
Moto-fastboot (search this forum)
Knowledge of ADB and fastboot
Fully Charged Battery
Backup everything from internal and external sdcard
Reboot to recovery
Flash the rom that you want on your sdcard to your phone like you would do normally.
Reboot phone and set it up if you like or just reboot back to recovery. If you set your rom up at this point, this
is how it will look on your sdcard at first boot.
Reboot back to recovery
adb shell
~ #mount /cache
~ #mount /system
~ #mount /data
~ #mount
Take note of system data and cache file systems (ext3 or ext4)
Power off phone and pull sdcard
Insert sdcard into computer and open minitool partition wizard.
Partition and format sdcard with same filesystem as noted before
These are the partition sizes I went with and only because i didnt feel like adjusting the slider anymore. But
These values did ensure they were big enough to hold the phone partitions. The first partition is whats left over
after resizing other partitions and will be formatted to fat32
system=384 MB <second partition on sdcard
cache=700 MB <third
data=2.6 GB <fourth
Insert sdcard and boot to recovery
adb shell
PATIENCE IS KEY FOR NEXT STEPS
~ # dd if=/dev/block/mmcblk0p12 of=/dev/block/mmcblk1p2 bs=1M
655360+0 records in
655360+0 records out
335544320 bytes (320.0MB) copied, 115.626214 seconds, 2.8MB/s
~ # dd if=dev/block/mmcblk0p15 of=/dev/block/mmcblk1p3 bs=1M
dd if=dev/block/mmcblk0p15 of=/dev/block/mmcblk1p3 bs=1M
640+0 records in
640+0 records out
671088640 bytes (640.0MB) copied, 206.557368 seconds, 3.1MB/s
~ # dd if=/dev/block/mmcblk0p16 of=/dev/block/mmcblk1p4 bs=1M
dd if=/dev/block/mmcblk0p16 of=/dev/block/mmcblk1p4 bs=1M
2048+0 records in
2048+0 records out
2147483648 bytes (2.0GB) copied, 658.327418 seconds, 3.1MB/s
Now get boot.img
While still in adb shell
~ #mount /dev/block/mmcblk0p18 /emmc
~ #cp /dev/block/mmcblk0p11 /emmc/boot.img
~ #exit
~ #adb pull /emmc/boot.img boot.img
Go here and follow this step by step and stop after you've got your boot image unpacked
http://forum.xda-developers.com/show....php?t=1630130
If you have any problems with cpio run cygwin installer again and search for cpio and install
Once boot image is unpacked go to the out directory and find init.rc
Edit init.rc with notepad++ (NOT NOTEPAD) and change these lines
ONLY CHANGE THE /dev/bloc/mmcblk part. LEAVE EVERYTHING ELSE THE SAME
From
mount ext4 /dev/block/mmcblk0p12 /system noatime nodiratime wait ro barrier=1
mount ext4 /dev/block/mmcblk0p16 /data nosuid nodev noatime nodiratime wait barrier=1 noauto_da_alloc
mount ext4 /dev/block/mmcblk0p15 /cache nosuid nodev noatime nodiratime wait barrier=1 noauto_da_alloc
TO
mount ext4 /dev/block/mmcblk1p2 /system noatime nodiratime wait ro barrier=1
mount ext4 /dev/block/mmcblk1p4 /data nosuid nodev noatime nodiratime wait barrier=1 noauto_da_alloc
mount ext4 /dev/block/mmcblk1p3 /cache nosuid nodev noatime nodiratime wait barrier=1 noauto_da_alloc
Once you have made these changes you can finish the tutorial posted above or below for repacking and make sure to
click thanks. If the boot_new.img is a different size than original that's okay.
http://forum.xda-developers.com/show....php?t=1630130
Move your boot_new.img to your moto-fastboot and reboot phone to fastboot.
moto-fastboot boot boot_new.img
If you're booted into your sdcard rom you're almost done.
Reboot to recovery and install any rom you want and boot to it.
Now create this directory on your internal sdcard
/sdcard/Boot/sdrom/
Copy your boot_new.img you used to boot your sd rom earlier to this directory and rename it to sdrom.img
Now create this directory on your internal sdcard
/sdcard/Boot/emmcrom/
Now open the rom zip you installed to your phone and copy the boot.img to this directory and rename it to
emmcrom.img
Use attached script with scriptmanager to commense dual booting. (Rename to modified-boot-rom.sh)
Run script as root with argument 1 to reboot to sdcard rom and argument 2 to reboot to phone rom. Argument 3 will
send you to recovery.
All done from windows even though it would be twice as easy and fast to do with linux but there ya go.
I take no credit as all I did was find the right resources and none of this would even be possible without
sendust7. If this helped you Please go to his guide and thank him TOO!!!!
http://forum.xda-developers.com/show....php?t=1642185
great.....will try and post back my experience!!!
I get everything up to get boot image. when I run that command, it runs for a few seconds then adb stops responding.
Any advice? I waited the one time for 15 minutes hoping it would respond...but it didn't.
thanks!
Sent from my MB860 using xda premium
95rr900 said:
I get everything up to get boot image. when I run that command, it runs for a few seconds then adb stops responding.
Any advice? I waited the one time for 15 minutes hoping it would respond...but it didn't.
thanks!
Sent from my MB860 using xda premium
Click to expand...
Click to collapse
What rom are you putting on sdcard
EDIT: look in your rom.zip.....boot img may be in there. If it is you can just use that
Edit: could try to make sure sdcard is mounted.......mount /sdcard
Sent from my MB860 using Tapatalk 2
Im putting nottachtrix on sdcard.
Ok, so I can just copy the boot image from the rom zip and use that in cygwin...and go from there?
Now that I think about it, the sdcard was probably not mounted.
I'll give it another go in the morning. Thanks for the help!
Sent from my MB860 using xda premium
95rr900 said:
Im putting nottachtrix on sdcard.
Ok, so I can just copy the boot image from the rom zip and use that in cygwin...and go from there?
Now that I think about it, the sdcard was probably not mounted.
I'll give it another go in the morning. Thanks for the help!
Sent from my MB860 using xda premium
Click to expand...
Click to collapse
Yes
Sent from my MB860 using Tapatalk 2
Install rom you want on your sdcard
hatefuel19 said:
Install rom you want on your sdcard
Reboot phone and set it up if you like or just reboot back to recovery. If you set your rom up at this point, this is how it will look on your sdcard at first boot.
Click to expand...
Click to collapse
What do you mean by install on sdcard and is that internal or external sd? And does Aroma make any difference
many thanks Simon
EDIT : Im an idiot it means install to the phone, the rom you want to have booting from sdcard.
This is really burnin my nut sack
No matter what I do, I can't get through "getting boot image". I tried going into the nottachtrix rom.zip, but it is set up different from other roms. I guess because of the aroma installer?
Maybe I'll try with a different rom just to see if I have the same problem.
EDIT: Tried it with aokp, and still get adb not responding in the middle of getting boot image?
95rr900 said:
This is really burnin my nut sack
No matter what I do, I can't get through "getting boot image". I tried going into the nottachtrix rom.zip, but it is set up different from other roms. I guess because of the aroma installer?
Maybe I'll try with a different rom just to see if I have the same problem.
EDIT: Tried it with aokp, and still get adb not responding in the middle of getting boot image?
Click to expand...
Click to collapse
In about thirty minutes I'm gonna run through this again. Been trying to get webtop2sd working. Once I do I'm gonna do this tut again step by step and I'll see if I have any snags.
And you're right since nottachtrix uses aroma it isn't packed like other rooms which is why I put this step in here
Edit: strange how its doin same to me now too.......found a fix and gonna double check b4 I update op
EDIT: op updated - give it a try
Sent from my A500 using Tapatalk 2
awesome, thank you!
Sent from my MB860 using xda premium
stokehall said:
What do you mean by install on sdcard and is that internal or external sd? And does Aroma make any difference
many thanks Simon
EDIT : Im an idiot it means install to the phone, the rom you want to have booting from sdcard.
Click to expand...
Click to collapse
not an idiot bud. I'll clarify in op
Alright, I'm going back in! I'm going to start from scratch...format external sd and repartion.....the works!
I got Nottachtrix set up perfect and doing a nandroid of it right now. Hopefully my next post will be about success!!
Thanks OP for updating the instructions......Here we go!!
I had no errors this time, and it still didn't work? How big is your boot.img after you extract it and repack it? Mine is 2.9mb,,is that right (nottachtrix)?
also, my other question is....when you make the partitions on the sdcard, are you making them primary or logical (I did primary)? everything was ext3 when I mounted it...and that's what I made the partitions.
Also, in mini partition tool when you create them...how are you naming them? I'm just naming them, system, cache, and data?
I used aokpbc 35.1 for the internal rom and just copied the boot.img into the boot folder.
Also, the original boot.img that gets extracted from nottachtrix is 8mb in size. But after making the edits with notepad++ and saving, then repacking in cygwin...it is only 2.9mb?
This is frustrating because it takes awhile to partition the sdcard and then copy everything over in adb shell.
Also, after doing the whole boot.img thing, and then doing moto-fastboot boot boot_new.img
it boots into nottachtrix, but I'm already in nottachtrix. How can I tell if I booted from the sdcard?
Sorry for all these questions, I really want to get this working! It's more a matter of just not giving up now...lol!
Anybody else get this to work on windows?
Thanks!
95rr900 said:
I had no errors this time, and it still didn't work? How big is your boot.img after you extract it and repack it? Mine is 2.9mb,,is that right (nottachtrix)?
also, my other question is....when you make the partitions on the sdcard, are you making them primary or logical (I did primary)? everything was ext3 when I mounted it...and that's what I made the partitions.
Also, in mini partition tool when you create them...how are you naming them? I'm just naming them, system, cache, and data?
I used aokpbc 35.1 for the internal rom and just copied the boot.img into the boot folder.
Also, the original boot.img that gets extracted from nottachtrix is 8mb in size. But after making the edits with notepad++ and saving, then repacking in cygwin...it is only 2.9mb?
This is frustrating because it takes awhile to partition the sdcard and then copy everything over in adb shell.
Also, after doing the whole boot.img thing, and then doing moto-fastboot boot boot_new.img
it boots into nottachtrix, but I'm already in nottachtrix. How can I tell if I booted from the sdcard?
Sorry for all these questions, I really want to get this working! It's more a matter of just not giving up now...lol!
Anybody else get this to work on windows?
Thanks!
Click to expand...
Click to collapse
the difference in sizes is okay. The orginal boot.img contains the kernel whereas the new boot.img only contains the ramdisk. my original is 8 mb and repacked is 2.8
if you ran fast-boot boot boot_new.img and it booted you're in your sd rom. from adb shell run mount and you'll see that system is mounted under /dev/block/mmcblk1p2. This is your sd card partition, internal is mmcblk0p12.
sd card partition naming is okay as that is exactly how i named mine. Make them primary.
Don't worry about asking questions, were both learning
I'm reaching here, but I wonder if it has something to do with how the internal and external sdcard are. I run aokpcb, but I flip flop the cards, so external is emmc and internal is sdcard.
Do you think that might be an issue?
Although, I did do a clean install of aokpbc with stock settings, still a no go.
I'll have to give it another try, I just don't wanna mess up my new 32gb sdcard!
I have to be close to getting this to work, this last time I made it all the way to using script manager to boot into the other rom...but it doesn't get past the splash screen,,,then loops.
anyway, thanks for your help...really!!
I don't anderstand....
May be wrong section, but...
Why don't use Nandroid backup files ?
Look in these directory :
/sdcard/clockworkmod/backup/<backupdatesave>
You have yours :
- boot.img
- system.etx4.tar
- data.ext3.tar
- cache.ext3.tar
...
all you need here.
May i'm wrong, but do a nandroid after install CM7, nottachtrix4G, CM9, etc...
A use Boot.img for multi boot
You can use "Boot Manager" too... http://forum.xda-developers.com/showthread.php?t=1191014
To create ".img" file, you can use this proc (use CWM program) :
su
mkyaffs2image /system system.img &
while [ `pidof mkyaffs2image` ]; do
echo -n "."
sleep 2
done
Create "system.img" file...
Same for
/data
/cache
Boot
...
95rr900 said:
I'm reaching here, but I wonder if it has something to do with how the internal and external sdcard are. I run aokpcb, but I flip flop the cards, so external is emmc and internal is sdcard.
Do you think that might be an issue?
Although, I did do a clean install of aokpbc with stock settings, still a no go.
I'll have to give it another try, I just don't wanna mess up my new 32gb sdcard!
I have to be close to getting this to work, this last time I made it all the way to using script manager to boot into the other rom...but it doesn't get past the splash screen,,,then loops.
anyway, thanks for your help...really!!
Click to expand...
Click to collapse
if its looping its so ething to do with your boot.img. tinker with it til you get it right. remember if you get that far and it doesnt boot dont start over. just flash the working boot image, meaning the one from the rom you just left and then try editing the broken boot.img
delewer said:
I don't anderstand....
May be wrong section, but...
Why don't use Nandroid backup files ?
Look in these directory :
/sdcard/clockworkmod/backup/<backupdatesave>
You have yours :
- boot.img
- system.etx4.tar
- data.ext3.tar
- cache.ext3.tar
...
all you need here.
May i'm wrong, but do a nandroid after install CM7, nottachtrix4G, CM9, etc...
A use Boot.img for multi boot
You can use "Boot Manager" too... http://forum.xda-developers.com/showthread.php?t=1191014
To create ".img" file, you can use this proc (use CWM program) :
su
mkyaffs2image /system system.img &
while [ `pidof mkyaffs2image` ]; do
echo -n "."
sleep 2
done
Create "system.img" file...
Same for
/data
/cache
Boot
...
Click to expand...
Click to collapse
give that a shot and see if it works
My partitions are all ext3, but in the boot.img it says mount ext4? Do i change it to ext3 or leave it ext4?
Also do you mind posting a video tutorial?
hatefuel19 said:
adb shell
~ #mount /cache
~ #mount /system
~ #mount /data
~ #mount
adb shell
PATIENCE IS KEY FOR NEXT STEPS
~ # dd if=/dev/block/mmcblk0p12 of=/dev/block/mmcblk1p2 bs=1M
655360+0 records in
655360+0 records out
335544320 bytes (320.0MB) copied, 115.626214 seconds, 2.8MB/s
~ # dd if=dev/block/mmcblk0p15 of=/dev/block/mmcblk1p3 bs=1M
dd if=dev/block/mmcblk0p15 of=/dev/block/mmcblk1p3 bs=1M
640+0 records in
640+0 records out
671088640 bytes (640.0MB) copied, 206.557368 seconds, 3.1MB/s
~ # dd if=/dev/block/mmcblk0p16 of=/dev/block/mmcblk1p4 bs=1M
dd if=/dev/block/mmcblk0p16 of=/dev/block/mmcblk1p4 bs=1M
2048+0 records in
2048+0 records out
2147483648 bytes (2.0GB) copied, 658.327418 seconds, 3.1MB/s
Click to expand...
Click to collapse
ADB was unable to mount cache
Then when i changed the block/mmcblk0p16 , i was told it was unable to (Not Enough space)
I am very much a noob with this, just determined not to go without dual boot!

[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