Nook Touch Partition Hacking - Nook Touch Android Development

Folks are starting to look at the ST partition table and the file layout on the ST. This post is intended for other folks with power tools to think about.
My goals:
- expose the BN content (so I can read the New Yorker on my NC, mostly, but also so I can manage the library on my ST with Calibre as I do on the NC)
- understand how much room I have on the internal memory
- increase the amount of memory available for sideloading.
I got in well over my head during a conference call last week, but my ST is reborn and now able to do cool things.
However: I did not start from a factory fresh partitioning scheme, sadly. My first backup of the device went permanently offline (the disk and linux install containing it) and I was unable to return to it after I'd borked the ST pretty badly on the call. All I really was sure of was the partition order.
The tools:
- "noogie." Available and discussed at http://nookdevs.com/NookTouch_Rooting
- the rooting disk from http://forum.xda-developers.com/showthread.php?t=1132693 (currently at 1-6-24 - mad props to the folks who put that together!)
- a working Linux installation with USB support. Vmware player in Windows works just fine for this.
Note: currently, that third element is key; this is not intended as a walkthrough that tons of people could follow today, but to spark awareness of the technique - it seems possible that something very much like the DeanG scripts for redoing the NC partitions could emerge. Hint Hint.
First: the noogie disk is super cool. You boot from it and it mounts all of your ST partitions. So you can get a complete backup in linux (or Mac) by :
#dd if=/dev/sdX of=virigin.ST.img bs=1M
A true disk image backup.
You could (if you were patient) get the individual partitions as well - there is value in doing that, because within the first three partitions your serial number is stored. It's possible to restore this image to a different ST -- but then you've also transferred your serial number. whoops.
You can mount the partitions in linux and copy all the files from each of them as well.
After you have a backup, power off, insert the simple touch root disk, and power up. It will boot to a screen that reads "rooted forever" (as does Noogie) and after a pause, will continue booting as it does some setup.
You will wind up with ADB enabled over wifi by default and google apps installed.
You may also need to restart immediately -- I've found that sometimes after rooting, my s/n is all zeroes. Restarting clears that.
I also find that in order to get the Android marketplace working, I need to hunt down a copy of Vending.apk that is 2 meg (2,125,824 bytes on disk) in size and install it over the copy that touchnooter installs. I believe this one is the one that folks use for cm7?
The command to install it is:
#adb install -r Vending.apk
The -r is needed to avoid getting told the signature's bad. It's a reinstall flag.
So , once rooted, you have access to ADB and to fdisk for examining and changing disk layout.
The layout is interesting. Here's the issue: I know the order of the layout, but I screwed up my partition boundaries before I started, so the actual values here are from AFTER I finished:
(these values are from the fdisk display; they are not commands)
/dev/block/mmcblk0p1 c Win95 FAT 1-38
/dev/block/mmcblk0p2 c Win95 FAT 39-46
/dev/block/mmcblk0p3 83 Linux 47-141
/dev/block/mmcblk0p4 5 Extended 142-926
/dev/block/mmcblk0p5 83 Linux 142-285
/dev/block/mmcblk0p6 6 FAT16 406-807
/dev/block/mmcblk0p7 83 Linux 808-926
/dev/block/mmcblk0p8 83 Linux 286-405
It's partitions 5-8 that are interesting.
5 is /system, and I leave it untouched.
6 is /media - the area you can copy files to. 6 is -- on my device -- the SECOND to last PHYSICAL partition.
7 is /cache. It is the LAST physical partition.
8 is /data - and it is the 6th PHYSICAL partition.
The device restore scripts from BN don't care how big the partitions are, but they do care what ORDER they're in.
I will give my current partition table at the end - I want to avoid posting a (wrong) copy of what I thought I started with, because I screwed it up.
A stock ST writes your purchases to /data, not to /media.
It writes them to /data/media, in fact.
So, first question: what happens if you do an
#rm -r
inside /data/media, then
#cd ..
#rmdir media
then do
#ln -s media /media to so you wind up with
lrwxrwxrwx root root 2011-08-29 20:19 media -> /media
in your /data partition?
1) It works
2) restart, grab stuff from BN - and you see it from your desktop system. Your content is visible.
Win!
Ok, so the next thing is: bugger . I only have 240 M or so of room for stuff now? Eh?
shell back in and use fdisk to delete the partitions and rebuild them.
The order is key here. They are named as they're made, but you need them laid out out of physical order.
The following worked for me:
#fdisk /dev/block/mmcblk0
d6
d6
d6
Partitions 6, 7 and 8 are gone now.
Next, to create partitions of a useful size in the correct order
n
(creates p6)
406 807
n
(creates p7)
808
926
n
(creates p8)
286 405
write your changes from fdisk.
reboot.
But - now you've picked stuff and moved it around. It's a Really Good Idea to reformat the partitions before use.
The best way is probably to use the mkfs tools on the device.
Best way, schmest way. I booted to Noogie and used qtparted in linux so I had a gui to doublecheck my partition layout.
formatted these as ext3 for the Linux partitions at 7 and 8, and as fat16 for the win partition at 6.
It's entirely possible that you could format that as fat32, but it comes from the factory at fat16 so I stuck with that.
Power down, remove noogie, power up.
I got a "failed to install" followed by a reboot followed by being back in the OS.
I did not have to reroot to get my apps, but I did need to reroot to fix the marketplace - the /data partition being blown out meant that the Android market was crashing.
Now, to finish:
go back in via adb and reestablish the symlink (you just blew it out when you resized /data)
So:
shell in
#cd /data/media
#rm -r
(only inside /data/media, it WILL tear out any files it sees.) then
#cd ..
#rmdir media
then do
#ln -s media /media
And your stuff is put on the /media directory and can be managed properly.
I think this stuff may well be scriptable.
There's a great thread on the repartitioning that I found last night, making use of sfdisk rather than fdisk:
http://forum.xda-developers.com/showthread.php?t=1225196
As far as I know, swapping /data/media out to /media is new, but if it's not I apologize for being unaware of it.
So, here's the layout I finished with:
Disk /dev/block/mmcblk0: 1958 MB, 1958739968 bytes
128 heads, 32 sectors/track, 934 cylinders
Units = cylinders of 4096 * 512 = 2097152 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 * 1 38 77808 c Win95 FAT32 (LB
A)
/dev/block/mmcblk0p2 39 46 16384 c Win95 FAT32 (LB
A)
/dev/block/mmcblk0p3 47 141 194560 83 Linux
/dev/block/mmcblk0p4 142 926 1607680 5 Extended
/dev/block/mmcblk0p5 142 285 294896 83 Linux
/dev/block/mmcblk0p6 406 807 823296 6 FAT16
/dev/block/mmcblk0p7 808 926 243696 83 Linux
/dev/block/mmcblk0p8 286 405 245728 83 Linux
Partition table entries are not in disk order

Can you please format your commands in such a way that they look correctly? Current formatting in the post with your commands seem strange and incorrect.

I think all are OK except the fdisk commands.
Unfortuantely, the fdisk commands are given inside of an ascii gui of sorts, to there's really no 'great' way to represent them, I don't think.
I've prepend the others with # so it's obvious they're shell commands.

How's about symlinking various things to a 2nd partition (ext4?) on the sdcard then?

gparted?
Has anybody tried gparted to resize the partitions? If it works it could be useful.

Have any one tried doing it on windows and using which software? I'm thinking of mini tool's partition manager. But i'm not sure. Anyone?

roustabout said:
#cd /data/media
#rm -r
(only inside /data/media, it WILL tear out any files it sees.) then
#cd ..
#rmdir media
then do
#ln -s media /media
And your stuff is put on the /media directory and can be managed properly.
Click to expand...
Click to collapse
Thanks a lot for this, but the second and last lines are wrong:
rm -r should be rm -r *
ln -s media /media should be ln -s /media media
Still, thanks for the idea!
I wonder if symlinking to the sdcard could fix the whole 'shelves don't work for sideloaded books on sdcards' problem.

Related

[How-to] How I expanded my app storage (repartitioning)

I took some time today to play with the partition layout on my Kindle Fire and I decided I wanted to share my method in case anyone else found it interesting. The reason I did this is because I know that I'm not going to be putting much of anything onto the KF's /sdcard directory. Instead of having 1 GB for data/apps (and books?) and 5 GB for media, I wanted to more-or-less reverse those numbers. What I settled on was 4.5 GB for data/apps and about 1.7 GB of "external" storage. In other words, I can install 4 times as many apps as I could have on a stock layout, but can only store about 1/3 as much music/pictures/etc.
BIG HONKING DISCLAIMER: I have ONLY tested this on my own personal Kindle Fire. There is some very real potential that you could render your system unbootable if you're not careful, so if you want to try this or something similar, please BE CAREFUL, and please don't try to hold me responsible if something gets messed up. You've been fairly warned! You also stand the chance of losing your data partition by doing this. If you have anything you don't want to lose, please make a backup of some sort. That being said, as long as you're careful when doing this it should be fairly safe and you shouldn't lose your data, either.
1. Preparation
1.1 Installing a custom bootloader (FIREFIREFIRE)
Strictly speaking, this is somewhat "optional", but it makes things a whole lot easier. I strongly suggest that you head on over to pokey9000's thread and install his custom bootloader. Not only will this get you into recovery much more easily, but it will give you access to fastboot on every boot up (which will be very helpful if something goes wrong). I won't repeat the installation instructions here, just head over there and follow the instructions!
1.2 Installing a custom recovery (ClockworkMod)
The second thing you'll need is ClockworkMod recovery. Again, the heavy lifting is mostly done, and you can jump over to JackpotCalvin's installation and info thread to get it. Don't worry about the fact that you can't navigate the recovery menu - we won't be using that. The only purpose of the recovery is that it gives us an environment to safely work in with the /data and /cache partitions unmounted (i.e. not being used).
1.3 Root your Kindle Fire
You could do most of this (maybe all of the partitioning, in fact) without rooting, but at best you would lose everything on your /data partition. I'm not even positive if you could do the partitioning without root since...well, I was already rooted when I tried this. In any case, head over to this thread, get SuperOneClick, and root your KF. You'll be voiding your warranty by doing the rest of this anyway
1.4 ADB connection
Make sure you have ADB set up on your computer. You can follow the rooting guide to get this working. You can't do anything else in this post without working ADB.
1.5 (Optional) The parted and e2fsprogs binaries
This is somewhat optional since CWM has the utilities you need already, but it's not a bad idea to have a backup copy of the parted utility and the various e2fsprogs binaries (e2fsck, tune2fs, etc). You can grab this zip file and set it aside somewhere in case you need it. Here is the documentation for parted (applies to both the CWM binaries and the standalone ones).
2. Repartitioning your device
2.1 Backup your data
I cannot stress this enough: backup anything you don't want to lose. And don't just back it up to the external storage, either - move it to your computer or dropbox or something. I also highly recommend following the instructions in the FIREFIREFIRE thread to pull images of your various partitions in their current layout, in case you need to restore through fastboot (or you need them later down the line). Backing up your external data is as simple as copying it to your computer. To backup your /data partition, you can do the following:
Code:
C:\> adb shell
$ su
# cd /data
# tar -cvpzf /sdcard/data.tar.gz .
Note the "." at the end of the last line (in *nix this means "the current directory"). This will create an archive on your external storage named data.tar.gz. You should copy this to your computer for now, to make sure nothing happens to it. This could take a few minutes depending on how much stuff you already have on your /data partition, of course (mine was ~500 MB compressed).
Once you've backed up everything you want, reboot your Kindle by turning off and back on again. You should land at the FIREFIREFIRE bootloader (a yellow triangle with a flame in it). When you see the bootloader come up, press the power button (I had to hold it for a few seconds) to boot into ClockworkMod.
3. Repartitioning
3.1 External storage (/sdcard)
Time for the fun part
Use adb to shell into your device, and then run 'mount' with no parameters to see what's already mounted. You should see /cache has been mounted, and since we'll be moving it later we'll go ahead and unmount it now:
Code:
C:\> adb shell
~ # umount /cache
At this point, your /cache, /data and /sdcard partitions should all be unmounted. Now you need to start up the parted partition manager, which should be included with CWM (it's in /sbin). Fire it up and check your current partition layout by doing the following. Note that
Code:
(parted)
is the prompt that parted gives you after you start it up.
Code:
~ # 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: 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 5381MB fat32 media msftres
(parted)
I highly recommend that you store this in a text file somewhere. I saved a copy to my Dropbox to make sure I don't lose it. The reason I say this is because I don't know how a custom partition layout will affect things like OTA updates. If you ever want to go back to the default layout, you'll need these numbers handy.
Now you can go ahead and resize your external partition, which is block 12 ("media"). Make sure you don't try to make it smaller than its contents, or else it will probably error out. For example, if you have 2 GB of music on your /sdcard storage, you won't want to shrink it to 1 GB. What you want to do to shrink the partition is increase the start value. If you were looking at this graphically, it would be equivalent to moving the start of the partition to the right. So, for example, I moved the start of my external partition from the default 2309 to 5809 (5809 - 2309 = 3500, so I made it 3.5 GB smaller). You can choose whatever size you want, and then set it like this:
Code:
(parted) resize 12 5809 7690
This says "resize partition 12 so that it starts at 5809 and ends at 7690 (same as the current end point, which is the end of the disk). As long as you don't see any errors, this should not affect your sdcard's data. I did not lose any of my data by doing this. If you want, you can reboot now to test and make sure everything is in good shape, but it's not required.
3.2 The /cache partition
Since data is partition 10, cache is 11, and media is 12, we now have a gap between the end of cache and the beginning of media. In order to expand the data partition to fill that gap, we need to move the cache partition so that it is next to media again. Unfortunately, parted doesn't support moving an ext4 partition, so we have to make some magic happen first. Basically, we're going to erase the current cache partition, create a new one that is ext2 in the proper spot, and then "upgrade" it to an ext4 partition.
To erase the cache partition (which will erase /cache's data - no big deal), do the following in parted:
Code:
(parted) rm 11
(parted) mkpartfs primary ext2 <begin> <end>
(parted) name 11 cache
To figure out the "begin" value, take the beginning value you used for your external partition and subtract 268. This will be the beginning of the cache partition (assuming you want it to stay the same size as before - this is what I recommend). For the "end" value, use the same number that you entered for the beginning of your media partition. Using my example, 5809 - 268 = 5541, so I used 5541 for the beginning and 5809 for the end. If you enter the "print" command again, you should now see that your cache partition has effectively been moved so that it's right next to your media partition again. Now we need to exit parted to "upgrade" the partition to ext4 by enabling some filesystem features and letting e2fsck run a check on the filesystem. It may say that it's fixing some group descriptor checksums - don't worry, this is normal.
Code:
(parted) quit
~ # tune2fs -j /dev/block/mmcblk0p11
~ # e2fsck -fDp /dev/block/mmcblk0p11
~ # tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p11
~ # e2fsck -fDp /dev/block/mmcblk0p11
If e2fsck complains that it needs to be run manually, you should omit the -p flag. This happened to me the second time I ran through this process, but the first time it did not. I'm not entirely sure why. In that case, the e2fsck commands simply become:
Code:
~ # e2fsck -fD /dev/block/mmcblk0p11
Which will cause it to ask if you want to fix the group descriptors. Just answer 'Y' and let it run through.
3.3. The userdata partition (/data)
The last thing we need to do is expand the userdata partition to use up the space we freed up by shrinking media. Once again, since we can't resize an ext4 partition directly, we're going to have to delete it, re-create it as an ext2 partition, and then "upgrade" it.
STOP. DO NOT PASS GO. DO NOT COLLECT $200
This will wipe your /data partition. Double check to make sure you have a copy of your backed up data, because it's going to be gone after this.
Code:
~ # parted /dev/block/mmcblk0
(parted) rm 10
(parted) mkpartfs primary ext2 849 <end>
(parted) name 10 userdata
Here the value of <end> should simply be the same as the beginning of your cache partition (in my case this was 5541). This creates the new partition between system and cache, and it takes up all of the available space. Next we need to enable the ext4 features, so we'll do the same thing we did with cache:
Code:
(parted) quit
~ # tune2fs -j /dev/block/mmcblk0p10
~ # e2fsck -fDp /dev/block/mmcblk0p10
~ # tune2fs extents,uninit_bg,dir_index /dev/block/mmcblk0p10
~ # e2fsck -fDp /dev/block/mmcblk0p10
At this point you can fire up parted again and use print to see your shiny new partition layout:
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 M8G2FA (sd/mmc)
Disk /dev/block/mmcblk0: 7734MB
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 5541MB 4692MB ext4 userdata
11 5541MB 5809MB 268MB ext4 cache
12 5809MB 7690MB 1881MB fat32 media msftres
As you can see, the userdata partition is now 4692 MB You'll also notice that Titanium Backup will report the new size, so you can keep track of how much space you've used up.
4. Restoring your data from the archive
Don't reboot your Kindle Fire yet! Remember the data we backed up earlier into the data.tar.gz archive? Now we need to restore it to your nice new data partition. First mount your /data partition so you can get at it from the recovery shell:
Code:
~ # mount /dev/block/mmcblk0p10 /data
Now push your backup to your phone. From a command shell on our computer, just use adb push to move it over:
Code:
C:\> adb push /path/to/data.tar.gz /data
Now you can go back to your adb shell and extract everything you backed up earlier. Once it finishes extracting you can go ahead and remove the backup from your /data partition and reboot:
Code:
~ # cd /data
/data # tar -xvpzf data.tar.gz
/data # rm data.tar.gz
/data # reboot
And that's it! Now you should have a larger /data partition, and you can go on an app installation spree.
5. Credits/Thanks/Etc
Just want to give a quick thanks to JackpotCalvin and pokey9000 for CWM and the custom bootloader, since I obviously needed those to make this happen. Also thanks to all the other devs working on the KF for all the great work so far!
If something doesn't work, feel free to drop a reply here. I'll see what I can do to help, but bear in mind that this is intended to be for power users or extreme tweakers. I'd definitely be interested in hearing some success stories if anybody else decides to give this a try.
I also want to add a shoutout/plug for the Android Enthusiasts website, hosted by StackExchange. It's a Q&A site dedicated to power users of Android devices. Stop by if you have a question, I'm always hanging around!
Very impressive tuto! I haven't tried it because I haven't run out of space yet but sounds great and I'm glad to know that it is here when I need it. Thanks!
Sent from my Kindle Fire using Tapatalk
SikYou said:
Very impressive tuto! I haven't tried it because I haven't run out of space yet but sounds great and I'm glad to know that it is here when I need it. Thanks!
Sent from my Kindle Fire using Tapatalk
Click to expand...
Click to collapse
Thanks! I got motivated to play around with it today when I realized I'd already eaten through 500 MB of my internal storage. All those "wifi only" game downloads really add up...
Also, here's a screenshot of Ti after I repartitioned. Note that my internal storage is at 3.73GB out of 4.61GB at the bottom
Sweet! Made me double check my space and yeah.... Those games do eat up a lot of space
I don't know if I'll ever change the partitions layout, but this guide is absolutely impressive.
WOW!!! Great!
I was thinking of what would it take to go the other way, actually. I mean,
1) I don't care about any future OTA updates from Amazon, so I definitely don't need a 500+ Mb /system partition.
2)/512 Mb will be more than enough for me on /data - anything I can't fit in that, I'll be able to just move to the /media partition.
3) Since I won't be flashing any OTA updates, I don't need this huge /cache partition either - I have 2Mb on my phone, but I think there's a script in the ROM that actively avoids using the cache partition for anything really.
4) What is /dfs and why do we need 200 Mb there...
This all adds up to nearly 2GB more space I can definitely use in the /media partition....
Do you guys think this could work? I.e - apply the same approach to /system - back up/shrink/restore?
renegade027 said:
WOW!!! Great!
I was thinking of what would it take to go the other way, actually. I mean,
1) I don't care about any future OTA updates from Amazon, so I definitely don't need a 500+ Mb /system partition.
2)/512 Mb will be more than enough for me on /data - anything I can't fit in that, I'll be able to just move to the /media partition.
3) Since I won't be flashing any OTA updates, I don't need this huge /cache partition either - I have 2Mb on my phone, but I think there's a script in the ROM that actively avoids using the cache partition for anything really.
4) What is /dfs and why do we need 200 Mb there...
This all adds up to nearly 2GB more space I can definitely use in the /media partition....
Do you guys think this could work? I.e - apply the same approach to /system - back up/shrink/restore?
Click to expand...
Click to collapse
I would think you could do this as long as you make sure you get a good backup of /system and it restores properly, but I've never tried. You'd just need to be a little careful since you would have to erase and repartition it since parted doesn't understand ext4, although as long as you can get into recovery and fastboot you could partition back to normal and flash a stock system image if something went wrong (at least you should be able to). I'm probably not going to try that since I'm fine with this layout and I've only got my personal KF, but it doesn't sound unreasonable.
I'm not sure what /dfs, /dkernel or /backup are, either. I thought I saw a thread somewhere that had some talk about them, but I don't remember where it was. /dkernel is actually the same size as the /boot partition - which made me suspicious - but I can't unpack the image with my usual unpack/repack scripts so I'm not sure what it really is and I don't want to mess with it
Assuming you do everything right, how long would you expect this process to take?
WOW, that's a lot of work for just a little bit more space! Good write up though, thanks!
rmagruder said:
Assuming you do everything right, how long would you expect this process to take?
Click to expand...
Click to collapse
I'd wager you could probably knock this out in about 20-30 minutes, depending on how much stuff is on your /data partition.
The longest part, by far, was archiving and unarchiving /data. All of the partitioning commands together would only take, like, 10 minutes or so (they execute very fast). Archiving the /data partition alone took about 4 or 5 minutes for me and my archive was ~500 MB. Unzipping the archive later was another 3-5 minutes.
Altogether it probably took me about 45 minutes of actual time since I was playing with numbers and writing stuff down periodically.
I know it looks like it would take a lot longer, but I just have a tendency to write very, uh, "thorough" documentation. It's mostly out of habit (I'm a software developer).
Right there with you.
I'm not feeling brave enough to do this right now because I'm not sure I would get EVERYTHING backed up and sorted properly...but as I've now run out of app install space several times, my tolerance for it is steadily decreasing!
Randy
Good Friggin Stuff
eldarerathis,
This guide was excellent and worked fantabulously for me. Thanks for an excellent walk-thru.
One Caveat. In this section:-
eldarerathis said:
3.3. The userdata partition (/data)
...
Code:
~ # parted
...
Click to expand...
Click to collapse
The executed parted command in should read:-
Code:
~ # parted /dev/block/mmcblk0
...
Also, in setting up the /cache partition, after initiating this command:-
Code:
tune2fs -j /dev/block/mmcblk0p11
Thanks for pointing out the potential for the need to fix 'group descriptor checksums'. Though, in order to ensure the filesystem was marked clean, I had to initiate an extra step of running f2sck manually:-
Code:
~ # e2fsck -fD /dev/block/mmcblk0p11
(note the lack of the -p switch)
Again: Good work putting this together for the KF community. I, for one, had the immediate consideration of a small /media partition (and an inflated apps area) as this is mostly for books / apps / games for the kids whom would not use this for locally stored content and would stream any media they desired.
One question: can any of this be scripted in any way?
Cheers.
I'd love to see a script or something for this....
airmaxx23 said:
I'd love to see a script or something for this....
Click to expand...
Click to collapse
Ya, I agree - terrified to do this myself but happy to run a script by someone who's had it tested by others.
drExel said:
eldarerathis,
This guide was excellent and worked fantabulously for me. Thanks for an excellent walk-thru.
One Caveat. In this section:-
The executed parted command in should read:-
Code:
~ # parted /dev/block/mmcblk0
...
Also, in setting up the /cache partition, after initiating this command:-
Code:
tune2fs -j /dev/block/mmcblk0p11
Thanks for pointing out the potential for the need to fix 'group descriptor checksums'. Though, in order to ensure the filesystem was marked clean, I had to initiate an extra step of running f2sck manually:-
Code:
~ # e2fsck -fD /dev/block/mmcblk0p11
(note the lack of the -p switch)
Again: Good work putting this together for the KF community. I, for one, had the immediate consideration of a small /media partition (and an inflated apps area) as this is mostly for books / apps / games for the kids whom would not use this for locally stored content and would stream any media they desired.
One question: can any of this be scripted in any way?
Cheers.
Click to expand...
Click to collapse
Oops, you're right. I *always* forget the device parameter when I use parted (even when I'm actually running it; I do it the first time without a param constantly and parted yells at me), so I'm not surprised I missed one of them. Thanks, I'll fix that.
Per your second comment: I actually did this a second time because I changed my mind and decided to go with 3.5 GB /data and 2.5 GB /media, and I also had to run e2fsck manually. The first time I did this I didn't need to, and I'm not entirely sure why that is. Thanks for reminding me to add that note, though.
If I have some time I could try to put together a script for this. I was thinking about doing that since you should be able to do all of the parted stuff with command line parameters, but I haven't had time between work and the holidays. I might try to take a look at it again this weekend if I have a chance.
eldarerathis said:
Oops, you're right. I *always* forget the device parameter when I use parted (even when I'm actually running it; I do it the first time without a param constantly and parted yells at me), so I'm not surprised I missed one of them. Thanks, I'll fix that.
Per your second comment: I actually did this a second time because I changed my mind and decided to go with 3.5 GB /data and 2.5 GB /media, and I also had to run e2fsck manually. The first time I did this I didn't need to, and I'm not entirely sure why that is. Thanks for reminding me to add that note, though.
If I have some time I could try to put together a script for this. I was thinking about doing that since you should be able to do all of the parted stuff with command line parameters, but I haven't had time between work and the holidays. I might try to take a look at it again this weekend if I have a chance.
Click to expand...
Click to collapse
I'd make a donation to you if you get this done in a script.
Awesome space Space flip. Lov It.
eldarerathis said:
Per your second comment: I actually did this a second time because I changed my mind and decided to go with 3.5 GB /data and 2.5 GB /media, and I also had to run e2fsck manually.
Click to expand...
Click to collapse
Having done this with your original method, I totally understand why you might have had to revisit and partition as you did the second go-around. It seems most game downloads cache the initial files on the media partition before actually 'installing' the data to the SYSTEM partition. As a result, in no time at all (especially with Gameloft titles) you begin to receive 'LOW SPACE' warnings when downloading some of the extremely large game-data (ie. Dungeon Hunter 2 requires 900+ megs free available) so there is potential for required manual clean-up to see things through.
Does this work with TWRP installed? I actually want to increase my media storage, as I use my Kindle Fire mainly for reading things online and watching movies/anime (not porn you nasty people). I'm not so sure I would want to install ClockworkMod if I have TWRP already on here.
Hydrocharged said:
Does this work with TWRP installed? I actually want to increase my media storage, as I use my Kindle Fire mainly for reading things online and watching movies/anime (not porn you nasty people). I'm not so sure I would want to install ClockworkMod if I have TWRP already on here.
Click to expand...
Click to collapse
Yes, this should work fine. TWRP 2.0 has the utilities you need, to my knowledge.

[Q] BusyBox Free locked my Nexus memory to read only

I've had BusyBox Free on my Nexus for many months... only there to keep me on the latest version. Well, yesterday it told me about 1.20.2 so I let it install that but it was a big mistake.
The memory is locked at read only now. I can even see last files written to it were...
busybox-stericson
toolbox-stericson
It crashes if I don't quickly put it in airplane mode, for example. I can push and delete files via adb, but that's only fake because once the buffer fills with backlogged changes, the phone crashes. In fastboot, erasing userdata, etc. doesn't really erase anything. Locking/Relocking the bootloader doesn't reallly take effect either, and neither does reflashing recovery. Formatting the internal memory doesn't have an effect, and while restoring a recovery backup goes through the motions, it complains at the end about the memory being read only.
I wrote the BusyBox Free developer an email last night but didn't get a response yet.
I don't know how this is possible.
BusyBox doesn't change anything to read only, except for /system, which is suppose to be read only anyways.
Besides this point, anything Busybox would have done, in regards to remounting partitions to rw, ro, or whatever a reboot would reset these to their defaults.
I suspect something else is going on. Maybe an applet or something of the like has been replaced that is causing this issue, but I have never heard of my installer causing an issue like this.
also, those files you are talking about being written, are written to you SDCard or internal storage which is not a part of your phones system memory.
Stericson said:
... those files you are talking about being written, are written to you SDCard or internal storage which is not a part of your phones system memory.
Click to expand...
Click to collapse
The Galaxy Nexus lumps all its memory in one 32GB pool (internal with SD) which is normally great compared to all my other Android devices. Regardless, writes to any of the filesystems don't appear to get committed from a buffer.
Anyways, thanks for the response. I'm gonna' have to do some more research and hope there's nothing wrong at the hardware layer (eg. write-enable/disable trace on chip). Physically, my phone is pampered and in mint condition.
I would say that's pretty dang good response time from the dev, and on the forum, even.
:good:
consultant.ben said:
I would say that's pretty dang good response time from the dev, and on the forum, even.
Click to expand...
Click to collapse
I agree, Ben. I have to remember this is more of a volunteer effort here, unlike at work where I'm a product engineer with certain response time criteria.
Hmmm, even with the memory being all internal I don't change any of the write permissions on the external storage...
Did you replace any applets?
Did you use smart install or normal install?
Maybe some applet got replaced that otherwise shouldnt have been...
If you run a logcat, do you notice any weird errors....if so, what are they stating?
Also, when your phone crashes, can you give us the actual logcat of the crash?
Also, I try to respond as quick as possible, but I have so little time to dedicate to my own personal applications nowadays
I didn't replace any applets, and have never used your applet manager. Also, normally I wait for your smart install to scan, but I remember I did something abnormal that day and impatiently hit install (ie. normal install) while it was doing its smart scan. It reported successfully installing 1.20.2 though.
Per your request... adb logcat -d -v time > logfile.txt
I put that file on my website at http://ErichMoraga.com/logcat.txt
I pulled the SIM card so I wouldn't have to put it into airplane mode, and got the logcat once the OS loaded after a crash. At first I thought this part was curious...
07-08 12:18:01.234 I/SystemServer( 186): Mount Service
07-08 12:18:01.234 D/MountService( 186): got storage path: /mnt/sdcard description: Internal Storage primary: true removable: false emulated: true mtpReserve: 100 allowMassStorage: false maxFileSize: 0
07-08 12:18:01.234 D/MountService( 186): using emulated external storage
But then I searched on the Internet and noticed other people had that too. This logcat didn't appear to catch the actual crash (I don't see how it could if I'm having a read only memory problem).
I understand we both don't have much free time, being technical people. Normally I'm analyzing logs for customers, so it's frustrating 'shooting my own device. I do appreciate any insight anyone has, and am concerned this could happen to other people too.
Well, I bought myself another Nexus so I'd have something to keep me going. I also disassembled my faulty one to inspect the module with the 32GB Sandisk memory, but couldn't see anything wrong with it. If I can find a replacement, I can easily swap modules I suppose...
{
"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"
}
What about the output of adb shell ls -l --color=never /system/bin? Maybe one of the necessary programs (e.g. mount) is missing or has a dead link.
-Snags
Snags697 said:
What about the output of adb shell ls -l --color=never /system/bin? Maybe one of the necessary programs (e.g. mount) is missing or has a dead link.
Click to expand...
Click to collapse
Thanks for the response, Snags. I uploaded output to that here...
http://ErichMoraga.com/color.txt
I haven't scoured that for yet for missing programs, dead links, etc. Mount seems to be there...
lrwxrwxrwx 1 0 0 19 Jul 5 2012 mount -> /system/bin/busybox
Since there's so much BusyBox redirection going on there, it still supports my theory that the BusyBox installation was the root cause of the read only memory issue.
I'm sure there is a way to debug the Nexus in real-time. I'll have to find out the command for that (ie. dump threads, etc. as they occur to my PC via USB). A reliable way to crash the phone is to wait about 5 seconds into the scan at... Settings > Storage
I also noticed other people have similar problems not being able to write any of their memory...
http://forum.xda-developers.com/showthread.php?t=1756111
I'm a Linux guy and just learning Android. My first impression would be to double-check with a known writable directory. If you can't write in the /data/local directory (adb push anyfile /data/local/), check the mount status of everything: adb shell toolbox mount should do that with the native toolbox instead of busybox. Each entry should list either "rw" or "ro" amidst the gibberish. If /data is "ro", remounting from a root prompt (toolbox mount -o remount,rw ... /data) (Note: no space before rw, and replace ... with whatever was listed before /data in the list of mounted filesystems above) may give you write access to /data/local.
Then again, I think this is pointless, because if fastboot can't write to the internal SD (like the link you posted), something hardware-related or partition-related must be going on. Maybe the partition table got fried. Fastboot is only willing to write whole partitions that are genuine, I think. So if the partitions are messed up, it may prevent fastboot from doing anything. To see the partition table, you'd need root (there's a hole in the bucket...) and from a root prompt, run: parted /dev/block/mmcblk0 then from the (parted) prompt, type print. Quit or exit should get you out of there. Compare the output to "Need a copy of a stock GSM Nexus partition table" (Google it, I can't post links yet).
Of course, if you don't have root, this all doesn't help.
-Snags
Well, Snags, let's just say great minds think alike :good:
Also, I have root, and bought another Nexus that should arrive this week to play with that I'll flash with a nandroid backup from a couple weeks ago. The mount output looked fine...
rootfs on / type rootfs (ro,noatime)
tmpfs on /dev type tmpfs (rw,nosuid,noatime,mode=755)
devpts on /dev/pts type devpts (rw,noatime,mode=600)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
none on /acct type cgroup (rw,noatime,cpuacct)
tmpfs on /mnt/asec type tmpfs (rw,noatime,mode=755,gid=1000)
tmpfs on /mnt/obb type tmpfs (rw,noatime,mode=755,gid=1000)
none on /dev/cpuctl type cgroup (rw,noatime,cpu)
/dev/block/platform/omap/omap_hsmmc.0/by-name/system on /system type ext4 (rw,noatime,barrier=1,data=ordered,noauto_da_alloc)
/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata on /data type ext4 (rw,nosuid,nodev,noatime,errors=panic,barrier=0,nomblk_io_submit,data=ordered,noauto_da_alloc)
/dev/block/platform/omap/omap_hsmmc.0/by-name/cache on /cache type ext4 (rw,nosuid,nodev,noatime,errors=panic,barrier=0,nomblk_io_submit,data=ordered,noauto_da_alloc)
/dev/block/platform/omap/omap_hsmmc.0/by-name/efs on /factory type ext4 (ro,noatime,barrier=1,data=ordered,noauto_da_alloc)
/sys/kernel/debug on /sys/kernel/debug type debugfs (rw,noatime)
/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata on /mnt/sdcard type ext4 (rw,nosuid,nodev,noatime,errors=panic,barrier=0,nomblk_io_submit,data=ordered,noauto_da_alloc)
/sbin # 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 SEM32G (sd/mmc)
Disk /dev/block/mmcblk0: 31.9GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 524kB 4194kB 3670kB sbl
3 4194kB 25.2MB 21.0MB ext4 efs
4 25.2MB 33.6MB 8389kB param
5 33.6MB 37.7MB 4194kB misc
6 37.7MB 41.9MB 4194kB dgs
7 41.9MB 50.3MB 8389kB boot
8 50.3MB 62.8MB 12.5MB recovery
13 62.8MB 62.9MB 65.5kB metadata
9 62.9MB 79.7MB 16.8MB radio
10 79.7MB 765MB 686MB ext4 system
11 765MB 1218MB 453MB ext4 cache
12 1218MB 31.9GB 30.7GB ext4 userdata
I've also included some other stuff...
</etc/fstab>
/dev/block/platform/omap/omap_hsmmc.0/by-name/cache /cache ext4 rw
/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata /data ext4 rw
/dev/block/platform/omap/omap_hsmmc.0/by-name/system /system ext4 rw
</etc/recovery.fstab>
# mount point fstype device
# there is no actual sdcard in this thing...
#/sdcard vfat /dev/block/sda1
/system ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/system
/cache ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/cache
/data ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/userdata
/misc emmc /dev/block/platform/omap/omap_hsmmc.0/by-name/misc
/boot emmc /dev/block/platform/omap/omap_hsmmc.0/by-name/boot
/recovery emmc /dev/block/platform/omap/omap_hsmmc.0/by-name/recovery
/sbl emmc /dev/block/platform/omap/omap_hsmmc.0/by-name/sbl
/xloader emmc /dev/block/platform/omap/omap_hsmmc.0/by-name/xloader
/radio emmc /dev/block/platform/omap/omap_hsmmc.0/by-name/radio
Bear in mind I have a Verizon CDMA phone, so the partition table is different than GSM's (32GB vs. 16GB). Oddly enough, I couldn't locate the CDMA version online. Here is one of the the GSM versions I found...
Model: MMC VYL00M (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 524kB 4194kB 3670kB sbl
3 4194kB 25.2MB 21.0MB ext4 efs
4 25.2MB 33.6MB 8389kB param
5 33.6MB 37.7MB 4194kB misc
6 37.7MB 41.9MB 4194kB dgs
7 41.9MB 50.3MB 8389kB boot
8 50.3MB 62.8MB 12.5MB recovery
13 62.8MB 62.9MB 65.5kB metadata
9 62.9MB 79.7MB 16.8MB radio
10 79.7MB 765MB 686MB ext4 system
11 765MB 1218MB 453MB cache
12 1218MB 15.8GB 14.5GB userdata
The only differences were the specification of ext4 in mine under 11 & 12, as well as the size in 12. I also noticed Koush documented the recovery.fstab to have "auto" for /data instead of ext4 like mine. Worst case, I can run some comparisons between my 2 phones when the new one arrives. It won't be hard to push the correct changes if found.
Yet another person has the same problem as me... [writing to the memory card isn't actually committed, effectively making it read-only]
http://forum.xda-developers.com/showthread.php?p=28707474
My new phone will arrive Monday so I'll be able to perform more comparative analysis then. That said, since parted can't even make effective changes (I already tried), this may be a tricky fix.
If you don't mind the fact that it'll result in a full wipe including internal storage, you could try:
Open up any Google official ROM and extract the userdata img file.
Go into fastboot and flash that img. Reboot. Let it go through the full reboot process.
If something went wonky with how the partition is configured, that should set it straight. If it's a hardware problem you are still boned.
ErichMoraga said:
Yet another person has the same problem as me... [writing to the memory card isn't actually committed, effectively making it read-only]
http://forum.xda-developers.com/showthread.php?p=28707474
My new phone will arrive Monday so I'll be able to perform more comparative analysis then. That said, since parted can't even make effective changes (I already tried), this may be a tricky fix.
Click to expand...
Click to collapse
So yes, it seems i have a pretty similar problem with mine : nothing can be written anymore on the internal memory, whatever i can try : in recovery, in windows or with a file manager in the phone. Plus it is in bootloops constantly.
But i haven't touch at Busybox at all ; i mean it comes with Trinity kernel i use, so i don't bother to install or update it....Problem appeared just after this procedure :
- Downloaded a new Rom
- Rebooted to recoverry (TWRP)
- Made a Nand
- Wiped cache/dalvik/data
-Flashed new Rom/ gapps
-Rebooted...in the old configuration, just as if i've done nothing ! O_O......then i knew something was getting really bad....
As i said in the other thread (http://forum.xda-developers.com/showthread.php?t=1756334&page=2) i've just sent it to Samsung for repair under warranty...so i'll tell you in about 2/3 weeks when they'll return it, if they accept it, becaused even if I relocked the bootloader, it is still rooted.....but as it is surely a hardware problem, the warranty should work.
Anyway, i read somewhere that people had experienced this kind of issue after a "bad nandroid", or EMMC (?)....i'm not sure of what it means though....
Yeah, I'm leaning towards the hardware side too. It looks like the SANDISK NAND that Samsung used in the Nexus is a bit unstable. Also, I ran...
fastboot flash userdata userdata.img
sending 'userdata' (139193 KB)...
OKAY [ 15.448s]
writing 'userdata'...
OKAY [ 9.876s]
finished. total time: 25.325s
Not surprisingly the data was unchanged when I booted up. I might call Samsung later today to get the ball rolling.
ErichMoraga said:
Yeah, I'm leaning towards the hardware side too. It looks like the SANDISK NAND that Samsung used in the Nexus is a bit unstable. Also, I ran...
fastboot flash userdata userdata.img
sending 'userdata' (139193 KB)...
OKAY [ 15.448s]
writing 'userdata'...
OKAY [ 9.876s]
finished. total time: 25.325s
Not surprisingly the data was unchanged when I booted up. I might call Samsung later today to get the ball rolling.
Click to expand...
Click to collapse
Yeah, that's not surprising me...let's them repair their **** after all....
Samsung was pretty quick with the repair. There was a status update yesterday...
"The unit has left the technician. SOLUTION: Replaced Component - PRL Updated - S/W Updated - Passed"
I assume they replaced the module that holds the SIM slot and SANDISK chip. I'm sure I'll receive the phone soon, although I've been using a backup i515 I bought on eBay earlier.

[problem] Convert2EXT4 = can't wipe properly

Hey Gang,
I have an old Dinc that I am trying to get setup for a friend to use on Cricket or Pageplus. This is not the issue though.
The phone is using:
hboot .92
S-Off
CMW recovery 5.0.2.0
The phone was on Touch of Blue 2.0 and having wifi issues, so i decided to wipe it and install ToB2.2
In looking for new mods for the dinc, I ran across Convert2EXT4
I flashed "Convert2Ext4_no_data_limit_dalvik_moved.v2.0.zip" and proceeded to install ToB.
All seemed fine, but upon initial boot it never gets past the bootanimation.
After 30 minutes of waiting I decided to re-wipe everything manually.
THIS IS WHERE THE PROBLEM CAME IN
I get an error when wiping /data & /cache
I flashed "Convert2Ext4_no_data_limit_dalvik_moved_Revert.v2.0.zip" to try to revert the change. It went fine, but i still get the error when wiping.
I have also tried to fix things using "fix_datadata.v2.0.zip" & "wipe_dalvik.v2.0.zip"
Nothing seems to fix the problem.
Now I can't flash anything.
When I flash a stock ROM via RUU or PB31IMG.zip I get a bootloop.
I believe the phone is not wiping the /data or /cache partitions because it can't find them.
Any help getting the partitions back to stock?
Try a factory reset from hboot? It will wipe emmc as a warning.
Sent from my Galaxy Nexus using Tapatalk 2
tiny4579 said:
Try a factory reset from hboot? It will wipe emmc as a warning.
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
tired that and every other form of wiping.
I have deduced that the phone has messed up partitions and needs to be re-setup.
I am currently following this thread ( http://forum.cyanogenmod.org/topic/6433-solved-messed-up-partitions-on-internal-storage/ ) to correct the problem. I'll post my success/failure in a bit :silly:
part of my problem is that i can't unmount /dev/block/mmcblk0 partition 1
The CACHE partition.
when I "print" ,or view, the partitions using "parted" i get this
Model: MMC SEM08G (sd/mmc)
Disk /dev/block/mmcblk0: 7911MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File System Flags
1 8192B 797MB 797MB primary ext4
2 797MB 1007MB 210MB primary ext3
3 1007MB 7944MB 6937MB primary fat32 lba
I wish i had a nandroid backup to revert to.... but i don't
Oh well. This thing might be bricked for now until i figure out how to remove and re-create the internal partitions.
i need some help understanding this 'parted' stuff.
I have tried to re-create the partitions but I get errors that i need to run "e2fsck" to fix them.
I am completely lost and need the help of a pro =)
TINY... where are you when I need you =)
CalvinAMi said:
i need some help understanding this 'parted' stuff.
I have tried to re-create the partitions but I get errors that i need to run "e2fsck" to fix them.
I am completely lost and need the help of a pro =)
TINY... where are you when I need you =)
Click to expand...
Click to collapse
At work. I haven't exactly had the chance to look. I wish I knew the thread where I tried to help before. Perhaps that could come in handy at least as a starting point.
Sent from my Galaxy Nexus using Tapatalk 2
tiny4579 said:
At work. I haven't exactly had the chance to look. I wish I knew the thread where I tried to help before. Perhaps that could come in handy at least as a starting point.
Click to expand...
Click to collapse
No rush!
Let me know what files or screenshots you need to even think about it =)
Who knows.... this could lead to the UlTiMaTE WiPE & FOrMaT script to rule them all :silly: :good:
Ok so just to be clear you were on 2.0, then without wiping you flashed the ext4 dalvik moved mod. Then without wiping you flashed 2.2? After you flashed the ext4 dalvik moved mod, did you reboot before flashing 2.2, or just flash it right after the ext4 mod?
Fyi all versions of tob have the ext4 normal dalvik mod already built in. This may be where the issue came up. That is why i want to know exactly how you flashed the files.
cmlusco said:
Ok so just to be clear you were on 2.0, then without wiping you flashed the ext4 dalvik moved mod. Then without wiping you flashed 2.2? After you flashed the ext4 dalvik moved mod, did you reboot before flashing 2.2, or just flash it right after the ext4 mod?
Fyi all versions of tob have the ext4 normal dalvik mod already built in. This may be where the issue came up. That is why i want to know exactly how you flashed the files.
Click to expand...
Click to collapse
No. Here is what i did.
looked for new version of the ROM and downloaded it.
while it was downloading, I ran across the Convert2EXT4 mod and downloaded all of the files.
moved all my downloaded files to the SD card (ROM & mods)
factory wipe, then wiped system, datadata, data, cache, emmc, sd-ext.
flashed the rom ToB2.2
flashed the ext4 dalvik moved mod.
reboot
*** this is when i noticed something wrong because the phone sat on the splash screen for 30 minutes.
At this point I decided to un-do the mod and move things back to the way they were.
I flashed the mod to revert the change. The flash went fine with no reported errors.
Next, I wanted to start fresh so I format everything again. This is where my problem was evident.
/data & /cache could not be formatted. I rebooted and tried formatting again. No dice.
I moved forward with flashing the ToB2.2 ROM once again. No joy. It still won't boot.
This is where I am now.
I researched online and found "parted" . I believe this may be the solution but for some reason /cache will not unmount so i can format it.
I need a way to completely remove all partitions from the internal memory of the phone and re-create them.
Otherwise, I am semi-bricked
I hope this info clears up any questions :good:
CalvinAMi said:
No. Here is what i did.
looked for new version of the ROM and downloaded it.
while it was downloading, I ran across the Convert2EXT4 mod and downloaded all of the files.
moved all my downloaded files to the SD card (ROM & mods)
factory wipe, then wiped system, datadata, data, cache, emmc, sd-ext.
flashed the rom ToB2.2
flashed the ext4 dalvik moved mod.
reboot
*** this is when i noticed something wrong because the phone sat on the splash screen for 30 minutes.
At this point I decided to un-do the mod and move things back to the way they were.
I flashed the mod to revert the change. The flash went fine with no reported errors.
Next, I wanted to start fresh so I format everything again. This is where my problem was evident.
/data & /cache could not be formatted. I rebooted and tried formatting again. No dice.
I moved forward with flashing the ToB2.2 ROM once again. No joy. It still won't boot.
This is where I am now.
I researched online and found "parted" . I believe this may be the solution but for some reason /cache will not unmount so i can format it.
I need a way to completely remove all partitions from the internal memory of the phone and re-create them.
Otherwise, I am semi-bricked
I hope this info clears up any questions :good:
Click to expand...
Click to collapse
Ok that wasnt the problem then. Im not sure what causes this, but i have seen it several times before on different roms. Its always cache and data that seem to mess up. Any luck with parted? That thread is the only one i see where someone actually got it working right again. My only other sugestion would be to unlock your bootloader with htcdev, and then fastboot flash a misc img from froyo. Then run the froyo ruu thru hboot. I belive this is where the partition info is stored.
CalvinAMi said:
No. Here is what i did.
looked for new version of the ROM and downloaded it.
while it was downloading, I ran across the Convert2EXT4 mod and downloaded all of the files.
moved all my downloaded files to the SD card (ROM & mods)
factory wipe, then wiped system, datadata, data, cache, emmc, sd-ext.
flashed the rom ToB2.2
flashed the ext4 dalvik moved mod.
reboot
*** this is when i noticed something wrong because the phone sat on the splash screen for 30 minutes.
At this point I decided to un-do the mod and move things back to the way they were.
I flashed the mod to revert the change. The flash went fine with no reported errors.
Next, I wanted to start fresh so I format everything again. This is where my problem was evident.
/data & /cache could not be formatted. I rebooted and tried formatting again. No dice.
I moved forward with flashing the ToB2.2 ROM once again. No joy. It still won't boot.
This is where I am now.
I researched online and found "parted" . I believe this may be the solution but for some reason /cache will not unmount so i can format it.
I need a way to completely remove all partitions from the internal memory of the phone and re-create them.
Otherwise, I am semi-bricked
I hope this info clears up any questions :good:
Click to expand...
Click to collapse
Check post #7 on this thread below:
http://forum.cyanogenmod.org/topic/6433-solved-messed-up-partitions-on-internal-storage/
Fortunately, parted is loaded on recoveries now so it doesn't need to be pushed over so run these from adb shell in recovery.
Quoted below:
Now, we need to fix the partitions. This is assuming that the partitions are there, just the wrong format (which is what happened to me .. I accidentally made them FAT32 instead of ext). So, run the following: parted /dev/block/mmcblk0 mkfs ext2. It will ask if you want to continue, hit yes. When it asks for the partition number, enter 1. Next, when it asks for the format, enter ext2. Let it do its thing. Now, once it's done, run parted again. This time, enter partition 2 (everything else is the same).
Click to expand...
Click to collapse
Prior to trying to change anything, what is the output if you run parted /dev/block/mmcblk0 then type print as shown in post #11 from that thread?
Here is mine below:
Code:
~ # 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
Model: MMC HYNIX (sd/mmc)
Disk /dev/block/mmcblk0: 8095MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 8192B 797MB 797MB primary ext3
2 797MB 1007MB 210MB primary ext3
3 1007MB 8095MB 7088MB primary fat32 lba
tiny4579 said:
Check post #7 on this thread below:
http://forum.cyanogenmod.org/topic/6433-solved-messed-up-partitions-on-internal-storage/
Fortunately, parted is loaded on recoveries now so it doesn't need to be pushed over so run these from adb shell in recovery.
Quoted below:
Prior to trying to change anything, what is the output if you run parted /dev/block/mmcblk0 then type print as shown in post #11 from that thread?
Here is mine below:
Code:
~ # 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
Model: MMC HYNIX (sd/mmc)
Disk /dev/block/mmcblk0: 8095MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 8192B 797MB 797MB primary ext3
2 797MB 1007MB 210MB primary ext3
3 1007MB 8095MB 7088MB primary fat32 lba
Click to expand...
Click to collapse
I have been round and round with parted (post#4). It seems my '/cache' partition will not unmount :crying:
I hope we can figure this out :highfive:
Here is my 'print'
Code:
C:\Program Files (x86)\Android\android-sdk\platform-tools\DINC>adb devices
List of devices attached
HT132HJ00898 recovery
C:\Program Files (x86)\Android\android-sdk\platform-tools\DINC>adb shell
# 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) [B][COLOR="Blue"]print[/COLOR][/B]
print
print
[B][COLOR="DarkOrange"]Model: MMC SEM08G (sd/mmc)
Disk /dev/block/mmcblk0: 7944MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 8192B 797MB 797MB primary ext4
2 797MB 1007MB 210MB primary ext3
3 1007MB 7944MB 6937MB primary fat32 lba[/COLOR][/B]
(parted) [B][COLOR="Blue"]mkfs[/COLOR][/B]
mkfs
mkfs
Warning: The existing file system will be destroyed and all data on the
partition will be lost. Do you want to continue?
Yes/No? [B][COLOR="blue"]y[/COLOR][/B]
y
y
Partition number? [B][COLOR="blue"]1[/COLOR][/B]
1
1
File system type? [ext2]? [B][COLOR="blue"]ext2[/COLOR][/B]
ext2
ext2
[B][COLOR="Red"]Error: File system was not cleanly unmounted! You should run e2fsck. Modifying
an unclean file system could cause severe corruption.[/COLOR][/B]
Ignore/Cancel?[B][COLOR="Blue"] i[/COLOR][/B]
i
i
Error: File system has an incompatible feature enabled. Compatible features are
has_journal, dir_index, filetype, sparse_super and large_file. Use tune2fs or
debugfs to remove features.
You found a bug in GNU Parted! Here's what you have to do:
Don't panic! The bug has most likely not affected any of your data.
Help us to fix this bug by doing the following:
Check whether the bug has already been fixed by checking
the last version of GNU Parted that you can find at:
http://ftp.gnu.org/gnu/parted/
Please check this version prior to bug reporting.
If this has not been fixed yet or if you don't know how to check,
please visit the GNU Parted website:
http://www.gnu.org/software/parted
for further information.
Your report should contain the version of this release (1.8.8.1.179-aef3)
along with the error message below, the output of
parted DEVICE unit co print unit s print
and the following history of commands you entered.
Also include any additional information about your setup you
consider important.
Error: SEGV_MAPERR (Address not mapped to object)
Aborted
Preliminary results from using e2fsck
Code:
#[B][COLOR="Blue"]e2fsck[/COLOR][/B]
e2fsck
Usage: e2fsck [-panyrcdfvtDFV] [-b superblock] [-B blocksize]
[-I inode_buffer_blocks] [-P process_inode_size]
[-l|-L bad_blocks_file] [-C fd] [-j external_journal]
[-E extended-options] device
Emergency help:
-p Automatic repair (no questions)
-n Make no changes to the filesystem
-y Assume "yes" to all questions
-c Check for bad blocks and add them to the badblock list
-f Force checking even if filesystem is marked clean
-v Be verbose
-b superblock Use alternative superblock
-B blocksize Force blocksize when looking for superblock
-j external_journal Set location of the external journal
-l bad_blocks_file Add to badblocks list
-L bad_blocks_file Set badblocks list
#[B][COLOR="blue"]e2fsck /dev/block/mmcblk0[/COLOR][/B]
e2fsck /dev/block/mmcblk0
e2fsck 1.41.12 (17-May-2010)
e2fsck: Device or resource busy while trying to open /dev/block/mmcblk0
Filesystem mounted or opened exclusively by another program?
#[B][COLOR="blue"]e2fsck -p /dev/block/mmcblk0[/COLOR][/B]
e2fsck -p /dev/block/mmcblk0
e2fsck: Device or resource busy while trying to open /dev/block/mmcblk0
Filesystem mounted or opened exclusively by another program?
#
CalvinAMi said:
Preliminary results from using e2fsck
Code:
#[B][COLOR="Blue"]e2fsck[/COLOR][/B]
e2fsck
Usage: e2fsck [-panyrcdfvtDFV] [-b superblock] [-B blocksize]
[-I inode_buffer_blocks] [-P process_inode_size]
[-l|-L bad_blocks_file] [-C fd] [-j external_journal]
[-E extended-options] device
Emergency help:
-p Automatic repair (no questions)
-n Make no changes to the filesystem
-y Assume "yes" to all questions
-c Check for bad blocks and add them to the badblock list
-f Force checking even if filesystem is marked clean
-v Be verbose
-b superblock Use alternative superblock
-B blocksize Force blocksize when looking for superblock
-j external_journal Set location of the external journal
-l bad_blocks_file Add to badblocks list
-L bad_blocks_file Set badblocks list
#[B][COLOR="blue"]e2fsck /dev/block/mmcblk0[/COLOR][/B]
e2fsck /dev/block/mmcblk0
e2fsck 1.41.12 (17-May-2010)
e2fsck: Device or resource busy while trying to open /dev/block/mmcblk0
Filesystem mounted or opened exclusively by another program?
#[B][COLOR="blue"]e2fsck -p /dev/block/mmcblk0[/COLOR][/B]
e2fsck -p /dev/block/mmcblk0
e2fsck: Device or resource busy while trying to open /dev/block/mmcblk0
Filesystem mounted or opened exclusively by another program?
#
Click to expand...
Click to collapse
You can't run a filesystem check on a device level as there's no partition data there. To check /data or /cache you need to run:
e2fsck /dev/block/mmcblk0p1 for /data and
e2fsck /dev/block/mmcblk0p2 for /cache
Try to add -f to the list to force check such as e2fsck -pf /dev/block/mmcblk0p1
Edit:
I don't know if you'll be able to check /cache if it's mounted. What do you get from adb shell in recovery when you type umount /cache or try to unmount it from the recovery options?
Anyways, you should be able to run mkfs even with the partition being dirty.
I just thought of something. What if you type:
parted /dev/block/mmcblk0
then
rm 1 to delete the first partition?
Then rebuild the partition with mkpartfs primary ext2 8192B 797MB
Then exit out of parted with quit.
Then convert to ext3 with mke2fs -j /dev/block/mmcblk0p1
This process will wipe /data.
I tested this with partition 2 with a similar command.
If the phone still bootloops, do the following:
parted /dev/block/mmcblk0
rm 2
mkpartfs primary ext2 797MB 1007MB
mke2fs -j /dev/block/mmcblk0p2
The above steps will wipe /cache.
Hopefully you should be able to mount and unmount /cache after rebooting recovery.
My results
tiny4579 said:
You can't run a filesystem check on a device level as there's no partition data there. To check /data or /cache you need to run:
e2fsck /dev/block/mmcblk0p1 for /data and
e2fsck /dev/block/mmcblk0p2 for /cache
Try to add -f to the list to force check such as e2fsck -pf /dev/block/mmcblk0p1
***
C:\Program Files (x86)\Android\android-sdk\platform-tools\DINC>adb shell
~ # 2fsck -pf /dev/block/mmcblk0p1
e2fsck -pf /dev/block/mmcblk0p1
/dev/block/mmcblk0p1: recovering journal
e2fsck: unable to set superblock flags on /dev/block/mmcblk0p1
~ #
***
Edit:
I don't know if you'll be able to check /cache if it's mounted. What do you get from adb shell in recovery when you type umount /cache or try to unmount it from the recovery options?
***
C:\Program Files (x86)\Android\android-sdk\platform-tools\DINC>adb shell
~ # unmount /cache
unmount /cache
/sbin/sh: unmount: not found
~ #
***
Anyways, you should be able to run mkfs even with the partition being dirty.
I just thought of something. What if you type:
parted /dev/block/mmcblk0
then
rm 1 to delete the first partition?
Then rebuild the partition with mkpartfs primary ext2 8192B 797MB
Then exit out of parted with quit.
Then convert to ext3 with mke2fs -j /dev/block/mmcblk0p1
This process will wipe /data.
I tested this with partition 2 with a similar command.
***
~ # 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) rm 1
rm 1
rm 1
(parted) mkpartfs primary ext2 8192B 797MB
mkpartfs primary ext2 8192B 797MB
mkpartfs primary ext2 8192B 797MB
Warning: You requested a partition from 8192B to 797MB.
The closest location we can manage is 7680B to 7680B.
Is this still acceptable to you?
Yes/No? y
y
y
Error: File system too small for ext2.
(parted)
***
If the phone still bootloops, do the following:
parted /dev/block/mmcblk0
rm 2
mkpartfs primary ext2 797MB 1007MB
mke2fs -j /dev/block/mmcblk0p2
The above steps will wipe /cache.
Hopefully you should be able to mount and unmount /cache after rebooting recovery.
Click to expand...
Click to collapse
CalvinAMi said:
My results
Click to expand...
Click to collapse
Do a print from parted and tell me what you get.
Sent from my Galaxy Nexus using Tapatalk 2
Same results :silly:
Code:
C:\Program Files (x86)\Android\android-sdk\platform-tools\DINC>adb shell
# 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 SEM08G (sd/mmc)
Disk /dev/block/mmcblk0: 7944MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 8192B 797MB 797MB primary ext4
2 797MB 1007MB 210MB primary ext3
3 1007MB 7944MB 6937MB primary fat32 lba
Did you try the ruu from cmlusco? Also theres a link someone gave for fixing their partition issues.
Edit: here is a detailed guide and the one I'm talking about. I'm sure you're up to trying anything.
http://blog.swiftpassage.com/2013/02/03/htc-incredible-jelly-bean-nearly-bricked/
Sent from my Galaxy Nexus using Tapatalk 2
tiny4579 said:
Did you try the ruu from cmlusco? Also theres a link someone gave for fixing their partition issues.
Edit: here is a detailed guide and the one I'm talking about. I'm sure you're up to trying anything.
http://blog.swiftpassage.com/2013/02/03/htc-incredible-jelly-bean-nearly-bricked/
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
I didn't see any particular RUU posted by Cmlusco. I have run the stock RUU for Froyo & Gingerbread multiple time. No dice.
Also, that blog went through the same stuff i have tired. Result = /cache & /data are still mounted and not available to alter.
I did find an old back (stock+) for this phone. When I try to restore the backup I get:
Code:
Checking MD5 sums...
Erasing boot before restore...
Restoring boot image...
Restoring system...
Restoring data...
Error while formatting /data!
I am at my wits-end with this thing.
Shame the stock RUU can't remove the partitions entirely and recreate them.
Oh well. It might be time to just put this old Dinc on the shelf. :crying:
Did you ever fix this?
I think I am having a very similar problem. I had originally flashed convert2ext4_no_data_limit_normal_dalvik.zip on stock ROM a long time ago.
I have /cache, but no /data. It was the opposite earlier.

[Q&A] [Guide] CWM ReParted

Q&A for [Guide] CWM ReParted
Some developers prefer that questions remain separate from their main development thread to help keep things organized. Placing your question within this thread will increase its chances of being answered by a member of the community or by the developer.
Before posting, please use the forum search and read through the discussion thread for [Guide] CWM ReParted. If you can't find an answer, post it here, being sure to give as much information as possible (firmware version, steps to reproduce, logcat if available) so that you can get help.
Thanks for understanding and for helping to keep XDA neat and tidy!
ChronoMonochrome said:
CWM ReParted is a method of reparition internal SDcard via recovery using flashable zip. It was developed a few months ago, but the message about this method "lost" in a closed thread http://forum.xda-developers.com/showpost.php?p=54157635&postcount=129 so I decided to create separate thread.
It's only for custom (non-stock) based ROMs
Installation method
1) backup your /data partition and /sdcard
2) flash zip archive. It may take a while, be patient.
3) format /data, /cache and /sdcard
4) restore your data
5) swap storages via Novathor settings app
After repartition you'll have:
2,87 Gb on data
~320 Mb on cache (I didn't change cache partition size because I use F2FS and it needs to use more memory in /cache. Anyway, you can edit repartition script as you want)
~51 kb on UMS and HIDDEN
This script will not change your /system partition.
View attachment 2959869
Click to expand...
Click to collapse
First i would like to thank you for your contribution for our Ace devices. I would like to use your kernel with full f2fs, but the system partition is too small(approx. 600MB) to install GApps that i would like. Is there any way to enlarge system partition? Thank you
fada3 said:
First i would like to thank you for your contribution for our Ace devices. I would like to use your kernel with full f2fs, but the system partition is too small(approx. 600MB) to install GApps that i would like. Is there any way to enlarge system partition? Thank you
Click to expand...
Click to collapse
Temporarily there is no repartition script, that changes system partition. You can edit repartition.sh manually(remove system partition, change start/end positions of needed partitions and then create /system. don't forget then to name it "SYSTEM" - without quotes. There's no difference in which order you create partitions, just make sure that number of system is 3, data - 5, cache - 4, etc... ).
Make sure you have backup. To restore partition scheme flash stock with pit file.
P.s. if unsure, read this topic since repartition may be potentially dangerous.
http://forum.xda-developers.com/showthread.php?t=2596521
Increase UMS partition size
Hi! Can you tell me how do I edit the script to leave a little more storage on UMS (around 50-100MB) ? Thx for your reply!
Matteo90 said:
Hi! Can you tell me how do I edit the script to leave a little more storage on UMS (around 50-100MB) ? Thx for your reply!
Click to expand...
Click to collapse
Forget it, I pretty much figured it out after downloading a proper script editor, instead of messing around in notepad, lol.
By the way, these are the lines I edited in reparted.sh:
parted $MMC unit kb mkpart primary 3578036 3448836
parted $MMC name $CACHEFS CACHEFS
parted $MMC unit kb mkpart primary 747635 3578036
parted $MMC name $DATAFS DATAFS
parted $MMC unit kb mkpart primary 3448836 3948886
parted $MMC name $UMS UMS
Is it going to work as expected, or there's still something that needs editing?
Matteo90 said:
Is it going to work as expected, or there's still something that needs editing?
Click to expand...
Click to collapse
Code:
KB
641.729 SYSTEM System mkpart primary 105906 747635
2.971.202 DATAFS Data mkpart primary 747635 3718837
130.000 CACHEFS Cache mkpart primary 3718837 3848837
100 HIDDEN Hidden mkpart primary 3848837 3848937
100.000 UMS Int. SDCard mkpart primary 3848937 3948937
Made with my selfmade partition calculator - Call if you need other values...
Chrono's script is still full of (for you) unneeded parts (for automatic backup/recocvery) - mostly hashed and not active
This is a bit cleaned... Anyway.... It's @ChronoMonochrome work - So its his respekt...
EDIT - UPDATED - Now its correct...
Use an CWM Kernel... TWRP has no PARTED integrated
Code:
#!/sbin/sh
#-------------------------------------------------------------------#
# CWM ReParted for Codina #
#-------------------------------------------------------------------#
MMC=/dev/block/mmcblk0
CACHEFS=4
UMS=8
Fota=11
HIDDEN=9
SYSTEM=3
DATAFS=5
DEV_UMS=`mount | grep 'sdcard0' | cut -f 1 -d ' ' | grep 'dev'`
p=p
# unmount partitions
umount $DEV_UMS
umount $MMC$p$UMS
umount $MMC$p$Fota
umount $MMC$p$HIDDEN
umount $MMC$p$DATAFS
umount $MMC$p$SYSTEM
umount -l $MMC$p$CACHEFS
# remove partitions
parted $MMC rm $UMS
parted $MMC rm $Fota
parted $MMC rm $HIDDEN
parted $MMC rm $CACHEFS
parted $MMC rm $DATAFS
parted $MMC rm $SYSTEM
# rebuild SYSTEM
parted $MMC unit kb mkpart primary 105906 747635
# rebuild CACHEFS
parted $MMC unit kb mkpart primary 3718837 3848837
# rebuild DATAFS
parted $MMC unit kb mkpart primary 747635 3718837
# rebuild UMS
parted $MMC unit kb mkpart primary 3848937 3948937
# rebuild HIDDEN
parted $MMC unit kb mkpartfs primary ext2 3848837 3848937
# name partitions
parted $MMC name $SYSTEM SYSTEM
parted $MMC name $CACHEFS CACHEFS
parted $MMC name $DATAFS DATAFS
parted $MMC name $UMS UMS
parted $MMC name $HIDDEN HIDDEN
#
Please note that mkpart-part is in the order as the name-part.
The nameing right after mkpart results that DATAFS was not named correctly here... Don't know why...
Therefore I put the naming at the end...
And note that I've already SYSTEM in the script - This can be deleted if you do not need it....
Thank you, both you and Chrono! :good:
So all I have to do, is paste your script into reparted.sh, and everything will work like a charm.
One last question, though... Chrono wrote in his original post, that he left cache 320MB because F2FS needs it. If I plan on upgrading to F2FS in the future, is it better for me to leave it at 320 or the 130MB you calculated should be enough?
Matteo90 said:
Thank you, both you and Chrono! :good:
So all I have to do, is paste your script into reparted.sh, and everything will work like a charm.
One last question, though... Chrono wrote in his original post, that he left cache 320MB because F2FS needs it. If I plan on upgrading to F2FS in the future, is it better for me to leave it at 320 or the 130MB you calculated should be enough?
Click to expand...
Click to collapse
As you like... I'm also an full F2FS and have the minimum recommended for F2FS whioch is 130MB... This is setted in the script...
Don't know if 320 will imporve it or not - Never tested...
If you want to have the values with 320 on Cache - Here you are
Code:
641.729 SYSTEM System mkpart primary 105906 747635
2.781.202 DATAFS Data mkpart primary 747635 3528837
320.000 CACHEFS Cache mkpart primary 3528837 3848837
100 HIDDEN Hidden mkpart primary 3848837 3848937
100.000 UMS Int. SDCard mkpart primary 3848937 3948937
And dont forget to format partitions DATA CACHE (SYSTEM if changed) with the file system you want. Also format Int. SD Card with vfat/fat32.
Keep in mind that if you format SYSTEM with F2FS you would need an ROM.zip with adjusted mounting values (Chrono wrote it in this Kernel thread)
AND: Make this all with a Kernel with CWM (not TWRP) - No PARTED in TWRP...
fluffi444 said:
And dont forget to format partitions DATA CACHE (SYSTEM if changed) with the file system you want. Also format Int. SD Card with vfat/fat32.
Keep in mind that if you format SYSTEM with F2FS you would need an ROM.zip with adjusted mounting values (Chrono wrote it in this Kernel thread)
AND: Make this all with a Kernel with CWM (not TWRP) - No PARTED in TWRP...
Click to expand...
Click to collapse
Thanks, but F2FS is still in the future. I'm currently using ace2nutzer kernel, and I'm happy with it, won't convert to F2FS until his kernel supports it. But this adjusted mounting volumes has to do something with this repartitioning, or it's just the same thing Chrono wrote about in the F2FS installation tutorial in the third post of his kernel thread?
Also another noob question In your script, you put HIDDEN partition between CACHE and UMS, while in the original Chrono script HIDDEN is the last partition. Does it matter where this partition is?
Matteo90 said:
Thanks, but F2FS is still in the future. I'm currently using ace2nutzer kernel, and I'm happy with it, won't convert to F2FS until his kernel supports it. But this adjusted mounting volumes has to do something with this repartitioning, or it's just the same thing Chrono wrote about in the F2FS installation tutorial in the third post of his kernel thread?
Also another noob question In your script, you put HIDDEN partition between CACHE and UMS, while in the original Chrono script HIDDEN is the last partition. Does it matter where this partition is?
Click to expand...
Click to collapse
The ones were HIDDEN partition is between CACHE and UMS is only for values of each partition (c&p out of my Excel calculation file) - This is not the script...
The script beginns with #!/sbin/sh
And no - This is only for changing partition sizes...
fluffi444 said:
The ones were HIDDEN partition is between CACHE and UMS is only for values of each partition (c&p out of my Excel calculation file) - This is not the script...
The script beginns with #!/sbin/sh
And no - This is only for changing partition sizes...
Click to expand...
Click to collapse
Okay, I did it! Now I have 2.55GB on data, thanks to you guys!
Although I got an erron in CWM, saying "E:unknown volume for path [/sd-ext]", but after googling it, I read that it should not cause any problems.
Could please you go to CWM - Start ADB shell (from PC with USB attached)
and enter the following...
Code:
parted /dev/block/mmcblk0 unit kb print
Will also work from running Phone with ADB shell and SU
Code:
C:\ADB>adb shell
[email protected]:/ $ su
su
[email protected]:/ # parted /dev/block/mmcblk0 unit kb print
Please copy and post results - Just to be sure that everything was setted correctly
---------- Post added at 02:59 PM ---------- Previous post was at 02:57 PM ----------
Matteo90 said:
"E:unknown volume for path [/sd-ext]", but after googling it, I read that it should not cause any problems.
Click to expand...
Click to collapse
Did you format Internal SD (SDCARD0 in CWM) to vfat?
fluffi444 said:
Please copy and post results - Just to be sure that everything was setted correctly
---------- Post added at 02:59 PM ---------- Previous post was at 02:57 PM ----------
Did you format Internal SD (SDCARD0 in CWM) to vfat?
Click to expand...
Click to collapse
That's what it says:
Code:
C:\Users\Matt>adb shell
←7←[r←[999;999H←[[email protected]:/ $ su
su
←7←[r←[999;999H←[[email protected]:/ # parted /dev/block/mmcblk0 unit kb print
parted /dev/block/mmcblk0 unit kb print
sh: parted: not found
127|[email protected]:/ #
I did a system wipe, installed Rox 20141109 Rom and switched to ART in the meantime, could that be the problem?
Also, Internal SD was formatted as default, which I guess is FAT32. But that unknown volume error has since disappeared, CWM only gave that for the first reboot after repartitioning.
Arg. Parted is not Part of cm11. Please Do it from CWM....
Yes. If the error message is away and you have access then its Ok.
Gesendet von meinem GT-I8160P mit Tapatalk 2
fluffi444 said:
Arg. Parted is not Part of cm11. Please Do it from CWM....
Yes. If the error message is away and you have access then its Ok.
Gesendet von meinem GT-I8160P mit Tapatalk 2
Click to expand...
Click to collapse
From CWM it worked:
Code:
~ # parted /dev/block/mmcblk0 unit kb print
parted /dev/block/mmcblk0 unit kb print
Model: MMC SEM04G (sd/mmc)
Disk /dev/block/mmcblk0: 3959423kB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
10 524kB 1573kB 1049kB PIT
6 1573kB 3146kB 1573kB CSPSA FS
7 4194kB 14680kB 10486kB ext4 EFS
2 14680kB 31457kB 16777kB ext4 Modem FS
14 32506kB 34603kB 2097kB SBL
16 34603kB 36700kB 2097kB SBL_2
1 36700kB 53477kB 16777kB PARAM
12 53477kB 55575kB 2097kB IPL Modem
13 55575kB 72352kB 16777kB Modem
15 72352kB 89129kB 16777kB Kernel
17 89129kB 105906kB 16777kB Kernel2
3 105906kB 747635kB 641729kB ext4 SYSTEM
5 747635kB 3528837kB 2781202kB ext4 DATAFS
4 3528837kB 3848837kB 320001kB ext4 CACHEFS
8 3848837kB 3948837kB 100000kB fat32 UMS
9 3948837kB 3948937kB 99.8kB ext2 HIDDEN
~ #
Is everything all right?
Matteo90 said:
From CWM it worked:
Code:
~ # parted /dev/block/mmcblk0 unit kb print
parted /dev/block/mmcblk0 unit kb print
Model: MMC SEM04G (sd/mmc)
Disk /dev/block/mmcblk0: 3959423kB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
10 524kB 1573kB 1049kB PIT
6 1573kB 3146kB 1573kB CSPSA FS
7 4194kB 14680kB 10486kB ext4 EFS
2 14680kB 31457kB 16777kB ext4 Modem FS
14 32506kB 34603kB 2097kB SBL
16 34603kB 36700kB 2097kB SBL_2
1 36700kB 53477kB 16777kB PARAM
12 53477kB 55575kB 2097kB IPL Modem
13 55575kB 72352kB 16777kB Modem
15 72352kB 89129kB 16777kB Kernel
17 89129kB 105906kB 16777kB Kernel2
3 105906kB 747635kB 641729kB ext4 SYSTEM
5 747635kB 3528837kB 2781202kB ext4 DATAFS
4 3528837kB 3848837kB 320001kB ext4 CACHEFS
8 3848837kB 3948837kB 100000kB fat32 UMS
9 3948837kB 3948937kB 99.8kB ext2 HIDDEN
~ #
Is everything all right?
Click to expand...
Click to collapse
Not 100% - Because HIDDEN and UMS should be changed (their place on NAND) - But the most impotrant (Partition Nrs) are correct...
Did you used the script? Each commant has to be eactly at his correct place...
http://forum.xda-developers.com/showpost.php?p=56755086&postcount=6
fluffi444 said:
Not 100% - Because HIDDEN and UMS should be changed (their place on NAND) - But the most impotrant (Partition Nrs) are correct...
Did you used the script? Each commant has to be eactly at his correct place...
http://forum.xda-developers.com/showpost.php?p=56755086&postcount=6
Click to expand...
Click to collapse
I edited Chrono's script with your values, but he left HIDDEN at the end, so I figured it would be better if I do the same.
Is it going to cause any problems? What is HIDDEN used for, by the way?
Matteo90 said:
I edited Chrono's script with your values, but he left HIDDEN at the end, so I figured it would be better if I do the same. Is it going to cause any problems? What is HIDDEN used for, by the way?
Click to expand...
Click to collapse
Never tried Chrono's script. Mine is tested (from me) with my phone and it gives me the 100% original partition order as it was originally.
This is an 100% original layout...unmodified... (left out the parts of no interest)
Code:
3 106MB 748MB 642MB ext4 SYSTEM
5 748MB 2056MB 1309MB ext4 DATAFS
4 2056MB 2377MB 321MB ext4 CACHEFS
9 2377MB 2713MB 336MB ext4 HIDDEN
11 2713MB 2765MB 52,4MB Fota
8 2765MB 3949MB 1184MB fat32 UMS
BUT - I would leave yours as it is...
As I said - Its important that partition no's and names are correct... And they are for you...
I don't think that there will be a noticeable difference...
HIDDEN is not really needed in CM11. But if its not there some reported that CM11 does not boot.
Therefore its there - but as small as it can be...some KBs... To be sure I choosed 100KB.
If I remember correctly PRELOAD was on HIDDEN on JB...
Okay then! Thanks @fluffi444 for all the support on this matter! :highfive:
Hello everybody! I'm do the repart about the guide but now I have got 2.64 GB in internal storage.This is normal? And when I try to do download apps or games from Play Store,I have an error message:"couldn't install on USB Storage or SD card".How to fix that? ROM:cm11 by poppmensa
Sorry for my bad english.

[Q] How to increase partition size on my redmi 1s?

I flashed Yirom on my redmi 1s yesterday and i downloaded PA's GOOGLE STOCK GAPPS PACKAGE (~437MB) to flash with it.But the problem is that the system partition size on my device is too small to flash this GAPPS package and I DON'T WANT TO FLASH ANY OTHER GAPPS PACKAGE. So if anyone here could help me increase the partition size of my redmi 1s without any risks of bricking my device then I would really appreciate it.
I've TWRP recovery installed and there is no other data in my internal memory.Also I don't want to partition my external SD card's space.
Thanks in advance.
I also wanted to resize the system partition by reducing cache.
I thought fdisk can help but it does not work gpt style partitions. We needed gpt-fdisk.
Go here
however, no use of extending system partition... our redmi 1s has around 800 MB system partition..i repartitioned couple of times n extended it to 2gigs by taking some space from data partition.. but still u will get that insufficient error if u flash stock pa lp gapps... but u can flash full pa lp gapps over mokee lp (not cm12) with having even 1 gig of system partition..worked for me... rest couple of apps u can install manually... go to pa gapps for lollipop thread... read point 5 in post 3...
This is an old thread, but this is a good, v cheap (under £70 new) phone and it's one of the top finds on Google for resize redmi s1 system partition, I've just done one for my OH so I thought I share.
Here goes, this is the exact specific instructions for resizing the redmi s1 system partition 400mb larger which you will need to do if you want to run Android 6 with GAPPS, as even pico GAPPS is too big.
You'll need a PC with USB port running the ADB drivers, get them here.
a factory reset Redmi 1S with nothing but custom recovery, easily installed from within the MIUI updater
a micro SD card with you choice of ROM (Mokee 6.0.1 is very good indeed) and GAPPS (nano is fine, pico may not be) zip files
Boot the phone to recovery (power and volume up)
Attach the USB lead from the PC to the phone
Open a CMD prompt (Windows) or whatever if you use Linux/Mac.
Type
Code:
adb devices
adb shell
parted /dev/block/mmcblk0
unit MB
print
and you should see this, as you can see the system partion is just 800mb, not enough! But we have 6gb of user data space which is more than ample.
So we need to delete partions 27, 28 and 29 and recreate them with system 400mb larger and user data 400mb smaller, name them and make them ext4 format again.
Code:
rm 27
rm 28
rm 29
mkpartfs primary ext2 336 1574
mkpartfs primary ext2 1574 1977
mkpartfs primary ext2 1977 7818
name 27 system
name 28 cache
name 29 userdata
print
quit
should get this, all going well.
then
Code:
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
tune2fs -j /dev/block/mmcblk0p28
e2fsck -fDp /dev/block/mmcblk0p28
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p28
e2fsck -fDp /dev/block/mmcblk0p28
tune2fs -j /dev/block/mmcblk0p29
e2fsck -fDp /dev/block/mmcblk0p29
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p29
e2fsck -fDp /dev/block/mmcblk0p29
parted /dev/block/mmcblk0
unit MB
print
quit
will get this.
REBOOT your phone to recovery (any attempt to do anything beforehand will fail with unable to mount errors) and flash your ROM and GAPPS.
All done!

Categories

Resources