[Q]: repartitioning hiccup [solved] - Kindle Fire Q&A, Help & Troubleshooting

Ok, I posted this question in 2 other threads that had info on the process (will delete the posts when this one goes live), but no responses after a couple of days. One of them is old though.
I have TWRP 2.1.1 installed. ADB seems to be working normally. Superuser is working fine after booting to android. I'm running a custom ICS ROM (Energy); read that stock ROM can cause issues repartitioning.
I started with this How-to as it looked very straight forward.
I start throwing the commands at ADB and here's what I got for my efforts:
Code:
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell
~ # su
su
/sbin/sh: su: not found
~ # cd /data
cd /data
/data # ls
ls
/data #
decided to go ahead and check the mount command:
Code:
~ # mount
mount
rootfs on / type rootfs (rw)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
~ #
and parted just for giggles:
Code:
~ # parted /dev/block/mmcblk0
parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
print
Model: MMC MMC08G (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 11.0MB 10.5MB dkernel
4 11.0MB 212MB 201MB ext4 dfs
5 212MB 229MB 16.8MB recovery
6 229MB 296MB 67.1MB ext4 backup
7 296MB 307MB 10.5MB boot
8 307MB 312MB 5243kB ext4 splash
9 312MB 849MB 537MB ext4 system
10 849MB 2041MB 1192MB ext4 userdata
11 2041MB 2309MB 268MB ext4 cache
12 2309MB 7690MB 5380MB fat32 media
(parted)
Ok, so that much worked. Now I tried to shrink 12 so I could double the size of 9. I want to get Switchme set up for his/her profiles and 500MB just isn't going to cut it.
That's when I hit a brick wall:
Code:
(parted) resize 12 2846 7690
resize 12 2846 7690
resize 12 2846 7690
Error: Unable to satisfy all constraints on the partition.
(parted)

One thing that jumps out at me right away is this:
Code:
adb shell
~ # su
su/sbin/sh: su: not found
It seems you are not actually rooted.
To check, enter:
Code:
adb shell
ls /system/xbin
If you don't see "su" in the list, then you don't have root permissions, which would probably prevent you from doing what you need to accomplish.

That's what I was wondering, but apps are able to ask for and receive root permission from within the ROM. SU does exist, just not where the shell is looking when in recovery.
Code:
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell
~ # ls /system/xbin
ls /system/xbin
ls: /system/xbin: No such file or directory
~ #
I did an ls /system/xbin from adb shell and from Terminal Emulator within Android and both returned a long list containing SU.

TWRP provides an unsecured (unsecure? insecure?) boot. Whatever the terminology, it gives you immediate access to root privileges. Apparently CWMR (which was used in the OP of the thread you used) does not and so that author had to use su. For TWRP, it's not necessary and not even available. You already have root privileges as indicated by the hash prompt.
I tried resizing my /sdcard partition and it worked fine with the command you tried. I'm not sure what's going on with your storage device that it wouldn't resize it for you. At first I thought it might be mounted, but your mount command shows otherwise and parted gave me a different error when I had it mounted.
I don't know if this is going to help you, but you might try giving it the "MB" suffix in your numbers....
Code:
resize 12 2846MB 7690MB
Maybe even try changing units to bytes and giving the resize command byte sized boundaries.
Code:
unit B
print
will show you the numbers in bytes and you'd have to use the "B" suffix as in the "MB" example above.
If none of that works, you can always remove and remake the partition. For example...
Code:
rm 12
mkpartfs primary fat32 <start> <end>
name 12 media
You'd obviously need to insert acceptable boundaries for the start and end into that command. It might even be easier to just remove all 9, 10, 11, and 12 and remake/rename them, but remember 9, 10, and 11 are ext4 filesystems so the above mkpartfs command needs to be tweaked accordingly.
One thing I noticed while I was experimenting with the partition table this morning... all of the existing partitions have been allocated in 128MB chunks. I have no idea if this affects performance. I'd imagine you'd only need to stick to the 512B sector sizes, but you might want to stay with those conventions if it's not too inconvenient for you.
If you mess up the partition table, you can always go back to fastboot mode in FFF and use the...
Code:
fastboot oem format
feature to bring your partition table back to stock.
Good luck.

Wow, excellent response. Just the kind of detail I was hoping to get and it confirmed a few suspicions I had while searching the kindle threads. I'll report back on my degree of success when I get some free time to tinker.
I have a nandroid backup (also saved to PC) just in case and saved the partition table as-found. If everything gets hosed and I do an oem format I can just restore that and go or try from square one again, yes?
Sent from my TBolt with the XDA App using 1 opposable thumb

ProfEngr said:
Wow, excellent response. Just the kind of detail I was hoping to get and it confirmed a few suspicions I had while searching the kindle threads. I'll report back on my degree of success when I get some free time to tinker.
I have a nandroid backup (also saved to PC) just in case and saved the partition table as-found. If everything gets hosed and I do an oem format I can just restore that and go or try from square one again, yes?
Sent from my TBolt with the XDA App using 1 opposable thumb
Click to expand...
Click to collapse
I'd say that's a safe bet. Just be very careful about handling partitions 1 and 2 because those two are critical to getting anything to boot on your device. As long as you don't touch the xloader in partition 1 and have FFF installed in partition 2, you can rebuild the rest of it.... in theory. I only say "in theory" because I've never actually had to do it, but I don't see why it wouldn't work.
A couple of additional things I figured out after you put me to work with parted....
It looks like parted doesn't know how to make an ext4 filesystem, so mkpartfs balks if you tell it to make one. You'll have to use mkpart which just makes the partition, but not the filesystem. Then exit out of parted and use mke2fs, which despite its name knows how to make an ext4 filesystem. Like this for the cache partition...
Code:
mke2fs -T ext4 /dev/block/mmcblk0p11
The other thing is that parted sets a "msftres" flag on the fat32 filesystem it makes. The flag apparently is to tell the OS that it's reserved for Windows, or something like that. I didn't have a problem mounting in Linux and MacOS X, but the stuff I've read seems to indicate that older OS's have a problem with it. Unfortunately, the version of busybox on TWRP doesn't have a module to make a fat32 filesystem. I'm looking around to see how to get around that.
In any case, this should get you most of the way there. I'll followup if I find something out.

Ok. I used to run n*x, but use only M$ right now. Haven't touched a 'mac' since Jr High (IIgs)
Sent from my TBolt with the XDA App using 1 opposable thumb

ProfEngr said:
Ok. I used to run n*x, but use only M$ right now. Haven't touched a 'mac' since Jr High (IIgs)
Sent from my TBolt with the XDA App using 1 opposable thumb
Click to expand...
Click to collapse
I have a IIgs sitting in the basement... but it's not a mac, it's an Apple ][.
Found the last piece...
Code:
/system/bin/newfs_msdos /dev/block/mmcblk0p12
will make a fat32 filesystem correctly. I think that's all you'll need.
EDIT: OK, I must have been half asleep when I posted the above. That binary is on the stock system software I had mounted. There's nothing on TWRP to create a fat32 filesystem correctly.

Yeah, ][e was my first computer that didn't crash at the drop of a keystroke. Had an Adam tape drive model, but it froze up constantly.
Sent from my TBolt with the XDA App using 1 opposable thumb

So, I met with success following the repartition thread and tweaking it with your suggestions. I didn't quite move and many MB around as I thought, but it was enough to move me a little farther down the road with SwitchMe. At least it doesn't tell me I don't have enough memory for a 2nd profile now.
I still think it has issues with ICS or EnergyROM itself. When I created a new profile and rebooted to it I was stuck on Nova launcher instead of GO like the main profile. Strange.
I'll consider this thread to have fulfilled its usefulness. Thanks again for the help.

no device found
ProfEngr said:
So, I met with success following the repartition thread and tweaking it with your suggestions. I didn't quite move and many MB around as I thought, but it was enough to move me a little farther down the road with SwitchMe. At least it doesn't tell me I don't have enough memory for a 2nd profile now.
I still think it has issues with ICS or EnergyROM itself. When I created a new profile and rebooted to it I was stuck on Nova launcher instead of GO like the main profile. Strange.
I'll consider this thread to have fulfilled its usefulness. Thanks again for the help.
Click to expand...
Click to collapse
I get
(parted)
Error: No device found
Retry/Cancel

Related

[Q] How to repartition KindleFire

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

Unable to mount data & cache

Hi all, got my kindle fire brick. I think my partition is messed up. I bought a factory cable which able me to install twrp and i succefully(i guess) flashed energy ICS. But it prompt me "e:unable to mount '/data" e:unable to mount '/cache". I were to boot to normal boot it will just boot endlessly but i still can access to fff and twrp.i did some research on repartitioning for kindle fire but i need some guidance. Help is much appreciated
Sent from my GT-I9100 using xda app-developers app
Usually this is a fairly bad indication but do this go to the mount section in twrp and make sure there are no checks in the boxes of data and system if so uncheck them, I know you said data and cache but this should have a check in the box then try a reboot also were you previously using cwmr? If so you may have been bitten by the bug a very unsightly one that generally means the death of your kindle unless you know how to repartition around a broken emmc. What did you do prior to this that caused this to happen?
Also energy is not the best for good mounting just saying...
I was using fireparted to backup my partition when my pc suddenly shut down. Thats when everything screws up. Also my data and cache are not able to check or uncheck. I hope theres a kind soul to guide me through this process
Sent from my GT-I9100 using xda app-developers app
If you ask me I would say its toast but maybe someone knows a way to restore factory partitions I know many are looking for a solution for thier parts only kindle....
From what I understand...
Code:
fastboot oem format
...will rewrite your partition table to stock. And as long as you haven't messed with the partition sizes, your data will stay intact.
Enter:
Code:
shell cat /proc/partitions
To get a list of your current partitions and sizes to check to see if they even exist to begin with. And if so, it's likely just a case of broken or missing mountpoints.
Now, whether or not "fastboot oem format" will restore broken or missing mountpoints, I couldn't tell you for sure; I've never had to try it. But in your situation, it probably couldn't hurt to try.
You can also recreate mountpoints manually if needed.
[Edit:] It has just been explained to me that "fastboot oem format" won't do anything about mountpoints.
Assuming you can get into TWRP and run adb shell, execute the following command...
Code:
adb shell parted /dev/block/mmcblk0 unit b print
Note: version 2.2.0 is missing the parted binary, so you'll need to use 2.1.1
This will give you a detailed layout of your storage device and the filesystems for each partition. I'm running from memory here, but the right column should show the filesystem types it sees for that particular partition. For userdata (which is mounted as data) and cache, those should be ext4. If you don't see that, you need to remake those partitions.
Code:
adb shell mke2fs -T ext4 /dev/block/mmcblk0p10
adb shell mke2fs -T ext4 /dev/block/mmcblk0p11
Then you can repeat the parted command above and see if the commands worked. If the commands were successful, you can use the mount command or it's probably easier to just reboot into TWRP and it should do it automatically.
kinfauns said:
Assuming you can get into TWRP and run adb shell, execute the following command...
Code:
adb shell parted /dev/block/mmcblk0 unit b print
Note: version 2.2.0 is missing the parted binary, so you'll need to use 2.1.1
This will give you a detailed layout of your storage device and the filesystems for each partition. I'm running from memory here, but the right column should show the filesystem types it sees for that particular partition. For userdata (which is mounted as data) and cache, those should be ext4. If you don't see that, you need to remake those partitions.
Code:
adb shell mke2fs -T ext4 /dev/block/mmcblk0p10
adb shell mke2fs -T ext4 /dev/block/mmcblk0p11
Then you can repeat the parted command above and see if the commands worked. If the commands were successful, you can use the mount command or it's probably easier to just reboot into TWRP and it should do it automatically.
Click to expand...
Click to collapse
Pardon me for my Noob-ness, are the code to be execute on pc or on TWRP?
dean11 said:
Pardon me for my Noob-ness, are the code to be execute on pc or on TWRP?
Click to expand...
Click to collapse
Step back a bit and figure out how all of these things work together by reading the first 3 posts here...
http://forum.xda-developers.com/showthread.php?t=1552547
It will be a lot easier for you to understand what you are doing and why you are doing them. It will also explain how and where to run the commands.
kinfauns said:
Step back a bit and figure out how all of these things work together by reading the first 3 posts here...
http://forum.xda-developers.com/showthread.php?t=1552547
It will be a lot easier for you to understand what you are doing and why you are doing them. It will also explain how and where to run the commands.
Click to expand...
Click to collapse
OH MY GOOOOD!!!! MY KINDLE IS ALIVE!!!! THANK YOU SO MUCH @kinfauns!
kinfauns said:
Assuming you can get into TWRP and run adb shell, execute the following command...
Code:
adb shell parted /dev/block/mmcblk0 unit b print
Note: version 2.2.0 is missing the parted binary, so you'll need to use 2.1.1
This will give you a detailed layout of your storage device and the filesystems for each partition. I'm running from memory here, but the right column should show the filesystem types it sees for that particular partition. For userdata (which is mounted as data) and cache, those should be ext4. If you don't see that, you need to remake those partitions.
Code:
adb shell mke2fs -T ext4 /dev/block/mmcblk0p10
adb shell mke2fs -T ext4 /dev/block/mmcblk0p11
Then you can repeat the parted command above and see if the commands worked. If the commands were successful, you can use the mount command or it's probably easier to just reboot into TWRP and it should do it automatically.
Click to expand...
Click to collapse
I have the similar situation.
And when I use "parted" to check my kidle partition, there is no cache, and the userdata is ext2.
Number Start End Size File system Name Flags
1 131072B 262143B 131072B xloader
2 262144B 524287B 262144B bootloader
3 524288B 11010047B 10485760B dkernel
4 11010048B 212336639B 201326592B ext4 dfs
5 212336640B 229113855B 16777216B recovery
6 229113856B 296222719B 67108864B ext4 backup
7 296222720B 306708479B 10485760B boot
8 306708480B 311951359B 5242880B ext4 splash
9 311951360B 848822271B 536870912B ext4 system
10 848822272B 849000447B 178176B ext2 userdata
12 2448000000B 7748000255B 5300000256B fat32 media msftres
When I use the mke2fs to change the file system type, it returns this error
Not enough space to build proposed filesystem while setting up superblock.
Please help!
Thank you in advance!
june12 said:
I have the similar situation.
And when I use "parted" to check my kidle partition, there is no cache, and the userdata is ext2.
Number Start End Size File system Name Flags
1 131072B 262143B 131072B xloader
2 262144B 524287B 262144B bootloader
3 524288B 11010047B 10485760B dkernel
4 11010048B 212336639B 201326592B ext4 dfs
5 212336640B 229113855B 16777216B recovery
6 229113856B 296222719B 67108864B ext4 backup
7 296222720B 306708479B 10485760B boot
8 306708480B 311951359B 5242880B ext4 splash
9 311951360B 848822271B 536870912B ext4 system
10 848822272B 849000447B 178176B ext2 userdata
12 2448000000B 7748000255B 5300000256B fat32 media msftres
When I use the mke2fs to change the file system type, it returns this error
Not enough space to build proposed filesystem while setting up superblock.
Please help!
Thank you in advance!
Click to expand...
Click to collapse
I don't know who or what did that to your partition table, but partitions 10-12 are not right. It looks like mke2fs is complaining because your userdata partition is only ~178KB. I'm also a bit concerned that you've extended the media partition as far as you have. You might have some additional problems there.
The easiest way for you to get started on a fix is to get into fastboot mode with FFF and run...
Code:
fastboot oem format
That will bring your partition table back to stock, so you can run those mke2fs commands to remake those filesystems on the two partitions. You'll also have to remake the media partition in parted. You can find some instructions on how to do that here...
http://forum.xda-developers.com/showthread.php?t=1658885
Hey,
My current ROM is fine, but I can't mount data & cache in TWRP.
Nothing happens when I click mount data or mount cache in TWRP 2.6.3.1
I reflashed twrp two times and checked the md5sum.
When I try to backup my rom:
When I try a factory reset:
This is what I tried in fastboot:
Code:
fastboot oem format
...
OKAY [ 0.064s]
finished. total time: 0.065s
fastboot oem idme bootmode 4000
...
OKAY [ 0.081s]
finished. total time: 0.081s
fastboot reboot
rebooting...
finished. total time: -0.000s
adb shell cat /proc/partitions
major minor #blocks name
7 0 8348 loop0
179 0 7553024 mmcblk0
179 1 128 mmcblk0p1
179 2 256 mmcblk0p2
179 3 10240 mmcblk0p3
179 4 196608 mmcblk0p4
179 5 16384 mmcblk0p5
179 6 65536 mmcblk0p6
179 7 10240 mmcblk0p7
179 8 5120 mmcblk0p8
179 9 524288 mmcblk0p9
179 10 1164288 mmcblk0p10
179 11 262144 mmcblk0p11
179 12 5254144 mmcblk0p12
179 64 512 mmcblk0boot1
179 32 512 mmcblk0boot0
254 0 8347 dm-0
The parted command isn't working for me.
I have never repartitioned them as far as I know.
Wha't wrong with my partitions?

Still Stuck on TWRP, but now able to see device via Linux!

Hey all,
So I was able to run KFU and it got me stuck on the boot screen. Got help with that and was able to run KFU again but it got stuck on removing boot check and now I'm stuck with the TWRP homescreen.
My device was recognized in device manager but in the KFU it says ADB Status: Offline and Boot Status Unknown. ADB Device List is empty.
I am unable to mount the device from TWRP it keeps failing. I am also unable to mount the sdcard partition what-so-ever.
Pooch sent me info on how to boot up via usb drive into Linux (Mint) and I can find the device in the adb device list but I am not familiar enough with Linux to know how to push the ROM to the device as well as a better/newer version of TWRP. Any help in this would be greatly appreciated. Thanks.
I sent you full instructions on how to proceed in a pm the reason I chose that system is because its nice and small it will get you going.. you only have 150 mb to work with follow instructions and you should be fine
Issues persist
Hello! So, I was able to detect my device via adb in Linux with the help of ThePooch. (thanks a bunch!!!) However we have a small problem.
I am unable to mount my SD Card partition in TWRP at all. I wasn't sure why so we tried a bunch of stuff: We tried pushing a ROM, We tried mounting it via adb in terminal on Linux... We tried "fastboot oem format"... We tried adb shell echo /dev/block/mmcblk0p12 >> /sys/devices/platform/usb_mass_storage/lun0/file
We tried updating the recovery to TWRP 2.2.2.0.
We tried a lot of things however we were very unsuccessful in this and I am still unable to click "Mount SD Card" in TWRP or format it or wipe it.
What's confusing is that I was able to push files (zips) to the sd card temporarily and see them when we click "install" on TWRP however they fail to install and anything pushed to the sd card is, or course, erased on rebooting.
Really don't know what to do at this point as I am at a loss and would appreciate any assistance in this. Thanks so much!
Boot into recovery and enter:
Code:
adb shell
parted /dev/block/mmcblk0
print
...and post the results here.
soupmagnet said:
Boot into recovery and enter:
Code:
adb shell
parted /dev/block/mmcblk0
print
...and post the results here.
Click to expand...
Click to collapse
Model: MMC MMC08G (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 11.0MB 10.5MB dkernel
4 11.0MB 212MB 201MB ext4 dfs
5 212MB 229MB 16.8MB recovery
6 229MB 296MB 67.1MB ext4 backup
7 296MB 307MB 10.5MB boot
8 307MB 312MB 5243kB ext4 splash
9 312MB 849MB 537MB ext4 system
10 849MB 2041MB 1192MB ext4 userdata
11 2041MB 2309MB 268MB ext4 cache
12 2309MB 7690MB 5380MB media
hmm wish I knew what I was looking at it looks to me like some things still exist even after a full wipe if I`m reading it correct glad soup knows what to look for
sphinxdog said:
Really don't know what to do at this point as I am at a loss and would appreciate any assistance in this. Thanks so much!
Click to expand...
Click to collapse
I've ran into this a couple of times and what I usually do is to delete the "media" partition, create it again with parted, name it "media", and then finally let the stock Kindle Fire recovery repair it. You may be able to skip the delete/create part and just boot into the stock recovery to see if it can repair it.
probably would work if in fact he had a working system but there isnt a bootable one at least..
Code:
Model: MMC MMC08G (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 11.0MB 10.5MB dkernel
4 11.0MB 212MB 201MB ext4 dfs
5 212MB 229MB 16.8MB recovery
6 229MB 296MB 67.1MB ext4 backup
7 296MB 307MB 10.5MB boot
8 307MB 312MB 5243kB ext4 splash
9 312MB 849MB 537MB ext4 system
10 849MB 2041MB 1192MB ext4 userdata
11 2041MB 2309MB 268MB ext4 cache
12 2309MB 7690MB 5380MB media
Thepooch said:
hmm wish I knew what I was looking at it looks to me like some things still exist even after a full wipe if I`m reading it correct glad soup knows what to look for
Click to expand...
Click to collapse
The 'parted' program manipulates the partition table, which basically tells the device how the storage partitions are laid out. The 'print' command used to obtain the output above just displays the information stored in the partition table. I set the output in CODE so it's easier to read. The bottom portion of the data is the more interesting part and you can see the column names there...
Number - This is the partition number. You may have seen "/dev/block/mmcblk0p5" in the past referring to the recovery partition. That number after the letter 'p' refers to the partition number.
Start - This is the offset value for where the partition begins.
End - This is the offset value for where the partition ends.
Size - This is the size of the partition calculated by the difference of the two offset values above. Imagine a ruler where your "Start" offset is the 1 inch tick mark and your "End" offset is the 6 inch tick mark. The "Size" between the tick marks... 6 - 1 is 5.
File system - This is how the partition has been formatted... ext4 is a commonly used filesystem for linux. It's blank if parted doesn't recognize the filesystem type or none has been specified.
Name - The name given to the partition. You'll recognize some as ones you've used to refer to these partitions in fastboot. FYI, userdata typically gets mounted to /data and media gets mounted to /sdcard.
Flags - Used to indicate special characteristics of the filesystem.
The significant part of the output above is the missing filesystem for the media partition. It should have a fat32 filesystem. I'll leave it to soupmagnet to explain how to fix it.
kinfauns said:
The significant part of the output above is the missing filesystem for the media partition. It should have a fat32 filesystem.
Click to expand...
Click to collapse
As always, kinfains is correct. I've dealt with an issue similar to this on my own device pretty recently, so I knew immediately what we'd be dealing with. So you're going to remove, recreate and repartition your sdcard and then you'll be all set. Needless to say, any data on your sdcard will be lost, if it isn't already. Not to worry though, considering everything you have gone through up until this point, this part should be pretty painless.
Code:
adb shell
parted /dev/block/mmcblk0
rm 12
mkpartfs primary fat32 2309 7690
name 12 media
quit
mount /sdcard
exit
adb reboot
You may not need to reboot, but in my case, I did. You'll then be able to mount your sdcard over USB, or use "adb push" to transfer a ROM to flash in recovery. Just remember to wipe System and "Factory Reset" in recovery first, or you may very well find yourself in the exact same situation as before.
Have fun.
SUCCESS!!!! That took care of it! And I was able to load up the ROM with no problem. Thanks for all the help ThePooch & SoupMagnet!!!
Sent from my Kindle Fire using xda app-developers app

[HOW TO] Check your filesystem (a la 'fsck')

I've been having lots of trouble with my SD and local filesystems getting corrupted, which in turn has been causing the flush-179 process to go ballistic (100% CPU loop, reboot hangs, etc.). If only there was a way to run a quick FSCK(8) on my Android's unmounted filesystems to check for problems. Well, there is!
This may be old, old news to some of the more seasoned OS hackers, so please be kind with any negative feedback about it being intuitively obvious. It wasn't to me, but after some research and testing, I've come up with these simple steps:
Boot into Recovery
Connect via USB to ADB shell
Code:
C:\Scratch\Android> [B]adb devices[/B]
C:\Scratch\Android> [B]adb shell[/B]
Mount /system and /data to determine the /dev/block names, then umount each
Code:
~ # [B]mount /system[/B]
~ # [B]mount /data[/B]
~ # [B]df[/B]
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 308620 64 308556 0% /dev
/dev/block/mmcblk0p27
295509 121021 159231 43% /cache
/dev/block/mmcblk0p26
1184268 848052 276060 75% /data
/dev/block/mmcblk0p25
562384 461416 72400 86% /system
~ # [B]umount /system[/B]
~ # [B]umount /data[/B]
Run e2fsck against each /dev/block filesystem
Code:
~ # [B]e2fsck -n /dev/block/mmcblk0p25[/B]
e2fsck 1.41.6 (30-May-2009)
/dev/block/mmcblk0p25: clean, 4168/35760 files, 117605/142847 blocks
~ # [B]e2fsck -n /dev/block/mmcblk0p26[/B]
e2fsck 1.41.6 (30-May-2009)
/dev/block/mmcblk0p26: clean, 7173/75200 files, 216745/300799 blocks
~ #
The 'e2fsck' command takes the same command-line switches as UNIX FSCK(8), so you can be as creative and daring as you need.
- Dave
some help
ViperGeek said:
I've been having lots of trouble with my SD and local filesystems getting corrupted, which in turn has been causing the flush-179 process to go ballistic (100% CPU loop, reboot hangs, etc.). If only there was a way to run a quick on my Android's unmounted filesystems to check for problems. Well, there is!
This may be old, old news to some of the more seasoned OS hackers, so please be kind with any negative feedback about it being intuitively obvious. It wasn't to me, but after some research and testing, I've come up with these simple steps:
Boot into Recovery
Connect via USB to ADB shell
Code:
C:\Scratch\Android> [B]adb devices[/B]
C:\Scratch\Android> [B]adb shell[/B]
Mount /system and /data to determine the /dev/block names, then umount each
Code:
~ # [B]mount /system[/B]
~ # [B]mount /data[/B]
~ # [B]df[/B]
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 308620 64 308556 0% /dev
/dev/block/mmcblk0p27
295509 121021 159231 43% /cache
/dev/block/mmcblk0p26
1184268 848052 276060 75% /data
/dev/block/mmcblk0p25
562384 461416 72400 86% /system
~ # [B]umount /system[/B]
~ # [B]umount /data[/B]
Run e2fsck against each /dev/block filesystem
Code:
~ # [B]e2fsck -n /dev/block/mmcblk0p25[/B]
e2fsck 1.41.6 (30-May-2009)
/dev/block/mmcblk0p25: clean, 4168/35760 files, 117605/142847 blocks
~ # [B]e2fsck -n /dev/block/mmcblk0p26[/B]
e2fsck 1.41.6 (30-May-2009)
/dev/block/mmcblk0p26: clean, 7173/75200 files, 216745/300799 blocks
~ #
The 'e2fsck' command takes the same command-line switches as UNIX FSCK(8), so you can be as creative and daring as you need.
- Dave
Click to expand...
Click to collapse
on my phone i have a fiel called fsck.exfat and fsck_msod i think and im trying to run one (though not sure what the difference is) to fix some corrupted files in data internally. im trying to see if the file can be run through recovery without putting it through adb to unmount the data. im not too sure how to figure out what the data block is called because when i rum the mount i get a ton of different blocks (about 32 of them).
im trying to clean up the lost+found files i have and i have 3 of from a corrupted nandroid
robcop19 said:
on my phone i have a fiel called fsck.exfat and fsck_msod i think and im trying to run one (though not sure what the difference is) to fix some corrupted files in data internally. im trying to see if the file can be run through recovery without putting it through adb to unmount the data. im not too sure how to figure out what the data block is called because when i rum the mount i get a ton of different blocks (about 32 of them).
im trying to clean up the lost+found files i have and i have 3 of from a corrupted nandroid
Click to expand...
Click to collapse
Hi Rob.
I'm not sure if I can be of any specific assistance. exFAT is a type of filesystem format, like UNIX/Android ext3 and ext4, but beyond that, I couldn't tell you what those programs do. I do know that on some operating systems, the only way to fix the file chains and blocks is to make sure it's unmounted in single user mode. ADB is the closest we Android guys can get to UNIX single user mode without some clever Recovery Mode ZIP file programming.
– Dave
alrighty
ViperGeek said:
Hi Rob.
I'm not sure if I can be of any specific assistance. , but beyond that, I couldn't tell you what those programs do. I do know that on some operating systems, the only way to fix the file chains and blocks is to make sure it's unmounted in single user mode. ADB is the closest we Android guys can get to UNIX single user mode without some clever Recovery Mode ZIP file programming.
– Dave
Click to expand...
Click to collapse
well thank you for at least writing back on it. im not sure how to run adb let alone run the progrma to try and fix this but i will be learning up on it
robcop19 said:
well thank you for at least writing back on it. im not sure how to run adb let alone run the progrma to try and fix this but i will be learning up on it
Click to expand...
Click to collapse
ADB isn't all that difficult to use. Here's a good primer on it:
http://droidlessons.com/how-to-install-adb-on-a-windows-7-pc/
Once installed, just boot your phone into Recovery (power off completely, then power on with the Vol Down key held, then select RECOVERY). Once it's sitting there, connect your phone to the PC via USB, wait for Windows to find the right drivers, and you're connected. 'adb devices' should list your phone in the "List of devices attached", after which you're good to go.
– Dave
ps. I've not tried it personally, but there's supposedly a "universal USB driver" available here:
https://plus.google.com/103583939320326217147/posts/BQ5iYJEaaEH
wow
ViperGeek said:
ADB isn't all that difficult to use. Here's a good primer on it:
Once installed, just boot your phone into Recovery (power off completely, then power on with the Vol Down key held, then select RECOVERY). Once it's sitting there, connect your phone to the PC via USB, wait for Windows to find the right drivers, and you're connected. 'adb devices' should list your phone in the "List of devices attached", after which you're good to go.
– Dave
ps. I've not tried it personally, but there's supposedly a "universal USB driver" available here:
Wow thank you very much for the help youre giving me I will see if i can go and start finding a solution
Click to expand...
Click to collapse
ViperGeek said:
The 'e2fsck' command takes the same command-line switches as UNIX FSCK(8), so you can be as creative and daring as you need.
- Dave
Click to expand...
Click to collapse
I figured this out about a week ago now I guess and did indeed find that there were corrupted partitions. My phone had been acting up for several weeks before and it pretty much unusable now. I do manage to clean system and data up, and was even able to flash a new ROM which I hadn't been able to, they'd always abort.
I have a question though, is this only good for ext2 partitions? I have the same version as shown in the tutorial and if you run 'e2fsck -V' the output makes me think that maybe it's not happy checking ext3 and ext4 partitions and that's why i was popping up errors, or at least that's why even when i fixed errors it maybe wasn't really fixing the issue.
Thanks.
I've got a different phone, but a search brought me here to this thread. I think my issues though are more corrupted memory rather than device specific so hope you don't mind my post here.
I think this will answer your question
http://linux.die.net/man/8/fsck.ext3
(It should be good for all ext partitions)
Sent from my Galaxy Nexus using Xparent Cyan Tapatalk 2
ahh the good old fsck
glad i found this thread
thanks a lot mannnn
One more helpful tidbit.
Even if you run 'e2fsck -n' and find a "clean" file system, it may be useful to force a scan via 'e2fsck -f'. This just happened to me. I had something funny going on, and so rebooted into recovery and checked my file systems. Everything was cool like Fonzie, which I didn't believe, and so I used 'e2fsck -f' and found lots of fuglies that got fixed.
Be careful running -f on a cross-linked file system like the /data partition on a Galaxy S3/S4. It can have the tendency to unlink the elfin magic Samsung used and make a mess.
- Dave
(Double-tap post deleted)
This will not work with stock Android - default boot to recovery doesn't enable adb - you have to have CWM for that.
So, the questions remains - how can I run e2fsck without rooting my phone (and possibly voiding its warranty)?
How do I get the Moto X in Recovery mode to accept the adb command?
Because when I put in Recovery (Android Robot lying down) mode, the command adb and fastboot are not recognized.
Can this be done in terminal? And would I need su?
PRose61 said:
Can this be done in terminal? And would I need su?
Click to expand...
Click to collapse
Yes, this can be done in terminal on the phone itself. You do need root/su.
ApTeM said:
This will not work with stock Android - default boot to recovery doesn't enable adb - you have to have CWM for that.
So, the questions remains - how can I run e2fsck without rooting my phone (and possibly voiding its warranty)?
Click to expand...
Click to collapse
Is this why I get can't read '/etc/fstab': No such file or directory?
I'm using a stock Samsung S2, but it is rooted and has superuser and busybox.
Code:
ViperGeek said:
I've been having lots of trouble with my SD and local filesystems getting corrupted, which in turn has been causing the flush-179 process to go ballistic (100% CPU loop, reboot hangs, etc.). If only there was a way to run a quick on my Android's unmounted filesystems to check for problems. Well, there is!
This may be old, old news to some of the more seasoned OS hackers, so please be kind with any negative feedback about it being intuitively obvious. It wasn't to me, but after some research and testing, I've come up with these simple steps:
Boot into Recovery
Connect via USB to ADB shell
Code:
C:\Scratch\Android> [B]adb devices[/B]
C:\Scratch\Android> [B]adb shell[/B]
Mount /system and /data to determine the /dev/block names, then umount each
Code:
~ # [B]mount /system[/B]
~ # [B]mount /data[/B]
~ # [B]df[/B]
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 308620 64 308556 0% /dev
/dev/block/mmcblk0p27
295509 121021 159231 43% /cache
/dev/block/mmcblk0p26
1184268 848052 276060 75% /data
/dev/block/mmcblk0p25
562384 461416 72400 86% /system
~ # [B]umount /system[/B]
~ # [B]umount /data[/B]
Run e2fsck against each /dev/block filesystem
Code:
~ # [B]e2fsck -n /dev/block/mmcblk0p25[/B]
e2fsck 1.41.6 (30-May-2009)
/dev/block/mmcblk0p25: clean, 4168/35760 files, 117605/142847 blocks
~ # [B]e2fsck -n /dev/block/mmcblk0p26[/B]
e2fsck 1.41.6 (30-May-2009)
/dev/block/mmcblk0p26: clean, 7173/75200 files, 216745/300799 blocks
~ #
The 'e2fsck' command takes the same command-line switches as UNIX FSCK(8), so you can be as creative and daring as you need.
- Dave
Click to expand...
Click to collapse
Thank you for your very well done post. I also realize that this thread is very old. Still it is the best I have found after days of looking. And finally, I have a different phone. Having said that perhaps someone might help.
My phone is a Galaxy S5 Verizon SM-G900V running KitKat 4.4.4. I have root on the phone, but am running stock Verizon Kitkat with stock recovery.
So I have used ADB by plugging in my phone via USB to my Windows computer. I can get root in ADB and find the /data filesystem and its /dev/block/... device. But when I try to
Code:
umount /data
I get a response that the filesystem is busy. This makes sense.
I have booted into recovery via VOL UP + HOME + POWER and it takes me to the RECOVERY menu. But the only option that connects with my ADB shell is "apply update from ADB". When you use the command
Code:
ADB devices
, my phone shows up, but as "phoneid" sideload, and
Code:
ADB shell
exits immediately.
I have also tried to use a terminal shell and then su to root. Again I cannot umount /data since it is busy. (Of course it is, I am using it...)
And finally I have tried
Code:
touch /forcefsck
to create that file in the root directory. This is supposed to force a fsck during boot up. But the root directory (/) is read only. So you can't write the file to it.
I am at my wits end. What I really need to do is mark the /data filesystem as dirty and have the system check it on reboot. But I can't find anyway to do it.
So if anyone can help, I would be very grateful
Joe

[Q] Pulling my hair out over Dual Booting!

Ok, I'm 90% of the way to getting my Kindle exactly how I want it, but I'm getting stuck at the last hill. Let me take you through a step by step of what I've done, and then what I want to do, and lets see if I can get some help and finally get this thing working!
I bought my 1st Gen Kindle a year after it came out, and immediately rooted it. Within a month, I put some old version of TWRP on and flashed to a custom ROM. Since then I've purchased Amazon Prime and wish to be able to use my Kindle with it. this involves having a perfectly Stock, non-rooted ROM installed. Thus began my nightmare of trying to get it back into such a state.
After 3 hours of running down dead end paths, I finally ran the latest Kindle Fire Utility (0.9.9) and had to finally use COTR recovery to flash the 6.2.3 stock rom because I was getting all sorts of errors using TWRP.
Now I have a perfectly back to Stock Kindle, but I still want Gapps and Netflix, but without rooting my device to break video streaming. Solution? Dual boot!
Ran the TWRP installer, and then the FFF installer. Then ran the Dual Boot installer, choosing the option to prepare FFF for dual booting. Now my kindle has the FFF bootloader, can boot into Stock as the primary and can boot into TWRP Recovery. However, when I tried to flash an alt rom (SBloods' ROM found https://code.google.com/p/kindle-alt-roms-cm10-cm9-dev/downloads/list ) it says it completes successfully, however when I attempt to boot into the alterante boot, it just stays at the Fastboot Booting screen.
What do I need to do and/or use in order to get my alt ROM (or any alt ROM) booting properly?
asrrin29 said:
Ok, I'm 90% of the way to getting my Kindle exactly how I want it, but I'm getting stuck at the last hill. Let me take you through a step by step of what I've done, and then what I want to do, and lets see if I can get some help and finally get this thing working!
I bought my 1st Gen Kindle a year after it came out, and immediately rooted it. Within a month, I put some old version of TWRP on and flashed to a custom ROM. Since then I've purchased Amazon Prime and wish to be able to use my Kindle with it. this involves having a perfectly Stock, non-rooted ROM installed. Thus began my nightmare of trying to get it back into such a state.
After 3 hours of running down dead end paths, I finally ran the latest Kindle Fire Utility (0.9.9) and had to finally use COTR recovery to flash the 6.2.3 stock rom because I was getting all sorts of errors using TWRP.
Now I have a perfectly back to Stock Kindle, but I still want Gapps and Netflix, but without rooting my device to break video streaming. Solution? Dual boot!
Ran the TWRP installer, and then the FFF installer. Then ran the Dual Boot installer, choosing the option to prepare FFF for dual booting. Now my kindle has the FFF bootloader, can boot into Stock as the primary and can boot into TWRP Recovery. However, when I tried to flash an alt rom (SBloods' ROM found https://code.google.com/p/kindle-alt-roms-cm10-cm9-dev/downloads/list ) it says it completes successfully, however when I attempt to boot into the alterante boot, it just stays at the Fastboot Booting screen.
What do I need to do and/or use in order to get my alt ROM (or any alt ROM) booting properly?
Click to expand...
Click to collapse
Boot into recovery and enter the following commands:
Code:
adb shell parted /dev/block/mmcblk0
print
If the shell complains that 'parted' isn't installed, you can install it temporarily (until reboot).
1)Download 'parted' here: http://d-h.st/h81
2) place the 'parted' binary in the same directory from which you are entering your commands and enter the following:
Code:
adb push parted /sbin/parted
adb shell chown 0.0 /sbin/parted
adb shell chmod 755 /sbin/parted
Once you have 'parted' running and have entered the 'print' command to print the partition table, copy it and post it here.
Here's the output:
Code:
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell
~ # ←[6nparted /dev/block/mmcblk0
parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
print
Model: MMC MMC08G (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 11.0MB 10.5MB dkernel
4 11.0MB 212MB 201MB ext4 dfs
5 212MB 229MB 16.8MB recovery
6 229MB 296MB 67.1MB ext4 backup
7 296MB 307MB 10.5MB boot
8 307MB 312MB 5243kB ext4 splash
9 312MB 849MB 537MB ext4 system
10 849MB 2041MB 1192MB ext4 userdata
11 2041MB 2309MB 268MB ext4 cache
12 2309MB 7690MB 5380MB fat32 media
(parted)
asrrin29 said:
Here's the output:
Code:
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell
~ # ←[6nparted /dev/block/mmcblk0
parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
print
Model: MMC MMC08G (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 11.0MB 10.5MB dkernel
4 11.0MB 212MB 201MB ext4 dfs
5 212MB 229MB 16.8MB recovery
6 229MB 296MB 67.1MB ext4 backup
7 296MB 307MB 10.5MB boot
8 307MB 312MB 5243kB ext4 splash
9 312MB 849MB 537MB ext4 system
10 849MB 2041MB 1192MB ext4 userdata
11 2041MB 2309MB 268MB ext4 cache
12 2309MB 7690MB 5380MB fat32 media
(parted)
Click to expand...
Click to collapse
Well there's your problem. In order to have a dual boot, you have to have separate sets of partitions for both boots. You should go back to the instructions for dual booting and see what you missed.
Hint: you should have a total of 16 partitions.
Ok, so I redid the the dual-boot and set up the partitions, but now I am unable to copy files to the sdcard. I keep getting an Error: 80070057 the parameter is incorrect.
I tried installing SBlood's ROM and this time it restarts the recovery everytime it goes to initialize scripts. I then tried to get a different ROM (The MIUI one) onto the kindle by using ADB push, and I get an unknown error when trying to install it.
asrrin29 said:
Ok, so I redid the the dual-boot and set up the partitions, but now I am unable to copy files to the sdcard. I keep getting an Error: 80070057 the parameter is incorrect.
I tried installing SBlood's ROM and this time it restarts the recovery everytime it goes to initialize scripts. I then tried to get a different ROM (The MIUI one) onto the kindle by using ADB push, and I get an unknown error when trying to install it.
Click to expand...
Click to collapse
What did you use to set up your partitions? Did you create them manually or did you use the format-all.zip?
soupmagnet said:
What did you use to set up your partitions? Did you create them manually or did you use the format-all.zip?
Click to expand...
Click to collapse
I used the altrom-format-all.zip that came with KFU 0.9.9.
asrrin29 said:
I used the altrom-format-all.zip that came with KFU 0.9.9.
Click to expand...
Click to collapse
The error you are receiving may be a problem with Windows, and not necessarily the device or the dual boot.
Try the following and see if it makes a difference:
http://support.microsoft.com/kb/982736
soupmagnet said:
The error you are receiving may be a problem with Windows, and not necessarily the device or the dual boot.
Try the following and see if it makes a difference:
http://support.microsoft.com/kb/982736
Click to expand...
Click to collapse
The error only happens on the dual booted Kindle. I can plug any other android device, or my kindle when it's in single boot mode, and it doesn't happen.
asrrin29 said:
The error only happens on the dual booted Kindle. I can plug any other android device, or my kindle when it's in single boot mode, and it doesn't happen.
Click to expand...
Click to collapse
When you print your partition table, does the media partition have "msftres" beside it?

Categories

Resources