This little guide is written down after I managed to screw up my partitions on my Galaxy Tab while rooting it. Luckily I still had some space that allowed me to reinstall stock firmware through Odin. I wrote a blog post on how to do this here. Then I had to get a recovery bootloader that gave me root access in recovery mode and the parted tool. So if you have a booting Android but with fucked up partitions, try this.
PS! Android will probably not boot after this. So know you will have to reinstall.
And if you have something on your SDcard you should back it up, you probably need to remove all partitions if you have a real screw up. You can resize if you want to get advanced though.
The guide is written for windows command line.
1. You device must be booted into Android at first. Install Samsung Kies and make sure it can connect to your PC, you need the drivers that comes with it.
2. Install ADB, it comes with Android SDK. When you have ADB you should test it. First set your Tab in USB debugging mode (settings/applications/development).
Type "adb devices" in the command prompt and see if a device is listed up with a serial number. Then try "adb shell", you will get a new command line with a $ in front if it works.
3. Root your device. My favourite is SuperOneClick, follow this guide or find another you like better.
4. Download the Flash_image file. This is a tool that does what it sounds like, flashes images.
5. Download the beta Cyanogenmod for Heimdall, check this thread (XDA Developer forum) for latest version.
Unzip the tcm7beta-2011-11-02.zip file and keep the file zImage, this is the ClockWorkMod recovery image we will use. This will give you root access from the recovery mode.
6. Flash the recovery bootloader. These commands depend on where you put your files.
the syntax works like this: "adb push <from file on PC> <to file on Tab>"
Run all these commands:
adb push flash_image /data/local/bin/flash_image
adb push zImage /sdcard/
adb shell
su
chmod 755 /data/local/bin/flash_image
/data/local/bin/flash_image boot /sdcard/zImage
sync
exit
exit
adb reboot recovery
7. Now you are hopefully inside ClockWorkMod Recovery 5.0. Along with it comes parted, a tool for managing partitions.
You can open "adb shell" again and type "su" for root access, which you need for opening parted.
8. Unmount all partitions in the ClockWorkMod under "mounts and storage". In the shell, open parted by typing:
parted /dev/block/mmcblk0
then type "print" to get the partition information, then you will see the madness.
9. To finally fix the partitions, follow this great guide (XDA Developer forum). It's really detailed and tells how you should part it up. Read it carefully though. If you wish to upgrade to ext3/4 it describes this as well.
I put my commands for cleaning up and upgrading to ext4 as an example.
Here I create a sdcard partition of 11696mb, ext2 of 4096mb and swap of 128mb.
These are parted commands, in case you get confused.
remove partitions:
rm 1
rm 2
rm 3
create partitions:
mkpartfs primary fat32 0 11696
mkpartfs primary ext2 11696 15792
mkpartfs primary linux-swap 15792 15920
now you are done with parted, type quit and get back to shell.
upgrade from ext2 to ext4:
tune2fs -O extents,uninit_bg,dir_index,has_journal /dev/block/mmcblk0p2
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p2
always run check afterwards:
e2fsck /dev/block/mmcblk0p2
10. After you have fixed your partitions your device probably won't boot into Android. So you have too reinstall somehow, like I mentioned in the beginning.
PS! Android will probably not boot after this. So know you will have to reinstall.
And if you have something on your SDcard you should back it up, you probably need to remove all partitions if you have a real screw up. You can resize if you want to get advanced though.
The guide is written for windows command line.
1. You device must be booted into Android at first. Install Samsung Kies and make sure it can connect to your PC, you need the drivers that comes with it.
2. Install ADB, it comes with Android SDK. When you have ADB you should test it. First set your Tab in USB debugging mode (settings/applications/development).
Type "adb devices" in the command prompt and see if a device is listed up with a serial number. Then try "adb shell", you will get a new command line with a $ in front if it works.
3. Root your device. My favourite is SuperOneClick, follow this guide or find another you like better.
4. Download the Flash_image file. This is a tool that does what it sounds like, flashes images.
5. Download the beta Cyanogenmod for Heimdall, check this thread (XDA Developer forum) for latest version.
Unzip the tcm7beta-2011-11-02.zip file and keep the file zImage, this is the ClockWorkMod recovery image we will use. This will give you root access from the recovery mode.
6. Flash the recovery bootloader. These commands depend on where you put your files.
the syntax works like this: "adb push <from file on PC> <to file on Tab>"
Run all these commands:
adb push flash_image /data/local/bin/flash_image
adb push zImage /sdcard/
adb shell
su
chmod 755 /data/local/bin/flash_image
/data/local/bin/flash_image boot /sdcard/zImage
sync
exit
exit
adb reboot recovery
7. Now you are hopefully inside ClockWorkMod Recovery 5.0. Along with it comes parted, a tool for managing partitions.
You can open "adb shell" again and type "su" for root access, which you need for opening parted.
8. Unmount all partitions in the ClockWorkMod under "mounts and storage". In the shell, open parted by typing:
parted /dev/block/mmcblk0
then type "print" to get the partition information, then you will see the madness.
9. To finally fix the partitions, follow this great guide (XDA Developer forum). It's really detailed and tells how you should part it up. Read it carefully though. If you wish to upgrade to ext3/4 it describes this as well.
I put my commands for cleaning up and upgrading to ext4 as an example.
Here I create a sdcard partition of 11696mb, ext2 of 4096mb and swap of 128mb.
These are parted commands, in case you get confused.
remove partitions:
rm 1
rm 2
rm 3
create partitions:
mkpartfs primary fat32 0 11696
mkpartfs primary ext2 11696 15792
mkpartfs primary linux-swap 15792 15920
now you are done with parted, type quit and get back to shell.
upgrade from ext2 to ext4:
tune2fs -O extents,uninit_bg,dir_index,has_journal /dev/block/mmcblk0p2
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p2
always run check afterwards:
e2fsck /dev/block/mmcblk0p2
10. After you have fixed your partitions your device probably won't boot into Android. So you have too reinstall somehow, like I mentioned in the beginning.
Sorry, but if you screwed your partition how the heck is possible to boot into android?
SvarSlettWell.. Doh.. Lame.. But ok: Depends how screwed things are, doesn't it. Ate there only one level of "screwed up" ? If your brain is dead, you can't be saved. If only your legs are broken, there is hope.
SvarSlett:D indeed, as there are differences between magicians and wizards.
SvarSlettAny suggestion for my issue? (deeply screwed partitions)
Cheers
Giuseppe
Are you able to get into bootloader or download mode, or both?
SlettYes, i can get into both modes, but i was hoping that samsung Kies was able to take over since then in order to restore some proprietary way. But none worked. By the way I'm struggling to fing a proper (trusted) firmware. Do you by chance still have the original firmware package?
SvarSlettThanks
Giuseppe
that case i could restore the original kernel, which is probably the reason why kies doesn't recognize my device...
SvarSlettGiu
Actually I do have a few original firmware zipfiles, 3 of android 2.3.3 and 2 of version 2.3.6. I don't remember now which of them that works best, but I can give you all five :)
SvarSlettIt would be reeeeeeeeeaaaaally very much appreciated man.
SvarSlettCould you find a way to share them on gdrive?
I owe you a linkback ;)
Giuseppe
okai I'm uploading to dropbox pub folder now. takes a little while, I'll let u know :)
Slettsee here
Sletthttps://www.dropbox.com/sh/oihd186psbr11yk/BxZ-HBl005
Hey, thanks! I'll download and take a look this evening after office
SvarSlettthanks!!
G