[How to] Determine dd Parameters For All LG G4 Models - G4 Q&A, Help & Troubleshooting

[How to] determine dd parameters for all LG G4 models
IMPORTANT:
Only for advanced users!
You are an advanced user if you know exactly what you are doing.
You are an advanced user if you know what to do if something went wrong.
You are NOT an advanced user if you know how to do copy+paste.
You can bring your smartphone into a state, so it no longer works.
I am not responsible for anything. The following instructions are only suggestions.
Hello,
everyone knows how to root the LG G4 with the "low effort root" method.
They copied the system partition to an ".img" file, rooted it and copied it back to the "system" partition.
Many users wonder how to get the right parameters for the "dd" commands.
Please read the complete guide and be sure that you understand it until you execute a command!
Information:
Code:
dd if=/inputfile bs=8192 count=12345 of=/outputfile
if = Input File
of = Output File
bs = Blocksize in bytes (default is 512 - to increase copy speed use multiple of 512 e.g. 8192)
count = how many blocks
skip = skip blocks before start reading
seek = skip blocks before start writing
more info: http://man7.org/linux/man-pages/man1/dd.1.html
There are different models of the LG G4 on the market.
We know that the system partition is different depending on the model of the G4.
As an example I will show you how to calculate the parameters for the LG G4 H815 (International Model).
What you need:
Windows with Send_Command.exe
Instructions:
At first we need to know where the "system" partition starts (first sector) and how big it is (partition size).
I used the first method to find these values. But I recommend the second method because it's easier.
First method (difficult method, extracting the GPT and using "gdisk" in linux to read the partition info)
What you need:
Linux with "gdisk" installed
Instructions:
Put your smartphone to "Download Mode" and connect it to the Send_Command.exe command prompt.
We need to copy the partition table to the internal storage.
The partition table of GPT (GUID Partition Table) has a size of 16384 bytes and starts at LBA2.
Each LBA has a size of 512 bytes. Because we start at LBA0 we need to add 1024 bytes.
In summary 16384 + 1024 = 17408 (bytes).
Execute the following command:
Code:
dd if=/dev/block/mmcblk0 bs=1 count=17408 of=/data/media/0/gpt_backup.img
Enter "LEAVE" to restart your phone.
You will find the (very small) file "gpt_backup.img" on your internal storage.
Switch to Linux:
Copy the file to your Linux and open the terminal. Then type this:
Code:
gdisk /yourpath/gpt_backup.img
Some warnings will occur. Ignore them.
You will see:
Code:
Command (? for help):
Enter "p" and hit "enter".
You will get a list of the partitions.
Scroll up a bit and check that you see:
"Logical sector size: 512 bytes"
Scroll down and look for the "system" partition.
You will find a line similar to this:
Code:
47 884736 9363455 4.0GiB FFFF system
Now you know the number of the "system" partition is "47".
You will see:
Code:
Command (? for help):
Type "i" and hit "enter".
You will be asked the partition number.
Enter it and hit "enter".
You will see something conatining lines similar to this:
Code:
First sector: 884736
Last sector: 9363455
Partition size: 8478720
Partition name: 'system'
We need the values from "First sector" and "Partition size".
Second method (easier method, just using "adb shell" to read the partition info)
What you need:
adb shell
usb debugging enabled
To get the "logical sector size" use:
cat /sys/block/mmcblk0/queue/logical_block_size
It should be 512
smason said:
To find in any smartphone the offset and the size of /system:
$ adb shell
[email protected]:/ $ ls -la /dev/block/bootdevice/by-name/system
ls -la /dev/block/bootdevice/by-name/system
lrwxrwxrwx root root 2015-01-02 10:50 system -> /dev/block/mmcblk0p47
[email protected]:/ $ cd /sys/block/mmcblk0/mmcblk0p47
cd /sys/block/mmcblk0/mmcblk0p47
[email protected]:/sys/block/mmcblk0/mmcblk0p47 $ cat start
cat start
884736
[email protected]:/sys/block/mmcblk0/mmcblk0p47 $ cat size
cat size
8478720
[email protected]:/sys/block/mmcblk0/mmcblk0p47 $
so:
offset = 512 * 884736 = 452984832
partition size = 512 * 8478720 = 4341104640
Cheers!
Click to expand...
Click to collapse
So "first sector" is the value from "cat start" (884736).
The "partiton size" is the value from "cat size" (8478720).
Now the mathematics (using the values from above):
Logical sector size = 512 (I never saw something different on LG G4 smartphones)
Assuming bs=8192
skip and seek: "First sector" * "Logical sector size" / bs
884736 * 512 / 8192 = 55296
count: "Partition size" * "Logical sector size" / bs
8478720 * 512 / 8192 = 529920
That was an example for the H815 (International Model).
Use your own values to calulate the "dd" parameters!
Back to Windows:
Put your smartphone to "Download Mode" and connect it to the Send_Command.exe command prompt.
Now you can copy your "system" partition to "system.img" with the following command:
Code:
dd if=/dev/block/mmcblk0 bs=8192 skip=55296 count=529920 of=/data/media/0/system.img
Replace the values with the ones you calculated for your model!
Now you could copy the "system.img" to your Linux and root it or do everything else you want.
Important: Do NOT delete the original "system.img" from your internal storage as long as you are not 100% sure your G4 is stable.
If your modifications don't work, you can copy back the original "system" partition (with "dd").
To copy the modified "system_changed.img" back to the "system" partition use the following command:
Code:
dd if=/data/media/0/system_changed.img bs=8192 seek=55296 count=529920 of=/dev/block/mmcblk0
Replace the values with the ones you calculated for your model!
Important: Be sure to use "skip" when reading and "seek" when writing.
The "dd" command should take about a minute.
Did the instructions help you?
Please give a "Thanks!"
Thank you

Hi,
thanks for this great post.
I just have one question. With your formulas and using 8K block size, I get a floating point number as result. So I used a block size of 4K instead, and I get an even number. This seems better to me so I went with it, as I believe smaller block sizes are always ok?
I'm just wondering one thing which seems not right to me. My system partition is reported to be 2.5GB:
Partition number (1-42): 39
Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)
Partition unique GUID: A8725BAA-9E45-B2F8-8FA3-8C972F60F0CF
First sector: 836608 (at 408.5 MiB)
Last sector: 6074573 (at 2.9 GiB)
Partition size: 5237966 sectors (2.5 GiB)
Attribute flags: 1000000000000000
Partition name: 'system'
So with the formulas:
FACTOR 512 / 4096 = 0.125
skip and seek: "First sector" * "Logical sector size" / bs
836608 *FACTOR = 104576
count: "Partition size" * "Logical sector size" / bs
8478720 * FACTOR = 1059840
If I now run the dd command:
dd if=/dev/block/mmcblk0 bs=4096 skip=104576 count=1059840 of=/storage/external_SD/system.img
I get a file system.img which is 4096 MB. Should it not be 2.5GB as my original system partition?
If I use bs=512 (the default) and type
dd if=/dev/block/mmcblk0 bs=512 skip=836608 count=8478720 of=/storage/external_SD/system.img
I get a system.img of the right size (bit over 2.5GB).
I think the block size to use for "skip" is to be specified with the option ibs=XXX, not bs=XXX which only applies to "count" (according to man dd). I tried the ibs option, but the command then just doesn't work on Send_Command.exe. It doesn't even print an error but simply returns immediately.
Cheers
Jen

Hi,
which phone do you have?
Your calculation seems wrong. It's ok to use BS with 4k. I could be a bit slower then 8k, but that doesn't matter.
BUT: Look at your "count" value. Your partition size is 5237966. You used 8478720 (the value from my G4(H815EU) example). Thats wrong!!!
How to calculate with 1k and your values:
bs=1024
skip=836608*512/1024=418304
count=5237966*512/1024=2618983
Please check my calulation!!!
It's interesting, that the Send_Command shell has access to your external sd card...
I think the block size to use for "skip" is to be specified with the option ibs=XXX, not bs=XXX which only applies to "count" (according to man dd).
Click to expand...
Click to collapse
No. "bs" is the right parameter.
If you use "bs" it sets "ibs" and "obs" to the value of "bs".
Just do "dd --help" on a linux system for more details.

Hi Dominik,
oh my, how embarrassing I actually did take the wrong value from the example you posted. I used my value (the 5237966) for calculating the parameters with bs=8K, and got a floating value, so tried 4K instead... and the wrong value must have snug in. Oups.
I also get floating value on 4K now that you've pointed my mistake out:
5237966 * 512/4096= 654745.75
If I rounded this up, would this not mean that I copy a tiny bit of the next partition on the image? And if I then use the image to restore, would I not run the risk to damage something in the following partition?
Anyway, it's not a huge drama as I can just use bs=512 and it works.
Yes I have access to the SD card, the image also has copied there successfully. I was also surprised because I read in the forums that it's not possible.
I found it out with the "df" command, as the SD was listed there. I needed to use it because there's no room on my internal storage (it's a ridiculous 8GB on the LG H735) to store the image there.
My system partition is only 2.5GB so I don't think I have to reformat, but you are right it would be better to use ext4.

Ok
I removed my information about formatting the sd card.
You dont't have to format it. FAT32 is ok.
So you can use your sd card on systems which don't support ext4 too.

I have the LG G4S (H735). It's unusable without rooting as it only has 8GB internal memory. That's why I'm trying to root it now.

jen.magnolis said:
I have the LG G4S (H735). It's unusable without rooting as it only has 8GB internal memory. That's why I'm trying to root it now.
Click to expand...
Click to collapse
Ok, good luck.
Please open a new thread if you have questions about rooting your phone.
Or is there already one? Maybe these?
http://forum.xda-developers.com/g4/help/rooting-lg-h735-g4-beat-t3192491
http://forum.xda-developers.com/g4/general/lg-g4s-world-root-lg-devices-t3231759/page7
Oh. Just saw that you are already there

dominik-p said:
Ok, good luck.
Please open a new thread if you have questions about rooting your phone.
Or is there already one? Maybe these?
http://forum.xda-developers.com/g4/help/rooting-lg-h735-g4-beat-t3192491
http://forum.xda-developers.com/g4/general/lg-g4s-world-root-lg-devices-t3231759/page7
Oh. Just saw that you are already there
Click to expand...
Click to collapse
I just created a new thread too to focus on the particular problem I have:
http://forum.xda-developers.com/g4/general/rooting-lg-g4s-h735-t3243549

this guide helped in dumping boot and recovery partitions.
thank you very much sir! i successfully dumped my boot and recovery partition using dd in my mediatek device by following your guide.

sparksthedev said:
thank you very much sir! i successfully dumped my boot and recovery partition using dd in my mediatek device by following your guide.
Click to expand...
Click to collapse
Congratulations
Did you use the first (more komplex) oder the second method for your device?
I saw that you had problems in this thread:
http://forum.xda-developers.com/showthread.php?p=65907557#post65907557
And you wrote a guide for MTK devices here:
http://forum.xda-developers.com/general/general/guide-dumping-boot-img-recovery-img-t3339530
This doesn't work with the LG G4, but I think it will help many others.
Thank you

My sister asked me to root her phone. It seems more complicated than anything I did in the past (HTC Wildfire, Galaxy Core Plus, Xperia M4A).
I tried this tutorial and it kinda worked, but I can't mount image I got, so it's useless (image, not tutorial!).
Phone is LG-H736 (Beat). I got this result in gdisk:
Code:
Partition number (1-42): 39
Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)
Partition unique GUID: A9520AE6-ABC6-F107-E8FE-B37C4C30CB77
First sector: 836608 (at 408.5 MiB)
Last sector: 6074573 (at 2.9 GiB)
Partition size: 5237966 sectors (2.5 GiB)
Attribute flags: 1000000000000000
Partition name: 'system'
The 8K bs gave me floating point result, so I used 0,5K.
So the dd command were:
Code:
dd if=/dev/block/mmcblk0 bs=512 skip=836608 count=5237966 of=/storage/external_SD/system.img
BTW, I had access to SDCard and I didn't need to open ports...
EDIT: I got the system.img. The problem was I haven't got enough space on SD card.
But now I bricked it...
https://forum.xda-developers.com/g4/help/softbricked-g4-beat-lg-h735-t3959237

Related

[Q] How to repartition KindleFire

So I got to the part where know I know my partitions are off. Heres what I get with the print command in parted:
Code:
/dev/block/platform/mmci-omap-hs.1 # parted /dev/block/mmcblk0
parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
print
Model: MMC M8G2FA (sd/mmc)
Disk /dev/block/mmcblk0: 7734MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 7734MB 7734MB ext2
I have the mmcblk0p1.img, mmcblk0p2.img, ect... on my computer. How would one use these to restore the partitions so I can install twrp and install stock os?
Messing with the partition table is one slip away from brickage...
Sent from my SAMSUNG-SGH-I777 using xda premium
Well, I am bricked.
I just said screw it and got a new one free from bestbuy.
http://forum.xda-developers.com/showthread.php?t=1388996
a good reading on cold night. also factory cable is not a bad thing
danij3l said:
http://forum.xda-developers.com/showthread.php?t=1388996
a good reading on cold night. also factory cable is not a bad thing
Click to expand...
Click to collapse
The partition tables got nuked while being stuck in fastboot mode, so a factory cable isn't gonna help anything. Repartitioning when there aren't any partition tables built can't help either.
Hoping to rev FIREFIREFIRE sometime this weekend with a partition table initializer. This plus the USB boot should give people a way out. It's already in there but I don't think the partition map is right. Maybe I could add an extra command for alternate partitioning so we don't run into this problem...
pokey9000 said:
Hoping to rev FIREFIREFIRE sometime this weekend with a partition table initializer. This plus the USB boot should give people a way out. It's already in there but I don't think the partition map is right. Maybe I could add an extra command for alternate partitioning so we don't run into this problem...
Click to expand...
Click to collapse
How would we install a new version of FFF if we don't have any partitions?
You don't. If the partition table is broken, then likely the CPU will default to USB boot, where you can use Rekindle to run FFF.
pokey9000 said:
You don't. If the partition table is broken, then likely the CPU will default to USB boot, where you can use Rekindle to run FFF.
Click to expand...
Click to collapse
Ah. I see what you mean. I'm sending mine back tomorrow anyway, so this will definitely help people who get nuked partition tables from booting unstable-ish kernels.
And FFF can now restore your partition table. Custom partitions is still TBD.
Get it here.
It's best to set "unit mib" in parted!
Thanks to to all for this useful thread. But I have an additional suggestion:
When starting parted and before issuing a 'print' command, one should issue the command:
Code:
unit MiB
which causes parted to print sizes and boundaries in binary megabytes, i.e., 1MiB = 1024KiB, where 1KiB = 1024 bytes, which is the numbering system still used for RAM chips, but not much else, since marketers prefer the numbering system that makes their product appear bigger. That way, the numbers given by parted are exact and non-overlapping. When numbers are entered in conformity with this presentation, they should be written with the suffix MiB, without any space after the number. Please keep in mind that, in this format, the end of one partition is the 1MiB block before the start of the next one. When the default decimal format is used, the end of one partition will be the in the same 1MB block as the start of the next partition, which hides the actual point of division, which could be anywhere in that 1MB block, depending on where an actual binary boundary falls.
Also note that each block is specified by its offset (in MB or MiB) from the beginning of some larger space, probably /dev/block/mmcblk0. It would make more sense to specify the end of a partition as the offset in MiB to the first byte following the partition, as most disk management programs do. I don't know why parted does it differently.

[Q]: repartitioning hiccup [solved]

Ok, I posted this question in 2 other threads that had info on the process (will delete the posts when this one goes live), but no responses after a couple of days. One of them is old though.
I have TWRP 2.1.1 installed. ADB seems to be working normally. Superuser is working fine after booting to android. I'm running a custom ICS ROM (Energy); read that stock ROM can cause issues repartitioning.
I started with this How-to as it looked very straight forward.
I start throwing the commands at ADB and here's what I got for my efforts:
Code:
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell
~ # su
su
/sbin/sh: su: not found
~ # cd /data
cd /data
/data # ls
ls
/data #
decided to go ahead and check the mount command:
Code:
~ # mount
mount
rootfs on / type rootfs (rw)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
~ #
and parted just for giggles:
Code:
~ # parted /dev/block/mmcblk0
parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
print
Model: MMC MMC08G (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 11.0MB 10.5MB dkernel
4 11.0MB 212MB 201MB ext4 dfs
5 212MB 229MB 16.8MB recovery
6 229MB 296MB 67.1MB ext4 backup
7 296MB 307MB 10.5MB boot
8 307MB 312MB 5243kB ext4 splash
9 312MB 849MB 537MB ext4 system
10 849MB 2041MB 1192MB ext4 userdata
11 2041MB 2309MB 268MB ext4 cache
12 2309MB 7690MB 5380MB fat32 media
(parted)
Ok, so that much worked. Now I tried to shrink 12 so I could double the size of 9. I want to get Switchme set up for his/her profiles and 500MB just isn't going to cut it.
That's when I hit a brick wall:
Code:
(parted) resize 12 2846 7690
resize 12 2846 7690
resize 12 2846 7690
Error: Unable to satisfy all constraints on the partition.
(parted)
One thing that jumps out at me right away is this:
Code:
adb shell
~ # su
su/sbin/sh: su: not found
It seems you are not actually rooted.
To check, enter:
Code:
adb shell
ls /system/xbin
If you don't see "su" in the list, then you don't have root permissions, which would probably prevent you from doing what you need to accomplish.
That's what I was wondering, but apps are able to ask for and receive root permission from within the ROM. SU does exist, just not where the shell is looking when in recovery.
Code:
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell
~ # ls /system/xbin
ls /system/xbin
ls: /system/xbin: No such file or directory
~ #
I did an ls /system/xbin from adb shell and from Terminal Emulator within Android and both returned a long list containing SU.
TWRP provides an unsecured (unsecure? insecure?) boot. Whatever the terminology, it gives you immediate access to root privileges. Apparently CWMR (which was used in the OP of the thread you used) does not and so that author had to use su. For TWRP, it's not necessary and not even available. You already have root privileges as indicated by the hash prompt.
I tried resizing my /sdcard partition and it worked fine with the command you tried. I'm not sure what's going on with your storage device that it wouldn't resize it for you. At first I thought it might be mounted, but your mount command shows otherwise and parted gave me a different error when I had it mounted.
I don't know if this is going to help you, but you might try giving it the "MB" suffix in your numbers....
Code:
resize 12 2846MB 7690MB
Maybe even try changing units to bytes and giving the resize command byte sized boundaries.
Code:
unit B
print
will show you the numbers in bytes and you'd have to use the "B" suffix as in the "MB" example above.
If none of that works, you can always remove and remake the partition. For example...
Code:
rm 12
mkpartfs primary fat32 <start> <end>
name 12 media
You'd obviously need to insert acceptable boundaries for the start and end into that command. It might even be easier to just remove all 9, 10, 11, and 12 and remake/rename them, but remember 9, 10, and 11 are ext4 filesystems so the above mkpartfs command needs to be tweaked accordingly.
One thing I noticed while I was experimenting with the partition table this morning... all of the existing partitions have been allocated in 128MB chunks. I have no idea if this affects performance. I'd imagine you'd only need to stick to the 512B sector sizes, but you might want to stay with those conventions if it's not too inconvenient for you.
If you mess up the partition table, you can always go back to fastboot mode in FFF and use the...
Code:
fastboot oem format
feature to bring your partition table back to stock.
Good luck.
Wow, excellent response. Just the kind of detail I was hoping to get and it confirmed a few suspicions I had while searching the kindle threads. I'll report back on my degree of success when I get some free time to tinker.
I have a nandroid backup (also saved to PC) just in case and saved the partition table as-found. If everything gets hosed and I do an oem format I can just restore that and go or try from square one again, yes?
Sent from my TBolt with the XDA App using 1 opposable thumb
ProfEngr said:
Wow, excellent response. Just the kind of detail I was hoping to get and it confirmed a few suspicions I had while searching the kindle threads. I'll report back on my degree of success when I get some free time to tinker.
I have a nandroid backup (also saved to PC) just in case and saved the partition table as-found. If everything gets hosed and I do an oem format I can just restore that and go or try from square one again, yes?
Sent from my TBolt with the XDA App using 1 opposable thumb
Click to expand...
Click to collapse
I'd say that's a safe bet. Just be very careful about handling partitions 1 and 2 because those two are critical to getting anything to boot on your device. As long as you don't touch the xloader in partition 1 and have FFF installed in partition 2, you can rebuild the rest of it.... in theory. I only say "in theory" because I've never actually had to do it, but I don't see why it wouldn't work.
A couple of additional things I figured out after you put me to work with parted....
It looks like parted doesn't know how to make an ext4 filesystem, so mkpartfs balks if you tell it to make one. You'll have to use mkpart which just makes the partition, but not the filesystem. Then exit out of parted and use mke2fs, which despite its name knows how to make an ext4 filesystem. Like this for the cache partition...
Code:
mke2fs -T ext4 /dev/block/mmcblk0p11
The other thing is that parted sets a "msftres" flag on the fat32 filesystem it makes. The flag apparently is to tell the OS that it's reserved for Windows, or something like that. I didn't have a problem mounting in Linux and MacOS X, but the stuff I've read seems to indicate that older OS's have a problem with it. Unfortunately, the version of busybox on TWRP doesn't have a module to make a fat32 filesystem. I'm looking around to see how to get around that.
In any case, this should get you most of the way there. I'll followup if I find something out.
Ok. I used to run n*x, but use only M$ right now. Haven't touched a 'mac' since Jr High (IIgs)
Sent from my TBolt with the XDA App using 1 opposable thumb
ProfEngr said:
Ok. I used to run n*x, but use only M$ right now. Haven't touched a 'mac' since Jr High (IIgs)
Sent from my TBolt with the XDA App using 1 opposable thumb
Click to expand...
Click to collapse
I have a IIgs sitting in the basement... but it's not a mac, it's an Apple ][.
Found the last piece...
Code:
/system/bin/newfs_msdos /dev/block/mmcblk0p12
will make a fat32 filesystem correctly. I think that's all you'll need.
EDIT: OK, I must have been half asleep when I posted the above. That binary is on the stock system software I had mounted. There's nothing on TWRP to create a fat32 filesystem correctly.
Yeah, ][e was my first computer that didn't crash at the drop of a keystroke. Had an Adam tape drive model, but it froze up constantly.
Sent from my TBolt with the XDA App using 1 opposable thumb
So, I met with success following the repartition thread and tweaking it with your suggestions. I didn't quite move and many MB around as I thought, but it was enough to move me a little farther down the road with SwitchMe. At least it doesn't tell me I don't have enough memory for a 2nd profile now.
I still think it has issues with ICS or EnergyROM itself. When I created a new profile and rebooted to it I was stuck on Nova launcher instead of GO like the main profile. Strange.
I'll consider this thread to have fulfilled its usefulness. Thanks again for the help.
no device found
ProfEngr said:
So, I met with success following the repartition thread and tweaking it with your suggestions. I didn't quite move and many MB around as I thought, but it was enough to move me a little farther down the road with SwitchMe. At least it doesn't tell me I don't have enough memory for a 2nd profile now.
I still think it has issues with ICS or EnergyROM itself. When I created a new profile and rebooted to it I was stuck on Nova launcher instead of GO like the main profile. Strange.
I'll consider this thread to have fulfilled its usefulness. Thanks again for the help.
Click to expand...
Click to collapse
I get
(parted)
Error: No device found
Retry/Cancel

[TEST] Custom Storage Partitions v1 for OPPO FIND 7 (x9076)

Read-Me First
1) This procedure may brick your phone and make it useless. Use this procedure at your own risk.
2) This procedure is not official, so it is not supported by Oppo company.
3) This procedure is only for advanced users with a good low-level knowledge of Android storage and adb-fastboot commands.
4) This procedure WILL ERASE ALL YOUR PERSONAL DATA on your phone. Please BACKUP ALL YOUR DATA before using this procedure.
5) This procedure has been tested only on Oppo Find 7 (x9076) phone.
6) This procedure will use an external Micro-SD card to make user run some scripts.
Goal/Purpose
This procedure will resize the two partitions ("userdata" and "sdcard") used by Oppo Find 7 to store personal data, such as apps, photos, images, and so on.
Due to the fact the Oppo Find 7 (x9076) uses an only-3GB "userdata" partition to store apps, while all the remaining space (24 GB) is used for "sdcard" partition to store other data, this matter doesn't provide with enough space to store apps and their related data.
This procedure should be used to enlarge the size of "userdata" partition, to let user have more space for apps and less space for personal data in order to use some ROMs that currently do not provide with support for unified storage ("Unified Storage Layout" or LVM), such as Color OS, CyanogenMod and other ROMs based on CyanogenMod rom.
With the provided compressed file, you will receive some ".sh" files to be used to resize the storage partitions. The namefile of these scripts just means two numbers, the first one is the new size (in GB) of "userdata" partition, while the second one is the new size (in GB) of "sdcard" partition. So, for example, the script "8_19.sh" should be used to have 8 GB for the resized "userdata" partition, and "19 GB" for the resized "sdcard" partition.
How to
1) Make a backup of all your data on your phone.
2) Download and unzip the compressed file.
3) Just unzip the included "external_sd.zip" file on root of your external MicroSD card.
4) Restart into recovery.
5) Run terminal window and execute "adb shell" to go into adb shell.
6) Run command "cd /external_sd/new_scripts".
7) Be sure that all .sh files are in folder "/external_sd/new_scripts".
8) Run one of the provided ".sh" file. Do not unplug the usb cable and wait until the end of the procedure. If you've selected "unified.sh" script, please remember that you have to update the custom recovery (as described in thread "Unified Storage Layout" - http://www.oppoforums.com/threads/tutorial-unified-storage-layout-for-oppo-find-7a.17952/).
9) Enjoy your new storage partitions.
Issues
1) If the procedure will end with the error "Persist partition is damaged. After rebooting into recovery, please run persist_fix application.", you have to reboot into recovery again, and then run the script included inside "persist_fix" folder (it is part of the zipped file "external_sd.zip").
Make sure that "persist" partition will have the "ext4" formatting, because it is happened, many times, that during backup and restore of "persist" partition, something happens to damaged the "ext4" formatting.
2) It is happened, once only, that you cannot reboot into recovery again due to some problems during backup-restore procedure of "recovery" partition. This problem may be simply solved flashing the recovery with "fastboot" command.
Tips & Hints
1) I suggest users of Oppo Find 7a, to use alternate unified procedures (such as “Unified Storage Layout” or LVM) instead of this procedure, due to low storage sizes. It is a non-sense to waste space for two partitions (one dedicated only to the apps, and the other one to user’s data) when you can use only a big one, shared for both apps and data.
2) If you have not enough know-how to use this procedure or if you are afraid of doing something wrong using this procedure, you can wait for a definitive decision from Oppo about storage layout. With last final release of ColorOS (2.0 kitkat), Oppo still continues to use two partitions, with only 3GB dedicated to apps, and the remaining storage space dedicated to user’s data.
There are some rumors about Oppo regarding storage layout, that is Oppo will use the LVM storage layout in the future. Anyway we hope that Oppo may release the guidelines for storage as soon as possible, maybe with next ColorOS release.
3) This procedure makes a backup of the most important partitions in order to restore them after the resizing procedure. The backup is stored on the external MicroSD card at the end of the procedure, so please keep the backup for future reference and to restore it if something goes wrong in the future.
Please take note that only ColorOS is bundled with updated images of few partitions (some of them managed by the backup/restore procedure), but not for all partitions, so the only way to restore an image of a partition currently is to restore it from a stored image (such as the images stored by this procedure).
4) During testing period, I’ve discovered that “persist” partition, managed by this procedure, may lose the “ext4” file system formatting during the backup/restore procedure. On Internet there is a lot of mainstream about this partition, but mainly there is a lot of confusion regarding it. Someone even suggests formatting (so erasing it) this partition whenever users encounter problems on using phone.
As far as I understand, “persist” partition is a mountable partition, it contains important code (binaries and data), mainly regarding wi-fi connections. It is used by all ROMs, including stock and custom ones.
So it is mandatory to preserve the contents of this partition to avoid bootloops, missing or poor wi-fi connections and other serious problems on using this phone.
If you want to know what is the contents of this partition, you can simply boot your ROM, use a terminal prompt, input “su” (you need root permissions) and simply go into “/persist” folder (it is mounted by the ROM).
At the end of the resize procedure, the “ext4” formatting will be checked in order to prevent any problems on “persist” partition. If “ext4” file system formatting is lost, a message will be shown to the user. The user must reboot into recovery, and then use the script included inside “persist_fix” folder (included in “external_sd.zip” file). This script will restore an image of “persist” partition and then check if the problem is solved or not. Please use this script whenever you have problems on “persist” partition (on Internet there is a lot of mainstream about “persist” partition, not only related to Oppo Find 7).
Copyrights
Some scripts included in this procedure are based on scripts written by Coldbird and included into "Unified Storage Layout" procedure. All rights are reserved to Coldbird.
Thanks
1) Thanks to Coldbird, to aut0mat3d and to all people involved into "Unified Storage Layout" procedure.
2) Thanks to all people involved into "LVM Partition Remapping" procedure.
3) Thanks, in advance, to all people that will test this procedure.
References
Why there is only 9.x GB user space on Find 7a (http://www.oppoforums.com/threads/faq-why-there-is-only-9-x-gb-user-space-on-find-7a.11787/)
Unified Storage Layout (http://www.oppoforums.com/threads/tutorial-unified-storage-layout-for-oppo-find-7a.17952/)
Partition Repairscripts for Oppo Find7, Find7a (http://www.oppoforums.com/threads/tool-partition-repairscripts-for-oppo-find7-find7a.20271/)
LVM Partition Remapping (http://forum.xda-developers.com/find-7/orig-development/ref-lvm-partition-remapping-t2865843)
Tested ROMs
1) Color OS – releases 1.2.6 and 2.0.0 Kitkat.
2) AICP – Release 20141018.
Issue: it is not possible to use the "sdcard0" mounting partition, it is set to read-only permission. To solve this issue, you have to flash another ROM before this, reboot and let it write its own folders onto "sdcard0" partition. Finally you can flash AICP rom and use it normally.
3) AOKP – Nightly 2014-10-18.
4) CyanogenMod CM11 – Nightly 20141025.
5) Dirty Unicorns – 20141011 v8.0 weekly.
Issue: bootloop – When a window, for selecting the language, appears, it seems to be blocked and after 5 seconds it reboots.
6) Mokee – 141025 release
7) Nameless ROM – 20141027 nightly
8) Omnirom 20140923 nightly and 20141031 nightly
Issue: bootloop – When a window, for selecting the language, appears, it seems to be blocked and after 5 seconds it reboots.
9) Paranoid Android – 4.6 beta 5 20141021
Issue : no boot – This ROM doesn't boot at all.
Tested also with 4.6 beta 4 20141007 – no problem.
Tested machine
Custom Recovery : TWRP 2.8.0.1
Google Apps : gapps-kk-20140606-signed.zip
New Internal Storage : 8 GB for "userdata" + 19 GB for "sdcard"
External Storage : 32 gb micro-sd class 10
I've tried this method. And I choose unified.
but I can't see that unified (like the pic).
Here the log from command
H:\adt\sdk\platform-tools>adb shell
~ # ←[6ncd external_sd
cd external_sd
/external_sd # ←[6ncd external_sd
cd external_sd
/external_sd/external_sd # ←[6nls
ls
new_scripts
persist_fix
/external_sd/external_sd # ←[6ncd new_scripts
cd new_scripts
/external_sd/external_sd/new_scripts # ←[6nls
ls
10_17.sh
11_16.sh
13_14.sh
8_19.sh
parted
stock.sh
unified.sh
/external_sd/external_sd/new_scripts # ←[6nsh unified.sh
sh unified.sh
=================================================
Retrieving the size of all partitions.....
userdata = 6291456s sectors
sdcard = 50000000 sectors
=================================================
rm: can't remove '/tmp/backup': No such file or directory
=================================================
Unmount all partitions except external_sd ....
=================================================
=================================================
Backup partitions into /tmp folder.....
=================================================
65536+0 records in
65536+0 records out
33554432 bytes (32.0MB) copied, 0.809779 seconds, 39.5MB/s
32768+0 records in
32768+0 records out
16777216 bytes (16.0MB) copied, 0.440292 seconds, 36.3MB/s
3072+0 records in
3072+0 records out
1572864 bytes (1.5MB) copied, 0.036449 seconds, 41.2MB/s
2+0 records in
2+0 records out
1024 bytes (1.0KB) copied, 0.000651 seconds, 1.5MB/s
16+0 records in
16+0 records out
8192 bytes (8.0KB) copied, 0.000746 seconds, 10.5MB/s
2048+0 records in
2048+0 records out
1048576 bytes (1.0MB) copied, 0.025429 seconds, 39.3MB/s
32768+0 records in
32768+0 records out
16777216 bytes (16.0MB) copied, 0.396552 seconds, 40.3MB/s
65536+0 records in
65536+0 records out
33554432 bytes (32.0MB) copied, 0.829321 seconds, 38.6MB/s
65536+0 records in
65536+0 records out
33554432 bytes (32.0MB) copied, 0.840793 seconds, 38.1MB/s
32768+0 records in
32768+0 records out
16777216 bytes (16.0MB) copied, 0.424749 seconds, 37.7MB/s
16384+0 records in
16384+0 records out
8388608 bytes (8.0MB) copied, 0.221377 seconds, 36.1MB/s
131072+0 records in
131072+0 records out
67108864 bytes (64.0MB) copied, 1.573372 seconds, 40.7MB/s
253919+0 records in
253919+0 records out
130006528 bytes (124.0MB) copied, 3.915451 seconds, 31.7MB/s
=================================================
We remove and create new partitions .......
=================================================
unified.sh: line 94: can't open /external_sd/new_scripts/parted/find7_unified.pa
rted: no such file
=================================================
Restore partitions from /tmp folder.....
=================================================
32768+0 records in
32768+0 records out
16777216 bytes (16.0MB) copied, 0.495464 seconds, 32.3MB/s
3072+0 records in
3072+0 records out
1572864 bytes (1.5MB) copied, 0.199716 seconds, 7.5MB/s
2+0 records in
2+0 records out
1024 bytes (1.0KB) copied, 0.000620 seconds, 1.6MB/s
16+0 records in
16+0 records out
8192 bytes (8.0KB) copied, 0.005822 seconds, 1.3MB/s
2048+0 records in
2048+0 records out
1048576 bytes (1.0MB) copied, 0.139941 seconds, 7.1MB/s
32768+0 records in
32768+0 records out
16777216 bytes (16.0MB) copied, 2.644259 seconds, 6.1MB/s
65536+0 records in
65536+0 records out
33554432 bytes (32.0MB) copied, 5.312673 seconds, 6.0MB/s
65536+0 records in
65536+0 records out
33554432 bytes (32.0MB) copied, 5.498313 seconds, 5.8MB/s
32768+0 records in
32768+0 records out
16777216 bytes (16.0MB) copied, 2.608278 seconds, 6.1MB/s
16384+0 records in
16384+0 records out
8388608 bytes (8.0MB) copied, 1.549714 seconds, 5.2MB/s
131072+0 records in
131072+0 records out
67108864 bytes (64.0MB) copied, 11.840047 seconds, 5.4MB/s
253919+0 records in
253919+0 records out
130006528 bytes (124.0MB) copied, 3.924011 seconds, 31.6MB/s
=================================================
We format userdata, cache and sdcard partitions.....
=================================================
mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=userdata
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
196608 inodes, 786432 blocks
0 blocks (0.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=805306368
24 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
tune2fs 1.41.14 (22-Dec-2010)
Setting maximal mount count to -1
Setting current mount count to -1
Setting interval between checks to 4294880896 seconds
mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=cache
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
32768 inodes, 131072 blocks
0 blocks (0.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=134217728
4 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 28 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
tune2fs 1.41.14 (22-Dec-2010)
Setting maximal mount count to -1
Setting current mount count to -1
Setting interval between checks to 4294880896 seconds
mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=sdcard
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1564672 inodes, 6250000 blocks
0 blocks (0.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
191 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
tune2fs 1.41.14 (22-Dec-2010)
Setting maximal mount count to -1
Setting current mount count to -1
Setting interval between checks to 4294880896 seconds
=================================================
We restore and check the persist partition.....
=================================================
65536+0 records in
65536+0 records out
33554432 bytes (32.0MB) copied, 4.838189 seconds, 6.6MB/s
e2fsck 1.41.14 (22-Dec-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/block/mmcblk0p16: 28/320 files (0.0% non-contiguous), 1085/1280 blocks
=================================================
We copy all /tmp folder into external sdcard....
=================================================
=================================================
End of resizing partitions....
=================================================
Model: MMC 032GE4 (sd/mmc)
Disk /dev/block/mmcblk0: 61071360s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 16384s 147455s 131072s fat16 modem
2 147456s 148479s 1024s sbl1
3 148480s 148543s 64s dbi
4 163840s 163903s 64s DDR
5 180224s 182271s 2048s aboot
6 182272s 183271s 1000s rpm
7 196608s 229375s 32768s boot
8 229376s 230375s 1000s tz
9 230376s 232423s 2048s pad
10 232424s 235495s 3072s modemst1
11 235496s 238567s 3072s modemst2
12 238568s 259047s 20480s oppodycnvbk
13 259048s 279527s 20480s oppostanvbk
14 294912s 3006463s 2711552s ext4 system
15 3006464s 9297919s 6291456s ext4 userdata
16 9297920s 9363455s 65536s ext4 persist
17 9363456s 10412031s 1048576s ext4 cache
18 10412032s 10444799s 32768s recovery
19 10444800s 10447871s 3072s fsg
20 10452992s 10452993s 2s fsc
21 10452994s 10453009s 16s ssd
22 10453010s 10455057s 2048s misc
23 10455058s 10487825s 32768s LOGO
24 10487826s 10553361s 65536s DRIVER
25 10553362s 10618897s 65536s reserve1
26 10618898s 10651665s 32768s reserve2
27 10651666s 10668049s 16384s reserve3
28 10668050s 10799121s 131072s reserve4
29 10813440s 60813439s 50000000s ext4 sdcard
30 60817408s 61071326s 253919s grow
Done.
/external_sd/external_sd/new_scripts # ←[6n
Maybe I make a mistake but can you explain more detail what's wrong?
Thanks
OldClass said:
I've tried this method. And I choose unified.
but I can't see that unified (like the pic).
Here the log from command
.......................
Maybe I make a mistake but can you explain more detail what's wrong?
Thanks
Click to expand...
Click to collapse
May you kindly show me the output of command "ls -l /external_sd/new_scripts/parted/", because I am worried about upper/lower case of extracted files. Thanks.
italianquadcore said:
May you kindly show me the output of command "ls -l /external_sd/new_scripts/parted/", because I am worried about upper/lower case of extracted files. Thanks.
Click to expand...
Click to collapse
Here is the output :
K:\adt\sdk\platform-tools>adb shell
~ # ←[6nls -l /external_sd/new_scripts/parted/
ls -l /external_sd/new_scripts/parted/
/external_sd/new_scripts/parted/: No such file or directory
~ # ←[6nls -l /external_sd/external_sd/new_scripts/parted/
ls -l /external_sd/external_sd/new_scripts/parted/
__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
-rwxrwxrwx root root 872 2014-11-06 23:36 find7_10_17.parted
-rwxrwxrwx root root 872 2014-11-06 23:36 find7_11_16.parted
-rwxrwxrwx root root 872 2014-11-06 23:36 find7_13_14.parted
-rwxrwxrwx root root 872 2014-11-06 23:36 find7_8_19.parted
-rwxrwxrwx root root 868 2014-11-06 23:36 find7_stock.parted
-rwxrwxrwx root root 872 2014-11-06 23:36 find7_unified.parted
~ # ←[6n
i'm sorry has make mistake when put extracted folder in my sd card
now i can repart my internal Find 7 X9076
thanks for your help
OldClass said:
i'm sorry has make mistake when put extracted folder in my sd card
now i can repart my internal Find 7 X9076
thanks for your help
Click to expand...
Click to collapse
I've just updated the "how-to" procedure in order to avoid this problem in the future. I'am happy that it worked. Thanks for your testing.
It's work. Tested on my x9076 using ColorOS KitKat 33 (Chinese Full)
Hello,
i was on unified storage (coldbird method) and this method take me to brick my x9076
I have recovered it with the method QHSUSB_BULK on Oppo forums, and then, when i have a stock layout, i try again with this method.
It works like a charm! Thank youuuuuuu!! :laugh: :laugh: :good:
Hi.
If i go to recovery and execute adb shell, "device not found" error appears. Seems that i missed to install a driver. But i installed the oppo driver, adb driver from google... Nothing of that works.
Trinaaa said:
Hi.
If i go to recovery and execute adb shell, "device not found" error appears. Seems that i missed to install a driver. But i installed the oppo driver, adb driver from google... Nothing of that works.
Click to expand...
Click to collapse
Enable USB Debugging under Developer options in ColorOS and disable MTP under the mount menu in TWRP, then reconnect the phone to PC.
Done everything before, but i´ve got an old twrp version which doesn´t show me the "diasble mtp" option. With your hint i installed the newest twrp and it works! Thank you!
Thank you!!!
Worked like a charm.
Regards,
Samit.
X9006
hi
is this work for x9006 device too?
thanks
@italianquadcore,
Thanks for this great mod.
I had a few issues, which I am posting below.
(I am using Linux)
1. copied the scirpt external_sd folder to external sd on the phone.
2. rebooted to recovery. (Since I was going to use unified.sh, so flashed the unified twrp recovery before hand)
3. connected to phone to pc.
4. from pc: sudo adb shell
5. cd external_sd/external_sd
6. ./unified.sh
Result ... Unification failed.
During the execution, the script encountered 2 problems.
1. The script was not able to find /external_sd/new_scrtipts/parted/find7_unified.parted on line no 94.
So i copied find7_unified.parted to new_scripts folder and modified line no 94 of unified.sh as follows:
parted /dev/block/mmcblk0 < /external_sd/new_scripts/find7_unified.parted
2. The other problem for me was that the script find /dev/block/mmcblk0p15 mounted.
So ran umount /dev/block/mmcblk0p15 script manually.
Result ... Unification successful.
I am posting this so that it can be helpful to others.
May I ask what exactly the unify version does? Does it properly unify the system or is the entire storage made only for apps? For example, running Coldbird's version in a non-unified ColorOS will result in the user being able to use the entire storage for apps, but you can't download files or add them through USB
ganeshbiyer said:
@italianquadcore,
Thanks for this great mod.
I had a few issues, which I am posting below.
(I am using Linux)
1. copied the scirpt external_sd folder to external sd on the phone.
2. rebooted to recovery. (Since I was going to use unified.sh, so flashed the unified twrp recovery before hand)
3. connected to phone to pc.
4. from pc: sudo adb shell
5. cd external_sd/external_sd
6. ./unified.sh
Result ... Unification failed.
During the execution, the script encountered 2 problems.
1. The script was not able to find /external_sd/new_scrtipts/parted/find7_unified.parted on line no 94.
So i copied find7_unified.parted to new_scripts folder and modified line no 94 of unified.sh as follows:
parted /dev/block/mmcblk0 < /external_sd/new_scripts/find7_unified.parted
2. The other problem for me was that the script find /dev/block/mmcblk0p15 mounted.
So ran umount /dev/block/mmcblk0p15 script manually.
Result ... Unification successful.
I am posting this so that it can be helpful to others.
Click to expand...
Click to collapse
"5. cd external_sd/external_sd" is wrong. Is it a typo? Folder "new_scripts" (and all its related subfolders) must be put on "external_sd". So you should have "/external_sd/new_scripts/unified.sh" script to be working.
"So ran umount /dev/block/mmcblk0p15 script manually." mmcblk0p15 is mounted as "data" under TWRP recovery, so all the scripts simply unmount "data" mounting partition. Did you use another recovery?
Thanks for your testing.
idir_muse3k said:
hi
is this work for x9006 device too?
thanks
Click to expand...
Click to collapse
Please refer to paragraph "Tips & Hints" (here above), item 1.
farenteria said:
May I ask what exactly the unify version does? Does it properly unify the system or is the entire storage made only for apps? For example, running Coldbird's version in a non-unified ColorOS will result in the user being able to use the entire storage for apps, but you can't download files or add them through USB
Click to expand...
Click to collapse
For questions regarding "Unified Storage", please refer to thread on Oppo Forum ( http://www.oppoforums.com/threads/tutorial-unified-storage-layout-for-oppo-find-7a.17952/ ). Thanks.
to Italianquadcore
This is so freakin brilliant i screwed up my partitions (with 48mb internal space-lol) and followed your very well written gui, and bingo i got the partition sizes i want again....:highfive::highfive:
Worked like a charm on my x9076 qhd, which i was about to give up on!! Thankyou thankyou so much Pal
Gonna throw a small donation your way soon (not enough to buy a airplane., sorry) money is not what i have most off, just to show my appreciation!
:good:
Hello, I repartitioned the internal memory of my oppo 7 ( rom color os 2.0.0i) by your guide (13GB for data and the rest for storage) and it works perfectly and for that I m very happy because to have 3GB maximum for the app was something really limiting.
I wanted to ask you a question, if I try to change the my actually rom into one of those that you tested (for repartition memory) in the first post of the thread, i must repeat the procedure repartitioning? I must do wipe data / factory and flash the rom and I maintain the same memory repartitioned or i must redo the repartitioning procedure again? With rom tested in the first post i risk a brick of device? I say this because I want to change the color os because I would like to reduce the high consumption of battery and switch to a rom with consumption lower than, or at least let me flash the kernel sensei (the only kernel undervolted available for oppo7) with which to make a undervolt decent. To this end, I take this opportunity to ask you this too, that your opinion and what the best rom with low battery consumption (or what rom where i can flash the kernel sensei) that allows me to maintain this repartitioning already done in my color os 2.0

[NooB Guide] Increase Internal Storage of XS/XSL

Attention!​ I know there are already some posts about it. If you find it annoying PLEASE ignore this post. Do Not bother to comment. Just Ignore it.​
Disclaimer: I'm Not Responsible for Anything. If you wish do it as your own risk.​
These things are goning to happen
For the reason of Formating data will be lost - So backup everything to PC
You'll lose google sign in, contacts, messages, social networking etc. - backup before proceed
Things You will Need
Drivers - For Detecting your device properly (Sony Users can use "Flashtool")
ADB - Use mini version. You don't have to install Android SDK for this
USB Cable
CMD - Use "ConEmu" or "Console2" more flexible than cmd. Provides easy copy of text from console
TWRP Recovery - Download it from twrp site
I'm Going to put this assuming you as Novice. So I'll Explain as much as possible
Step 1 -
* Installing flashtool
Download flashtool from the link given above
Install flashtool as usual.
Then from "C:\Flashtool\drivers" install drivers for your phone.
Open Flashtool (Keep it open for this step)
* Phone Detection
After installing drivers - enable "USB debugging" in phone. Connect your phone to pc see if it is detected or not.
If not try doing uninstall & installing flashtool again. If it is not detected yet I shall say "STOP" forget partitioning. Look in the forum for a solution. Fix it and then continue.
If your device detects properly in normal mode then proceed
Turn off phone. Connect USB cable to PC and while pressing volume up button and connect cable to Phone.
A blue light will flash & Driver will install if necessary. In Flashtool window it will show fastboot mode after detecting phone. If not "STOP" try again. Fix it and then continue.
Step 2 - Install mini adb
If you have downloaded mini ADB.exe version install it to root directory of PC for example C:\ADB. Double click to open the .exe when ask for location of install show to C:\ADB
If you have downloaded Mini ADB as .zip/.rar file. Right click on the file> Extract to > C:\ADB
Step 3 - TWRP
Download from the link given above.
Move Downloaded TWRP image such as twrp-3.0.0-0-nozomi.img to ADB folder (C:\ADB)
Rename the file to twrp.img.
(Optional) - also move rom.zip for later use. If you want to install a fresh rom.
Step 4 - Kernel flash
* Flashing Kernel by flashtool
Turn off phone, conncet it to pc while pressing volume + button
open flashtool> flash device (thunder icon)> fastboot> Flash kernel> select twrp-3.0.0-0-nozomi.img
See the flashtool log if it says "OK" then Reboot/start the phone. Otherwise redo this step.
When starting press volume + - button several time it will bring up recovery screen.
* Flashing kernel into Fota Kernel.
You have to Upload the recovery.img into your phone & Flash to do this: Open Command Window by default in windows it is called cmd.
Opening Command window
* By CMD:
Go to ADB folder> Press Shift + Right Mouse button> Open Command window here> it will open a command window
* Using Other console software:
ConEmu or Console2 can't be open this way. You have to use "cd" command to go to adb folder.
In conEmu or console2 write: cd your adb location for example: cd c:\ADB
Now write these in command window-
adb push twrp.img /sdcard/ <<<<---- this will copy twrp.img to your phone sdcard. Remember to change recovery name to twrp.img
dd if=/sdcard/twrp.img of=/dev/block/mmcblk0p11 <<<<---- this will write twrp to FOTA block of your phone.
** Rebooting phone will bring up recovery screen. In the recovery screen it will ask you whether system should be put into "Read only mode". Don't do that.
** In twrp Go to Mount> deselect System, data, cache, Sdcard and read only system > select again > again Deselect
Before You Procced Any Further Make Sure:
PC can detect your device Normally
PC Can detect device in Fastboot mode
If you really want to do this or not?
Step 5 - Partitioning
[*] Connect USB Cable while in TWRP recovery. (It dosen't matter which screen you are in just Stay in twrp recovery)
[*] Open ADB Folder> Open CMD or ConEmu from there (See Step 4 - opening command window section for this)
Write these command
adb shell <<<<----- it will start ADB
then write
fdisk /dev/block/mmcblk0 <<<<----- It will enable partitioning commands to work
This will bring some info & It will Look Like this:
The number of cylinders for this disk is set to 973824.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help):
**NOTE** " Command (m for help): " will show automatically if you successfuly entered in partitioning mode if not redo steps again.​
Now we need to see each block of default partition and detect SDCARD & Internal Storage: Write this-
p <<<<<<----- This will print or show each partition. Command (m for help): already be there just write p for example Command (m for help): p
It will show this:
Code:
[HIDE]Disk /dev/block/mmcblk0: 31.9 GB, 31910264832 bytes
4 heads, 16 sectors/track, 973824 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 65 2048 f0 Linux/PA-RISC boot
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 * 65 81 512 4d Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 129 768 20480 48 Unknown
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 769 954240 30511104 5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 785 800 512 46 Unknown
/dev/block/mmcblk0p6 833 928 3072 4a Unknown
/dev/block/mmcblk0p7 961 1056 3072 4b Unknown
/dev/block/mmcblk0p8 1089 1184 3072 58 Unknown
/dev/block/mmcblk0p9 1217 1376 5120 70 Unknown
/dev/block/mmcblk0p10 1409 1664 8192 83 Linux
/dev/block/mmcblk0p11 1665 2176 16384 f0 Linux/PA-RISC boot
/dev/block/mmcblk0p12 2177 34944 1048576 83 Linux
/dev/block/mmcblk0p13 34945 42944 256000 83 Linux
/dev/block/mmcblk0p14 42945 108480 2097152 83 Linux
/dev/block/mmcblk0p15 108481 954240 27064320 c Win95 FAT32 (LBA)
Command (m for help):[/HIDE]
STOP​COPY THESE PARTITIOIN INFO TO A TEXT FILE AND SAVE IT. EVERY PHONE HAS SEPERATE PARTITION SETTING. IF ANYTHING GOES WRONG IT WILL BE NECESSARY TO SEE AND GIVE EXACTLY SAME VALUE TO RECOVER ORIGINAL PARTITION.​
Identifying SDCARD & Internal Storage - From the print output we see lots of blocks and lots of data. But We need to know which partition belongs to which.
/dev/block/mmcblk0p14 <<<---- this is the Internal Storage. See the blocks column its like 2 GB (2097152)
/dev/block/mmcblk0p15 <<<---- this is the SDCARD. Blocks look like it's around 27GB and there is also win95 FAT32 type partition.
As we need to increase Internal Storage Size. From where these extra storage will come from? Well, it's from SDCARD. That's why SDCARD & Internal Storage has to be deleted and repartition again. As for delete do this
d <<<<<---- for deleting partition Command (m for help): d
Partition number (1-15): <<<<---- it will ask which partition you want to delete?
15 <<<<<---- First delete mmcblk0p15
then again give
d <<<<<---- for deleting partition Command (m for help): d
Partition number (1-15): 14 <<<<----- Deletes Internal storage partition which is mmcblk0p14
You can give P command to see whether those partition deleted or not
Command (m for help): p
Now creating new partition for Internal storage. Write
n <<<<<----- this is for creating new partition Command (m for help): n
this will show this:
Code:
First cylinder (769-954240, default 769):
To Understand properly look at this table you generated earlier using p command:
Code:
start end
/dev/block/mmcblk0p13 34945 42944
/dev/block/mmcblk0p14 42945 108480
/dev/block/mmcblk0p15 108481 954240
Here mmcblk0p13 started ended at 42944. mmcblk0p14 started at 42945. And mmcblk0p14 ended 108480 just after that mmcblk0p15 started at 108481. Ending is beginning. Quiet easy actually.
So when asked to put first cylinder: you take mmcblk0p13 end value plus 1 write that in first cylinder. for example if End value of mmcblk0p13 is 2 then first cylinder will be 3. if mmcblk0p13 end value is 1000 then first cylinder value will be 1001. if mmcblk0p13 End value is 42900 then first cylinder Value will be 42901. I think that's enough for understanding.
First cylinder (769-954240, default 769): 42945 [<<<<----- in my case mmcblk0p13 end value is 42944 so first cylinder value is 42945 this will not be same for you. press Enter]
Then it will ask for Last Cylinder value: There is three way to put this in kilobyte, in megabyte or in default size but we have to put + sign before size. For example: +100000k or +4000M or +2000000. Easiest one will be using Megabyte. 4000 megabyte is 4 gb, 8000 is 8GB. By default when partitioning system keep some space for recording partition info that's why we never get full size in Memory card, Hard disk, Flash drive etc. This will also be applied here. If you give +4000M command you will get 3.6GB or 3.7GB Something like that. So calculate give some more to keep it even if you want.
Code:
Last cylinder or +size or +sizeM or +sizeK (42945-954240, default 954240):
I want my internal storage is around 4GB So I Gave
+4192 <<<<----- Last cylinder or +size or +sizeM or +sizeK (42945-954240, default 954240): +4192
Now The SDCARD Partition. To create This partition we have to give First cylinder value. As we don't know mmcblk0p14 has which Ending cylinder value. We have to generate the partition table and see. So give the P command.
Command (m for help): p <<<<--- shows partition table. Note the END Value of mmcblk0p14. suppose End value is 170875
Give n command
Command (m for help): n <<<<--- new partition for SDCARD or mmcblk0p15. It will ask for first cylinder
First cylinder (769-954240, default 769): <<<<---- put noted Ending value of mmcblk0p14 + 1 here. (170875+1 = 170876) press enter
Now Last cylinder: Just press enter it will take default
Last cylinder or +size or +sizeM or +sizeK (42945-954240, default 954240):
Change partition type for SDCARD by giving these command.
Command (m for help): t <<<--- t for change partition type.
Partition number (1-15): 15 <<<--- It asks which partition to be changed give 15 for SDCARD/mmcblk0p15
Hex code (type L to list codes): c <<<--- FAT32 from win95 for most compatibility give c to choose this. Do not change to any other system type it might not recognized by PC or even your device. Press enter.
Writing all these changing permanently
Command (m for help): w <<<--- give w for write permission. if successful you'll see these message.
Code:
The partition table has been altered.
Calling ioctl() to re-read partition table
**NOTE** if you see something like below line. Partition is not altered or changed. Redo all steps carefully and properly.
Code:
fdisk: WARNING: rereading partition table failed, kernel still uses old table: Device or resource busy
Step 6 - Formatting Partition.
Your Partition table redefined or resized only. No Formatting has done yet. Your phone do not read memory unless its properly formatted.
If you wish to use stock or stock based rom DO NOT CHANGE PARTITION FORMAT. It will cause problem even brick. Search around forum for more info about this.
Changing Partition format is good for the Upgraded OS version like lolipop 5.0.0 or 5.1.1 or Marshmallow 6.0.0 to work some features. But not always necessary.
Disconnect Phone from pc> Boot into recovery
Code:
TWRP> Wipe> Advance> Format data, cache, system and SDCARD.
If you want to change Format>
Code:
From TWRP>Wipe>Advance>select system or data or cache> change file format> select desiered one> change.
Nice tutorial...but how to push ROM back to phone
payjo73 said:
Nice tutorial...but how to push ROM back to phone
Click to expand...
Click to collapse
If you Mean Stock ROM Use flash tool.
If you mean a zip file of custom rom use adb command:
adb push something.zip /sdcard/
Hey, I have done the exact same procedure and flashed oneofakind ROM. Now my internal SD card seems to be messed up.
Camera app throws error "insert an SD card before using" error & Gallery app throws error "no SD card detected error"
Kindly HELP !!
ps : I already had TWRP installed, had root access & unlocked bootloader. So started from Step 5 with partitioning steps ! I can see the internal storage of 19GB in settings though.
pps : I searched google extensively but most related solutions had external SD card being used so I couldn't reconcile it with my device (Xperia S)
C0D3FR34K said:
Hey, I have done the exact same procedure and flashed oneofakind ROM. Now my internal SD card seems to be messed up.
Camera app throws error "insert an SD card before using" error & Gallery app throws error "no SD card detected error"
Kindly HELP !!
ps : I already had TWRP installed, had root access & unlocked bootloader. So started from Step 5 with partitioning steps ! I can see the internal storage of 19GB in settings though.
pps : I searched google extensively but most related solutions had external SD card being used so I couldn't reconcile it with my device (Xperia S)
Click to expand...
Click to collapse
You need to allow permissions for letting the app access storage in settings of phone.
Mirhawk said:
You need to allow permissions for letting the app access storage in settings of phone.
Click to expand...
Click to collapse
Thanks.
How do i do that ? I never had to do it earlier. I have installed the ROM multiple times in past year.
C0D3FR34K said:
Thanks.
How do i do that ? I never had to do it earlier. I have installed the ROM multiple times in past year.
Click to expand...
Click to collapse
It's in Settings, Apps>Settings icon at top right> App permissions. This error occurs with Marshmellow ROM's as they some new pemission features. You can check out the link in My signature for more related info
Bro i was following this tutorial but i don't know how mobile got disconnected ?.. Now mobile got damaged it can't able to switch on.. Even pc not detecting.. What should I do now.. Please help???

Guide[Linux][Windows]: Migrate to SSD/HDD of any size, only for SATV Pro

Code:
[B][I][COLOR="Red"][SIZE="3"]I am not responsible for bricked devices, dead HDDs, animals
activist campaigns, or any H/W damage caused by you following these
directions. YOU are choosing to make these modificiations, and
you, yourself take responsibility for doing these modifications
to your device.
You can do serious H/W damage to your SATV or even your computer
by doing any of this. So, you have been warned! [/SIZE][/COLOR][/I][/B]
First of all, you should pay your thanks to @Luxferro for mapping out the entire partition array, and building the chart that does all the calculations for using another disk size.
He also proved that it was indeed possible to modify your GPT header to another sized drive.
None of this would have been possible, if it was not for him.
Also thanks to @Tilator for initiating his thread, and proving it was possible to swap your HDD for something else.
1. Preparations and disassembling the SATV
Well, to begin with you should have a working linux environment set up. This can easily be a live CD/DVD/USB. Or you can do it from a virtual environment. You can use DD for Windows now, follow guide as normally.
You should have a hex editor with CRC32 calculating capabilities. I recommend HxD:
https://mh-nexus.de/en/downloads.php?product=HxD
Yes, that is for Windows, I use Linux for all the writing/dumping, but I prefer my Windows hex editor.
It's worth to know, that your device should be bootloader unlocked, and preferably newly factory reset.
Also, an autotool has been made now to do this GPT header edit. See post #3.
Then you can go open up the SATV by prying off the bottom of the casing. I managed to do this with my fingernails. A small plastic pry tool can be used as well.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Then you remove the 2 wire sets from the plugs to give more working room. There is 2 sets of tape holding the wires and the HDD in place as well.
There is (on mine at least) just one screw with a small bracket holding the HDD in place, you will need a T6 driver to remove it.
Gently lift the black latch/lock on the connector to the secondary board, then the FCC connector will be easily out.
Then it is just a matter of gently loosening the adhesive on the FCC strip from the HDD and pull out the SATA connector.
With the HDD out, you will have to connect it to your Linux setup somehow. I used an enclosure with a USB3 connection.
With the HDD recognized in the computer, the time has now come to clone you HDD.
You could as well use the bin files Tilator has provided, but if you want your own genuine Netflix ESN, you should use your own.
If you want to use DD for Windows, please continue the guide from post #2. After finishing that part, come back to this post and skip to the hex editing part.
2. Dumping the data from the SATV SSHD
In a terminal window you start by listing the drives:
Code:
sudo -s
fdisk -l
This is to determine which drive you are working with. Remember that the DD command does't care which drive you specify, it will destroy your main drive if you ask it to.
The you continue by dumping the first 6899870 blocks of data to a bin file:
Code:
dd if=/dev/sd[B]X[/B] of=firstpart.bin count=6899870
This will give you a raw image file of all the partitions up until the /data partition which is better left out (it will come later).
Then continue by dumping the last 5120 bytes of data which contains the partition array and the GPT header:
Code:
dd if=/dev/sd[B]X[/B] bs=512 skip=976773158 of=lastpart.bin
EDIT: 26th August 2016, @anchung.chen has experimented with aligning the partitions to Advanced Format 4096 byte sectors (4K alignment). This supposedly gives better performance especially on SSD drives.
It's worth to know that this most likely breaks the OTA updates, as they might write partitions on block level rather than on a file level. OTA updates seems to be working.
Also, anchung.chen has had problems unlocking the bootloader on the 4K aligned disk.
@ahmed68
Reports that TWRP doesn't work well when trying to flash SuperSU.
Please see follow these steps to write the bin files with 4K alignment:
Start by downloading the ELF executable programmed by anchung.chen from this post:
http://forum.xda-developers.com/showpost.php?p=68300570&postcount=44
Patch the lastpart.bin the following way (2TB disk size):
Code:
./shield_pro_new_disk_gpt_calculator-0.3 lastpart.bin [B]2000398934016[/B] lastpart4k.bin
This will recalculate the GPT header to match the 2TB disk, but also rewrite the partition array.
Then continue by writing the firstpart.bin in 2 steps instead of just one:
Code:
if=firstpart.bin of=/dev/sd[B]X[/B] bs=512 count=69888
Code:
dd if=firstpart.bin of=/dev/sd[B]X[/B] bs=512 skip=69790 seek=69888 count=6830080
These 3 steps effectively moves the partitions 16-32 to match 4K alignment structure.
And finish off by writing the lastpart4k.bin:
Code:
dd if=lastpart4k.bin of=/dev/sda[B]X[/B] bs=512 seek=[B]3907029158[/B]
This completes the guide, no more steps needed.
You can now disconnect your HDD. These 2 files also counts as a backup of your SATV (not with settings as userdata was not copied).
Now connect your new SSD in the enclosure.
You can easily start by writing the firstpart.bin:
Code:
dd if=firstpart.bin of=/dev/sd[B]X[/B]
3. Hex-editing the partition array and the GPT header
In your linux terminal load up the block count (called sectors in linux language) of the new drive:
Code:
fdisk -l
A 2 TB disk should have a total block count of 3907029168, but a smaller disk would have a smaller block count, so use fdisk -l to determine this.
Or if you use DD for Windows you have the output from dd --list to work with.
The lastpart.bin must be edited before we can write it on the new disk.
So use the spreadsheet provided by @Luxferro in this post:
http://forum.xda-developers.com/showpost.php?p=67996717&postcount=189
In the column at the buttom right that says disk size, you change the value to match you new disk. In this example for the 2TB it should be 2000398934016 (bytes). This value should be taken from fdisk -l as well.
Now it gets a little hairy!
In the spreadsheet you should start with the buttom value marked out in purple under the row called "Last LBA". This should be E8E0888E:
Open up lastpart.bin in HxD and navigate to offset 00000FA8. There you should find the 4 bytes 0E 60 38 3A illustrated in this picture:
This value is in a format called reverse byte ordering, so to put in your new calculated value, you will have to arrange it like this: 8E 88 E0 E8. Input that value instead of the bytes already there like this picture:
While we are in this particular position in the lastpart.bin we might as well do the CRC32 of the partition array.
Now make a selection containing the 64 bytes or 4 empty lines underneath the line having UDA written in ASCII, and all the way to the top of the file, offset 00000000 to 00000FF0 like in this picture:
In the drop-down menu, choose Analyzis->Checksums and generate a CRC-32 checksum (Not checksum-32).
It will come up in the buttom screen of HxD, and should read 6B CF E5 7D
Navigate to the buttom of the file which contains the GPT header. It should start with an ANSI text reading "EFI PART".
In offset 00001258 you should find the value of the original CRC-32 value containing the bytes 0E 02 C5 DC.
Replace this, again reversing the bytes from your newly calculated CRC-32 value like this: 7D E5 CF 6B:
Now we are actually almost finished! In the spreadsheet all the way to the right, you will find 4 hexadecimal values marked in purple.
First is the position of the GPT header, and the second is the position of the backup GPT header. Since there is only 1 on the SATV, these values are both the same.
Write them into the GPT header on offset 00001218, and 00001220, again reversing the bytes like illustrated in the picture:
Same goes for offset 00001230, Last Usable LBA, and offset 00001248, Starting LBA of array of partition entries.
This brings us to the last thing on the table, the CRC32 of the GPT header itself.
The CRC is located on offset 00001210 and should have the bytes 46 C9 88 78 already there.
Just write 00 00 00 00 to blank them out:
Now make a selection of the GPT header containing the beginning of the header, and to the last written byte before all the zeroes:
In the drop-down menu, choose Analyzis->Checksums and generate a CRC-32 checksum (Not checksum-32).
It will come up in the buttom screen of HxD, and should read 46 9F 24 38
Again, write it instead of the 4 bytes with zeroes reversed like this:
This completes the matter, now just save your work in HxD and write it to the end of your drive.
To do this we need the total block count from the HDD that you fetched in the beginning of the guide from the fdisk -l output, should be 3907029168
The lastpart.bin is 5120 bytes which is the same as 10 blocks of 512 byte length.
So, 3907029168 minus 10 is 3907029158 and put into your DD-line like this:
Code:
dd if=lastpart.bin of=/dev/sda[B]X[/B] bs=512 seek=[B]3907029158[/B]
Or like this if you use DD for Windows:
Code:
dd if=lastpart.bin of=\\?\Device\Harddisk[B]X[/B]\Partition0 bs=512 seek=[B]3907029158[/B]
4. Assembling SATV and finishing up
Now at last, put in your new disk in the SATV and assemble everything back together.
If it doesn't boot in the first try, you could try another cold boot (give it 15 min.).
If that won't do it, you might have to wipe the DATA partition from the fastboot menu.
To cold boot into fastboot, follow this (taken from "http://developer.download.nvidia.com/mobile/shield/ROM/SHIELD_ATV/OTA-1.1/HowTo-Flash-Recovery-Image.txt"):
Code:
HW method:
- Disconnect power cable
- Insert USB OTG cable and make sure to connect other end to a host PC
- Connect power cable to SHIELD
- Quickly start pressing power button for ~3 seconds
- Do not hold the button and connect power supply afterwards
- HDMI TV should be always connected to SHIELD
And format the /DATA partition from fastboot like this:
Code:
fastboot format FS:EXT4 /data
Or do a fastboot oem unlock of the SATV.
Hopefully you will now have a SATV with an upgraded SSD/HDD!
DD for Windows part
Guide for Windows, using dd for Windows by John Newbigin
Download the dd utility from: http://www.chrysocome.net//dd
Code:
[SIZE="4"]
[COLOR="Red"]
WARNING! Using DD for Windows from a command prompt with administrator privileges is DANGEROUS!
If you specify your Windows drive as output file/device, it WILL destroy the partition!
[/COLOR]
[/SIZE]
Code:
[B][I][COLOR="Red"][SIZE="3"]I am not responsible for bricked devices, dead HDDs, animals
activist campaigns, or any H/W damage caused by you following these
directions. YOU are choosing to make these modificiations, and
you, yourself take responsibility for doing these modifications
to your device.
You can do serious H/W damage to your SATV or even your computer
by doing any of this. So, you have been warned! [/SIZE][/COLOR][/I][/B]
So, I used a Windows 10 Pro environment to test this. I think any Windows version based on the NT architecture will be working.
Extract the dd.exe and as the path you want to extract to, use this: "%USERPROFILE%\AppData\Local\Microsoft\WindowsApps"
This gives you the ability to use DD system wide.
Plug in the HDD from your SATV. The disk will be unreadable to Windows as it has no known filesystem. Windows might pop up asking you to format the drive. You MUST ignore that, and press cancel!
Open up a command prompt with administrator privileges. You can do this with Windows key+X to bring up a menu, then choose Command Prompt (administrator).
Navigate to a folder where you want to work from. It doesn't matter where, as you just have to have space enough to store the bin files.
If you need a refreshment in navigating the commnd prompt, you can read up on it here:
http://www.pcstats.com/articleview.cfm?articleid=1723&page=3
Now, run the command
Code:
dd --list
This gives you a lot of information. It even gives you the total byte count of your harddisk drives.
Navigate a little up to locate the right disk:
In this example I didn't use my SATV HDD, but another 750GB HDD I had lying around. The SATV SSHD will have a size of 500107862016 bytes.
Be careful that you choose the right drive to work on, and you also have to find the one that has the device string "\\?\Device\HarddiskX\Partition0".
And X will have to be equivalent to the harddisk number that Windows has assigned to your device.
The you continue by dumping the first 6899870 blocks of data to a bin file:
Code:
dd if=\\?\Device\Harddisk[B]X[/B]\Partition0 of=firstpart.bin count=6899870
This will give you a raw image file of all the partitions up until the /data partition which is better left out (it will come later).
Then continue by dumping the last 5120 bytes of data which contains the partition array and the GPT header:
Code:
dd if=\\?\Device\Harddisk[B]X[/B]\Partition0 of=lastpart.bin skip=976773158 bs=512
You can now disconnect your HDD. These 2 files also counts as a backup of your SATV (not with user settings, data partition was not copied).
Now connect your new SSD in the enclosure. Use dd --list again to determine the right disk to use, and please be careful not to mix up your Windows drive or another drive which contains important data.
You can easily start by writing the firstpart.bin:
Code:
dd if=firstpart.bin of=\\?\Device\Harddisk[B]X[/B]\Partition0
Please continue the rest of the guide in first post.
Hi All:
Thank Luxferro, Tilator and hallydamaster for your hard works, so we could replace the SSHD on shield-pro-tv with any SSD or HHD.
I wrote a small program to do all calculations and generate the new lastpart.bin directly.
usage : ./shield_pro_new_disk_gpt_calculator Input_bin_file New_disk_size_in_byte Output_bin_file
It is for 64-bit Linux PC. Any comments are welcome. And if you like, the source code will be opened.
Well, I think it is quite straightforward to use it. This program just generates the modified lastpart.bin from your original lastpart.bin and disk size (byte) of new SSD/HHD which you will migrate to.
For example of hallydamaster guide, the new 2TB disk has 2000398934016 bytes and 3907029168 sectors. Then
Using following command to generate the correct lastpart.bin for the new 2TB disk.
Code:
./shield_pro_new_disk_gpt_calculator lastpart.bin 2000398934016 new_lastpart.bin
Using following command to write the correct lastpart.bin to the new 2TB disk.
Code:
sudo dd if=new_lastpart.bin of=/dev/sdX bs=512 seek=3907029158
Thanks for the guide.
Does anyone know the performance penalty for using a regular 2TB HDD?
anchung.chen said:
Hi All:
Thank to Luxferro, Tilator and hallydamaster hard works, so we could replace the SSHD on shield-pro-tv with any SSD or HHD.
I wrote a small program to do all calculations and generate the new lastpart.bin directly.
usage : ./shield_pro_new_disk_gpt_calculator input_bin_file disk_size_in_byte output_bin_file
It is for 64-bit Linux PC. Any comments are welcome. And if you like, the source code will be opened.
Click to expand...
Click to collapse
Well, I suppose we have the guide for educational purposes then!
Please, tell something about how to use it.
tech3475 said:
Thanks for the guide.
Does anyone know the performance penalty for using a regular 2TB HDD?
Click to expand...
Click to collapse
I know that another user here @ahmed68 just did his with a SATV, AFAIK.
I don't think it was an SSD atleast.
hallydamaster said:
Well, I suppose we have the guide for educational purposes then!
Please, tell something about how to use it.
Click to expand...
Click to collapse
Well, I think it is quite straightforward to use it. This program just generates the modified lastpart.bin from your original lastpart.bin and disk size (byte) of new SSD/HHD which you will migrate to.
For example of your guide, the new 2TB disk has 2000398934016 bytes and 3907029168 sectors. Then
Using following command to generate the correct lastpart.bin for the new 2TB disk.
Code:
./shield_pro_new_disk_gpt_calculator lastpart.bin 2000398934016 new_lastpart.bin
Using following command to write the correct lastpart.bin to the new 2TB disk.
Code:
sudo dd if=new_lastpart.bin of=/dev/sdX bs=512 seek=3907029158
anchung.chen said:
Hi All:
Thank Luxferro, Tilator and hallydamaster for your hard works, so we could replace the SSHD on shield-pro-tv with any SSD or HHD.
I wrote a small program to do all calculations and generate the new lastpart.bin directly.
usage : ./shield_pro_new_disk_gpt_calculator input_bin_file disk_size_in_byte output_bin_file
It is for 64-bit Linux PC. Any comments are welcome. And if you like, the source code will be opened.
Click to expand...
Click to collapse
have any example how to use it or only run in term ./shield_pro_new_disk_gpt_calculator input_bin_file disk_size_in_byte output_bin_file
plz help I wont to gen gpt for 64gb sd card. I have boot.img for sd card and usb only for l4t Ubuntu thanks.
ahmed68 said:
have any example how to use it or only run in term ./shield_pro_new_disk_gpt_calculator input_bin_file disk_size_in_byte output_bin_file
plz help I wont to gen gpt for 64gb sd card. I have boot.img for sd card and usb only for l4t Ubuntu thanks.
Click to expand...
Click to collapse
You are supposed to do:
Code:
./shield_pro_new_disk_gpt_calculator lastpart.bin 68719476736 lastpart64gb.bin
But take the byte value you get from your own fdisk -l output.
Also, if you are going to use this for Linux and not android, I don't think it will work. The GPT layout that the SATV Pro uses is not standard.
hallydamaster said:
You are supposed to do:
Code:
./shield_pro_new_disk_gpt_calculator lastpart.bin 68719476736 lastpart64gb.bin
But take the byte value you get from your own fdisk -l output.
Also, if you are going to use this for Linux and not android, I don't think it will work. The GPT layout that the SATV Pro uses is not standard.
Click to expand...
Click to collapse
hallydamaster thank you for help
now i use the orig. sshd under ubuntu 14.04 L4T 24.1 i wont to make sdcard for linux and sshd for android to use shield in 4k tv android the best .
I think Nvidia should put boot loader and kernel on internal emmc's for both 16GB and 500GB SATVs rather than keeping significantly different ROM versions for 16GB and 500GB SATVs.
It'd save Nvidia and users time by doing so.
It seems much simpler to add HDDs of any size to 16 GB SATV if the HDD cable is available.
yahoo2016 said:
I think Nvidia should put boot loader and kernel on internal emmc's for both 16GB and 500GB SATVs rather than keeping significantly different ROM versions for 16GB and 500GB SATVs.
It'd save Nvidia and users time by doing so.
It seems much simpler to add HDDs of any size to 16 GB SATV if the HDD cable is available.
Click to expand...
Click to collapse
I certainly agree with that, seems they had a brain fart when deciding how to build the pro. Could be great if we could somehow convert the pro version to boot from internal EMMC.
hallydamaster said:
I certainly agree with that, seems they had a brain fart when deciding how to build the pro. Could be great if we could somehow convert the pro version to boot from internal EMMC.
Click to expand...
Click to collapse
I have serial console print out from 16GB SATV:
http://forum.xda-developers.com/showpost.php?p=67973969&postcount=303
I'm wondering what the output would be for SATV Pro when the HDD is disconnected.
If the first stage boot loader (TegraBoot?) is smart enough, it could check emmc for boot loader.
yahoo2016 said:
I have serial console print out from 16GB SATV:
http://forum.xda-developers.com/showpost.php?p=67973969&postcount=303
I'm wondering what the output would be for SATV Pro when the HDD is disconnected.
If the first stage boot loader (TegraBoot?) is smart enough, it could check emmc for boot loader.
Click to expand...
Click to collapse
That's indeed interesting, lot of info in that output!
I'm pretty sure that @Tilator had someone send him a copy of a complete rip of the EMMC from a 16GB SATV.
He then wrote it to the EMMC on the Pro, which is just empty. It didn't boot with it, but I'm not sure if he tried booting it without the HDD in it.
Cloud be interesting to try though.
Unfortunately I don't really have the time to read up on UART and solder wires on my board to try this. :-/
Not for the time being at least.
i will try to flash satv pro from satv and see it must save in emmc , I wont to make sd card like recovery for satv and satv pro I try repack the partition but bot work I need to edit boot.img #include <sys/mount.h>
#include <unistd.h>
#include <linux/reboot.h>
#include <fcntl.h>
extern char **environ;
int main(int argc, char **unused) {
mount("/dev", "/dev", "devtmpfs", 0, NULL);
mount("/dev/mmcblk0", "/dest", "ext4", 0, NULL);
// mount Android system
// mount("/dev/mmcblk0p1", "/mnt", "ext4", 0, NULL);
mount("/dev", "/dest/dev", NULL, MS_BIND, NULL);
chroot("/dest");
chdir("/");
char * const argv[] = { "/sbin/init", NULL };
execve(argv[0], argv, environ);
}
must change mmcblk0 to mmcblk0p1 ,mmcblk1p1 or sda21/32
---------- Post added at 08:40 PM ---------- Previous post was at 08:20 PM ----------
I take this flash.sh from tegra jetson-tx1
flash.sh: Flash the target board.
# flash.sh performs the best in LDK release environment.
#
# Usage: Place the board in recovery mode and run:
#
# flash.sh [options] <target_board> <root_device>
#
# for more detail enter 'flash.sh -h'
#
# Examples:
# ./flash.sh <target_board> mmcblk0p1 - boot <target_board> from eMMC
# ./flash.sh <target_board> mmcblk1p1 - boot <target_board> from SDCARD
# ./flash.sh <target_board> sda1 - boot <target_board> from USB device
# ./flash.sh -N <IPaddr>:/nfsroot <target_board> eth0 - boot <target_board> from NFS
# ./flash.sh -k LNX <target_board> mmcblk1p1 - update <target_board> kernel
# ./flash.sh -k EBT <target_board> mmcblk1p1 - update <target_board> bootloader
can anybody edit the boot.img to
1. mmcblk0p1 for emmc
2. mmcblk1p1 for sdcard
I think its most work
i flash satv pro from satv i now it come not bootable then i will remove hdd and boot to linux when run sudo fdisk -l i see 2 part of hdd first mmcblk0 (emmc) and sdx its sda in android by dd if=/dev/sdx of=firstpart.bin count=6899870
then dd if=firstpart.bin of=/dev/mmcblk0 and dd if=lastpart.bin of=/dev/mmcblk0 bs=512 seek=xxxxx (xxxxx i will take it from fdisk -l -10) then i most to delete boot patition from sda by sudo fdisk /dev/sda21 # input d , w .
now we have a work satv non pro , i need to use ubuntu in emmc and android in sda for that we must make the first boot img for dualOS like (Geekbox Lollipop Lubuntu dualOS)
http://forum.geekbox.tv/viewtopic.php?f=12&t=3198
anybody have any edia plz help.
ahmed68 said:
now we have a work satv non pro
Click to expand...
Click to collapse
You can boot to Android from emmc (mmcblk0) of SATV Pro without HDD?
Does recovery mode work for SATV Pro without HDD?
Is this fix working with the 3.2 update from a few weeks ago? I'd like to duplicate more of my movies onto my SATV Pro now that the Plex Server is installed.
ahmed68 said:
i flash satv pro from satv i now it come not bootable then i will remove hdd and boot to linux when run sudo fdisk -l i see 2 part of hdd first mmcblk0 (emmc) and sdx its sda in android by dd if=/dev/sdx of=firstpart.bin count=6899870
then dd if=firstpart.bin of=/dev/mmcblk0 and dd if=lastpart.bin of=/dev/mmcblk0 bs=512 seek=xxxxx (xxxxx i will take it from fdisk -l -10) then i most to delete boot patition from sda by sudo fdisk /dev/sda21 # input d , w .
now we have a work satv non pro , i need to use ubuntu in emmc and android in sda for that we must make the first boot img for dualOS like (Geekbox Lollipop Lubuntu dualOS)
http://forum.geekbox.tv/viewtopic.php?f=12&t=3198
anybody have any edia plz help.
Click to expand...
Click to collapse
Hi ahmed, can you please clarify if you had it boot without the HDD?
You cloned the HDD partitions onto the EMMC? And then removed the boot partition from the HDD, and then it booted anyway?
revoman said:
Is this fix working with the 3.2 update from a few weeks ago? I'd like to duplicate more of my movies onto my SATV Pro now that the Plex Server is installed.
Click to expand...
Click to collapse
This procedure will just clone your HDD to another disk, this should be totally independant from Android, unless ofcourse Nvidia would do something to break this.
Maybe I'm the only one who would like to put a smaller HD on my shield TV. Can someone tell me if a 128GB SSD is larger enough or the smaller disk is 256GB?
TIA Polve

Categories

Resources