I have Samsung S 3 mini.
I did something really bad to my INTERNAL SD CARD partition layout. As I remember correctly, I tried to repartition my External SD card via fdisk right on Android via 'adb shell'. And I delete existed (there was only one as I recall) partition on mmcblk0 (which is appears to be not an External, but Internal =)
Now I have:
~ # cat /proc/partitions major minor #blocks name 179 0 7634944 mmcblk0 179 64 2048 mmcblk0boot1 179 32 2048 mmcblk0boot0 179 96 3866624 mmcblk1 179 97 3862528 mmcblk1p1
~ # 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
~ # df Filesystem 1K-blocks Used Available Use% Mounted on tmpfs 411756 16452 395304 4% /dev /dev/block/mmcblk1p1 3858432 1473472 2384960 38% /external_sd
~ # 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) /dev/block/mmcblk1p1 on /external_sd type vfat (rw,nodev,noatime,nodiratime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
~ # 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
~ # 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?
My ClockWorkMod recovery tool can't mount anything (/cache, /system, nothing). This is what kind of stuff I get in CWM:
-- 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 As you can see, there is no partitions for /system, /cache and other stuff, that should be there. (but /system, and /cache folders are present in dir listing)
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, how does those 22, 23 25 partitions are created etc ...
What should I do?
UPDATE!
Oh, looks like I have everything in console buffer (full history of distraction actions)
In the beginning I had this:
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
/ $ 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
~ # 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
~ # 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
~ # 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
UPDATE 2
I can see difference from initial state. Now I have 4 heads instead of 1 and so 238592 cylinders instead of 954368. How do I change number of heads?