FORUMS
Remove All Ads from XDA

New Storage Layout for HOX Endeavoru

2,344 posts
Thanks Meter: 2,248
 
By teemo, Senior Member on 5th February 2015, 12:09 PM
Post Reply Email Thread
New Storage Layout for HOX Endeavoru

This New Layout will change the way your phones internal memory partitions are used.
The primary goal is to get more space for your apps and data. The secondary goal is to be more compatible with new OS/software. This is obtained by using a layout similar to Nexus devices.

Two years ago pabx showed us "How to switch to a big /data partition", but at that time very few of us actually needed it. It was experimental and good Linux skills was required.

Almost one year ago Thömy proposed to use a new better storage layout for our device. We tried it and found it good (at least I did), but we were still happy with KitKat on Dalvik, so we didn't bother to publish it.

Well, now we have Lollipop and ART. And memory suddently seem very limited.
Move2SD is a must for many of us. And guess what...: Thömy refined the layout to be used for Android 5 and ... I have the pleasure to present this New Layout. So, here we go.


Before starting the process of converting your HOX to the New Layout, please make sure you have plenty of time for this.
Don't start if you are planning to use the phone in near future. Unforseen things can happen, so you may need some advice to get back on the right track.
It is very hard to brick the HOX as HTC did a good job on securing it, but we all know, s... happens.
Remember, xda is all about changes and no change is without risk.


A word of warning: Although some error situations will be prevented, it was not possible to cover all situations.
You CAN restore a backup from the wrong layout. And you may be able to loose data if you don't keep track of which layout you are using.
It is YOUR responsability to keep track of your files.
Good luck and have fun flashing.


Enough talking, let's start.

Requirements: HTC One X International. 50%+ battery. You know how to flash a recovery. You know how to flash ROM and boot.img.
To upgrade, follow these simple steps or use the detailed guides below:

Make sure your adb/fastboot is up to date and working.
Make sure you can transfer files with MTP (test before you start the transformation).
  1. Backup everything in your phone that you want to keep. This will WIPE ALL!
  2. Boot to fastboot and Install a recovery made for the New Layout. twrp2811.BiG.img will do for a start.
  3. Disconnect the phone from PC (current recovery will fail the format process if you skip this step).
  4. Format Data. This will reformat your SD Card to be used for both app-data and user storage (new SD Card).
  5. Clean out all other partitions.
  6. Restart recovery and wait for two new drives to pop up on your PC.
  7. Copy a ROM with the New Layout to the Internal SD Card or the new 2GB Extra Data.
  8. Flash the ROM (and gapps) and reboot.
  9. Go here and press the Thanks button (or even better, the button above it).


Going back to the old layout is easy:
  1. Boot to fastboot and Install an old Recovery.
  2. Change the file system of the SD Card back to FAT.
  3. Copy a ROM or a backup with old layout to SD Card. Mount USB Storage if you want to copy a backup - MTP may fail on very large files.
  4. Wipe/format everything except SD Card.
  5. Flash ROM or restore backup.
  6. Reboot to bootloader and Flash boot.img from ROM or the backup.
  7. Boot to your old system.


Whats missing ? Let me know if you find something!
Want pictures ? Look in the guides
Want more ? Upload it....
... and so he did... thanks @dady000 for SlimBean!

Adding New Layout to Legendary @pabx AOSP 4.2.2 >>>>>>DOWNLOAD<<<<<

All my files are now copied/moved to >>>>> Android File Host
The Following 105 Users Say Thank You to teemo For This Useful Post: [ View ] Gift teemo Ad-Free
 
 
5th February 2015, 12:09 PM |#2  
teemo's Avatar
OP Senior Member
Flag Kolding
Thanks Meter: 2,248
 
More
FAQ


How do I create a backup of my Old Layout?
Guide on BACKUP


How do I switch to the New Layout?


How do I get back to the Old Layout?
Guide on Going Back to Normal Layout



How difficult is it to switch to the New Layout?
Quote:
Originally Posted by Nemesis1278

Awesome I will try the new layout.
... @teemo love the instruction for New big partition it is easy to follow and I don't thnk I can make a mistake unless I forget to backup my files to my computer. Thanks for the formatting over to new partition instructions.


What if I update the ROM or if I change to a different ROM. Do I need to backup my pictures and music etc. first ?
Quote:

The SD Card is now a part of the /data partition. It is actually just a directory named - /data/media
This "media" is the SD Card.
When you flash a ROM, you can wipe Dalvik, System, Cache and Data. This will not touch the SD Card.
When you select wipe Data in twrp, it does NOT format /data. It selectively delete everything on /data except /data/media
To wipe the SD Card, you need to select Internal SD Card.

Preparation for a new ROM



Show me the difference...

Partitions on the Old Layout:
Code:
#p12: 1280MB  /system
#p13:  320MB  /cache
#p14:   25GB  sdcard
#p15: 2196MB  /data
Partitions on the New Layout:
Code:
#p12: 1280MB  /system
#p13:  320MB  /cache
#p14:   25GB* /data
#p14:   25GB* /data/media = sdcard
#p15: 2196MB  /xtradata
* #p14 is 25GB that is shared between DATA and SDCARD


Why can't we use Mass storage?

The data we want to store on the bigger partition need to be protected. The FAT system used by current sdcard does not offer any kind of protection. Linux/Android use ext4 to secure your data. This mean you can use your phone for banking, pictures, videos and other private data without worrying too much.
HTC have locked the partitions, so we cannot resize /data and sdcard.


Can I restore from Old Layout to New Layout

Thanks to @eyosen for reminding me of this. It can make life a little easier for us:
You can restore DATA from the Old Layout to the New Layout. Do not restore the system.
Make sure the data you restore is compatible with the ROM (system) you install. Most apps may restore and work perfect, but be prepared, that there might be issues. If an app is messed up, first try to clear the apps data via Settings-Apps-"BadApp".


I can't see the drives on PC ... I have problems with Windows drivers:

THIS guide has proven to be useful, thanks @bhushan11689


I still have problems with Windows drivers when using twrp2834-BiG:

Try the new twrp2851-BiG, it is more friendly

I cannot download to sdcard,
Pictures and Screenshot does not work,
How can I access my sdcard?

For all solutions below: Once you enter the command, you must WAIT.
It can take a while, as the command will change ownership of all your files on the sdcard.
On a fresh install it may only take a second. But if you restored a lot of files, be prepared to WAIT

If you use MultiRom don't do this (I am not sure, but I think it will change ownership for your secondary ROMs)

Originally Posted by Thunder07 I'd recommand
Code:
adb root
adb shell chown -R media_rw:media_rw /data/media/0/
If that didn't work, try this:
- boot into the recovery
- tap Advanced -> Terminal Command -> Select
- write carefully:
Code:
chown -R media_rw:media_rw /data/media/0/
tap Go and WAIT for the command to finish
- tap Home and reboot system

Or if you have Root Explorer or similar installed in android, you can:
- From Root Explorer navigate to /data/media
- long press the "0" folder and select Change owner
- Set Owner and Group to "1023 - media_rw" and tick "Also set on all sub-folders and files"
- hit OK and WAIT.


...to be updated...
The Following 21 Users Say Thank You to teemo For This Useful Post: [ View ] Gift teemo Ad-Free
5th February 2015, 12:10 PM |#3  
teemo's Avatar
OP Senior Member
Flag Kolding
Thanks Meter: 2,248
 
More
Please welcome HTC Sense to the New Layout.
Converting Sense5 4.2.2 to the New Layout

Note: If you have no experience with the tools below used in this Sense-kitchen, please get familiar with the tools before starting. I will not explain usage of these.

Here is the recipe for cooking:
Code:
1. ROM
2. apktool
3. for linux: mkbootimage + split_boot + repack_ramdisk
   alternatively for windows: bootimg_tools_windows
4. Apply The "patch"
Short instructions:
1. Edit the storage_list in the ROMs framework. Just change parameters for the sdcard.
2. Remove sdcard from vold.fstab, we fuse it in the ramdisk.
3. Update the ROMs updater-script. Pay special attention to any mmcblk0p15 entries. Change it to mmcblk0p14. Some scripts want to wipe Data (if asked), comment it away (or it will wipe data and sdcard).
4. The RAM Disk. One important point here: Use the old command for the sdcard service.

Additionally: Be aware of scripts adding "UMS features/helpers/whatever". I have currently a windows popup asking me to format "F:". This came from converting the lONElyX kernel.

The "patch":
Code:
ROM
1.
  /system/frameworks/framework-res.apk
    apktool d framework-res.apk
      frameworks-res/res/xml/storage-list.xml
        - <storage android:mountPoint="/storage/sdcard0" whatever .... />
        + <storage android:mountPoint="/storage/sdcard0" android:storageDescription="@string/storage_internal" android:primary="true" android:emulated="true" android:mtpReserve="100" />
    apktool b framework-res
      new framework will be in frameworks-res/dist
      open new framework-res.apk and
      add original META-INF and 
      replace AndroidManifest.xml with the original
2.
  system/etc/vold.fstab
    - dev_mount sdcard /storage/sdcard0 emmc /devices/platform/sdhci-tegra.3/mmc_host/mmc0
    + #dev_mount sdcard /storage/sdcard0 emmc /devices/platform/sdhci-tegra.3/mmc_host/mmc0
3.
  META-INF/com/google/android/updater-script
    - mount("ext4", "EMMC", "/dev/block/mmcblk0p15", "/data");
    + mount("ext4", "EMMC", "/dev/block/mmcblk0p14", "/data");
4.
  boot.img
    split_boot boot.img
      boot/ramdisk/init.endeavoru.common.rc
        -   # for backwards compatibility
        -   export EXTERNAL_STORAGE /storage/sdcard0
        -   mkdir /storage 0050 system sdcard_r
        -   mkdir /storage/sdcard0 0000 system system
        -   symlink /storage/sdcard0 /sdcard
        -   symlink /storage/sdcard0 /mnt/sdcard
        + on init
        +   # See storage config details at http://source.android.com/tech/storage/
        +   mkdir /mnt/shell/emulated 0700 shell shell
        +   mkdir /storage/emulated 0555 root root
        + 
        +   export EXTERNAL_STORAGE /storage/emulated/legacy
        +   export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
        +   export EMULATED_STORAGE_TARGET /storage/emulated
        + 
        +   # Support legacy paths
        +   symlink /storage/emulated/legacy /sdcard
        +   symlink /storage/emulated/legacy /mnt/sdcard
        +   symlink /storage/emulated/legacy /storage/sdcard0
        +   symlink /mnt/shell/emulated/0 /storage/emulated/legacy
        +   # Our old /data partition
        +   mkdir /xtradata
          on fs
        
        +   setprop ro.crypto.umount_sd false
        +   setprop ro.crypto.fuse_sdcard true
        +
          on post-fs-data
        +   mkdir /data/media 0770 media_rw media_rw

        -   /dev/block/platform/sdhci-tegra.3/by-name/UDA \
        +   /dev/block/platform/sdhci-tegra.3/by-name/ISD \

        +   # virtual sdcard daemon running as media_rw (1023)
        +   service sdcard /system/bin/sdcard /data/media /mnt/shell/emulated 1023 1023
        +   class late_start
        #eof
        
      boot/ramdisk/init.rc
        mkdir /cache 0770 system cache
        mkdir /config 0500 root root

        + # See storage config details at http://source.android.com/tech/storage/
        + mkdir /mnt/shell 0700 shell shell
        + mkdir /mnt/media_rw 0700 media_rw media_rw
        + mkdir /storage 0751 root sdcard_r

        # Directory for putting things only root should see.
      
      boot/ramdisk/fstab.endeavoru
        - /dev/block/platform/sdhci-tegra.3/by-name/APP           /system             ext4      ro                                                                                  wait
        - /dev/block/platform/sdhci-tegra.3/by-name/UDA           /data               ext4      noatime,nosuid,nodev,noauto_da_alloc                                                wait,encryptable=/dev/block/platform/sdhci-tegra.3/by-name/DUM
        - /dev/block/platform/sdhci-tegra.3/by-name/CAC           /cache              ext4      noatime,nosuid,nodev,noauto_da_alloc                                                wait
        - /dev/block/platform/sdhci-tegra.3/by-name/RCA           /rca                ext4      noatime,ro                                                                          wait
        - /dev/block/platform/sdhci-tegra.3/by-name/RFS           /rfs                ext4      noatime,rw                                                                          wait
        - /dev/block/platform/sdhci-tegra.3/by-name/DLG           /devlog             ext4      nosuid,nodev                                                                        defaults
        + # New Layout #
        + /dev/block/platform/sdhci-tegra.3/by-name/APP  /system       ext4   ro,barrier=0                                            wait
        + /dev/block/platform/sdhci-tegra.3/by-name/CAC  /cache        ext4   noatime,nosuid,nodev,noauto_da_alloc,barrier=0          wait,check
        + /dev/block/platform/sdhci-tegra.3/by-name/RCA  /rca          ext4   noatime,rw,barrier=0                                    wait
        + /dev/block/platform/sdhci-tegra.3/by-name/RFS  /rfs          ext4   noatime,rw,barrier=0                                    wait
        + /dev/block/platform/sdhci-tegra.3/by-name/DLG  /devlog       ext4   nosuid,nodev,barrier=0                                  defaults
        + /dev/block/platform/sdhci-tegra.3/by-name/UDA  /xtradata     ext4   noatime,nosuid,nodev,nomblk_io_submit,errors=panic      wait
        + /dev/block/platform/sdhci-tegra.3/by-name/ISD  /data         ext4   noatime,nosuid,nodev,nomblk_io_submit,errors=panic      wait,encryptable=/dev/block/platform/sdhci-tegra.3/by-name/DUM

    cd boot
    repack_ramdisk ramdisk
    mkbootimg --kernel boot.img-kernel --ramdisk new-ramdisk.cpio.gz -o boot-newlayout.img
    boot-newlayout -> rom.zip/boot.img
NOTE: The "patch" below is not automatic. It must be "applied" by hand
Attached Files
File Type: txt Sense5-2-NewLayout.patch.txt - [Click for QR Code] (5.3 KB, 796 views)
The Following 9 Users Say Thank You to teemo For This Useful Post: [ View ] Gift teemo Ad-Free
5th February 2015, 12:11 PM |#4  
teemo's Avatar
OP Senior Member
Flag Kolding
Thanks Meter: 2,248
 
More
Reserved 3
The Following User Says Thank You to teemo For This Useful Post: [ View ] Gift teemo Ad-Free
5th February 2015, 01:03 PM |#5  
Senior Member
Thanks Meter: 135
 
More
Hi Teemo, thanks for the effort. The time of great change for HOX is coming eventually. OMNIROM seems new for me. Is it the same as SLIMLP ROM but with new layout or it's a totally new LP ROM ? One more question, will the other ROM makers follow this new layout as well ? Thanks.
5th February 2015, 04:32 PM |#6  
teemo's Avatar
OP Senior Member
Flag Kolding
Thanks Meter: 2,248
 
More
Omnirom is Omnirom
This is the first preview of lollipop onOmni. Very young, but with potential.
I hope other ROMs will follow, Thömy did all the work on the design, I just made the recovery and the guide. So I assume CM will join.
Time will tell if there is a need for it. It's all up to the users.
5th February 2015, 04:44 PM |#7  
lalit387's Avatar
Senior Member
Flag Delhi
Thanks Meter: 659
 
More
Finally we got it.

Thanks buddy

Do we need new layout for Omni?
5th February 2015, 05:27 PM |#8  
teemo's Avatar
OP Senior Member
Flag Kolding
Thanks Meter: 2,248
 
More
thought
Quote:
Originally Posted by lalit387

Do we need new layout for Omni?

Yes, absolutely
Omni is PREview. No wifi yet. No update schedule at the moment, but seem stable and have some nice options.
Just thought we should have some options to start with. SlimLP should join soon.
The Following 3 Users Say Thank You to teemo For This Useful Post: [ View ] Gift teemo Ad-Free
5th February 2015, 07:00 PM |#9  
lalit387's Avatar
Senior Member
Flag Delhi
Thanks Meter: 659
 
More
Quote:
Originally Posted by teemo

Yes, absolutely
Omni is PREview. No wifi yet. No update schedule at the moment, but seem stable and have some nice options.
Just thought we should have some options to start with. SlimLP should join soon.

Would appreciate an old layout Omni compilation, if possible
5th February 2015, 08:00 PM |#10  
teemo's Avatar
OP Senior Member
Flag Kolding
Thanks Meter: 2,248
 
More
Quote:
Originally Posted by lalit387

Would appreciate an old layout Omni compilation, if possible

Should be possible. Maybe @audahadi can point me to the latest good KitKat Omni build. It may take a while though, as I do have a lot of other stuff to look at. But if everything is setup and ready to pick from github, I can give it a try.
Of course audahadi is more than welcome to do it, if time and energy permit it
The Following User Says Thank You to teemo For This Useful Post: [ View ] Gift teemo Ad-Free
6th February 2015, 12:05 AM |#11  
Senior Member
Thanks Meter: 135
 
More
Quote:
Originally Posted by teemo

Yes, absolutely
Omni is PREview. No wifi yet. No update schedule at the moment, but seem stable and have some nice options.
Just thought we should have some options to start with. SlimLP should join soon.

Thanks Teemo for more information. But I guess wifi is critical for the ROM. Hope that can be resolved soon.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes