[HELP] Broken Partitions Mi Pad 1 - Xiaomi Mi Pad Questions & Answers

Hello everyone, I have sort of messed up my parititions in mipad.
So I thought of flashing Lineage 14.1 on my MI Pad so i searched around the net and learned I had to merge System1 and System2.
I came across a tutorial showing me how to do it, so i booted my mipad into recovery and typed:
adb shell
parted /dev/block/mmcblk0
print
after print i got a huge table with some entries, system 1 and system 2 were my entries no 26 and 27. I had to delete both the partitions and then recreate another.[I took a picture of this table, just in case]
so I typed
rm 26
rm 27
after running 'print' again it showed that the partitions were deleted.
a sort of problem came up when i was doing this, so i decided to revert to the old config with the system1 and system2.
I was able to create the old system1 and system2 partitions in ext2 format, but when i was trying to convert them into ext4, the error came
UNEXPECTED INSCONSISTENCY, RUN fsck manually
I am stuck at this point, any help would be greatly appreciated

Awesomebub said:
Hello everyone, I have sort of messed up my parititions in mipad.
So I thought of flashing Lineage 14.1 on my MI Pad so i searched around the net and learned I had to merge System1 and System2.
I came across a tutorial showing me how to do it, so i booted my mipad into recovery and typed:
adb shell
parted /dev/block/mmcblk0
print
after print i got a huge table with some entries, system 1 and system 2 were my entries no 26 and 27. I had to delete both the partitions and then recreate another.[I took a picture of this table, just in case]
so I typed
rm 26
rm 27
after running 'print' again it showed that the partitions were deleted.
a sort of problem came up when i was doing this, so i decided to revert to the old config with the system1 and system2.
I was able to create the old system1 and system2 partitions in ext2 format, but when i was trying to convert them into ext4, the error came
UNEXPECTED INSCONSISTENCY, RUN fsck manually
I am stuck at this point, any help would be greatly appreciated
Click to expand...
Click to collapse
Flash the original ROM using miflash if you can access your fastboot partition.

Related

TWRP bricked karbonn smart tab 10 software with TWRP boot screen loop.

Hi, i tried to backup my current rom image and installed TWRP from this webpage.
But after installing TWRP the software application continuously looping to its homescreen menu when i reboot every time.
I Tried fastboot but i dint turned on usb debug option in development settings before i install TWRP. my device is offline in adb devices from command prompt window. I cant turn on usb debug option until i boot into my device OS homescreen menu.
The terminal command is available from TWRP menu screen.
help me if i can turn on usb debug option through terminal command.
help me if i can recover my device from TWRP boot loop through the terminal commands.
Hope someone will fix my problem
st10user said:
Hi, i tried to backup my current rom image and installed TWRP from this webpage.
But after installing TWRP the software application continuously looping to its homescreen menu when i reboot every time.
I Tried fastboot but i dint turned on usb debug option in development settings before i install TWRP. my device is offline in adb devices from command prompt window. I cant turn on usb debug option until i boot into my device OS homescreen menu.
The terminal command is available from TWRP menu screen.
help me if i can turn on usb debug option through terminal command.
help me if i can recover my device from TWRP boot loop through the terminal commands.
Hope someone will fix my problem
Click to expand...
Click to collapse
Try:
Code:
adb kill-server
adb start-server
adb devices
fuser-invent said:
Try:
Code:
adb kill-server
adb start-server
adb devices
Click to expand...
Click to collapse
Thanks for your reply.
Tried these commands. device is offline in command prompt window.
st10user said:
Thanks for your reply.
Tried these commands. device is offline in command prompt window.
Click to expand...
Click to collapse
Have you tried flashing either of my ROM's from TWRP? I read in the other thread that you wiped /system so you probably don't have an operating system to boot into, that's why it keeps booting back into TWRP.
Yes bro, I tried flashing your roms through "apply update from EXT" but not worked for me.
I dont know how to flash through twrp terminal commands.
Plz help me.
which commands i need to flash through twrp?
Maybe you should try ADT android download tool
PM me if u need help
Sent from MOON......
You can't flash my ROM's through "apply update from EXT" because that is the stock recovery and they are built to be flashed in TWRP. You don't need to use terminal commands to flash anything in TWRP.
All you do is press the "Install" button, choose the zip files you want to flash and then swipe the button that shows up on the screen to the right to start the flashing process. When it's done, hit the "wipe dalvik and cache" button, flash it the ROM again, hit "wipe dalvik and cache" again and then reboot. For some reason on a lot of these tablets you need to double flash the firmware.
When i installing karbonn_custom_st10_v1.3.zip or karbonn_st10_stock_plus_v1.2.zip I receiving message like "skipping md5 check: no md5 file found."
After that everything installing successfully. But after reboot to system still my tablet stuck on twrp.
Help me.
st10user said:
When i installing karbonn_custom_st10_v1.3.zip or karbonn_st10_stock_plus_v1.2.zip I receiving message like "skipping md5 check: no md5 file found."
After that everything installing successfully. But after reboot to system still my tablet stuck on twrp.
Help me.
Click to expand...
Click to collapse
"skipping md5 check: no md5 file found." doesn't matter, you can ignore that.
Are you using the correct TWRP? There are two, one is for the ST8 and one is for the ST10.
Did you use the double flash method I suggested with the wipes? Have you tried flashing anything else before this? I'm hoping that you followed the instructions and didn't try to flash the stock+ ROM in TWRP, right?
The Stock+ ROM is for the stock recovery and the Custom ROM is for TWRP.
If there are more details, please write them. From what I understand this is where you are at so far and nothing more.
1. You downloaded TWRP
2. You flashed TWRP using ozadroid's instructions
3. You booted into TWRP and wiped /system
4. Your tablet reboots and is stuck in a boot loop.
fuser-invent said:
"skipping md5 check: no md5 file found." doesn't matter, you can ignore that.
Are you using the correct TWRP? There are two, one is for the ST8 and one is for the ST10.
Did you use the double flash method I suggested with the wipes? Have you tried flashing anything else before this? I'm hoping that you followed the instructions and didn't try to flash the stock+ ROM in TWRP, right?
The Stock+ ROM is for the stock recovery and the Custom ROM is for TWRP.
If there are more details, please write them. From what I understand this is where you are at so far and nothing more.
1. You downloaded TWRP
2. You flashed TWRP using ozadroid's instructions
3. You booted into TWRP and wiped /system
4. Your tablet reboots and is stuck in a boot loop.
Click to expand...
Click to collapse
I installed correct twrp for st10. I followed your guidance but still stuck with twrp loop. I uploaded a video of my st10 installing log here
Plz help me.
Same thing happend to me also.when I flashed twrmp .it doesn't boot to system or stock recovery. I gave it and serviced by service centre.
Sent from my Micromax A110 using xda premium
In the video you are flashing the Stock+ ROM. Flash the Karbonn Custom ROM in the same way instead. When it gets to the last step right before you hit the reboot button, remove your external SD card and then hit the reboot button with the SD card out. Let me know what happens, there could be something on your SD card forcing you to reboot into recovery instead of the ROM.
Also, it looks like ozadroid has released a newer version of TWRP than the one you are running, I would suggest downloading that and using it instead.
I flashed newer version of trmp but no change .my tab stuck again.it doesn't reboot to system.but stock recovery is available,I flashed stock rom.but no change it reboot again to trmp.now what should I do .my service center will not accept my tab again.
Sent from my Micromax A110 using xda premium
Okay, so it doesn't appear from the TWRP install video that the partitions are damaged but we should check that out, fun the following in adb from TWRP:
Code:
adb kill-server
adb start-server
adb devices
adb shell cat /proc/partitions
adb shell parted /dev/block/mtdblock0 print
adb shell parted /dev/block/mtdblock8 print
adb shell parted /dev/block/avnftli print
adb shell fdisk -l /dev/block/mtdblock0
adb shell fdisk -l /dev/block/mtdblock8
adb shell fdisk -l /dev/block/avnftli
If when you run "adb shell cat /proc/partitions" the partitions are labeled differently, then change the block name in the next section of commands. You should get something like this:
Code:
C:\adb>adb shell cat /proc/partitions
major minor #blocks name
31 0 8192 mtdblock0
31 1 8192 mtdblock1
31 2 8192 mtdblock2
31 3 8192 mtdblock3
31 4 8192 mtdblock4
31 5 524288 mtdblock5
31 6 262144 mtdblock6
31 7 1048576 mtdblock7
31 8 6504448 mtdblock8
250 32 6041600 avnftli
250 33 6024375 avnftli1
253 0 1906688 cardblksd
253 1 1905049 cardblksd1
Then this with "print" in "parted":
Code:
C:\adb>adb shell parted /dev/block/mtdblock0 print
Error: Can't have a partition outside the disk!
C:\adb>adb shell parted /dev/block/mtdblock8 print
Model: Unknown (unknown)
Disk /dev/block/mtdblock8: 6661MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 16.5MB 6185MB 6169MB primary
C:\adb>adb shell parted /dev/block/avnftli print
Model: Unknown (unknown)
Disk /dev/block/avnftli: 6187MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 16.5MB 6185MB 6169MB primary fat32
Then this with" fdisk":
Code:
C:\adb>adb shell fdisk -l /dev/block/mtdblock0
Disk /dev/block/mtdblock0: 8 MB, 8388608 bytes
255 heads, 63 sectors/track, 1 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block/mtdblock0p1 2 481 3855600 b Win95 FAT32
C:\adb>adb shell fdisk -l /dev/block/mtdblock8
Disk /dev/block/mtdblock8: 6660 MB, 6660554752 bytes
255 heads, 63 sectors/track, 809 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block/mtdblock8p1 3 752 6024375 b Win95 FAT32
C:\adb>adb shell fdisk -l /dev/block/avnftli
Disk /dev/block/avnftli: 6186 MB, 6186598400 bytes
255 heads, 63 sectors/track, 752 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block/avnftli1 3 752 6024375 b Win95 FAT32
The main thing you want to be looking for is that they actually show up and don't read:
Code:
Error: /dev/block/mtdblock8: unrecognised disk label
or
Code:
Error: Partition doesn't exist.
or
Code:
Disk /dev/block/mtdblock8 doesn't contain a valid partition table
You also want to make sure that it says your partition tablet is "msdos" and the format is "FAT32"
Lastly, I wanted to ask you both which method you used to install TWRP, did you flash the zip in the stock recovery, did you place the TWRP "recovery.img" on your external SD card or did you use the "Android Partition Manager" app to flash it?
I used android partation manager.I will check wid adb
Sent from my Micromax A110 using xda premium
---------- Post added at 12:31 AM ---------- Previous post was at 12:18 AM ----------
Adb method not working
Sent from my Micromax A110 using xda premium
@ st10user
I think you have done something in the booting system. I have seen your video and saw that without pressing any keys combination your tab is just booting in TWRP.
I believe you have done the same mistake the other user done..You have flashed recovery.img in boot partition...
Solution should be now, to flash boot.img to boot partition and recovery.img to recovery partition...But not sure how to help you..
There should be some flashable file which you can use and flash thru TWRP..
--------------------------------------------------------------------------------------------
Edit: Here is your solution provided by great Fuser...
http://forum.xda-developers.com/showthread.php?t=2105692&page=65
Moonguy75 said:
Maybe you should try ADT android download tool
PM me if u need help
Sent from MOON......
Click to expand...
Click to collapse
Now my problem is solved. Thanks for your help.
KSKHH said:
@ st10user
.
I think you have done something in the booting system. I have seen your video and saw that without pressing any keys combination your tab is just booting in TWRP.
I believe you have done the same mistake the other user done..You have flashed recovery.img in boot partition...
Solution should be now, to flash boot.img to boot partition and recovery.img to recovery partition...But not sure how to help you..
There should be some flashable file which you can use and flash thru TWRP..
--------------------------------------------------------------------------------------------
Edit: Here is your solution provided by great Fuser...
http://forum.xda-developers.com/showthread.php?t=2105692&page=65
Click to expand...
Click to collapse
Now everything fine. Thanks for your help.
Thank you very much fuser-invent. You saved my tab.
Wish you all the best.
st10user said:
Thank you very much fuser-invent. You saved my tab.
Wish you all the best.
Click to expand...
Click to collapse
So please google and get some basic knowledge..that will help you in future..
Even I do not have much knowledge, however just playing with the things with common sense...:laugh:
after install the twrp my tab is dead
after install twrp in my smart tab 10 after one minute it is swzoff but still it not start then what i ll do please help me m hope less ....i charged it 1 day thare after also it not start ....plz help me......my email.id - [email protected]...

[Q] Can one mount an Android file system image?

So after a failed attempt to upgrade from CyanogenMod 10.1.3 to 10.2, I was unable to access /data or /sdcard because both systems were encrypted. I ended up having to factory reset my phone because it refused to co-operate or let me access my files. However, before I did that, I was able to run
Code:
adb shell "dd if=/dev/block/mmcblk0p2" > data.img
and
Code:
adb shell "dd if=/dev/block/mmcblk0p3" > sdcard.img
, which appears to have copied the raw partition images from the phone (at least, they're the right sizes).
According to my reading, Android (and, I'm inferring, CyanogenMod) encrypts filesystems using dm-crypt, with a AES-CBC ESSIV:SHA256 cipher, with the key being derived from the password using PBKDF2. Knowing the precious little I do about encrypted file systems, my guess is that if I configure the image in cryptsetup to create a drive mapping, I can mount the mapped drive and recover the data from the images.
According to /fstab.herring on my ahem, fresh, install of Android, the /data partition is in ext4 format whereas the /sdcard partition is vFAT. So, once I've gotten through the encryption on the partition images, they should mount normally, right?
I know that dm-crypt accepts plain, LUKS, LoopAES and TrueCrypt device formats. I'm inferring from the PBKDF2 extension that Android goes the LUKS route for encrypting. Is this conclusion correct?
Could someone explain whether it's possible to decrypt a dumped android image? I'm really hoping that the cypher information is stored on the file system and not on some key file that I nuked in the factory reset. If it can, in theory, be decrypted, am I using the right tools to approach the matter? If so, I'll continue fiddling with cryptsetup and mount, but no sense in wasting time if it's an impossible task.
Never did get a response to this question, so I'll try it again, but start with a simpler question:
If someone dds an Android (specifically Cyanogenmod 10.x) partition to an img file, is there any way to read that image from, say a Linux laptop? I dumped the contents of the /system partition using
Code:
adb shell "dd if=/dev/block/mmcblk0p1" > system.img
I expected system.img to be a normal ext4 partition. However, attempting to loopback mount it with
Code:
sudo mount -t ext4 -o loop,ro system.img ~/android/system
Gave me errors about corrupt group descriptors, bad magic numbers and other maladies indicative of a thoroughly corrupted file system. I'm assuming that:
/data has the same ext4 partition structure as /system; and
The process to mount /storage would be no different to mounting /system with the exception that the former uses vFAT as its file system
However, as my Android is currently working normally (well, as well as one can hope for Android to work), I know I don't have a corrupted file system.
So what's going on? Does Android use a special version of ext4 that other Linuxes don't recognise? Am I not dd-ing correctly? Is there a block-size issue I ignored to my peril?
Borden Rhodes said:
So after a failed attempt to upgrade from CyanogenMod 10.1.3 to 10.2, I was unable to access /data or /sdcard because both systems were encrypted. I ended up having to factory reset my phone because it refused to co-operate or let me access my files. However, before I did that, I was able to run
Code:
adb shell "dd if=/dev/block/mmcblk0p2" > data.img
and
Code:
adb shell "dd if=/dev/block/mmcblk0p3" > sdcard.img
, which appears to have copied the raw partition images from the phone (at least, they're the right sizes).
According to my reading, Android (and, I'm inferring, CyanogenMod) encrypts filesystems using dm-crypt, with a AES-CBC ESSIV:SHA256 cipher, with the key being derived from the password using PBKDF2. Knowing the precious little I do about encrypted file systems, my guess is that if I configure the image in cryptsetup to create a drive mapping, I can mount the mapped drive and recover the data from the images.
According to /fstab.herring on my ahem, fresh, install of Android, the /data partition is in ext4 format whereas the /sdcard partition is vFAT. So, once I've gotten through the encryption on the partition images, they should mount normally, right?
I know that dm-crypt accepts plain, LUKS, LoopAES and TrueCrypt device formats. I'm inferring from the PBKDF2 extension that Android goes the LUKS route for encrypting. Is this conclusion correct?
Could someone explain whether it's possible to decrypt a dumped android image? I'm really hoping that the cypher information is stored on the file system and not on some key file that I nuked in the factory reset. If it can, in theory, be decrypted, am I using the right tools to approach the matter? If so, I'll continue fiddling with cryptsetup and mount, but no sense in wasting time if it's an impossible task.
Click to expand...
Click to collapse
Can you give the result of the "file sdcard.img" and "file data.img" commands?
You are quite right. With regular LUKS container/partition, you would do (being root) the following. With the following commands, you can create a container named "safe", setup it, then format its content in ext3 and mount the partition:
Code:
dd if=/dev/zero bs=1M count=50 of=safe
losetup /dev/loop0 safe
cryptsetup luksFormat -c aes -h sha256 /dev/loop0
cryptsetup luksOpen /dev/loop0 safe
mkfs.ext3 /dev/mapper/safe
(losetup /dev/loop0 safe)
(cryptsetup luksOpen /dev/loop0 safe)
mkdir mnt
mount -t ext3 /dev/mapper/safe mnt
//HERE: do whatever you want in your mounted encrypted filesystem
umount mnt
cryptsetup luksClose safe
losetup -d /dev/loop0
For details, you can go there: http://blog.theglu.org/index.php/20...-couteau-suisse-du-chiffrement-de-partitions/
Sorry, the article is in French but you can translate it if you need to.
Here, using "hexdump", you can see the "safe" file has a LUKS magic at the beginning. And doing a "file safe" command, you can check it detects it as a "LUKS encrypted file".
If doing "file" on your .img files does not give you the same result, you may not be able to directly use the "cryptsetup" command and need to adapt it.
Finally: usually in Android the header containing the key is stored on another partition so you may have lost it when wiping your phone, sorry.
---------- Post added at 02:44 PM ---------- Previous post was at 02:41 PM ----------
Borden Rhodes said:
Never did get a response to this question, so I'll try it again, but start with a simpler question:
If someone dds an Android (specifically Cyanogenmod 10.x) partition to an img file, is there any way to read that image from, say a Linux laptop? I dumped the contents of the /system partition using
Code:
adb shell "dd if=/dev/block/mmcblk0p1" > system.img
I expected system.img to be a normal ext4 partition. However, attempting to loopback mount it with
Code:
sudo mount -t ext4 -o loop,ro system.img ~/android/system
Gave me errors about corrupt group descriptors, bad magic numbers and other maladies indicative of a thoroughly corrupted file system. I'm assuming that:
/data has the same ext4 partition structure as /system; and
The process to mount /storage would be no different to mounting /system with the exception that the former uses vFAT as its file system
However, as my Android is currently working normally (well, as well as one can hope for Android to work), I know I don't have a corrupted file system.
So what's going on? Does Android use a special version of ext4 that other Linuxes don't recognise? Am I not dd-ing correctly? Is there a block-size issue I ignored to my peril?
Click to expand...
Click to collapse
Can you give the result of the "file system.img" command?
Thanks, saidlike, for your reply:
saidelike said:
Can you give the result of the "file sdcard.img"...
Click to expand...
Click to collapse
sdcardPartitionDump.img: data
saidelike said:
... and "file data.img" commands?
Click to expand...
Click to collapse
data.img: data
saidelike said:
Can you give the result of the "file system.img" command?
Click to expand...
Click to collapse
system.img: Linux rev 1.0 ext4 filesystem data, UUID=57f8f4bc-abf4-655f-bf67-946fc0f9f25b (needs journal recovery) (extents) (large files)
Again, attempting to run
Code:
mount -t ext4 -o loop systemimg mountpoint/
yields
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
Click to expand...
Click to collapse
Ignoring the results of data.img and sdcard.img for the time being, the fresh dump of the system partition shows that it's an EXT4 filesystem, but that it's heavily corrupted. fsck.ext4 on that partition basically asks me to fix every single inode, so it's not a simple unclean journal issue. Therefore, is it fair to conclude that CyanogenMod (and maybe AOSP too) have modified the ext4 partiiton type?
@Borden Rhodes
Maybe, my reply is too late, but you could try to make the same experiment with backup of your current data.
If you get the same results as with the old pre-wipe backup, then you still have a hope.

CMxx [sdcard as Emulated] {Walkthrough} Guide

Hello,
This guide will help you merge userdata and media partitions in to one Big for 16gb Nooks is aprox. 14,3GB and for 8Gb is aprox 6.1GB
What are those?
userdata is your /data partition and in that one you can currently install the apps/games until is full.
Media is your internal sdcard(emmc)
What we are going to do?
We will delete both userdata and media and make a bigger userdata and inside that we are going to mount the media partition so will become like this /data/media.
Required
1.Working CyanoBoot aka 2ndary bootloader.
2.Fastboot drivers and adb shell drivers with both of them functional
3.A special recovery to perform the merge.
4. A little patience until is implemented into cm as a special recovery will be needed after this merge.
You cant use any existing recoveries after this is done.I or chrmhoffmann will post a special recovery after the changes are done on device tree.
A special thanks to meghd00t for the sgdisk tool. A very valuable tool for this task.
So how this is done already!
1. Download the special recovery from here
http://goo.im/devs/demetris/Acclaim/CM11//sgdisk-recovery.img
Mirror
http://s000.tinyupload.com/index.php?file_id=57668299249558322082
2. Download the new cm recovery from here
https://goo.im/devs/chrmhoffmann/cm-12.0/acclaim/recovery-L-acclaim-20150221-ENG.img/
Mirror
http://s000.tinyupload.com/index.php?file_id=07462035216933296298
3.Put both into your working fastboot folder.
4.Enter fastboot mode with holding N and select fastboot on Cyanoboot menu.
5. Copy&Paste the next lines
Code:
fastboot flash recovery sgdisk-recovery.img
fastboot reboot
6.Enter recovery with holding N and select Internal eMMC Recovery from Cyanoboot menu.
7. Copy&Paste the next lines
Code:
adb shell
You get a # and you are now in adb shell interface and you are root so, lets delete both partitions with:
Code:
sgdisk /dev/block/platform/mmci-omap-hs.1/mmcblk0 -d 11 -d 10
And merge into one
Code:
sgdisk /dev/block/platform/mmci-omap-hs.1/mmcblk0 -n 0:0:0
Name the new partition into userdata
Code:
sgdisk /dev/block/platform/mmci-omap-hs.1/mmcblk0 -c 10:userdata
Format our new partition into EXT4
Code:
make_ext4fs -L userdata /dev/block/mmcblk0p10
Check if all done ok
Code:
parted /dev/block/mmcblk0
Code:
print
It should print in the end (for 16GB nooks)
10 1611MB 15.9GB 14.3GB ext4 userdata
It should print in the end (for 8GB nooks)
10 1611MB 7734MB 61240MB ext4 userdata
Number 10 is your new partition, 14.3GB/6.1GB is the partition size ext4 is the filesystem and userdata is the name of the partition
After that you can issue a
reboot
Enter fastboot again and flash the new recovery [recovery-L-acclaim-20150221-ENG.img]
For F2FS support boot into new recovery
Code:
adb shell
Code:
#mkfs.f2fs /dev/block/platform/omap/omap_hsmmc.1/by-name/userdata
This guide is for an alternate way of #1 post guide using a big part of it throughout.
1.Download new recovery from #1
2.Flash it with fastboot
3.Boot in it
4.Download this
http://s000.tinyupload.com/index.php?file_id=14937290426749868964
unzip it and push it to /tmp with adb
Code:
adb push sgdisk /tmp/
Code:
adb shell
Code:
chmod +x /tmp/sgdisk
Code:
umount /storage/sdcard1/
Code:
/tmp/sgdisk /dev/block/platform/mmci-omap-hs.1/mmcblk0 -d 11 -d 10
Code:
/tmp/sgdisk /dev/block/platform/mmci-omap-hs.1/mmcblk0 -n 0:0:0
Code:
/tmp/sgdisk /dev/block/platform/mmci-omap-hs.1/mmcblk0 -c 10:userdata
Now depending what filesystem you want you must use the right command
EXT4 Use:
Code:
mkfs.ext4 /dev/block/platform/omap/omap_hsmmc.1/by-name/userdata
F2FS Use:
Code:
mkfs.f2fs /dev/block/platform/omap/omap_hsmmc.1/by-name/userdata
Thats it.
really
Dont do this yet. CM11 does not support this at the moment.
Chris
Sent from my TF300T using xda app-developers app
Sorry if I sound like a noob, but, why exactly is it so difficult to change internal SD to external in CM11 specifically for the Nook Tablet? I have switched up the external SD as my internal SD on my Samsung GS2 running CM11 HellKat ROM quite easily. But then again, CM11 HellKat has a functioning vold.fstab, but the Nook Tablet does not. Why is that? Just curious.
sagirfahmid3 said:
Sorry if I sound like a noob, but, why exactly is it so difficult to change internal SD to external in CM11 specifically for the Nook Tablet? I have switched up the external SD as my internal SD on my Samsung GS2 running CM11 HellKat ROM quite easily. But then again, CM11 HellKat has a functioning vold.fstab, but the Nook Tablet does not. Why is that? Just curious.
Click to expand...
Click to collapse
+1 on this.
The current partitoning scheme is a real hinderance. a HUGE hinderance.
are there any clear instructions anywhere to fuse sdcard to /data/media anywhere?
This would really take the Nook Tablet to a whole new level if both partitions could be merged into a single partition as described above. Are you still planning on creating a special recovery for this?
Thanks for all of your hard work on this and Bexus.
So, this merge died?
rpadula said:
So, this merge died?
Click to expand...
Click to collapse
If this is dead is there still an effort to make the media partition (internal storage) act as the SD card? Some apps (like minion rush for example) won't completely install without and external SD card. Used to be able to swap internal and external but can't find a way to do that anymore. Even then there were still issues like the media process frequently crashing. It would be nice to utilize all of the 16GB of the NT and not be required to also use an external SD card. That would be sublime.
Yeah I agree with you guys but cm maintainer don't so if we merge partitions then you won't be able to use official cm
ok guys this guide is adjusted for the new cm12 sdcard as emulated merge with f2fs filesystem support.
Enjoy
I previously resized emmc to ~9.5 GB ( and reduced data). I assume this method should work fine regardless of the relative sizes of these two partitions?
rete said:
I previously resized emmc to ~9.5 GB ( and reduced data). I assume this method should work fine regardless of the relative sizes of these two partitions?
Click to expand...
Click to collapse
Doesnt matter what repartitioning sheme you have as both partitions get deleted then merged so all will end up with the same size.
When i refer to all i mean users that repartioned and those who didnt.
I now added a new alternate guide on #2
Regards
Thanks. This is nice guide for cm12 with nightlies of 22 Feb 2015 and newer.
Chris
If emulated sdcard has been implemented, is it no longer ok to flash back to CM11? I'm sure F2FS is not supported, but is emulated sdcard also not ok?
Also, if we need to get back to stock after this repartition method, will AdamOutler's unbrick method restore the original partitions back?
If you dont merge the partitions there is no problem to go back to any rom cm or stock

[Guide] Resizing LG G2 partition size

Resizing LG G2 partition size​Must have: Latest TWRP Recovery, ADB experience and gdisk for arm in attached zip.
Clean /system partition (unused apps, bloatware, garbage and so on...)
Backup everything important from /sdcard.
Reboot to TWRP and connect ADB (if "ADB devices" fails, check windows "Device Management" and install "Android Sooner Single ADB Interface" for your unrecognized phone).
In TWRP backup /system and /data and download /sdcard/TWRP folder via MTP to your PC.
Now it's ADB time:
Code:
[B]# check /system used space (in Mb) and remember it, as we should cut no more than "Available" space:[/B]
adb shell "mount /system"
adb shell "df -m /system"
[B]# un-mount partitions:[/B]
adb shell "umount /system"
adb shell "umount /data"
adb shell "umount /sdcard"
adb shell "umount /cache"
[B]# unzip gdisk in your ADB folder and install it:[/B]
adb push gdisk /sbin
adb shell "chmod 0755 /sbin/gdisk"
[B]# check partitions info:[/B]
adb shell "/sbin/gdisk -l /dev/block/mmcblk0" >gpt.txt
[B]# open new gpt.txt file in your ADB folder
# now you should recalculate your new partitions (30-36) size and position (in sectors)
# partition start-sector should be even, end-sector should be odd
# to make it simplier, use formula: (new size in MB) * 2048 + 1 = (new size in sectors)[/B]
Check my examples:
Code:
default (4.4.2 firmware):
30 819200 6488063 2.7 GiB 0700 system
31 6488064 7733247 608.0 MiB 0700 cache
32 7733248 7897087 80.0 MiB 0700 tombstones
33 7897088 7929855 16.0 MiB 0700 spare
34 7929856 8028159 48.0 MiB 0700 cust
35 8028160 60948479 25.2 GiB 0700 userdata
36 60948480 61071326 60.0 MiB 0700 grow
my mod v1:
(30) 800000 3526297 1.3 GiB system
(31) 3526298 3853977 160 MiB cache
(32) 3853978 3858073 2 MiB tombstones
(33) 3858074 3862169 2 MiB spare
(34) 3862170 3866265 2 MiB cust
(35) 3866266 61067229 27.2 GiB userdata
(36) 61067230 61071326 2 MiB grow
my_mod_v2:
(30) 800000 2897153 1 GiB system
(31) 2897154 3122433 110 MiB cache
(32) --- --- deleted tombstones
(33) --- --- deleted spare
(34) 3122434 3126531 2 MiB cust
(35) 3126532 61071326 27.6 GiB userdata
(36) --- --- deleted grow
Important! It's only mine D802 4.4.2 example. You should calculate your own values, because of your /system used size, /cust size for unlock, etc.
/spare and /grow partitions unused on our phones. /tombstones is obesolete since it mounts from /data, anyway.
After all checks and calculations, let's do the magic:
Code:
[B]# run gdisk:[/B]
adb shell
cd /sbin
gdisk /dev/block/mmcblk0
[B]# no real changes applied to the phone, before "w" command.
# if you did something wrong, exit by "q" command
# you can check youreself with "p" command (partition list with virtual changes you made).
# OK, let's delete our old partitons and create them anew:[/B]
"d" command > enter partition number (for all 30-36 partitons).
"n" command > enter partition number > start > end > code (start & end = new values in sectors, code = 0700)
"c" command > enter partition number > name (system, cache, etc.)
[B]# if all seems fine, and you're pretty sure of youreself:[/B]
"w" command > "Y" answer
[B]# there is no FS on new partitions, so format them:[/B]
mke2fs -t ext4 /dev/block/mmcblk0p30
mke2fs -t ext4 /dev/block/mmcblk0p31
mke2fs -t ext4 /dev/block/mmcblk0p34
mke2fs -t ext4 /dev/block/mmcblk0p35
[B]# there is no point to format others, because they have no fs by default.
# if using kernel with F2FS support (like Dorimanx), you can format some of them as F2FS:[/B]
mkfs.f2fs /dev/block/mmcblk0p35
[B]# to make TWRP realise, horrors we just did - reboot it:[/B]
reboot recovery
[B]# after reboot, we can optimize /userdata a bit (ext4 only), with this:[/B]
adb shell "tune2fs -m 0 /dev/block/platform/msm_sdcc.1/by-name/userdata"
[B]# bring backups from PC to /sdcard via MTP and restore them, as usual
# now you can reboot to your system with custom-sized partitions!
# P.S. If you notice your /sdcard permissions glith a bit after all this - flash "sdcard Fix Permissions script" from [URL="http://forum.xda-developers.com/showthread.php?t=2239421"]this[/URL] thread.[/B]
Good luck.
Awesome :good: this guide will help 16GB user like me to increase data/sdcard partition
Too bad I don't have pc to play around with....
so, stock, user-usable fresh after format on KK4.4 we have 24GB on the /sdcard part. Would we want to use this to go smaller? Would there be a benefit to that? Or would I want to use it to go larger, shrinking my /sdcard
I know it can go both ways, but which are people more interested in here?
rancur3p1c said:
I know it can go both ways, but which are people more interested in here?
Click to expand...
Click to collapse
Who knows? It's not that hard, it takes 5 minutes, it gets you + 1-3 Gib on the phone (without SD-Card support), and it's safe - coz we don't touch bootloader or recovery partitions... It's worth it.
THIS is just pure awesome
I've followed the guide and successfully added almost 2gb to userdata on my 16gb d802
This is my gpt for now
30 791568 4158721 1.6 GiB 0700 system
31 4158722 4306179 72.0 MiB 0700 cache
34 4306180 4310277 2.0 MiB 0700 cust
35 4310278 30777310 12.6 GiB 0700 userdata
And this is my aim, if i have time to do it again
30 791568 3937297 1.5 GiB 0700 system
31 3937298 3961875 12.0 MiB 0700 cache
34 3961876 3965973 2.0 MiB 0700 cust
35 3965974 30777310 12.7 GiB 0700 userdata
Also, i've notice this in the gpt.txt file
Total free space is 230360 sectors (112.5 MiB)
So can we get even more from our phone?
Hello everybody
first of all I ll thank you for your guide Resizing LG G2 partition size.
But no I have problems with installing a new rom. Everytime I enter twrp I get the message "Can't mount /system". So its impossible for me to install a new rom.
All partitions seems to be fine. gdisk works perfect without any errors.
My partition table looks like:
Code:
30 819200 3686401 1.4 GiB 0700 system
31 3686402 4014083 160.0 MiB 0700 cache
34 4014084 4034565 10.0 MiB 0700 cust
35 4034566 30777310 12.8 GiB 0700 userdata
If someone have any idea how I can solve this problem?
Thanks
Chris
I am thinking to try this tool, but I would like to know if flashing kdz will work in case I screw things up, or am I risking to permanently brick the phone?
Okay, going back to stock partitions will fix my problem and my system partition is again 2.7 GB
With the customised partitions i was unable to install neither Resurrection Remix Rom nor Google Edition 1.5. Both return an error in twrp.
Backfisch said:
Everytime I enter twrp I get the message "Can't mount /system". So its impossible for me to install a new rom.
All partitions seems to be fine. gdisk works perfect without any errors.
Click to expand...
Click to collapse
I have the same problem. Did you fix it by any chance?
Yes, going back to the stock values of the partition using the gdisk again.
Its also import to make sure the partition format works correct. Better format twice....
Backfisch said:
But no I have problems with installing a new rom. Everytime I enter twrp I get the message "Can't mount /system". So its impossible for me to install a new rom.
Click to expand...
Click to collapse
Okay, the fix is that you have to restore TWRP backup, in my case CM13 booted all good. But now I have a different problem, the MTP connection is really unstable, disconnects and reconnects for no reason. Same problem using twrp mtp or cm mtp. Tried two different cables, two different pc, and resized the partitions twice using different values. Still no luck. Anyone had any similar experience?
EDIT: Seems my charging port is failing. Many cables have hard time being stable, but some of them work better.
Backfisch said:
Yes, going back to the stock values of the partition using the gdisk again.
Its also import to make sure the partition format works correct. Better format twice....
Click to expand...
Click to collapse
Back when I tried to resize the /system partition, all non-lg rom doesnt install because of that error, and they are the ones that has the most potential of freeing some space
you can only get some space from /cache and other partitions without getting errors
I have gained 2 Gb extra space on the internal memory, and it works great so far. The only problem is that flashing roms from twrp returns the error /system can not be mounted, and you have to install the rom by restoring twrp backups.
Am I right in thinking that you cant install an rom update with modified partitions by flashing it in twrp?
If restoring my backup is the only way to install my rom, I will delete some music and pictures on the userdata partition...
You can install roms with "system" folder and files in it, on modified partitions (if you have enough space in /system, of course).
But you won't be able to install CyanogenMod-based roms with partition image in them (system.img, system.bin, etc.)
I played with this a bit and something went wrong Now i can't flash any os neither TOT or KDZ. I dismantled my phone to enter 9006 mode and recover it from there. But with no success :c What should i do now? I have my stock values of 30f saved, but after flashing kdz and tot i have stock recovery. It doesn't have adb suppor so i can't start gdisk operation. And i can't push any rom or recovery by sideload. When recovery starts I have list of errors. It can't mount system, data etc. I think I bricked it quite well xd
SantoSubito said:
I played with this a bit and something went wrong Now i can't flash any os neither TOT or KDZ. I dismantled my phone to enter 9006 mode and recover it from there. But with no success :c What should i do now? I have my stock values of 30f saved, but after flashing kdz and tot i have stock recovery. It doesn't have adb suppor so i can't start gdisk operation. And i can't push any rom or recovery by sideload. When recovery starts I have list of errors. It can't mount system, data etc. I think I bricked it quite well xd
Click to expand...
Click to collapse
Did you fix it yet? Does download mode work? Why didn't work flashing kdz in the first place?
Yes it does. After flashing kdz phone enters recovery and I have list of errors. And when i tried to flash tot i have error something with laf partition and gpt. Yesterday i tried to recover it from 9008 but I'm also getting error :c
SantoSubito said:
And when i tried to flash tot i have error something with laf partition and gpt.
Click to expand...
Click to collapse
Try to flash TOT-firmware with modded dll (bypass gpt-error). One of this should do the trick.
Yeah it worked. But not in 100%. When its 94% my phone reboots and LG Tool shows:
...
CACHE
CACHE
CUST
Wiating for the device 120s
then device reboots and get bootloop
BoardDiag have this wierd dload error and also i cant do nothing with this tool

filesystem mounting / repartitioning on live android system

Hy!
I have a mi2s and this phone is come to separated partitions in its internal drive. It has separated data and sdcard partition. My sdcard partition not mounted for some reason.
I want to keep this partition system, I just want to either mount the sdcard partition, or resize them without loseing data. (I can delete the sdcard partition but I want the data partition untouched, I had a long fight till this rom started to work with google play store, and I dont really want to remach it after all my apps are installed... Fun thing that after the first boot both partitions were mounted, after my first reboot only the data.)
I tried:
adb mount - adb sees it Android not sees it
write it to the fstab.qalcom - its on the / if I reboot the phone its loaded from somewhere again (I know its a ramdisk), my modifications are not permanent on there
I have basic linux knowlage and I started to dig into it, but I cant google out a general solution.
My questions:
How can I mount a fs like the usb otg from adb/android shell?
Can I edit the fstab file in its permanent store on an installed rooted device? And if I can where?
If I place new lines to the fstab on rootfs how can I tell the system to "reload" it?
Can I extend an ext4 partition from adb without loseing its data? *
* I have the required tools like parted from xiaomi forum, I cant post the link but you can google it with "Mi2S extending size of storage partition stillka".
Any help appreciated, and sorry for my english I'm not native.
So the basics:
If you can mount it from adb its a half win!
Try search the correct block partition and mount it with -t, add the correct file system and don't try auto it.
After you can mount it, you need to start an sdcard process its in /system/bin/sdcard. I had to see the custom rom implementation for that, in cm u need to param it "sdcard from to 1023 1023", but in samsung devices the to is hardcoded, and you nedd to do some sed magic.
After that your android programs will see it as a valid sdcard partition.
The harder way:
Wrap it to a startup script.
Add this script somewhere to run at bootup.
I'm still working on it, but I'm closer and closer. After I have the final solution I will write here once more.
I get so much help from there:
http://forum.xda-developers.com/showthread.php?t=2467048
If somebody want to do this:
After few hours of trying to mount the filessystem in boottime (in CM 12.1 its a hard work), i gave up, and went to a repartitioning way.
BE CAREFUL YOU CAN BRICK YOUR DEVICE IF YOU HAVE NO IDEA WHAT IM TALKING ABOUT!
I merged 2 tutorials:
reboot phone into CWM, connect phone to PC
connect to phone over adb and check if you are root
mount system
umount cache
umount data
copy content of partition_tools.zip into /system/bin and add executable attributes if necessary
Run parted on your device: parted /dev/sdX
Change display unit to sectors: unit s
Print current partition table and note the start sector for your partition: p
Delete your partition (won't delete the data or filesystem): rm <number>
Delete your partition (the second one we will delete data from there): rm <number>
Recreate the partition with the starting sector from above: mkpart primary <start> <end>
Recreate partition 27 (the last) mkpartfs primary ext2 3070 15758
name 26 userdata #we have to set back partition labels
name 27 storage
Exit parted: quit
Check the filesystem of 26: sudo e2fsck -f /dev/sdXX
Resize filesystem 26: sudo resize2fs /dev/sdXX
restore partition 27 with:
tune2fs -j /dev/block/mmcblk0p27
e2fsck -fDp /dev/block/mmcblk0p27
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p27
e2fsck -fDp /dev/block/mmcblk0p27
Of course in parted print you can see your original partition layout and this case it is possible that you have other partition numbers (my 26 partition is labeld by userdata and 27 with storage, and I gave more space to userdata from storage without loseing any data from userdata).
You can download the partition_tools.zip from the original miui forum, try to search to mi2s extending size of storage partition. (yes it will work with other devices too)

Categories

Resources