Early Lollipop Ports for Micromax A116 and A117

It feels like it was only yesterday when Google announced the mysterious Android L.After … more

Now Gesture Tweaks Replaces Google Now with Custom Action

On most modern Android devices with software navigation keys, swiping up from the … more

ToqAN Fixes Android 5.0 Notification Bug on Qualcomm Toq

The Qualcomm Toq is probably one of the lesser known smartwatches on the market … more

How to Root and Unlock the Google Nexus 6 on a Mac – XDA TV

In the past, XDA Developer TV Producer droidmodd3rx has shown you how to … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[SOLVED] How to restore damaged Internal SD card partition layout? Tried everything.

OP soswow

4th July 2013, 12:46 AM   |  #1  
OP Junior Member
Thanks Meter: 2
 
15 posts
Join Date:Joined: Jun 2013
I did something really bad to my INTERNAL SD CARD partition layout, so now I have

I have the i8190N model

Code:
~ # cat /proc/partitions
major minor  #blocks  name

 179        0    7634944 mmcblk0
 179        1    7634936 mmcblk0p1
 179       64       2048 mmcblk0boot1
 179       32       2048 mmcblk0boot0
 179       96    3866624 mmcblk1
 179       97    3862528 mmcblk1p1

~ # df
Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                   411756        48    411708   0% /dev

~ # mount
rootfs on / type rootfs (rw)
tmpfs on /dev type tmpfs (rw,nosuid,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)

~ # 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
Warning: /dev/block/mmcblk0 contains GPT signatures, indicating that it has a
GPT table.  However, it does not have a valid fake msdos partition table, as it
should.  Perhaps it was corrupted -- possibly by a program that doesn't
understand GPT partition tables.  Or perhaps you deleted the GPT table, and are
now using an msdos partition table.  Is this a GPT partition table?
Yes/No?
As you can see, there is no /system, /cache and other stuff, that should be there.

My ClockWorkMod recovery tool can't mount anything (/cache, /system, nothing)

I really did everything I could. I tried: restore from backup (I have one, made with recovery tool), install new ROM (With recovery tool), install stock firmware and stock kernel in ODIN mode. I even tried some PIT file: nothing did absolutely nothing to my status.

Frankly I miss some important part in understanding of filesystem, partitions, images, what is ROM, what is stock kernel etc ...

What should I do?

UPDATE:
Short answer: user right PIT file and burn it with Odin3. Long answer in post below.
Last edited by soswow; 4th July 2013 at 10:50 PM.
4th July 2013, 09:05 AM   |  #2  
OP Junior Member
Thanks Meter: 2
 
15 posts
Join Date:Joined: Jun 2013
Found interesting file:

Code:
~ # tail ./etc/recovery.fstab
/system		ext4	/dev/block/mmcblk0p22
/cache		ext4	/dev/block/mmcblk0p23
/data		ext4	/dev/block/mmcblk0p25 length=-16384
/efs		ext4    /dev/block/mmcblk0p11
/boot		emmc	/dev/block/mmcblk0p20
/recovery	emmc	/dev/block/mmcblk0p21
/preload	ext4	/dev/block/mmcblk0p24
/modem		ext4	/dev/block/mmcblk0p12
/sdcard		datamedia	/dev/null
/external_sd	vfat	/dev/block/mmcblk1p1

~ # tail ./etc/fstab
/dev/block/mmcblk0p23 /cache ext4 rw
/dev/block/mmcblk0p25 /data ext4 rw
/dev/block/mmcblk0p22 /system ext4 rw
/dev/null /sdcard datamedia rw
And here is more info
Code:
~ # ls -la /dev/block/mmcblk*
brw-------    1 root     root      179,   0 Jan  1 10:30 /dev/block/mmcblk0
brw-------    1 root     root      179,  32 Jan  1 09:28 /dev/block/mmcblk0boot0
brw-------    1 root     root      179,  64 Jan  1 09:28 /dev/block/mmcblk0boot1
-rw-rw-rw-    1 root     root      16777216 Jan  1 10:07 /dev/block/mmcblk0p20
-rw-r--r--    1 root     root             0 Jan  1 10:07 /dev/block/mmcblk0p22
brw-------    1 root     root      179,  96 Jan  1 09:28 /dev/block/mmcblk1
brw-------    1 root     root      179,  97 Jan  1 09:28 /dev/block/mmcblk1p1
Last edited by soswow; 4th July 2013 at 09:38 AM.
4th July 2013, 09:49 AM   |  #3  
OP Junior Member
Thanks Meter: 2
 
15 posts
Join Date:Joined: Jun 2013
This is what kind of stuff I get in CWM:

Code:
-- Wiping cache...
Formatting /cache...
Need size of filesystem
E:format_volume: make_extf4fs failed on /dev/block/mmcblk0p23
Cache wipe complete.
W:failed to mount /dev/block/mmcblk0p23 (Block device required)
E:Can't mount /cache/recovery/log
E:Can't open /cache/recovery/log
W:failed to mount /dev/block/mmcblk0p23 (Block device required)
E:Can't mount /cache/recovery/last_log
E:Can't open /cache/recovery/last_log
W:failed to mount /dev/block/mmcblk0p23 (Block device required)
W:Can't unlink /cache/recovery/command
Formatting /data...
warning: get_file_size: Computed filesystem size less than 0
Need size of filesystem
E:format_volume: make_extf4fs failed on /dev/block/mmcblk0p25
Error formatting /data!
W:failed to mount /dev/block/mmcblk0p23 (Block device required)
E:Can't mount /cache/recovery/log
E:Can't open /cache/recovery/log
4th July 2013, 12:29 PM   |  #4  
Senior Member
Thanks Meter: 18
 
142 posts
Join Date:Joined: Jul 2011
Have you tried to flash stock firmware again with re partition ticked and the pit file? Using the pit file make sense only if you flash the whole firmware with it

Inviato dal mio GT-I8190 con Tapatalk 2
4th July 2013, 01:11 PM   |  #5  
OP Junior Member
Thanks Meter: 2
 
15 posts
Join Date:Joined: Jun 2013
Quote:
Originally Posted by Byteater

Have you tried to flash stock firmware again with re partition ticked and the pit file? Using the pit file make sense only if you flash the whole firmware with it

As I wrote in initial post - yes, I did. But maybe I used wrong pit file =\



Btw, looks like I have everything in console buffer (full history of distraction actions)

In the beginning I had this:
Code:
cat /proc/partitions
major minor  #blocks  name

   7        0       2111 loop0
 179        0    7634944 mmcblk0
 179        1        128 mmcblk0p1
 179        2        384 mmcblk0p2
 179        3       1024 mmcblk0p3
 179        4       1024 mmcblk0p4
 179        5        512 mmcblk0p5
 179        6        512 mmcblk0p6
 179        7        512 mmcblk0p7
 179        8        512 mmcblk0p8
 179        9       1024 mmcblk0p9
 179       10       1024 mmcblk0p10
 179       11      16384 mmcblk0p11
 179       12      16384 mmcblk0p12
 179       13      16384 mmcblk0p13
 179       14      51200 mmcblk0p14
 179       15         64 mmcblk0p15
 179       16      14336 mmcblk0p16
 179       17       2048 mmcblk0p17
 179       18       2048 mmcblk0p18
 179       19      16384 mmcblk0p19
 179       20      16384 mmcblk0p20
 179       21      16384 mmcblk0p21
 179       22    1228800 mmcblk0p22
 179       23     860160 mmcblk0p23
 179       24     327680 mmcblk0p24
 179       25    4945920 mmcblk0p25
 179       64       2048 mmcblk0boot1
 179       32       2048 mmcblk0boot0
 179       96    3872256 mmcblk1
 179       97    3868160 mmcblk1p1
 254        0       2110 dm-0
Code:
/ $ df
Filesystem               Size     Used     Free   Blksize
/dev                   402.1M    84K   402M   4096
/mnt/asec              402.1M     0K   402.1M   4096
/mnt/obb               402.1M     0K   402.1M   4096
/dev/shm               402.1M     0K   402.1M   4096
/system                  1.2G   414.5M   766.6M   4096
/modemfs                15.7M     4.3M    11.4M   4096
/cache                 826.8M    84.8M   742M   4096
/efs                    15.7M     4.5M    11.2M   4096
/preload               315M    64.2M   250.8M   4096
/data                    4.6G     4G   699.2M   4096
/mnt/.lfs: Function not implemented
/storage/sdcard0         4.6G     4G   699.2M   4096
/mnt/asec/com.spruds.transport.pro.tallin-1     2M   888K     1.1M   4096
/storage/sdcard1         3.7G   905.7M     2.8G   32768
Even before everything went wrong I tried to use parted command and get an error
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) list
list
  check NUMBER                             do a simple check on the file system
  cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER   copy file system to another partition
.....
.....
        copyright information of GNU Parted
(parted) print
print
Error: Unable to satisfy all constraints on the partition.

This is fdisk print before disaster
Code:
~ # fdisk /dev/block/mmcblk0

The number of cylinders for this disk is set to 954368.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/block/mmcblk0: 7818 MB, 7818182656 bytes
1 heads, 16 sectors/track, 954368 cylinders
Units = cylinders of 16 * 512 = 8192 bytes

              Device Boot      Start         End      Blocks  Id System
/dev/block/mmcblk0p1               1      954368     7634943+ ee EFI GPT
Partition 1 does not end on cylinder boundary
And then I deleted it
Code:
~ # fdisk /dev/block/mmcblk0

The number of cylinders for this disk is set to 954368.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/block/mmcblk0: 7818 MB, 7818182656 bytes
1 heads, 16 sectors/track, 954368 cylinders
Units = cylinders of 16 * 512 = 8192 bytes

              Device Boot      Start         End      Blocks  Id System
/dev/block/mmcblk0p1               1      954368     7634943+ ee EFI GPT
Partition 1 does not end on cylinder boundary

Command (m for help): d
Selected partition 1

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table
fdisk: WARNING: rereading partition table failed, kernel still uses old table: Device or resource busy
4th July 2013, 01:32 PM   |  #6  
Senior Member
Thanks Meter: 18
 
142 posts
Join Date:Joined: Jul 2011
To be honest, I've never seen a problem like that. In Odin there's an option to erase all nand. I don't know if this would help you, since you should have an efs backup and I don't know if it will bring consequences.

Inviato dal mio GT-I8190 con Tapatalk 2
4th July 2013, 02:21 PM   |  #7  
tys0n's Avatar
Recognized Contributor
Flag Stockholm
Thanks Meter: 1,262
 
1,982 posts
Join Date:Joined: Nov 2010
More
Try firmware posted here, with pit-file.
It's worth a try. It has saved me a few times, but from other problems.
4th July 2013, 02:40 PM   |  #8  
OP Junior Member
Thanks Meter: 2
 
15 posts
Join Date:Joined: Jun 2013
Quote:
Originally Posted by tys0n

Try firmware posted here, with pit-file.
It's worth a try. It has saved me a few times, but from other problems.

I have "some" goldenxx.pit file already. And I took original firmware from some semi-official sources. Though I didn't have this CSC file. Also In original article (on 4pda.ru) they say NOT TO use this firmware with I8190N (which I have) ...
4th July 2013, 02:46 PM   |  #9  
tys0n's Avatar
Recognized Contributor
Flag Stockholm
Thanks Meter: 1,262
 
1,982 posts
Join Date:Joined: Nov 2010
More
Quote:
Originally Posted by soswow

I have "some" goldenxx.pit file already. And I took original firmware from some semi-official sources. Though I didn't have this CSC file. Also In original article (on 4pda.ru) they say NOT TO use this firmware with I8190N (which I have) ...

Oh sorry. My mistake. I missed it was i8190N.

Sent through time and space from my s3mini/CM10.
4th July 2013, 10:45 PM   |  #10  
OP Junior Member
Thanks Meter: 2
 
15 posts
Join Date:Joined: Jun 2013
Found it!
I found it!

The answer was in PIT file, because as it says here:
Quote:

you will only need to use this if a firmware update needs to change your partition layout (very very unlikely) or if you mess up you partition table (you donít want to do this)

Which is definitely my case.

So, I tried that GT-I8190N and GT-I8190 should be used with different PIT files (I tried to use for GT-I8190 one). So I found long list of PIT files here

Thank you everyone for help.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes