Is there a way to dualboot? - GT540 Optimus Android Development

Is there a way to dualboot roms?
Sent from my GT540 using Tapatalk

I really know nothing about dualbooting but i don't think the optimus swift has the guts for it

No.
someone correct me if i
am wrong, but our phones can't dualboot.

It could be possible by creating new partitions. For example, have two system partitions and two data partitions. We can flash one boot.img to the boot partition for the ROM to automatically boot, and flash another to the recovery partition. So when you hold home, it will boot into the second boot.img instead.(recovery images are exactly the same as boot images but with a modified ramdisk that runs the recovery program)
Where in the second boot.img, we can modify the init.rc file to mount a different partition as /system (a data2system rom works sort of like this, init.rc is modified so the data partition is mounted as /system, and system is mounted to /data, this is how you get more space as data is stored on /system, but Android thinks its acessing the data partition, where it is really accessing system) We can use this principle to dual boot.
Now, how will this work. Somehow split the system and data partitions into two bits (2 system partitions and 2 data) If we have the 1st ROM on the original system partition, and use its original boot.img, and then have the 2nd rom on the different system partition, and modify the ramdisk to use the different partitions as /system and /data, we could have a working dual boot.
However, there are some problems.
1. Our device has a NAND that is 512MB in size. It is split into:
Boot
Recovery
System
Userdata
Cache
and some other miscellaneous partitions. System is 250MB in size, and data is 134MB (under stock partition sizes) These split would barely fit any rom on it and hardly any data either. Maybe if the device had 1GB ROM, it may be different.
2. It may require some bootloader tweaking to create these new partitions, and for the device to recognise them.
Also, why would you want to dual boot your phone anyway? You have a computer for that

App
There is this app named BootManager
I've tried it out but this can't backup the boot partition. It's currently not supported. Maybe someone could try it out.
Keep in mind that it needs to be purchased for 'LEGAL' use.

jhonnyx1000 said:
There is this app named BootManager
I've tried it out but this can't backup the boot partition. It's currently not supported. Maybe someone could try it out.
Keep in mind that it needs to be purchased for 'LEGAL' use.
Click to expand...
Click to collapse
I tried that! Gives an error when backing up boot image!
Sent from my GT540 using Tapatalk

effortless. said:
Also, why would you want to dual boot your phone anyway? You have a computer for that
Click to expand...
Click to collapse
Actually I don't
Sent from my GT540 using Tapatalk

It is possible to dualboot. A russian guy already made it for us. It was meant to dualboot 2.1 and 2.2 but that rom has never made it to beta stadium.
The idea is that a second rom is stored on the sd card. I've tried to get it working but i didnt succed. But it should work.
It was on 4pda.ru. when i am on my computer, i will post a link.
Joost
Sent from my GT540 using Tapatalk

Couldn't we use the same principal as running Ubuntu chroot? As I thought chroot and loop devices where originally for HTC to test builds? Correct me if I'm wrong here
But I always thought if you had say a 32gb SD you could have 2 or 3 roms plus a couple Linux distros running on the device through chroot not same time obviously device would handle 2 max?
Also I was looking at a article to run native Linux on the eee pad transformer it looked like all they did was swap the boot.img or some kind of script so it ran off the SD card straight away. So my question would be could you add a feature to recovery that would allow you to change boot.img or script for each rom/distro then reboot straight into it making the device multi boot?
Sent from my GT540RR using XDA App

This is the topic about the dualboot, with download links to the 'dualboot' boot, and some explanation about the partitions on the sdcard.
http://4pda.ru/forum/index.php?showtopic=200838
Joost

liamwilli said:
Is there a way to dualboot roms?
Sent from my GT540 using Tapatalk
Click to expand...
Click to collapse
This should be possible. But, would require customizing boot.img and boot loader.
ErnuB said:
I really know nothing about dualbooting but i don't think the optimus swift has the guts for it
Click to expand...
Click to collapse
effortless. said:
It could be possible by creating new partitions. For example, have two system partitions and two data partitions. We can flash one boot.img to the boot partition for the ROM to automatically boot, and flash another to the recovery partition. So when you hold home, it will boot into the second boot.img instead.(recovery images are exactly the same as boot images but with a modified ramdisk that runs the recovery program)
Where in the second boot.img, we can modify the init.rc file to mount a different partition as /system (a data2system rom works sort of like this, init.rc is modified so the data partition is mounted as /system, and system is mounted to /data, this is how you get more space as data is stored on /system, but Android thinks its acessing the data partition, where it is really accessing system) We can use this principle to dual boot.
Now, how will this work. Somehow split the system and data partitions into two bits (2 system partitions and 2 data) If we have the 1st ROM on the original system partition, and use its original boot.img, and then have the 2nd rom on the different system partition, and modify the ramdisk to use the different partitions as /system and /data, we could have a working dual boot.
However, there are some problems.
1. Our device has a NAND that is 512MB in size. It is split into:
Boot
Recovery
System
Userdata
Cache
and some other miscellaneous partitions. System is 250MB in size, and data is 134MB (under stock partition sizes) These split would barely fit any rom on it and hardly any data either. Maybe if the device had 1GB ROM, it may be different.
2. It may require some bootloader tweaking to create these new partitions, and for the device to recognise them.
Also, why would you want to dual boot your phone anyway? You have a computer for that
Click to expand...
Click to collapse
Your idea is right and would work but we can't afford to loose the recovery. It's important when modding. Unlike fastboot or KDZ modes, using recovery leaves one partition untouched. ie, when using recovery, the recovery partition is never modified. It doesn't touch boot loader either. It's almost impossible to brick a phone using recovery. And, if something goes wrong with other partitions, you can always boot into recovery and have stuff restored or fixed with an update.
jhonnyx1000 said:
There is this app named BootManager
I've tried it out but this can't backup the boot partition. It's currently not supported. Maybe someone could try it out.
Keep in mind that it needs to be purchased for 'LEGAL' use.
Click to expand...
Click to collapse
It's an HTC only app. It's an xda project. You can get it for free. Hit on to http://forum.xda-developers.com/showthread.php?t=1184173
joostvhoek said:
It is possible to dualboot. A russian guy already made it for us. It was meant to dualboot 2.1 and 2.2 but that rom has never made it to beta stadium.
The idea is that a second rom is stored on the sd card. I've tried to get it working but i didnt succed. But it should work.
It was on 4pda.ru. when i am on my computer, i will post a link.
Joost
Sent from my GT540 using Tapatalk
Click to expand...
Click to collapse
Thanks. Would love to try it out.
Danzano said:
Couldn't we use the same principal as running Ubuntu chroot? As I thought chroot and loop devices where originally for HTC to test builds? Correct me if I'm wrong here
But I always thought if you had say a 32gb SD you could have 2 or 3 roms plus a couple Linux distros running on the device through chroot not same time obviously device would handle 2 max?
Also I was looking at a article to run native Linux on the eee pad transformer it looked like all they did was swap the boot.img or some kind of script so it ran off the SD card straight away. So my question would be could you add a feature to recovery that would allow you to change boot.img or script for each rom/distro then reboot straight into it making the device multi boot?
Sent from my GT540RR using XDA App
Click to expand...
Click to collapse
chroot is not a real dual boot solution. It's based on the idea of virtualization and so it has performance issues on a low end phone like GT540. When using chroot, parts of the Android OS as well as the other OS is run at the same time. This would be idea only in faster devices with more RAM.
And, yes, if you can modify the boot.img or recovery.img to boot into other partitions, it would be awesome. The beauty of linux is that you can directly mount images as a disk unlike in Windows where you need a separate software. Due to this, mounting a different partition would be easy but modifying the boot.img or bootloader is the risky part. If you do it wrong, your phone may get permanently bricked.
joostvhoek said:
This is the topic about the dualboot, with download links to the 'dualboot' boot, and some explanation about the partitions on the sdcard.
http://4pda.ru/forum/index.php?showtopic=200838
Joost
Click to expand...
Click to collapse
Thanks

joostvhoek said:
This is the topic about the dualboot, with download links to the 'dualboot' boot, and some explanation about the partitions on the sdcard.
http://4pda.ru/forum/index.php?showtopic=200838
Joost
Click to expand...
Click to collapse
I don't understand or talk Russian. Would anybody be kind enough to find out what modifications did he do to the boot.img and/or bootloader? If we do the same modifications, we might be able to dualboot.
But, there's one problem, the boot.img is not same for all versions. Maybe that is why you can't dual boot.

It wouldn't work on the gt540. We have a dual boot for the defy which has only 90mb of ram left Max when running dual system. Usually I'm running 190mb ram on stock and 240mb on miui. Major slow down on dual boot. So no point
Sent from my MB525 using xda premium

keewanchoapsss said:
It wouldn't work on the gt540. We have a dual boot for the defy which has only 90mb of ram left Max when running dual system. Usually I'm running 190mb ram on stock and 240mb on miui. Major slow down on dual boot. So no point
Sent from my MB525 using xda premium
Click to expand...
Click to collapse
You are talking about chroot. In real dual boot, only one OS is loaded.

nibras_reeza said:
I don't understand or talk Russian. Would anybody be kind enough to find out what modifications did he do to the boot.img and/or bootloader? If we do the same modifications, we might be able to dualboot.
But, there's one problem, the boot.img is not same for all versions. Maybe that is why you can't dual boot.
Click to expand...
Click to collapse
Oh I'll be looking into this one tomorrow, I'd like to be able to have a dual boot... this would enable me to store testing roms onto sdcard and boot into them "safely" without forever having to go through backup & restore each time...
If I can crack it... I'll post it!!
Edit: I don't read Russian either... but I can reverse engineer things like this! -- Just had a brief look at it... I should be able to port his modifications over to another image, but as you said... it'll only work if both OS's are compatible with the one boot.img ... and this could take some trial and error.
Second Addition: Not to mention... it could cause issues for some people that use ext partition on sdcard for apps.... hmmz, will have to keep that in mind. (People like me ya'see lol)

olite said:
Oh I'll be looking into this one tomorrow, I'd like to be able to have a dual boot... this would enable me to store testing roms onto sdcard and boot into them "safely" without forever having to go through backup & restore each time...
If I can crack it... I'll post it!!
Edit: I don't read Russian either... but I can reverse engineer things like this! -- Just had a brief look at it... I should be able to port his modifications over to another image, but as you said... it'll only work if both OS's are compatible with the one boot.img ... and this could take some trial and error.
Second Addition: Not to mention... it could cause issues for some people that use ext partition on sdcard for apps.... hmmz, will have to keep that in mind. (People like me ya'see lol)
Click to expand...
Click to collapse
People who use ext for moving apps shouldn't face problems. Android is not Windows. =P It can handle unlimited number of partitions. Looking at the guide, I could understand that the method uses multiple ext partitions. People using sd-ext for apps would only need to increase the mtdblockn(where n is a number) by 1 or 2 if using swap as well.
Yup. Both OSs will work only if the boot.imgs are compatible. That means we might not be able to run 1.6 and 2.3. However, this wouldn't be applicable if you can loop the boot.imgs as well.
ie a setup likes.
BOOT has a GRUB like boot loader which is compatible with Android is SYSTEM.
SYSTEM partition has one OS.
Then, there will be different BOOT and SYSTEM is each of the sd-ext partition or they will be stored as imgs in SD.
When device boots, it will enter BOOT. Then, this will present a menu which will allow you to select OS. If you choose, default, it will load SYSTEM from phone. If you choose another, it will loop to a BOOT from the SD-ext which will loads its relevant SYSTEM from SD/SDEXT.
That's just my idea though. Basically, if you can get an idea of the modifications that need to be made to BOOT.img to loop mount another partition as BOOT or SYSTEM, then the problem is 80% solved.

nibras_reeza said:
People who use ext for moving apps shouldn't face problems. Android is not Windows. =P It can handle unlimited number of partitions. Looking at the guide, I could understand that the method uses multiple ext partitions. People using sd-ext for apps would only need to increase the mtdblockn(where n is a number) by 1 or 2 if using swap as well.
Click to expand...
Click to collapse
lol, yer I worded that wrong... I meant it *could* be a problem if they just followed his guide steps (since it doesn't account for existing use of ext on sdcard), but you'r right this isn't really a problem... it just requires an additional partition. Also, I'd probably change the partition layout instead so that applications such as Link2SD would still be able to "automatically" (it only checks partition #1) locate the ext partition intended for apps.
Something like this...
Partition #0: FAT32
Partition #1: EXT2/3 <-- sd-ext2
Partition #2: EXT2/3 <-- data
Partition #3: EXT2/3 <-- system
Partition #4: SWAP
This would allow most internal OS's to continue to function as per normal without any script modifications.
(Most swap mount scripts are just blind scripts, they simply try mounting each partition from #1 to #9 as swap... so swap location shouldn't be an issue)
#!/system/bin/sh
#
# find and enable swap
#
echo 30 > /proc/sys/vm/swappiness
# find swap partition
for PART in `seq 0 9`;
do
swapon /dev/block/mmcblk0p$PART
if [ $? = 0 ]; then
break
fi
done
Click to expand...
Click to collapse
nibras_reeza said:
That's just my idea though. Basically, if you can get an idea of the modifications that need to be made to BOOT.img to loop mount another partition as BOOT or SYSTEM, then the problem is 80% solved.
Click to expand...
Click to collapse
And a damn good one at that... sadly I think this might just be a lil bit out of my reach... for now! While I should be able to get it to work for 2.1-2.3 (Since they essentially use the same boot), I honestly don't know where to begin with boot looping (I understand the concept yes, just not sure how to implement it... wonder if I can bake a grub version for this...)

This idea is really exciting. I wish i could help but as it stands, based on my extreme lack of know-how, i'd be as much help as a sack of potatoes XD
Sent from my GT540 using XDA App

olite said:
lol, yer I worded that wrong... I meant it *could* be a problem if they just followed his guide steps (since it doesn't account for existing use of ext on sdcard), but you'r right this isn't really a problem... it just requires an additional partition. Also, I'd probably change the partition layout instead so that applications such as Link2SD would still be able to "automatically" (it only checks partition #1) locate the ext partition intended for apps.
Something like this...
Partition #0: FAT32
Partition #1: EXT2/3 <-- sd-ext2
Partition #2: EXT2/3 <-- data
Partition #3: EXT2/3 <-- system
Partition #4: SWAP
This would allow most internal OS's to continue to function as per normal without any script modifications.
(Most swap mount scripts are just blind scripts, they simply try mounting each partition from #1 to #9 as swap... so swap location shouldn't be an issue)
And a damn good one at that... sadly I think this might just be a lil bit out of my reach... for now! While I should be able to get it to work for 2.1-2.3 (Since they essentially use the same boot), I honestly don't know where to begin with boot looping (I understand the concept yes, just not sure how to implement it... wonder if I can bake a grub version for this...)
Click to expand...
Click to collapse
Porting grub eh? Hmm. I believe there should be an ARM version for grub but we might have trouble with the drivers and kernel. It might be a better idea to copy the menu layout from CWM recovery. The menu need not be intelligent.
As for me, I also don't know how to loop the boot images.
daggerxXxsin said:
This idea is really exciting. I wish i could help but as it stands, based on my extreme lack of know-how, i'd be as much help as a sack of potatoes XD
Sent from my GT540 using XDA App
Click to expand...
Click to collapse
You could always risk your phone for others by using the pre-alpha. xD

Porting grub eh? Hmm. I believe there should be an ARM version for grub but we might have trouble with the drivers and kernel.
Click to expand...
Click to collapse
We wouldn't need a kernel for GRUB, as GRUB loads the kernel. We would have to modify the bootloader (or MBR) to use GRUB.

Related

[HOWTO]Change SD with app2sd

Upgrading/Changing of memory/SD cards while using App2SD?
Here's how.
What you need:
-Rooted
-Drellisdee's ThunderG custom recovery(preferably v1.2)
-Card Reader(Optional)
Steps:
-Boot into recovery
-In recovery menu, select "Backup/Restore" then "Nand + ext backup".(If you are using an ext4 app2sd partition, ThunderG v1.2 is a MUST)
-Now with any means suitable to you, transfer the "nandroid" folder found on your SD to your PC.(the easiest way is to mount USB-ms via recovery, but for some reason this option doesn't work for me)
-Now turn off your phone and insert the NEW SD.
-Boot into recovery again and partition your new SD(for app2sd).
-Now again, with any means suitable to you, transfer the "nandroid" folder you just copied to your PC back to the new SD.
-In recovery menu, select "Backup/Restore" then "Nand restore", choose the file to restore(in most cases, there is only one option)
-Wait for it, now reboot.
-Enjoy!
Custom Recovery
ThunderG v1.2
man! you woke up early for this?
kudos!!!! now everyone can happily change/upgrade their cards...
(the easiest way is to mount USB-ms via recovery, but for some reason this option doesn't work for me)
Click to expand...
Click to collapse
now this doesnt seem right... i mean, it has to work.
hhmm.. mine does. im on thunderG too.
maybe youre lacking drivers for it.... have you checked you device manager?
------------------
EDIT ok i get it. i dont have the V1.2 will try to install later on.
maybe the new recovery has the problem.. and not your PC...
---------------------------------
more EDIT
ok ive just installed V1.2 and yes i can confirm that the USB toggle under recovery works for me.
now the next thing to try is upgarade to a higher capacity card... *lol*
nice one Ungaze!
lol, up late seems more like it.
usb-toggle issue might be usb driver related.
havent flashed the firmware yet so i didnt have the need to install the drivers as well.
i also used this method to revert my app2sd partition from ext4 to ext2. so it also works with different partition filesystem, someone can maybe test if it also works with different partition size.
thats backing up and restoring right?
maybe ill try it on ext4...
anyway, why convert back to ext2? is there any significance?
bluviper said:
thats backing up and restoring right?
maybe ill try it on ext4...
anyway, why convert back to ext2? is there any significance?
Click to expand...
Click to collapse
was doing a test, and speed-wise there is a slight improvement. about 50 - 80 points on I/O using quadrant. Although really unnoticeable and I don't really rely on quadrant that much, performance seems to be just the same.(OptimusXrom maker domenic_s also uses ext2).
i see.. maybe one time ill try to do ext2.. hehehe
theres not much happening with our O1 today ei?!
so i need to do something... hehehe errr experiment on something...
*lol*
now thats weird.. after rebooting the second time to recovery...
i cant find my files under Flash zip files...
seems like only system folders are installed....
I just used EASEUS Todo Backup to clone old sd card (with partition ext 4, i think) to new sd card.
It copied everything on the old sd card to new sd card and it works flawlessly.
The software is free for home user.
bluviper said:
now thats weird.. after rebooting the second time to recovery...
i cant find my files under Flash zip files...
seems like only system folders are installed....
Click to expand...
Click to collapse
are you refering to this step?
-Boot into recovery again and partition your new SD(for app2sd).
which i highly doubt. please explain.
I just used EASEUS Todo Backup to clone old sd card (with partition ext 4, i think) to new sd card.
It copied everything on the old sd card to new sd card and it works flawlessly.
The software is free for home user.
Click to expand...
Click to collapse
good for you. just sharing how I did it since changing SDs are becoming pretty common nowadays.
ungaze, after installing the recovery...
and rebooting it via adb, i can still access the files on my sd card. like for example i want to install a new theme etc etc using Flash ZIP menu on V1.2
but after rebooting the second time.
i cant see the files anymore... just folders....
im not into changing cards. but i just want to install something using V1.2 recovery.
and somehow i cannot see my zip files inside Flash ZIP menu.
thats the place to look for when i want to install flashable zips right?
I see, I think I know what you mean.
One of the new features of ThunderG v1.2 recovery is the ability to recognize folders when choosing a zip file to flash. Well that's good, but the problem is that it still doesn't have the option to scroll down when the screen/list is full(or maybe I just havent found out yet). I also had this problem before, so what I did was to make a new folder with a higher alphabetical priority name, eg: "aaflash", "aflashfiles", "1flash" etc so that the folder will always appear at the top. Then I placed all my zip files into that folder and just open the folder when I need to apply something. Try it, the files should appear.
yap. someone told me that too... and so i did.. and yes it can be read...
but we can still consider that a bug.
and i think the author needs to edit that part.
anyhow. its working fine....
What does this do? Is this the way we can move all our apps to sd card??? Please im desperate
Sent from my LG-P500 using XDA App
ungaze said:
lol, up late seems more like it.
usb-toggle issue might be usb driver related.
havent flashed the firmware yet so i didnt have the need to install the drivers as well.
i also used this method to revert my app2sd partition from ext4 to ext2. so it also works with different partition filesystem, someone can maybe test if it also works with different partition size.
Click to expand...
Click to collapse
could you explain how you converted the ext4 partition into ext2?
victortangocharlie said:
could you explain how you converted the ext4 partition into ext2?
Click to expand...
Click to collapse
Actually, I can't really call it a convertion, I just backed up the SD contents, format it, repartition ext2 than put the old contents back in place. Update: Ext2 on optimusXrom's app2sd doesnt seem to work, didn't checked thoroughly and app2sd got disabled. Need to contact domenic on how he did this.
domenic_s said:
No, actually ext2 is faster than ext3 ... i don't know how it is to ext4 but i'm using ext2 at the moment.
Click to expand...
Click to collapse
Hey ungaze,
Could you tell me how to use apps2sd to move an app to the ext4 partition i have on my phone.

[Guide]How 2 Create EXT3 for the Salsa only! * Increased Internal Memory*

Ok seems many usrs here have the same problems over and over again. so heres a tut!
This will probably cover many other topics but simplified here as much as i can.
You Must have the following to get this to work:
ROOT
Recovery 5.0.2.6
busybox installed.
if you have non of these...do not attempt any of this thread till you have!
To start with.
Creation of EXT3 Partitions.
you will need Minitool Partition Wizard. Mini Tool Partition Wizard Download
This is a harddrive/diskspace program allowing accurate modification of disk space.
Never create an EXT3 in CWM, as this will create whats known as a swap drive.
this causes the bootloop. Hence the non boot!
EXT3 has to be set as primary drive not logical.
Size allowance recommendations (personal choice, but this is after a few findings and results given by Salsa users)
SD Card Size.................................EXT3 Size
2GB......(Class 2).............................250MB
4GB......(Class 2-4)..........................500MB
8GB......(Class4-6)...........................500MB-1GB
16GB....(Class8-10).........................1.2GB​
WARNING, anything over 1.5GB will result in serious problems and SD damage
This also works around class types of SD Card. the higher the class the faster it works, there are various brands offering different class cards, find a fast and big card for best performance. I currently use Class 8 16GB with 1GB Ext3 with little/no lag
Wise idea before this to make an SD backup, if done correctly your data will not be affected...if you screwed up...you'll loose everything...so back it up!
To start with,
Remove Sd Card and use and SD Reader and insert into your computer USB Slot.
Open Minitool Partition Wizard.
Resize your sd card accordingly leaving 1.2-1.5gb of unallocated space. Apply the actions.
Now you have the unallocated space, reformat the space in EXT3 and set as Primary drive. Apply Actions.
Now normally the Application throws your sd out and says bad drive......this is sometimes normal so don't panic.
Reinsert your Sd in Phone and boot into recovery only
Data2sd script
theres 2 scripts available for these roms.
htc-data2sd-ext3 or data2whatever by m1ndh8x4r.
2.1 Roms work well with htc-data2sd-ext3 script with no problems.
data2whatever works really well with 3.5 sense Roms (Bens/M1nds)
*****There is a warning with this data2whatever script....When using this script, you will notice after a short period, that you cannot update or install any more apks. This is due to a Dalvik error within the script on Deodexed roms, currently it cannot be fixed, you have been warned*****​
these can be used easily but the following rules must be applied.
You must flash the rom firstly by the 3 wipes...regardless!
flash the rom as normal and reboot full, letting the rom fully build it self and load up... ie input your details/sign in wifi etc.
check it out for a few mins while your waiting...hey even make a backup lol!
OK now reboot in recovery and flash the chosen script....DO NOT WIPE ANYTHING!
once flashed reboot normally.
it will boot, it may take up to 5-10mins but it will boot. if by any chance you a boot loop at the boot animation screen then you have an EXT3 fault and you must redo the EXT3 Partition in Minitool to proceed again.
data2sd scripts are here>
http://www.mediafire.com/download.php?duigp9ky9796b65 for htc-data2sd-ext3.zip
http://www.mediafire.com/download.php?m7bv6pk024p63ef for d2extv0.43.zip (New/Advanced)
http://www.mediafire.com/download.php?qr5rh2fho1hnbnl for data2whatever
This is a proven way and so many have tried and failed other ways.
Please try this guide. If you get stuck please just ask!
Please Answer my poll at the top and Thank this post...Ty!
If you Answer NO to this guide, please post below and tell me why so i may help further
Heyy it worked thanks man
BigBearEvo said:
Open Minitool Partition Wizard.
Resize your sd card accordingly leaving 1.2-1.5gb of unallocated space. Apply the actions.
Now you have the unallocated space, reformat the space in EXT3 and set as Primary drive.
Click to expand...
Click to collapse
Trying to do this with fdisk on linux
It works but runs slowly for some reason
I have a 2GB cards, first partition is about 1.4 for normal /sdcard the remaining .4GB for /data
Both partitions are start aligned on 2048 sectors
Issue - applications get corrupted after restart
I am facing strange issue. I did everything described above and have /data on sd. But everytime I reboot something happens to most apps. They are installed but when I try to launch any of them I got errors and application closes. I need to reinstall EVERY app and they work until next reboot. Any ideas about the cause or what to check ? At this point I am trying not to discharge or reboot my phone by it;s impossible to keep it that way.
procek said:
I am facing strange issue. I did everything described above and have /data on sd. But everytime I reboot something happens to most apps. They are installed but when I try to launch any of them I got errors and application closes. I need to reinstall EVERY app and they work until next reboot. Any ideas about the cause or what to check ? At this point I am trying not to discharge or reboot my phone by it;s impossible to keep it that way.
Click to expand...
Click to collapse
thats a rom issue.
What rom are you running?
Are you using a Data2sd script? if so which one?
Are you using links2sd?
BigBearEvo said:
thats a rom issue.
What rom are you running?
Are you using a Data2sd script? if so which one?
Are you using links2sd?
Click to expand...
Click to collapse
I am running standard HTC ROM 1.12.401.2 With Sense 2.1.
I used ext3 version of script.
No. Shall I ?
procek said:
I am running standard HTC ROM 1.12.401.2 With Sense 2.1.
I used ext3 version of script.
No. Shall I ?
Click to expand...
Click to collapse
no dont lol...ok sounds a bit stupid but have u got root? because what your describing is and apps2sd thing...which u cant get on stock rom....but if u dont have full root....then this sort of thing does happen....or...you got a faulty ext3 partition...
questions next...
which guide did u make ext3?
size and did u make swap?
root?
Need file name of the data2sd script u used and how u used it...(this is important)
so i need full break down....assuming u have root that is....this almost sounds like a silly problem, but then most of us don't use stock roms anymore....so we dont have this problem lol
BigBearEvo said:
no dont lol...ok sounds a bit stupid but have u got root? because what your describing is and apps2sd thing...which u cant get on stock rom....but if u dont have full root....then this sort of thing does happen....or...you got a faulty ext3 partition...
questions next...
which guide did u make ext3?
size and did u make swap?
root?
Need file name of the data2sd script u used and how u used it...(this is important)
so i need full break down....assuming u have root that is....this almost sounds like a silly problem, but then most of us don't use stock roms anymore....so we dont have this problem lol
Click to expand...
Click to collapse
Of course I have a root - it works perfectly. I created the partition according to above instructions (I mean this thread). My ext3 partition is about 800 MB and 3200 MB is for FAT32. I did not create swap - just fat32 and ext3 with Partition Wizard. I used htc-data2sd-ext3.zip in I think normal way - phone reset, installing busybox, reboot, installing script with recovery - done. Everything is perfect until next reboot.
procek said:
Of course I have a root - it works perfectly. I created the partition according to above instructions (I mean this thread). My ext3 partition is about 800 MB and 3200 MB is for FAT32. I did not create swap - just fat32 and ext3 with Partition Wizard. I used htc-data2sd-ext3.zip in I think normal way - phone reset, installing busybox, reboot, installing script with recovery - done. Everything is perfect until next reboot.
Click to expand...
Click to collapse
sounds like a problem with your rom my friend....hard to tell without seeing it really...
have you thought about changing the rom itself?
BigBearEvo said:
sounds like a problem with your rom my friend....hard to tell without seeing it really...
have you thought about changing the rom itself?
Click to expand...
Click to collapse
To this moment no. But if there's no other option I will probably have to...
procek said:
To this moment no. But if there's no other option I will probably have to...
Click to expand...
Click to collapse
either that or find your ruu and reinstall stock again!
Funny thing
I used my previous card (smaller - just 2 GB) and there's no such behaviour as with my 4GB. Smaller one is Sandisk, bigger one is Kingstone - both known for good products. So switching ROM is rather not an option. There's something about SD but I can not figure out what...
Pls help
I have created 6gb of fat32 and copied ROM and data2sd-ext3.zip then formatted remaining 1gb space in ext3. When I tried to install zip from recovery mode it throws "E: can't mount /sdcard/"
pls help
Thx
yuva0103 said:
I have created 6gb of fat32 and copied ROM and data2sd-ext3.zip then formatted remaining 1gb space in ext3. When I tried to install zip from recovery mode it throws "E: can't mount /sdcard/"
pls help
Thx
Click to expand...
Click to collapse
how did you make the partitions? and are they set as primary?
what class sd card is it? you need a class 8 or 10 on that size.
I used mini tool for partition. I set fat32 as logical and ext3 as primary. I have 8gb class 10 SD.
Sent from my HTC Salsa C510e using XDA
Shrink the ext3 to 750mb and set all partitions as primary.
BigBear is using Xparent Tapatalk Purple
Yep now I can see my data in SD card. Another problem I triple wiped and flash arc rom again, and given detail/sign in. When trying to flash script in recovery mode, it asks for busybox in some sys folder. I don't have busybox and also script installed, but ext3 memory not reflects in as main memory. Am I used different script or I need to install busybox, if so how to do that.?
I installed busybox @ system/xbin and flashed script, it worked. Finally my internal memory problem solved:thumbup:
I request to add installing busybox step and download link for script in tutorial.
Thx bb
Sent from my HTC Salsa C510e using XDA
I used data2sd without without any problem for past two days, suddenly today some apps force closing. Instagram app show error msg like"unfortunately this device's filesystem is reporting a problem." and pointing to this url "bit.ly/igfilesystem".
pls help.
I'm using arc V2 ROM, class 10 8gb sd, with 750mb of ext3.
yuva0103 said:
I used data2sd without without any problem for past two days, suddenly today some apps force closing. Instagram app show error msg like"unfortunately this device's filesystem is reporting a problem." and pointing to this url "bit.ly/igfilesystem".
pls help.
I'm using arc V2 ROM, class 10 8gb sd, with 750mb of ext3.
Click to expand...
Click to collapse
contact instagram with a logcat or report for them to check

SD-EXT

I am looking forward to make a partition of my SD Card to allow easier installation of apps.
I have a 16GB Micro-SD Card and i'm looking forward to make a 4GB Partition.
I've heard of amarullz script and I definitely want to use it.
I searched XDA Alot, and i found out that there are different partition types. So if someone could kindly answer these questions, It would be great:
1) Can you give me a simple and efficient guide on how to partition using CWM, or anything else?
2) What partition type should i use.
3) Does Amarullz script need to be configured or it's the simple flashing.
4) Is there any way to automatically move apps to sd-ext without apps like S2E. I think the scripts do that but i'm not sure.
Thanks.
xD
masterex567 said:
1) Can you give me a simple and efficient guide on how to partition using CWM, or anything else?
2) What partition type should i use.
3) Does Amarullz script need to be configured or it's the simple flashing.
4) Is there any way to automatically move apps to sd-ext without apps like S2E. I think the scripts do that but i'm not sure.
Thanks.
xD
Click to expand...
Click to collapse
1 no, use search and check the stickies. Cwm and partition guides are all over the place. Reading several guides to do it will help you in case something doesn't go as planned.
2 depends. Stock roms work better with fat32 and ext2 partitions. Custom roms work good with any ext format partition. Cwm creates ext3 format partitions, for other formats use another partitioning tool (minitool partition wizard).
3 just flash it and reboot twice. It needs a kernel that supports /init.d, which most custom roms have, and stock roms can be flashed with cf-root to enable /init.d.
4 yeah, the scripts do it. There are several, amarullz is one, there's also int2ext++ and darktremors (this one requires some user input though). Look them up, make your call.
dxppxd said:
1 no, use search and check the stickies. Cwm and partition guides are all over the place. Reading several guides to do it will help you in case something doesn't go as planned.
2 depends. Stock roms work better with fat32 and ext2 partitions. Custom roms work good with any ext format partition. Cwm creates ext3 format partitions, for other formats use another partitioning tool (minitool partition wizard).
3 just flash it and reboot twice. It needs a kernel that supports /init.d, which most custom roms have, and stock roms can be flashed with cf-root to enable /init.d.
4 yeah, the scripts do it. There are several, amarullz is one, there's also int2ext++ and darktremors (this one requires some user input though). Look them up, make your call.
Click to expand...
Click to collapse
oK..
Any link to a simple and efficient guide on partitioning??
Just a tip. Never go beyond 1GB SD-ext size. You'll just wait it coz app size are about 20-30 mb (the bigger ones) and you'll not be installing that much on your phone.
About partitioning you can just do it via CWM recovery.
Shadow xD said:
Just a tip. Never go beyond 1GB SD-ext size. You'll just wait it coz app size are about 20-30 mb (the bigger ones) and you'll not be installing that much on your phone.
About partitioning you can just do it via CWM recovery.
Click to expand...
Click to collapse
Okk..
I just wanted to install over 10 pages of apps.
I heard partitioning through CWM makes an ext3 partition, and ext3 partitions are not supported.
One question: I'm following this: http://forum.xda-developers.com/showthread.php?t=1476121
If i use minitool partition wizard and follow the instructions there. will amarullz script work?
And will it work on all roms like cm7, cm9 and stock????
Thanks.
Ext4 has been said around as unstable. *need to research more on this one*
Yes, CWM makes ext3 partition.
If you're using CM7 based ROM I'd suggest using S2E. Supports ext3, no errors whatsoever, 1GB is more than enough for over 100 apps, and make sure the SD Card is class 6 or higher, otherwise you might face performance issues. It's just install, tick and forget. Unlimited *theoretically* apps can be installed then
I do not have any idea on Amarulzz script though,
This Page might help
So what's the best partition??
If i follow this guide: http://forum.xda-developers.com/wiki/SD_card_partitioning
Will it succesfully get me the result?
masterex567 said:
So what's the best partition??
If i follow this guide: http://forum.xda-developers.com/wiki/SD_card_partitioning
Will it succesfully get me the result?
Click to expand...
Click to collapse
Yes that's a good guide.
Ok. Great.
Final Question: What Partition type should i use? Ext2, Ext3 or Fat32??
It should work good with amarullz script and with stock and cm7 roms...
Damn. I try deleting partition through minitool and after that my sd card isn't recognized, it says damaged.
though i fixed it with a format. :/
masterex567 said:
Ok. Great.
Final Question: What Partition type should i use? Ext2, Ext3 or Fat32??
It should work good with amarullz script and with stock and cm7 roms...
Damn. I try deleting partition through minitool and after that my sd card isn't recognized, it says damaged.
though i fixed it with a format. :/
Click to expand...
Click to collapse
I use ext3 with a 16gb class 6 sd card (1gb partition) with A2SD+ cronmod script.
Shadow xD said:
I use ext3 with a 16gb class 6 sd card (1gb partition) with A2SD+ cronmod script.
Click to expand...
Click to collapse
Okk. I've finished the first step according to the guide.
Well. According to the guide "Step 2". and created the fat32 primary partition. Now on step 3 i'm kind of clueless. coz i can't click create new partition as it is greyed out.
I think i'm just gonna use CWM.
What's the procedure to use CWM, to partition for 4gb?? and then use amarullz??
masterex567 said:
Okk. I've finished the first step according to the guide.
Well. According to the guide "Step 2". and created the fat32 primary partition. Now on step 3 i'm kind of clueless. coz i can't click create new partition as it is greyed out.
I think i'm just gonna use CWM.
What's the procedure to use CWM, to partition for 4gb?? and then use amarullz??
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=1477996
Shadow xD said:
http://forum.xda-developers.com/showthread.php?t=1477996
Click to expand...
Click to collapse
Thanks. I partitioned.
Now, I'm going to use amarullz script. I see that it needs to be copied to init.d.
Isn't there any way to make a flashable zip coz i change roms aloot.
Thx!!
Search for the original thread here in xda. You will find the flashable zip
Sent from my GT-S5830 using xda premium
Shadow xD said:
Search for the original thread here in xda. You will find the flashable zip
Sent from my GT-S5830 using xda premium
Click to expand...
Click to collapse
I got it. It's ok..
I prefer doing it manually anyways.
Thanks a lott!

Can we repartition to make swap?

I've been thinking about this for a few days now. Then, today, xda posted an article on repartitioning the Xperia to gain some advantage. So it seems like a good time to pose this question for us HD+ owners.
This a "feasibility study" question. I'm not a developer. I can hardly hack my way though Mint, let alone the HD+. I'm asking if the following possible?
(If yes, maybe a nice developer will do it for us? )
Can we shrink and repartition the /factory partition in the HD+ (as they shrink partitions in the Xperia) and use the leftover space as /swap?
Background
I've been reading leapinlar's excellent treatises on the partition structure in the HD+ (see Item 16) and how the /factory partition, meant for automatic disaster recovery, doesn't do us much good if you've installed a custom ROM and a custom recovery. (See all of Item A12.)
Among other things, the /factory partition contains an image of the stock B&N ROM. Which will cause bootloops if triggered when you're running CM.
But, if I understand it correctly, the /factory partition isn't a total waste. It duplicates some important data from the /rom partition (devconf), which could come in handy IF you put the stock recovery back on in an attempt to fix your HD+. (Then it could rebuild the /rom partition if it had become corrupted.)
So, as it stands now, /factory is 448 MB that's mostly useless to us. Can't we put it to good use? Like /swap? Or direct zRAM to it?
Leapinlar has already created some repartitioning tools, as has the Xperia dev now. So I'm hoping a lot of the hard work has been done already.
Proposal
(I apologize in advance is my terminology isn't exactly correct.)
Is it possible to:
1) remove the factory.zip from the /factory partition and then shrink the partition to accommodate only the /rom backup files. (I'm thinking that all factory zips are the same size, so once the new smaller partition is calculated, it ought to be the same for everyone's HD+);
2) create a new partition from the left over space, calling it (new) partition #11;
3) format partition #11 as swap
4) easily tell CM 10 or CM 11 to use the /swap? I'm hoping this can be done with just a init.d script. (Maybe an fstab tweak too?)
5) Or perhaps dedicate #11 for zRAM, as a kernel developer has done with useless space in the Galaxy Tab 2. In essence, we'd have almost 1.5GB of RAM.
Feasible? Yes/No? I realize that dinking with partitions can damage my HD+. It's a risk I'm willing to take.
I'm not going to get involved with this, I'm just going to add a warning. The partition structure for the HD/HD+ is different than the Nook Color and most other devices. The NC and other devices like SDs use DOS partitioning. The HD/HD+ is like the Nook Tablet that uses GPT partitioning. The two partitioning schemes are not compatible. So don't try to use my tools in the NC forum. If you want to know more about GPT partitioning on the Nook Tablet and get some tools, search the Nook Tablet forum.
Sent from my BN NookHD+ using XDA Premium HD app
leapinlar said:
The partition structure for the HD/HD+ is different than the Nook Color and most other devices. The NC and other devices like SDs use DOS partitioning. The HD/HD+ is like the Nook Tablet that uses GPT partitioning. The two partitioning schemes are not compatible.
Click to expand...
Click to collapse
Good to know! Now we have more data than we had before.
Looks like a lot of the work has been done already
So, I found this thread in the xda forums all about nook tablet partitions. They even talk about resizing! (Or at least, about making a different size /userdata partition.)
There is also this here about repartitioning Nook partitions.
Looks like parted would be easier for what I'm looking to do, shrink the /factory partition and create a new partition.
I read here that I can use a live Linux CD to mount the factory.img. From there, I presume I can delete the factory.zip and create a new image?
I'm not a linux geek, but I presume I need to be on a live Mint CD to use parted in ADB? (Update: Apparently I am to use the Android SDK for ADB in Windows. Downloaded already. Am climbing the steep learning curve.)
First half of Step 1, Done
Well, it took longer than it should have, but I made a new, smaller factory7.partition.img file. It's 1 MB.
I started by booting a Mint 16 Live CD.
Then I mounted the OEM factory partition image I made beforehand using the dd command, per leapinlar's instructions. (See his Item 16.)
Code:
sudo mount -o loop partition7.factory.img {some.folder}
That image contained 4 zips: factory,zip; fsck.zip; rombackup.zip; romrestore.zip.
Dummy me, I tried deleting the factory.zip inside the mounted image. It occurred to me later that that would be like trying to delete a file from a mounted CDROM's iso image. Can't be done.
So I copied the 4 zips to a new folder. Then I could deleted factory zip, which was 433.3 MB.
That left less than 1MB for the other 3 zips.
If there's an elegant way of modifying an .img and resaving it, I couldn't find it. (I spent a lot of time with mkfs.yaffs2. But this .img was not a yaffs.(Didn't pass a "sanity check" when I tried to mount the new .img I had made with mkfs.yaffs2.)
So I brute forced an imaging solution by copying the 3 copied zips to a 1MB ext4 partiton on a USB stick. (I made the partition with gparted and used chmod 777 to clear permissions in the partition.)
Then I made an image of the new 1MB partition using the dd command. In my case
Code:
sudo dd if=/dev/sdd2 of=new.partition7.factory.img
(I probably don't have the leading /'s right here. Am truly hacking my way through all this. I'm sure most of you could do this whole project in a few minutes.)
So now I have a shiny new 1MB custom factory image just wating to be used.
Update: I think I'll redo this, and leave 4 zips, in case the recovery mechanism is looking for a "factory.zip" I'll made a dummy file and archive it, calling it "factory.zip."
The next task is to get ADB working, delete the original large partition7 in the HD+, create a new 1MB partition7 in its place, and then restore my new image to partition 7 using the dd command in reverse.
After that, then to create partition11 out of the unallocated 432MB and format that as swap.
Update: It occurs to me that I will have to backup partitions 8, 9, and 10 with dd. Then I'll have to destroy them, recreate them in new locations, and then restore them. Fortunately, an xda developer has already written the instructions on how to do all this.
I see that CM 10 supports swapon, so I'm hoping it will be downhill after the partition work. I'm hoping CM will automagically find the new swap partition, once I enable swap.
If you know different, I'd appreciate hearing from you. Will using swap in this memory burn the memory out quickly?
Better yet, swap file instead of swap partition
So, I was thinking more about this idea and how I'd have to destroy and recreate p8, p9 and p10 to make a new swap partition at p11. Aside from that being a lot of work and more prone to errors with all those operations, a new p11 would never get TRIM'd by the OS.
So now the plan is to reduce /factory (p7) to 1MB and increase /system (p8) by 443 MB. Then I'll put a swap file in /system.
Only have to work on two partitions that way and /system gets TRIM'd. (Or at least Lagfix will trim it.)
Whatdaya think?
I suppose it's easy enough to put a swap file in /data to get a feel if there's any performance gain from swap in eMMC. Someone wanna show me the code to do this? (I've read about how to create a swap file. Not sure how to mount it at emmcblk10.) Never mind, Found it on xda! Am currently running 500MB swap on /data to see what it's like.
PMikeP said:
So, I was thinking more about this idea and how I'd have to destroy and recreate p8, p9 and p10 to make a new swap partition at p11. Aside from that being a lot of work and more prone to errors with all those operations, a new p11 would never get TRIM'd by the OS.
So now the plan is to reduce /factory (p7) to 1MB and increase /system (p8) by 443 MB. Then I'll put a swap file in /system.
Only have to work on two partitions that way and /system gets TRIM'd. (Or at least Lagfix will trim it.)
Whatdaya think?
I suppose it's easy enough to put a swap file in /data to get a feel if there's any performance gain from swap in eMMC. Someone wanna show me the code to do this? (I've read about how to create a swap file. Not sure how to mount it at emmcblk10.) Never mind, Found it on xda! Am currently running 500MB swap on /data to see what it's like.
Click to expand...
Click to collapse
I guess this is a dumb question, but if you can put a swap file in /system and /data, why can't you delete the factory.zip from /factory and put the swap there? Why create a new partition?
Sent from my BN NookHD+ using XDA Premium HD app
leapinlar said:
I guess this is a dumb question, but if you can put a swap file in /system and /data, why can't you delete the factory.zip from /factory and put the swap there? Why create a new partition?
Click to expand...
Click to collapse
First, I'm abandoning my bright idea. Turns out that swap is slow (even on eMMC) and possibly destructive to the eMMC with all the writes. (Hmmm . . . I wonder how many writes /cache gets compared to a swap file? (IOW, would a swap file be any more destructive than cache is?))
There were 1 second pauses every now and then, presumably while swapping when I had a swap file mounted in /data. Even tho I could get more free memory with a swap file than with zRAM, zRAM is much faster. And since zRAM is supported by the OS, it's the path of least resistance for me.
But to answer your question, it's not a dumb question. I'm a dumb user.
First, I don't know how to mount the /swap on the /factory partition. Can it be done? I don't see /factory in root explorer when running. Whereas I can see /system and /data. (So, to use Windows talk, it seems like /factory is "hidden" when running the OS?) By the same token, I don't know if I can delete the factory.zip from /factory in situ. If it can be done, it probably requires ADB and fastboot (?). But I haven't learned about those yet. So I'd have to use my new image trick, from my post above, to "delete" factory.zip from /factory.
Second, even if I could mount a swap in /factory, I don't think I'd want to. (Although I agree it's be a lot easier (and less dangerous) than deleting and recreating partitions.) I don't think /factory gets TRIM' by the OS. And I presume I would want it TRIM'd every now and then or else the swap would get slower over time than it already is.
I notice that Lagfix offers to trim /system and /data (and /cache). But not /factory. As above, if /factory is not visible during operation of the OS, that would be one reason why Lagfix doesn't trim it.
Or it could simply be that Lagfix doesn't see the need to trim /factory. Since /factory is supposed to be static, there wouldn't be any reason for Lagfix (or CM) to trim it.
Whether /factory can be trimmed with the fstrim command while running, I don't know.
Anyway, my idea for swap wasn't such a good idea. So I've abandoned the idea.
It still bugs me, as an engineer who compulsively tries to optimize everything, to carry that wasted 443 MB around in /factory.
I don't think we need an extra 443 MB in /system or /data. (Or /cache.) But if we ever do, we know where to find it.
/factory is not automatically mounted in stock or CM. So to get access to it you would need to mount it with a script command. And I would assume you need script commands to set up /swap so that should not be a problem. But /factory is formatted fat32 and /data and /system are ext4 so that might interfere too.
And manual trim commands can be run to trim the mounted /factory. You don't need the app lagfix to do it.
But I agree, I'm not really sure you gain anything with swap on this device.
Edit: as PMikeP pointed out to me in a PM, I was mistaken. /factory is ext4, not fat 32. Thanks for the correction. That should make it easier.
Sent from my BN NookHD+ using XDA Premium HD app

[Q/Dev suggestion] Space for another big ROM slot in internal storage?

Taken from CM12 thread as this started to become off-topic. The issue I'm trying to address is how to stuff a huge Lollipop ROM directly into internal storage, without creating a virtual slot, to increase system performance and have overall cleaner solution. Original inspiration: @Mentor.37's custom Safestrap for unused partitions, which has way too small /data for me unfortunately. (explanation)
sd_shadow said:
Septfox said:
This in mind, is there any way to repartition the internal (stock) storage to decrease the size of /cache/ and create a larger /data/ partition, or is it not possible without modifying the bootloader?
Click to expand...
Click to collapse
Code for mounting the unused preinstall and webtop partitions to SD storage http://forum.xda-developers.com/showthread.php?p=59253593
Click to expand...
Click to collapse
This allows you to mount the partitions either as a new storage or to a specific directory only, in other words it does not merge the storages, just adds a mount point next to (or possibly if modified a bit on the top of) other storage. While this may be useful for taking some inherent load off /storage/sdcard0/ (i.e. mounting /dev/block/webtop to /storage/sdcard0/Downloads) for people not swapping their sdcards, it doesn't help in Septfox's intention of enlarging /data/.
I face the same problem as Septfox: I'd love to use the storage intended for running system for it, not virtually mounted storages created in the storage intended for storing media and support data. However, the outline of the storage is intended for way older and less robust system so even the /system/ is not quite enough (667 MB, which tightly fits CM12 with a small GApps package) and /data/ is also not enough for heavier use (3.22 GB). Therefore I would like to merge it with currently unused partitions: maybe join preinstall to system and webtop to data, making both big enough.
One alternative would be to mount the 1.4 GB webtop as /data/app, which currently makes about 2/5 of occupied space of my /data. Is this possible? At which point of system startup is the script in /system/etc/init.d executed (is it done by Safestrap or the ROM itself?), and at which point might the system first need to access /data/app that contains the APKs of user-installed apps? All the really needed stuff (compiled executables) is in the /data/dalvik-cache, right? Here I'm on a really thin ice, don't know much about Android's architecture, so sorry if this is a major bullsh*t - just throwing my idea in Technically what I'm talking about is such modification of the script:
Code:
#!/system/bin/sh
mount -o rw,remount /data # Not too sure about this
# - depending on whether /data is already rw or not.
# For that I would need to know when is the script
# executed. I'm almost sure this is not necessary
# though. In original script this was done to allow
# writing into /storage/.
mkdir /data/app
#mount -o ro,remount / - unnecessary, see above
#mount -t ext3 /dev/block/preinstall /storage/preinstall
# I don't see any use for small preinstall partition.
mount -t ext4 /dev/block/webtop /data/app
chmod 777 /data/app # not sure about this either,
# probably should be 771
Clean version:
Code:
#!/system/bin/sh
mount -o rw,remount /data # Unnecessary?
mkdir /data/app
mount -t ext4 /dev/block/webtop /data/app
chmod 777 /data/app # Possibly 771 instead.
Is that possible to run, or will it bootloop, what do you think?
Even better IMO would be to delete preinstall and webtop and shrink the Stock data down to maybe 200 MB so the original Stock system is still present, preventing the phone from bricking and accommodating Safestrap. The remaining space could be divided between Safe system (say 800 MB) and Safe data (over 4 GB). Are we able to do this somehow, maybe by customizing Safestrap a bit more? Or are partitions in /dev/block locked by bootloader? Also are all these and Internal storage located on the same physical chip, or are there two separate memories in the D4? Attached proposal of repartitioned layout Sizes taken from here and here.
Developers and experienced users, I would love to hear your opinion, mainly on whether repartitioning internal storage or at least mounting webtop to /data/app could work on D4. Thanks!
Addition to the original post:
I have a spare D4 with shattered screen and not working SIM slot that I bought for spare parts. Apart from GSM (or telephony altogether? I didn't try, as only option would be emergency call which I don't want to abuse, and we don't have CDMA networks here) it works fine though. I can try meddling with formatting/partitioning - it won't be too big deal if it gets bricked beyond possibility of SBF restore.
Replies so far, taken from the original CM12 thread:
sd_shadow said:
I don't think repartitioning is possible without high risk of hard bricking the device, and yes the locked bootloader does limit what can be done.
This is quite off topic, and you should start a new thread if you are going to continue.
Click to expand...
Click to collapse
Good call, started new thread
lucize said:
tried to change the type of preinstall partition and the device would boot into fastboot: (invalid cg hab (cg: ebr, status: 0x0056)
so a recovery is needed, I'll try a resize if I can compile the tools in safestrap. but I think it would not work
later edit: used fdisk to resize in safestrap and it broke again so it can't be done
Click to expand...
Click to collapse
Thanks for trying! What do you mean by changing type?
As I added here in the first post, I have a spare shattered but mostly working D4 I wouldn't be too sad to see bricked - I can try out more dangerous stuff if you point me in the right direction. I'd like to help testing different approaches to repartitioning if you have some potentially harmful ideas that you wouldn't try on your own phone.
Curious question aside: where is bootloader (and fastboot) stored? Is it sitting on some other small partition? Can we mount it to be read, or even to write there? What/where is that protection that keeps us from unlocking the bootloader?
Also, concerning mounting the free partitions to other system partitions: do you think it's possible to mount them as a folder in /data (whichever we use)? Does it matter what filesystem the partitions use? What part of boot-up runs the /system/etc/init.d/ scripts? Do you think attached proposals 2 or 3 are feasible? It would still have the stock system untouched for an emergency use and Safestrap storage, but its data would be shared with the safe system, with webtop mounted as /data/app or /data/data (1.4 GB should suffice I hope) which would leave us with nice 3.2 GB for the rest. Of course, preinstall's 600 MB for /system is hardly enough for CM12 with Pico version of PA GApps so the rest of used Google apps would inflate /data a bit - but still this is probably the best option we have now.
Actually, I find the stock /system/ to be adequate. Yea, it's a tight fit, but CM12+PA Micro Gapps slots in with 30-someodd megabytes to spare, and there shouldn't be any real need for additional space on top of that. Though, I suppose there could be trouble if CM starts including larger apps.
Init.d is done by the ROM itself, and has to be enabled at build time; CM12 actually has it shut off for whatever reason (Slimkat did as well, I would imagine CM11 also did). There's an app called "Universal Init.d" in the Store, but by the time it can get around to executing the scripts, it's obviously way too late to be screwing with vital partitions : \
Worth pointing out that Safestrap appears to have proper ADB access, you might be able to do something with partitions thataway. I don't know enough about partitions and mounting in Linux to take a jab at it. Woop, looks like that's already a no-go. Maybe the bootloader does a check or three to make sure the partitions are all in order, and throws a critical error if not.
If absolutely all else fails, there's still symlinking large apps into the newly-accessible partitions that can be done, either manually or with Link2SD/similar apps. It's a bit of a hassle, but an option nonetheless.
Well, stock /system is fine but I want to keep it untouched - mainly because I don't want to install CM12 as an update over stock JB, and also to keep myself from SBFing (at least in the long run) because of trivial issues. When this option is off the plate, the remaining partitions don't seem to offer enough space to run CM11 in a non-virtual slot (as Mentor.37 offers with his modified Safestrap with a "Safe" slot with 600M system and 1.4G for data).
Symlinking is an ugly solution - used it for a while, never liked it, mainly because symlinks broke once SD got unmounted or mounted as Mass Storage, with problems remounting afterwards.
Since we can modify the system freely, I'm sure that if necessary, we could make a neater solution than using an app to create symlinks after boot. Question how early in the boot process can we add some scripts (by flashing some zipped patch over the ROM) goes to more knowledgeable devs though...
first time I just used t option in fdisk to change partition type to whatever without changing size, the second time I resized some of them and every time after 1st reboot the M logo would appear for 1 second and from now on it would go straight into fastboot without M logo, so it seems that something in bootloader is verifying the layout or something and if is not good it would stop.
I don't think that it's possible to brick it for good, use rsd to recover
Regards
Thanks to @lucize for his trying, sadly it seems we can't repartition at all
@Mentor.37, is there a source to your customized SS 3.75 available? I'd like to try and mess around with it to put the Proposal 3 from my second post's attachment to work.
Could mounting and symlinking be done from Safestrap, or does the ROM do it itself? I have ideas of various cross-linking of folders on the partitions to kind of emulate repartitioning - but I'd have to try if it works and it would need to be done either before the system boot or shortly in the process. See attachment - that's a first draft I presume for this that the user keeps stock system only for keeping the phone bootable no matter what happens in other than stock slots, so stock data would be utilized only for root and safestrap, leaving most of its 3.2 GB free.
LuH said:
Thanks to @lucize for his trying, sadly it seems we can't repartition at all
@Mentor.37, is there a source to your customized SS 3.75 available? I'd like to try and mess around with it to put the Proposal 3 from my second post's attachment to work.
Could mounting and symlinking be done from Safestrap, or does the ROM do it itself? I have ideas of various cross-linking of folders on the partitions to kind of emulate repartitioning - but I'd have to try if it works and it would need to be done either before the system boot or shortly in the process. See attachment - that's a first draft I presume for this that the user keeps stock system only for keeping the phone bootable no matter what happens in other than stock slots, so stock data would be utilized only for root and safestrap, leaving most of its 3.2 GB free.
Click to expand...
Click to collapse
I believe that it's impossible because symlinking "works" after kernel is loaded and safetrap take place (is loaded) before a kernel is loaded....
If I'm not mistaken, symbolic linking is a filesystem thing, something like a shortcut only more complex (after all, it's completely transparent to anything accessing it). ADB probably has commands to make links, terminal emulators in Android definitely can. I think the problem you face is making sure the mountpoint, path, etc are exactly the same both in SS and Android.
Probably better to just do both the mounting and symlinking under Android, so you can be 100% sure that everything matches. We already know /cache/ is unused most of the time under LP, and can (probably) even be unmounted while booted if needbe; why not experiment with it, rather than going straight for the other more important partitions, until you're sure what you're thinking will work?
Edit: Wikipedia has a big ol' writeup on symlinks under various systems, looks like a fun read.
rblanca said:
I believe that it's impossible because symlinking "works" after kernel is loaded and safetrap take place (is loaded) before a kernel is loaded....
Click to expand...
Click to collapse
I guess then this could be implemented in some early booting stage of the system by some custom .zip being patched over, kind of the way Mentor.37's ramdisks are. Unfortunately I don't have nearly enough knowledge to do it.
What I hope could be done more easily is altering SS to maybe use not only shared cache but shared data as well - then webtop could be used for safe system, leaving more then enough space for it, and we still would have fairly usable 3.2 GB data for it. Maybe we could even assign preinstall as stock data? @Mentor.37, I'd really love to hear your opinion on this, or maybe even get your alternated safestrap's source so I could try it myself
Sorry guys, I'm dropping this. I tried CM12 in stock slot and it doesn't help the system as much as I hoped for, so there's no need for this from my side.
I also mistook the process of installing ROM in Stock. I thought I have to upgrade the stock system to the new ROM in order to keep Safestrap in it, but it turns out it's independent and when "wiping" stock /system it leaves the Safestrap there, so I can easily do a clean install of a new ROM in the stock slot
LuH said:
I tried CM12 in stock slot and it doesn't help the system as much as I hoped for, so there's no need for this from my side.
Click to expand...
Click to collapse
About that, could you compare the difference regarding performance between CM12 on the safe slot and CM12 on the stock slot?
I currently got it running on safe slot but I'm thinking about trying to install it to stock slot, now that I sold my Lapdock and don't need Weptop mode anymore.
But I only would do it if it increases the performance of the D4.
Shani Ace said:
About that, could you compare the difference regarding performance between CM12 on the safe slot and CM12 on the stock slot?
I currently got it running on safe slot but I'm thinking about trying to install it to stock slot, now that I sold my Lapdock and don't need Weptop mode anymore.
But I only would do it if it increases the performance of the D4.
Click to expand...
Click to collapse
I don't really remember unfortunately, been running it from stock slot for a while now. Before it definitely was way more laggy than now, but that's also when CM12 for D4 was in a VERY early phase.
It definitely increases the performance, I'm just not sure how much. I don't see any reason why leave original system in stock slot though, so no reason to run CM from the safe slot. I don't like the idea of mounting the ext fs with system running from it from fat storage, it's bound to generate some unnecessary overhead.
In case of any major screw-up, sbf is your friend and AFAIK can't get messed up itself It's a good idea to have the factory cable available though, just in case it for whatever reason dies on you with low battery.
Ok, still good to know, thanks! What's sbf?
Well when I got my D4 a few months ago, I thought installing on the stock slot would be dangerous (in terms of bricking) and since I had the Lapdock, I wanted to keep the stock ROM.
But since then I've read that many users have CM12 running on stock slot, so now I want to do that, too. It's just so annoying when the whole phone freezes for half a minute or so and I think that's mostly due to the limited memory (although I have 170-300 MB free most of the time).
Do I have to consider anything special or different while installing than on an install on safe slot?
Shani Ace said:
Ok, still good to know, thanks! What's sbf?
Click to expand...
Click to collapse
see
Q12: What is a SBF?
Shani Ace said:
It's just so annoying when the whole phone freezes for half a minute or so and I think that's mostly due to the limited memory (although I have 170-300 MB free most of the time).
Click to expand...
Click to collapse
Same here, I suspect it's also connected with throttled data transfer requests of multiple apps at once, but the RAM is IMO the biggest factor. In Linux RAM is almost always full and the "free" space is occupied by cache (filesystem cache or whatever else app's cache) ready to be deleted - maybe the phone is stuttering when freeing the "free" space for other use.
Weird is that my brother with almost vanilla L 5.1 on Nexus 4 has system consuming about 100M less RAM than my CM12 - device-specific drivers maybe?
Shani Ace said:
Do I have to consider anything special or different while installing than on an install on safe slot?
Click to expand...
Click to collapse
If you mean on stock slot, just remember that you need to have some system installed there even in order to boot into safestrap - delete old, install new and ONLY then reboot, otherwise you're facing sbf Learned the hard way It doesn't brick your phone (meaning you can unbrick it), but it's lengthy and annoying...
@sd_shadow: Thanks, now I know. Feels kinda stupid having asked one of the FAQ's - can't remember when that happened before.
LuH said:
Same here, I suspect it's also connected with throttled data transfer requests of multiple apps at once, but the RAM is IMO the biggest factor. In Linux RAM is almost always full and the "free" space is occupied by cache (filesystem cache or whatever else app's cache) ready to be deleted - maybe the phone is stuttering when freeing the "free" space for other use.
Weird is that my brother with almost vanilla L 5.1 on Nexus 4 has system consuming about 100M less RAM than my CM12 - device-specific drivers maybe?
Click to expand...
Click to collapse
Ah that's interesting, didn't know that about Linux before. Well I always imagined that when there's little memory left, the drive somehow gets slowed down because there would'nt be enough space for some temp files or executions. But I don't really have a clue.
On the other hand, different devices showing different and inconclusive results like that is something I already experienced many years ago. ^^
LuH said:
If you mean on stock slot, just remember that you need to have some system installed there even in order to boot into safestrap - delete old, install new and ONLY then reboot, otherwise you're facing sbf Learned the hard way It doesn't brick your phone (meaning you can unbrick it), but it's lengthy and annoying...
Click to expand...
Click to collapse
Yeah I know, I had read about it before. But you can't really miss all those hints everywhere, so I think the community takes good care of spreading that time-saving information.
Actually thanks for encouraging me, because last night I flashed CM12.1 and everything onto the stock slot! Today I installed and configured most of the things I needed (including int/ext storage swap) and I have to say, it really runs better! It might not be as smooth as with a more recent smartphone, but it's definitely snappier than CM12 on the safe slot was (now it's gone and will rest in peace^^). It may sometimes take a few seconds, but most of the time it's very fluid, a great, noticeable improvement.
Additionally, now that I don't have to household with the memory anymore, I installed all the apps that I had left out on the safe slot install and even installed a couple of huge games from the Play Store (NFS:MW, NBA Jam, Batman Dark Knight, Injustice) onto my microSD card and it still runs almost without any hick-ups! I haven't tested the games yet, though.
EDIT: It really seems to have something to do with the amount of memory left on /system. After all that installing I was down to ~ 200MB (which would've been normal on the safe slot) and the phone started lagging a little bit more. But after moving some games and apps to the SD I have more than 500MB 600MB - okay after deleting the cache it's 1,26GB - free on /system and the phone runs smoothly again.
Shani Ace said:
EDIT: It really seems to have something to do with the amount of memory left on /system. After all that installing I was down to ~ 200MB (which would've been normal on the safe slot) and the phone started lagging a little bit more. But after moving some games and apps to the SD I have more than 500MB 600MB - okay after deleting the cache it's 1,26GB - free on /system and the phone runs smoothly again.
Click to expand...
Click to collapse
I guess you're talking about /data, not /system (different partitions, /system is usually read-only and system is installed there with stuff you flash from safestrap, everything else goes to /data or /sdcard). Yup, when /data is becoming full, you're gonna experience some strange behavior.
/data is the first "Internal storage" in Storage settings, /system is not shown there, /sdcard is the second "Internal storage" and /sdcard-ext, or "SD card", is the actual microSD in default CM12 setup. I guess you have the last two switched though.

Categories

Resources