[GUIDE] Unpack/repack ext4 Android system images - Android General

I didn't find any good info for modifying and creating ext4 sparsed images so i decided to share
This is for all who wants to unpack and modify the original system.img that you can flash using recovery.
system.img (what you get from the google factory images for example) represents a sparsed ext4 loop mounted file system.
It is mounted into /system of your device. Note that this tutorial is for ext4 file system, you may have system image which is yaffs2 for example.
the way it is mounted on Galaxy Nexus:
"/dev/block/platform/omap/omap_hsmmc.0/by-name/system /system ext4 ro,relatime,barrier=1,data=ordered 0 0"
Prerequisites:
1. Linux box or virtual machine
2. simg2img, make_ext4fs binaries which can be downloaded from here http://web.djodjo.org/?a=download:android:tools:x86_linux:ext4tools
Procedure:
place you system.img and the 2 binaries in one directory, and make sure the binaries have exec permission.
Part 1 - mount the filesystem
1. mkdir sys
2. ./simg2img system.img sys.raw
3. sudo mount -t ext4 -o loop sys.raw sys/
Then you have all your system partition mouned in 'sys' and you can modify whatever you want in 'sys'. For example de-odex apks and framework jars.
Part 2 - create a new flashable system image.
1. sudo ./make_ext4fs -s -l 512M -a system new.img sys/
2. sudo umount sys
3. rm -fr sys
Now you can simply type:
fastboot flash system new.img
enjoy

Hey thanks for the guide .
I tried to make use of you command to make the .img but I get this error
Code:
[email protected]:~/ext4_utils$ sudo ./make_ext4fs -s -l 512M -a system new.img ~/system/
[sudo] password for vijai:
Creating filesystem with parameters:
Size: 536870912
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 2048
Label:
Blocks: 131072
Block groups: 4
Reserved block group size: 31
error: do_inode_allocate_extents: Failed to allocate 134 blocks

for what is that 512m ?

This is the same problem...
any idea?
vijai2011 said:
Hey thanks for the guide .
I tried to make use of you command to make the .img but I get this error
Code:
[email protected]:~/ext4_utils$ sudo ./make_ext4fs -s -l 512M -a system new.img ~/system/
[sudo] password for vijai:
Creating filesystem with parameters:
Size: 536870912
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 2048
Label:
Blocks: 131072
Block groups: 4
Reserved block group size: 31
error: do_inode_allocate_extents: Failed to allocate 134 blocks
Click to expand...
Click to collapse

TiBiSMART said:
This is the same problem...
any idea?
Click to expand...
Click to collapse
This is the solution for sgs3:
./make_ext4fs -s -l 1610612736 -a system new_system.img sys/

You need to use the correct size for your new system image.
Use tune2fs -l sys.raw and "Block count" * "Block size" for make_ext4fs -s parameter.
You can also use "cat /proc/partitions" and your device to find out the correct size
Note: If your Samsung Device does not support fastboot, you can use heimdall instead.
Tom

You can just get the size of the original sys.raw and create the new image the same size. You can create the new image whatever size you like that can fit the files you put in but have to bear in mind not to ovrflow the dedicated partition size by the system as it wont be mounted correctly. For example if you create 1gb system for Galaxy Nexus it will be fine and flashed but it will not boot.
RealBorg said:
You need to use the correct size for your new system image.
Use tune2fs -l sys.raw and "Block count" * "Block size" for make_ext4fs -s parameter.
You can also use "cat /proc/partitions" and your device to find out the correct size
Note: If your Samsung Device does not support fastboot, you can use heimdall instead.
Tom
Click to expand...
Click to collapse

after mounting i cant modify and cant unmount it
after mounting the sys i cant write maybe there is no root permission and i cant unmout also and tell me one more thing when i use the fastboot flash command its says command not found. please help me, i have mtk .img files

Good time of the day for everyone. Finnaly I found what I need. I need to make an image of the system of the Kindle Fire. I have problem with my KF. It can be seen only from Fastboot. It was absolutly dead. Now partitions mounted and even its boot till Kindle Fire (white and yellow). All I've done in the terminal of the TWRP. But to finish I need to make system.img and flash it in Fastboot. As I understood I need Linux, I prepare USB disk right now that to install. Then as wrote:
------------------------------------------------------------------------
1. Linux box or virtual machine
2. make_ext4fs binary which can be downloaded from here http://andwise.net/?attachment_id=406
Procedure:
Create a new flashable system image.
1. sudo ./make_ext4fs -s -l 512M -a system new.img sys/
2. sudo umount sys
3. rm -fr sys
Now you can simply type:
fastboot flash system new.img
----------------------------------------------------------------------------------------------
So, I rebooting my Windows to install Linux

thanks .

Waiting for any solution

thanks .

Recheck
thinh182009 said:
This is the same problem...
Click to expand...
Click to collapse
make sure that your calculation is correct(block size*number of blocks)
otherwise ur system image might be large
try to do (number of blocks+number of blocks failed to be allocated)*(block size)

@ my english is not good. sorry
Big thankssssss:good:
---------- Post added at 03:22 PM ---------- Previous post was at 02:32 PM ----------

thinh182009 said:
You can tell me how? I use the phone S7562i size?
@ my english is not good. sorry
Big thankssssss:good:
---------- Post added at 03:22 PM ---------- Previous post was at 02:32 PM ----------
Thank, Thank many to have successfully, wait to close package tar and uprom
Click to expand...
Click to collapse
the image should be enough to contain the new data but it do not make it lager than the size of img.raw.
make: ls -l img.raw get the size and use it instead of 512M

thanks you.....................

[email protected]:/ $ export PATH=/data/local/bin:$PATH
[email protected]:/ $ su
[email protected]:/ # cat proc/partitions
major minor #blocks name
7 0 14585 loop0
7 1 4190 loop1
179 0 15388672 mmcblk0
179 1 61440 mmcblk0p1
179 2 128 mmcblk0p2
179 3 256 mmcblk0p3
179 4 512 mmcblk0p4
179 5 2048 mmcblk0p5
179 6 512 mmcblk0p6
179 7 10240 mmcblk0p7
179 8 512 mmcblk0p8
179 9 512 mmcblk0p9
179 10 10240 mmcblk0p10
179 11 13952 mmcblk0p11
179 12 3072 mmcblk0p12
179 13 3072 mmcblk0p13
179 14 1536000 mmcblk0p14
179 15 12832768 mmcblk0p15
179 16 8192 mmcblk0p16
179 17 860160 mmcblk0p17
179 18 10240 mmcblk0p18
179 19 10240 mmcblk0p19
179 20 6144 mmcblk0p20
179 21 3072 mmcblk0p21
179 22 8 mmcblk0p22
179 23 5120 mmcblk0p23
179 64 2048 mmcblk0boot1
179 32 2048 mmcblk0boot0
179 96 30702592 mmcblk1
179 97 30698496 mmcblk1p1
254 0 14584 dm-0
254 1 4189 dm-1
[email protected]:/ #
This is the output of running # cat proc/partition. The number before mmc**** is the block size. My system is mmcblk0p15. So my system needs to be that size.
Sent from my SPH-L710 using xda app-developers app

thanks .

You won't be able to use any of the methods that I know.
Sent from my SPH-L710 using xda app-developers app

thanks .

Related

Samsung Galaxy Stellar SCH-I200 - System, Recovery, and Boot Images FOUND!

We found the structure of the Samsung Stellar and we now know where the System, recovery, and boot images are!
This here is some of the file structures of the Samsung Stellar:
Code:
cat /proc/partitions
major minor #blocks name
179 0 3866624 mmcblk0
179 1 61440 mmcblk0p1
179 2 128 mmcblk0p2
179 3 256 mmcblk0p3
179 4 512 mmcblk0p4
179 5 2048 mmcblk0p5
179 6 512 mmcblk0p6
179 7 10240 mmcblk0p7
179 8 512 mmcblk0p8
179 9 512 mmcblk0p9
179 10 10240 mmcblk0p10
179 11 13952 mmcblk0p11
179 12 3072 mmcblk0p12
179 13 3072 mmcblk0p13
179 14 1228800 mmcblk0p14
179 15 1966080 mmcblk0p15
179 16 8192 mmcblk0p16
179 17 512000 mmcblk0p17
179 18 10240 mmcblk0p18
179 19 10240 mmcblk0p19
179 20 6144 mmcblk0p20
179 21 3072 mmcblk0p21
179 22 8 mmcblk0p22
179 23 5120 mmcblk0p23
179 64 1024 mmcblk0boot1
179 32 1024 mmcblk0boot0
179 96 1955840 mmcblk1
179 97 1081054 mmcblk1p1
179 98 750000 mmcblk1p2
179 99 124785 mmcblk1p3
To extract the images in their locations: you'll need to use these commands:
Code:
dd if=/dev/block/mmcblk0p18 of=/mnt/extSdCard/Recovery.img
dd if=/dev/block/mmcblk0p7 of=/mnt/extSdCard/boot.img
dd if=/dev/block/mmcblk0p14 of=/mnt/extSdCard/system.img
This assumes that you have an external SD card.
System Partition: http://goo.im/devs/invisiblek/i200/stock.VRALG4.system.img.tar.md5.zip
The rest of the goodies are here: http://goo.im/devs/invisiblek/i200
BIG Thanks to Invisiblek!
Romdump
sovereign73811 said:
Does anyone know how to use Romdump on a Samsung device? I read that Samsung has its own flashing structure which makes extracting the ROMs harder.
Is there any way to know how the file strucutre works or how to access the stock ROMs. Oh and yes we do have rooted devices.
This here is some of the file structures of the Samsung Stellar:
Code:
[email protected]:/dev/block # ls
ls
loop0
loop1
loop2
loop3
loop4
loop5
loop6
loop7
mmcblk0
mmcblk0boot0
mmcblk0boot1
mmcblk0p1
mmcblk0p10
mmcblk0p11
mmcblk0p12
mmcblk0p13
mmcblk0p14
mmcblk0p15
mmcblk0p16
mmcblk0p17
mmcblk0p18
mmcblk0p19
mmcblk0p2
mmcblk0p20
mmcblk0p21
mmcblk0p22
mmcblk0p23
mmcblk0p3
mmcblk0p4
mmcblk0p5
mmcblk0p6
mmcblk0p7
mmcblk0p8
mmcblk0p9
mmcblk1
mmcblk1p1
mmcblk1p2
mmcblk1p3
platform
ram0
ram1
ram10
ram11
ram12
ram13
ram14
ram15
ram2
ram3
ram4
ram5
ram6
ram7
ram8
ram9
Code:
cat /proc/partitions
major minor #blocks name
179 0 3866624 mmcblk0
179 1 61440 mmcblk0p1
179 2 128 mmcblk0p2
179 3 256 mmcblk0p3
179 4 512 mmcblk0p4
179 5 2048 mmcblk0p5
179 6 512 mmcblk0p6
179 7 10240 mmcblk0p7
179 8 512 mmcblk0p8
179 9 512 mmcblk0p9
179 10 10240 mmcblk0p10
179 11 13952 mmcblk0p11
179 12 3072 mmcblk0p12
179 13 3072 mmcblk0p13
179 14 1228800 mmcblk0p14
179 15 1966080 mmcblk0p15
179 16 8192 mmcblk0p16
179 17 512000 mmcblk0p17
179 18 10240 mmcblk0p18
179 19 10240 mmcblk0p19
179 20 6144 mmcblk0p20
179 21 3072 mmcblk0p21
179 22 8 mmcblk0p22
179 23 5120 mmcblk0p23
179 64 1024 mmcblk0boot1
179 32 1024 mmcblk0boot0
179 96 1955840 mmcblk1
179 97 1081054 mmcblk1p1
179 98 750000 mmcblk1p2
179 99 124785 mmcblk1p3
Click to expand...
Click to collapse
I tried romdump myself the other day on this, after rooting the phone, and romdump can't find /proc/mnt - I see that there is a file called /proc/mounts on the Stellar, however. I'm wondering if changing the references to /proc/mnt in the romdump script to /proc/mounts would help, but I'm a regular Linux person and am new to the way Android does things. You think this might work? I tried viewing romdump in a text editor,but it just spit out some gibberish with the word ELF at the top, which leads me to believe it is a Lua script or something. Do you know what language is being used? By the way, I'm also following your thread with moondeath on androidforums - did he ever get his situation sorted out?
Yeah we're still working on it, but so far Moondeath, AGZealot, and frankly even I have been greatly...discouraged. I wish I knew what langauge was being used for Romdump.
Moondeath so far has been unable to get the screen back so I'm wondering if there's something to the bootloader LCD Density changer did? I thought LCD Density changer only changed the OS.
Lastly, I also found something on that same site for Romdump. Take a look at this:
http://android.podtwo.com/recoverymanager/
Be careful. We only want to extract the stock images and the stock recovery mode image. If it wants to put a custom recovery/bootloader in your phone STOP, or you will be like me and have a beautifully bricked phone. Only stock images will help me now.
It's a shame too. I made some kind of backup on my phone and I can't even access it.
By the way, it's good to have another person on board with this...I just wish we can get a REAL developer on this...
OK people: here's a tip I've received from an XDA developer expert (thanks invisiblek):
Quote:
a quick and dirty explanation (need root)
Code:
dd if=/dev/block/mmcblk0p1 of=/sdcard/output.img
this will save the partition mmcblk0p1 to output.img
now, to determine what partitions are
on my device its:
Code:
ls -l /dev/block/platform/msm_sdcc.1/by-name/
but you're scheme and directory structure there might be a little different, so adjust accordingly
Longer Version:
http://www.darkyrom.com/index.php?t...o-guide-to-dump-entire-s3-data-with-adb.8059/
sovereign73811 said:
OK people: here's a tip I've received from an XDA developer expert:
Quote:
a quick and dirty explanation (need root)
Code:
dd if=/dev/block/mmcblk0p1 of=/sdcard/output.img
this will save the partition mmcblk0p1 to output.img
now, to determine what partitions are
on my device its:
Code:
ls -l /dev/block/platform/msm_sdcc.1/by-name/
but you're scheme and directory structure there might be a little different, so adjust accordingly
Click to expand...
Click to collapse
Ok, I ran the ls -l /dev/block/platform/msm_sdcc.1/by-name/ command and I do see a "backup" directory and a "recovery" directory. I also see "rpm", which leads me to believe that Android runs on Red Hat. Not sure how relevant that is, but at least there's something that directly refers to what we're looking for. I do remember being asked to back up the phone when I first powered it on after I bought it. I wonder if maybe some kind of stock image is stored there?
There is. See if you can extract the system image and the recovery image.
We think we've found the system image in mmcblk0p14.
The SYSTEM may be in
Code:
[email protected]:/ # dd if=/dev/block/mmcblk0p14 of=/sdcard/system.img bs=4096
dd if=/dev/block/mmcblk0p14 of=/sdcard/system.img bs=4096
307200+0 records in
307200+0 records out
1258291200 bytes tra
We may also have a bootloader:
Code:
[email protected]:/ #
dd if=/dev/block/mmcblk0boot1 of=/sdcard/boot1.img bs=4096
dd if=/dev/block/mmcblk0boot1 of=/sdcard/boot1.img bs=4096
[email protected]:/ # dd if=/dev/block/mmcblk0boot1 of=/sdcard/boot1.img bs=4096
256+0 records in
256+0 records out
1048576 bytes transferred in 0.130 secs (8065969 bytes/sec)
[email protected]:/ # dd if=/dev/block/mmcblk0boot0 of=/sdcard/boot0.img bs=4096
dd if=/dev/block/mmcblk0boot0 of=/sdcard/boot0.img bs=4096
256+0 records in
256+0 records out
1048576 bytes transferred in 0.129 secs (8128496 bytes/sec)
[email protected]:/ #
Now all we need is to find the recovery...
I have a theory:
I believe that the recovery partition is in "mmcblk0p20." This partition is about 6MB and I've seen Galaxy S3 recovery partitions size around 6MB.
Let's try adding this:
Code:
ls -l /dev/block/platform/msm_sdcc.1/by-name/recovery
or:
Code:
ls -l /dev/block/platform/msm_sdcc.1/mmcblk0p20
Can anyone help me confirm the theory? I would if I had a working phone.
Hey guys what's up, I have a ROM or 2 out for the skyrocket and the vzw gs3, I picked one of these up for my son and been playing with it, what is it your trying to do here? For root its easy ,but what is it your looking for and I may be able to help
Sent from my SCH-I200 using xda premium
We're trying to make a backup of the system, recovery, and boot partitions and make them into ROMs flashable to Odin or whatever we need them to be.
If you can try to shed some light on the locations of the ROMs I'd certainly be grateful.
boot recovery
Hey you think somehow if i go into boot recovery, and click on the option that says format from sdcard.. is there a way i can transfer my root files into my sd car (8GB) then root it again? So basically do something from my sd card? instead of plugging it into the comp? And the repair option for the upgrade assistant didnt work since my computer couldnt read my device.
I'm sure you've installed the Samsung USB drivers on there.
It takes much more to "transfer" the "root files" to your SD Card. The only thing you can "pull" from the phone in recovery mode is the Recovery image itself.
I can use that actually. Refer to my previous posts here on this very topic and see what you can do.
Has anyone tried any cwm recoveries yet?
Sent from my SCH-I200 using xda premium
DON'T DO IT! Unless you want to brick your phone. I did something similar and that's how I'm in my predicament.
Before you do anything else PLEASE backup your ROMs. Look at my past posts of this topic; I think we've found some of the ROMs.
sovereign73811 said:
I have a theory:
I believe that the recovery partition is in "mmcblk0p20." This partition is about 6MB and I've seen Galaxy S3 recovery partitions size around 6MB.
Let's try adding this:
Code:
ls -l /dev/block/platform/msm_sdcc.1/by-name/recovery
or:
Code:
ls -l /dev/block/platform/msm_sdcc.1/mmcblk0p20
Can anyone help me confirm the theory? I would if I had a working phone.
Click to expand...
Click to collapse
a/local/bin:$PATH <
/platform/msm_sdcc.1/mmcblk0p20 <
lrwxrwxrwx root root 1970-01-13 18:02 mmcblk0p20 -> /dev/block/mmcblk0p20
/platform/msm_sdcc.1/by-name/recovery <
lrwxrwxrwx root root 1970-01-13 18:02 recovery -> /dev/block/mmcblk0p18
[email protected]:/ $
So it's in mmcblk0p18? Hmm...can you extract anything out of it?
And I'll ask again: If any of you are successful in extracting the ROMs, please upload them. I need my Stellar back up and running soon!
Sure, I can try to extract something - any tips on how to do that? I can obviously just Google it, but I'm new to the Android environment. If I could get the device to talk to my Linux box, I could probably do a lot more, but it doesn't recognize the device via MTP, which is another battle I'm working on. As a result, I have either use my work laptop, which runs Windows, or I have to do it directly from the phone.
If I know the code enough, I believe that these commands through adb will extract the partitions in an image file. You can look at the very first post of the topic; I've updated it with some compiled information I've gathered.
So I too am new to android. I just attempted a rom dump using the podtwo romdump/adb method, and I am pretty sure that it did not complete as it should have. Here is the output
Code:
C:\Users\gravewood\AppData\Local\Android\android-sdk\platform-tools>adb push romdump
/data/local
2587 KB/s (1149900 bytes in 0.434s)
C:\Users\gravewood\AppData\Local\Android\android-sdk\platform-tools>adb shell chmod
04755 /data/local/romdump
C:\Users\gravewood\AppData\Local\Android\android-sdk\platform-tools>adb shell /data/
local/romdump
Android ROM dumper v0.82b
(c)2011 Sebastian404
You need to be rooted to run this aplication
Device : IMM76D.I200VRALG4
Creating required files... cat: can't open '/proc/mtd': No such file or director
y
done.
Opening mtd table... Segmentation fault
C:\Users\gravewood\AppData\Local\Android\android-sdk\platform-tools>
It did not create the sub directory named after my device so what is in the zip is all I have, taking a smoke break hope someone can work with it let me know what else I can do to help.
ROMDump doesn't work because of Samsung's proprietary partitioning. Try looking around here instead.

Need help renaming Partitions in Dual Boot kernel!! Please Help!!

Hi all,
I am in the process of porting the dual boot ramfs from the Galaxy S3 Siyah kernel to our Note II smartphones.
I have finished editing the ramfs, and changing the init files ect.
But the is still two files I have left to edit, and I am a bit stuck on them.
In the files /sbin/init and /sbin/ueventd the is quite a few references to theses partitions:
mknod /dev/block/mmcblk0p13 b 179 9
mknod /dev/block/mmcblk0p16 b 179 12
Click to expand...
Click to collapse
the problem is this, on the Galaxy S3 (which is what that ramfs was designed for) those partitions dont exist as far as I can see.
But on the note 2, those partitions are the /DATA and /SYSTEM partitions.
So I need to change thoses partitions to something else, but I dont know what.
I have copied the contents of the two files which thoses partitions are referenced in, and a table showing the Note 2 partitions and the coresponing S3 partitions, below
Could someone please help me find out what I should do here, as I cant do any more on the dual boot kernel till I get that sorted.
Here is the question I asked gokhan moral:
“I have edited all the files in the ramfs, apart from two files.
In the files /sbin/init and /sbin/ueventd the is 2 partitions referenced thru out them, they are:
mknod /dev/block/mmcblk0p13 b 179 9
mknod /dev/block/mmcblk0p16 b 179 12v
On the Galaxy S3, thoses partition names are un-used (as far as i know)
But on the Galaxy Note 2, thoses partitions are the /DATA and /SYSTEM partitions.
can i just change the partition names in thoses 2 files to soemthing like:
mknod /dev/block/mmcblk0p17 b 179 9
mknod /dev/block/mmcblk0p18 b 179 12v
or do i need to do something else to rename thoses two partitions?.”
Click to expand...
Click to collapse
And here is Gokhan Morals Response:
“block devices are created using the major and minor id's specific to your device (those do not change normally but you need to check anyway). so if they are mounted and needed you create them. if they are not needed in the script you don't have to create them. you have to try to keep the same functionality in the script. if you mount /system then you will need the block device that corresponds to /system with the correct major and minor numbers.”
Click to expand...
Click to collapse
but I still dont understand what I am supposed to do (I am not really a developer, I am more of a web designer ect)
Could someone please explain in simpler steps what I should do to rename thoses two partitions.
Here are the file contents (both files have the same contents, so i have only copied one here)
INIT:
#!/sbin/busybox sh
cd /
busybox mount -t proc proc /proc
busybox mount -t sysfs sysfs /sys
if busybox grep -q 1 /sys/class/power_supply/battery/batt_lp_charging ; then
# low power mode
echo 0 > /proc/sys/kernel/rom_feature_set
cp -a /res/misc/init.41/* /
chmod 755 /innt
chmod 644 /*.rc
chmod 644 /*.prop
exec /sbin/init2
fi
SECONDROM=1
NOBOOTLOGO=0
mkdir -p /dev/block
mkdir /dev/input
mkdir /dev/graphics
mknod /dev/graphics/fb0 c 29 0
mknod /dev/input/event1 c 13 65
mknod /dev/input/event2 c 13 66
mknod /dev/input/event8 c 13 72
mknod /dev/input/event9 c 13 73
mknod /dev/ashmem c 10 60
mknod /dev/block/mmcblk0p13 b 179 9
mknod /dev/block/mmcblk0p16 b 179 12
mknod /dev/block/loop0 b 7 0
mkdir /mnt
chmod 755 /mnt
mkdir /.secondrom
mount -t ext4 /dev/block/mmcblk0p16 /.secondrom
NEXTBOOT=`cat /.secondrom/media/.nextboot`
rm -f /.secondrom/media/.nextboot
DEFAULTROM=`cat /.secondrom/media/.defaultrom`
if grep -q bootmode=2 /proc/cmdline ; then
NEXTBOOT=0
fi
if [ "$NEXTBOOT" == "0" ]; then
mv -f /res/etc /
umount /.secondrom
echo 0 > /proc/sys/kernel/rom_feature_set
mv -f /res/misc/init.41/* /
mv -f /res/misc/recovery/* /
chmod 755 /innt
chmod 644 /*.smdk4x12
chmod 644 /*.rc
chmod 644 /*.prop
chmod -R 755 /lib
exec /sbin/init2
fi
SECONDROM=1
NOBOOTLOGO=0
[ -f /.secondrom/media/.secondrom/system.img ] || SECONDROM=0
[ -f /.secondrom/media/.nobootlogo ] && NOBOOTLOGO=1
if [ "$SECONDROM" == "0" ];then
if [ "$NOBOOTLOGO" == "0" ];then
/sbin/choose_rom $SECONDROM
fi
else
if [ "$NEXTBOOT" == "1" ];then
SECONDROM=0;
elif [ "$NEXTBOOT" == "2" ];then
SECONDROM=1;
else
if [ "$NOBOOTLOGO" == "1" ];then
SECONDROM=$DEFAULTROM
elif [ "$DEFAULTROM" == "1" ];then
/sbin/choose_rom $SECONDROM
if [ "$?" == "1" ]; then
SECONDROM=0
else
SECONDROM=1
fi
else
/sbin/choose_rom $SECONDROM
if [ "$?" == "1" ]; then
SECONDROM=1
else
SECONDROM=0
fi
fi
fi
fi
if [ "$SECONDROM" == "1" ]; then
mount -t ext4 /.secondrom/media/.secondrom/system.img /system
else
mount -t ext4 /dev/block/mmcblk0p13 /system
fi
AOSP=0
MIUI=0
CM10=0
JB=0
[ -f /system/framework/framework2.jar ] || AOSP=1
[ -f /system/framework/miui-framework.jar ] && MIUI=1
[ -f /system/lib/ssl/engines/libkeystore.so ] && JB=1
[ -f /system/framework/seccamera.jar ] || CM10=1
if [ "$JB" == 1 ];
then
if [ "$CM10" == 1 ];
then
echo 3 > /proc/sys/kernel/rom_feature_set
mv -f /lib/modules/dhd_cm.ko /lib/modules/dhd.ko
mv -f /res/misc/init.cm10/* /
else
echo 2 > /proc/sys/kernel/rom_feature_set
mv -f /res/misc/init.41/* /
fi
fi
if [ "$SECONDROM" == "1" ];then
mv /init.smdk4x12.rc.2 /init.smdk4x12.rc
mv /init.rc.2 /init.rc
mv /fstab.smdk4x12.2 /fstab.smdk4x12
else
rm -f /init.rc.2 /init.smdk4x12.rc.2 /fstab.smdk4x12.2
fi
umount -f /system
umount -f /.secondrom
rm -rf /res/misc/init*
chmod 755 /innt
chmod 644 /*.smdk4x12
chmod 644 /*.rc
chmod 644 /*.prop
chmod -R 755 /lib
# misc mods for i9300
insmod /lib/modules/m0_mods.ko
# cpu undervolting interfaces
insmod /lib/modules/cpu_undervolting.ko
# mali (gpu) interfaces
insmod /lib/modules/mali_control.ko
# additional CPU governors
insmod /lib/modules/cpufreq_hotplug.ko
insmod /lib/modules/cpufreq_lulzactiveq.ko
# additional I/O schedulers
insmod /lib/modules/sio-iosched.ko
insmod /lib/modules/vr-iosched.ko
# audio enhancements
insmod /lib/modules/kscoobydoo.ko devicename=scoobydoo_sound
exec /sbin/init2
Click to expand...
Click to collapse
And here is the partition layouts:
PARTITION: ` Galaxy S3 Galaxy Note 2
/BOOT mmcblk0p5 mmcblk0p8
/BOTA0 mmcblk0p1 mmcblk0p1
/BOTA1 mmcblk0p2 mmcblk0p2
/CACHE mmcblk0p8 mmcblk0p12
/EFS mmcblk0p3 mmcblk0p3
/HIDDEN mmcblk0p10 mmcblk0p14
/OTA mmcblk0p11 mmcblk0p15
/PARAM mmcblk0p4 mmcblk0p7
/RADIO mmcblk0p7 mmcblk0p10
/RECOVERY mmcblk0p6 mmcblk0p9
/SYSTEM mmcblk0p9 mmcblk0p13
/TOMBSTONES unknown mmcblk0p11
/USERDATA mmcblk0p12 mmcblk0p16
Click to expand...
Click to collapse
I think i copied thoses partitions right from my pc, but i may have got one mixed up or something
Please can someone help, as i have been searching for days, and asking lots of different people on xda, but no response
Thanks in advance
Cheers
Corey
First, if "herbew" is a friend of yours, please ask him to never send me a PM asking me to help someone ELSE. That's just spam.
On the i9300 (and Note2) devices, I'm surprised to see any calls at all to mknod. Most of the device files are created automatically these days. However, I'm NOT familiar with Gokhan's dual boot thing (I've never used it and I don't have an i9300 anymore to tinker with it.) I'm assuming that you'd like to reverse engineer what Gokhan has done and it's often more fun to work backwards than to just nag him until he helps. So, I can't answer how to make it work, but I might be able to help you to reverse engineer or understand what is going on.
To find out more about your device nodes for mmcblk devices, you can run the following command (rooted, of course):
Code:
ls -l /dev/block/mmc*
The output will contain several lines similar to:
Code:
brw-rw---- 1 system root 179, 7 Dec 18 22:28 mmcblk0p7
In this case, the device major id is 179 and the minor id is 7. To see what those major ID's are, run "cat /proc/devices". (This doesn't show ALL device ID's used by the system, but covers most of them.) Another way to see all the partitions within the system is "cat /proc/partitions".
Doing the above on a i9300 both with and without the dual boot stuff might give some hints as to what changes the dualboot thing is making. You might also consider taking a look at whatever is used to install that dualboot stuff. Is it ONLY a kernel, or something more? Is it re-partitioning the device?
From what I could see of that init file, p16 is a partition used to store the secondary boot related flags and a system image. p13 appears to be the "primary" /system image partition.
Some questions to ask yourself:
What is the /system partition on a normal (non-dualboot) i9300? Is it p13 or something else? Does p16 exist in /proc/partitions on a non-dualboot system? In that non-dual boot setup, is there ANY device with a major of 179 and minor of 12? (My first thought would be it would be named mmcblk0p12)
Disclaimer: I'm going to try to avoid solving this for you. I'd prefer if I can guide you to solving it yourself and then sharing the results.
garyd9 said:
First, if "herbew" is a friend of yours, please ask him to never send me a PM asking me to help someone ELSE. That's just spam.
On the i9300 (and Note2) devices, I'm surprised to see any calls at all to mknod. Most of the device files are created automatically these days. However, I'm NOT familiar with Gokhan's dual boot thing (I've never used it and I don't have an i9300 anymore to tinker with it.) I'm assuming that you'd like to reverse engineer what Gokhan has done and it's often more fun to work backwards than to just nag him until he helps. So, I can't answer how to make it work, but I might be able to help you to reverse engineer or understand what is going on.
To find out more about your device nodes for mmcblk devices, you can run the following command (rooted, of course):
Code:
ls -l /dev/block/mmc*
The output will contain several lines similar to:
Code:
brw-rw---- 1 system root 179, 7 Dec 18 22:28 mmcblk0p7
In this case, the device major id is 179 and the minor id is 7. To see what those major ID's are, run "cat /proc/devices". (This doesn't show ALL device ID's used by the system, but covers most of them.) Another way to see all the partitions within the system is "cat /proc/partitions".
Doing the above on a i9300 both with and without the dual boot stuff might give some hints as to what changes the dualboot thing is making. You might also consider taking a look at whatever is used to install that dualboot stuff. Is it ONLY a kernel, or something more? Is it re-partitioning the device?
From what I could see of that init file, p16 is a partition used to store the secondary boot related flags and a system image. p13 appears to be the "primary" /system image partition.
Some questions to ask yourself:
What is the /system partition on a normal (non-dualboot) i9300? Is it p13 or something else? Does p16 exist in /proc/partitions on a non-dualboot system? In that non-dual boot setup, is there ANY device with a major of 179 and minor of 12? (My first thought would be it would be named mmcblk0p12)
Disclaimer: I'm going to try to avoid solving this for you. I'd prefer if I can guide you to solving it yourself and then sharing the results.
Click to expand...
Click to collapse
Hi,
Yes Herbew is a friend of mine, but i didn't tell him to start private messaging people like that lol, I think he just gets a bit carried away, I will tell him to stop .
I will try running thoses commands on my note 2 to get the device id ect tomorrow thanks.
And on a normal S3, the is no partitions past p12 (I think the /system partition is either p7 or p9, i will check tomorrow) hence why I am stuck
I don't have a galaxy S3, so i can't run thoses commands u said, is the any other way I can work it out?, without spending $500 on a s3?. Thanks.
Thanks for your help.
Sent from my GT-N7100
fishingfon said:
I don't have a galaxy S3, so i can't run thoses commands u said, is the any other way I can work it out?, without spending $500 on a s3?. Thanks.
Click to expand...
Click to collapse
If I wanted that info, I'd probably post a message in the i9300/General section titled "Need a rooted user to help" and containing a message body similar to:
Can someone who is rooted, comfortable with a shell prompt, and NOT running any kind of dualboot, please run the following commands and send me (or reply with) the results? "ls -l /dev/block/mmc*", "cat /proc/devices", and "cat /proc/partitions"
Thank you,
YourNameHere
Click to expand...
Click to collapse
You might also ask that a person who IS running dualboot do the same thing so you can compare them. Just be sure that they tell you if they are/aren't doing dualboot so you don't get mixed up which is which. Another thing that might be helpful is to compare the init scripts of a non-dualboot kernel's initramfs with the ones you already have. Understanding what is different might be the key to understanding what you'll have to change on the note2.
Gary
garyd9 said:
If I wanted that info, I'd probably post a message in the i9300/General section titled "Need a rooted user to help" and containing a message body similar to:
You might also ask that a person who IS running dualboot do the same thing so you can compare them. Just be sure that they tell you if they are/aren't doing dualboot so you don't get mixed up which is which. Another thing that might be helpful is to compare the init scripts of a non-dualboot kernel's initramfs with the ones you already have. Understanding what is different might be the key to understanding what you'll have to change on the note2.
Gary
Click to expand...
Click to collapse
Ok thanks, I will make a thread in the s3 section tomorrow.
I have already replaced all the init files in /res/misc/init.41 with the stock ones from the root of the ramfs from a stock boot img (when the phone starts, if it detects a jb stock rom, it will move all the init files from init.41 to the root of the ramfs). So they are already stock.
I will have another look thru the stock Sammy ramfs tomorrow, and see if I can find a init file in /sbin (where the one i am having trouble with came from).
I can't get on my pc right now, as the is about 200 ants that have decided to move in to the laptop, so i need to figure out how to remove them before I can look
Thanks again for your help.
Corey
Sent from my GT-N7100
Still no luck
http://forum.xda-developers.com/showthread.php?t=2058538
Cheers
Corey
Sent from my GT-N7100
garyd9 said:
If I wanted that info, I'd probably post a message in the i9300/General section titled "Need a rooted user to help" and containing a message body similar to:
You might also ask that a person who IS running dualboot do the same thing so you can compare them. Just be sure that they tell you if they are/aren't doing dualboot so you don't get mixed up which is which. Another thing that might be helpful is to compare the init scripts of a non-dualboot kernel's initramfs with the ones you already have. Understanding what is different might be the key to understanding what you'll have to change on the note2.
Gary
Click to expand...
Click to collapse
Hi,
I have got the results from typing 2 of the things in the terminal on the s3, and I will compare them when I get home, but i havent got the results from typing "ls -l /dev/block/mmc*" tho, do i really need the results from that command, or are the ones from the other 2 commands enough?.
Thanks
Cheers
Corey
EDIT: i have found someone to get me the results from "
ls -l /dev/block/mmc" so ignore the message above
Sent from my GT-N7100
Hi,
I have got the results from thoses 3 commands u said to run in the terminal, and u can see the is 3 extra devices when the dual boot kernel is installed on the S3. theses are the devices:
brw------- root root 179, 16 2012-12-22 12:53 mmcblk0boot0
brw------- root root 179, 32 2012-12-22 12:53 mmcblk0boot1
7 1 1572864 loop1
Here are the full results from the terminal:
Code:
"Siyah Dual boot 1.8.4,booted in to 2nd Rom ParanoidAndroid 2.54"
[email protected]:/ $ su
[email protected]:/ # ls -l /dev/block/mmc*
brw------- root root 179, 0 2012-12-22 12:53 mmcblk0
brw------- root root 179, 16 2012-12-22 12:53 mmcblk0boot0
brw------- root root 179, 32 2012-12-22 12:53 mmcblk0boot1
brw------- root root 179, 1 2012-12-22 12:53 mmcblk0p1
brw------- root root 179, 10 2012-12-22 12:53 mmcblk0p10
brw------- root root 179, 11 2012-12-22 12:53 mmcblk0p11
brw------- root root 179, 12 2012-12-22 12:53 mmcblk0p12
brw------- root root 179, 2 2012-12-22 12:53 mmcblk0p2
brw------- root root 179, 3 2012-12-22 12:53 mmcblk0p3
brw-rw---- system system 179, 4 2012-12-22 12:53 mmcblk0p4
brw------- root root 179, 5 2012-12-22 12:53 mmcblk0p5
brw------- root root 179, 6 2012-12-22 12:53 mmcblk0p6
brw-rw---- system radio 179, 7 2012-12-22 12:53 mmcblk0p7
brw------- root root 179, 8 2012-12-22 12:53 mmcblk0p8
brw------- root root 179, 9 2012-12-22 12:53 mmcblk0p9
brw------- root root 179, 48 2012-12-22 12:53 mmcblk1
brw------- root root 179, 49 2012-12-22 12:53 mmcblk1p1
[email protected]:/ # cat /proc/devices
Character devices:
1 mem
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
13 input
21 sg
29 fb
81 video4linux
89 i2c
108 ppp
116 alsa
128 ptm
136 pts
153 spi
180 usb
188 ttyUSB
189 usb_device
204 ttySAC
216 rfcomm
243 ump
244 mali
248 ttyGS
249 roccat
250 BaseRemoteCtl
251 media
252 usbmon
253 tzic
254 rtc
Block devices:
1 ramdisk
259 blkext
7 loop
8 sd
65 sd
66 sd
67 sd
68 sd
69 sd
70 sd
71 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
179 mmc
254 device-mapper
[email protected]:/ # cat /proc/partitions
major minor #blocks name
7 0 1572864 loop0
7 1 1572864 loop1
179 0 15388672 mmcblk0
179 1 4096 mmcblk0p1
179 2 4096 mmcblk0p2
179 3 20480 mmcblk0p3
179 4 8192 mmcblk0p4
179 5 8192 mmcblk0p5
179 6 8192 mmcblk0p6
179 7 32768 mmcblk0p7
179 8 1048576 mmcblk0p8
179 9 1572864 mmcblk0p9
179 10 573440 mmcblk0p10
179 11 8192 mmcblk0p11
179 12 12091392 mmcblk0p12
179 32 2048 mmcblk0boot1
179 16 2048 mmcblk0boot0
179 48 30657536 mmcblk1
179 49 30653440 mmcblk1p1
[email protected]:/ #
Code:
"Siyah DualBoot 1.8.4,booted in to 1st rom XXELKC Samsung Rom"
[email protected]:/ $ su
[email protected]:/ # ls -l /dev/block/mmc*
brw------- root root 179, 0 2012-12-22 12:10 mmcblk0
brw------- root root 179, 16 2012-12-22 12:10 mmcblk0boot0
brw------- root root 179, 32 2012-12-22 12:10 mmcblk0boot1
brw------- root root 179, 1 2012-12-22 12:10 mmcblk0p1
brw------- root root 179, 10 2012-12-22 12:10 mmcblk0p10
brw------- root root 179, 11 2012-12-22 12:10 mmcblk0p11
brw------- root root 179, 12 2012-12-22 12:10 mmcblk0p12
brw------- root root 179, 2 2012-12-22 12:10 mmcblk0p2
brw------- root root 179, 3 2012-12-22 12:10 mmcblk0p3
brw-rw---- system system 179, 4 2012-12-22 12:11 mmcblk0p4
brw------- root root 179, 5 2012-12-22 12:10 mmcblk0p5
brw------- root root 179, 6 2012-12-22 12:10 mmcblk0p6
brw-rw---- system radio 179, 7 2012-12-22 12:10 mmcblk0p7
brw------- root root 179, 8 2012-12-22 12:10 mmcblk0p8
brw------- root root 179, 9 2012-12-22 12:10 mmcblk0p9
brw------- root root 179, 48 2012-12-22 12:10 mmcblk1
brw------- root root 179, 49 2012-12-22 12:10 mmcblk1p1
[email protected]:/ # cat /proc/devices
Character devices:
1 mem
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
13 input
21 sg
29 fb
81 video4linux
89 i2c
108 ppp
116 alsa
128 ptm
136 pts
153 spi
180 usb
188 ttyUSB
189 usb_device
204 ttySAC
216 rfcomm
243 ump
244 mali
248 ttyGS
249 roccat
250 BaseRemoteCtl
251 media
252 usbmon
253 tzic
254 rtc
Block devices:
1 ramdisk
259 blkext
7 loop
8 sd
65 sd
66 sd
67 sd
68 sd
69 sd
70 sd
71 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
179 mmc
254 device-mapper
[email protected]:/ # cat /proc/partitions
major minor #blocks name
7 0 2111 loop0
179 0 15388672 mmcblk0
179 1 4096 mmcblk0p1
179 2 4096 mmcblk0p2
179 3 20480 mmcblk0p3
179 4 8192 mmcblk0p4
179 5 8192 mmcblk0p5
179 6 8192 mmcblk0p6
179 7 32768 mmcblk0p7
179 8 1048576 mmcblk0p8
179 9 1572864 mmcblk0p9
179 10 573440 mmcblk0p10
179 11 8192 mmcblk0p11
179 12 12091392 mmcblk0p12
179 32 2048 mmcblk0boot1
179 16 2048 mmcblk0boot0
179 48 30657536 mmcblk1
179 49 30653440 mmcblk1p1
254 0 2110 dm-0
[email protected]:/ #
Code:
"Stock Kernel (ELK4) + XXELKC Samsung Rom"
[email protected]:/ $ su
[email protected]:/ # ls -l /dev/block/mmc*
brw------- root root 179, 0 2012-12-22 12:57 mmcblk0
brw------- root root 179, 1 2012-12-22 12:57 mmcblk0p1
brw------- root root 179, 10 2012-12-22 12:57 mmcblk0p10
brw------- root root 179, 11 2012-12-22 12:57 mmcblk0p11
brw------- root root 179, 12 2012-12-22 12:57 mmcblk0p12
brw------- root root 179, 2 2012-12-22 12:57 mmcblk0p2
brw------- root root 179, 3 2012-12-22 12:57 mmcblk0p3
brw-rw---- system system 179, 4 2012-12-22 12:58 mmcblk0p4
brw------- root root 179, 5 2012-12-22 12:57 mmcblk0p5
brw------- root root 179, 6 2012-12-22 12:57 mmcblk0p6
brw-rw---- system radio 179, 7 2012-12-22 12:57 mmcblk0p7
brw------- root root 179, 8 2012-12-22 12:57 mmcblk0p8
brw------- root root 179, 9 2012-12-22 12:57 mmcblk0p9
brw------- root root 179, 16 2012-12-22 12:57 mmcblk1
brw------- root root 179, 17 2012-12-22 12:57 mmcblk1p1
[email protected]:/ # cat /proc/devices
Character devices:
1 mem
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
13 input
21 sg
29 fb
81 video4linux
89 i2c
108 ppp
116 alsa
128 ptm
136 pts
153 spi
180 usb
188 ttyUSB
189 usb_device
204 ttySAC
216 rfcomm
243 ump
244 mali
248 roccat
249 BaseRemoteCtl
250 media
251 ttyGS
252 usbmon
253 tzic
254 rtc
Block devices:
1 ramdisk
259 blkext
7 loop
8 sd
65 sd
66 sd
67 sd
68 sd
69 sd
70 sd
71 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
179 mmc
254 device-mapper
[email protected]:/ # cat /proc/partitions
major minor #blocks name
7 0 2111 loop0
179 0 15388672 mmcblk0
179 1 4096 mmcblk0p1
179 2 4096 mmcblk0p2
179 3 20480 mmcblk0p3
179 4 8192 mmcblk0p4
179 5 8192 mmcblk0p5
179 6 8192 mmcblk0p6
179 7 32768 mmcblk0p7
179 8 1048576 mmcblk0p8
179 9 1572864 mmcblk0p9
179 10 573440 mmcblk0p10
179 11 8192 mmcblk0p11
179 12 12091392 mmcblk0p12
179 16 30657536 mmcblk1
179 17 30653440 mmcblk1p1
254 0 2110 dm-0
[email protected]:/ #
And here is the results I got from typing the commands in my Note
II
Code:
[email protected]:/ $ export PATH=/data/local/bin:$PATH
[email protected]:/ $ su
[email protected]:/ # ls -l /dev/block/mmc*
brw------- root root 179, 0 2012-12-22 08:35 mmcblk0
brw------- root root 179, 1 2012-12-22 08:35 mmcblk0p1
brw-rw---- system radio 179, 10 2012-12-22 08:35 mmcblk0p10
brw-rw---- system radio 179, 11 2012-12-22 08:35 mmcblk0p11
brw------- root root 179, 12 2012-12-22 08:35 mmcblk0p12
brw------- root root 179, 13 2012-12-22 08:35 mmcblk0p13
brw------- root root 179, 14 2012-12-22 08:35 mmcblk0p14
brw------- root root 179, 15 2012-12-22 08:35 mmcblk0p15
brw------- root root 259, 0 2012-12-22 08:35 mmcblk0p16
brw------- root root 179, 2 2012-12-22 08:35 mmcblk0p2
brw------- root root 179, 3 2012-12-22 08:35 mmcblk0p3
brw-rw---- system radio 179, 4 2012-12-22 08:35 mmcblk0p4
brw-rw---- system radio 179, 5 2012-12-22 08:35 mmcblk0p5
brw-rw---- system radio 179, 6 2012-12-22 08:35 mmcblk0p6
brw-rw---- system root 179, 7 2012-12-22 08:35 mmcblk0p7
brw------- root root 179, 8 2012-12-22 08:35 mmcblk0p8
brw------- root root 179, 9 2012-12-22 08:35 mmcblk0p9
brw------- root root 179, 16 2012-12-22 08:35 mmcblk1
brw------- root root 179, 17 2012-12-22 08:35 mmcblk1p1
[email protected]:/ # cat /proc/devices
Character devices:
1 mem
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
13 input
21 sg
29 fb
81 video4linux
89 i2c
108 ppp
116 alsa
128 ptm
136 pts
153 spi
180 usb
188 ttyUSB
189 usb_device
204 ttySAC
216 rfcomm
243 ump
244 mali
248 roccat
249 BaseRemoteCtl
250 media
251 ttyGS
252 usbmon
253 tzic
254 rtc
Block devices:
1 ramdisk
259 blkext
7 loop
8 sd
65 sd
66 sd
67 sd
68 sd
69 sd
70 sd
71 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
179 mmc
254 device-mapper
[email protected]:/ # cat /proc/partitions
major minor #blocks name
7 0 47849 loop0
7 1 12506 loop1
7 2 14585 loop2
7 3 2111 loop3
7 4 3150 loop4
7 5 35375 loop5
7 6 34335 loop6
7 7 2111 loop7
179 0 15388672 mmcblk0
179 1 4096 mmcblk0p1
179 2 4096 mmcblk0p2
179 3 20480 mmcblk0p3
179 4 4096 mmcblk0p4
179 5 4096 mmcblk0p5
179 6 4096 mmcblk0p6
179 7 8192 mmcblk0p7
179 8 8192 mmcblk0p8
179 9 8192 mmcblk0p9
179 10 90112 mmcblk0p10
179 11 4096 mmcblk0p11
179 12 1400832 mmcblk0p12
179 13 2097152 mmcblk0p13
179 14 573440 mmcblk0p14
179 15 8192 mmcblk0p15
259 0 11141120 mmcblk0p16
179 16 62367744 mmcblk1
179 17 62351360 mmcblk1p1
254 0 47848 dm-0
254 1 12505 dm-1
254 2 14584 dm-2
254 3 2110 dm-3
254 4 3150 dm-4
254 5 35374 dm-5
254 6 34335 dm-6
254 7 2110 dm-7
7 8 13545 loop8
254 8 13545 dm-8
7 9 16664 loop9
254 9 16663 dm-9
7 10 2111 loop10
254 10 2110 dm-10
7 11 43691 loop11
254 11 43690 dm-11
7 12 8348 loop12
254 12 8347 dm-12
7 13 9387 loop13
254 13 9387 dm-13
7 14 21861 loop14
254 14 21861 dm-14
[email protected]:/ #
Do u know how I would get thoses two extra partitions on the note 2?. are thoses the same partitions that I mentioned in the first post (p13 and p16)??.
Thanks again for your help.
Corey
Ps,
The /system and /data partitions on a stick non-dual boot s3 are p9 and p12, and they have the minor of 9 and 12, just like the partitions p13 and p16 I mentioned in the first post. But the partitions on the first post have different names. Do u have any idea why that could be?.
Cheers
Corey
Sent from my GT-N7100
What I'm NOT seeing is the mmcblk0p13 and mmcblk0p16 devices that are supposedly made by the init script on the dual boot s3. Any idea why not?
garyd9 said:
What I'm NOT seeing is the mmcblk0p13 and mmcblk0p16 devices that are supposedly made by the init script on the dual boot s3. Any idea why not?
Click to expand...
Click to collapse
Hi,
No I have no idea
Also I can't find anything in the script about the 3 devices that are made, so i have absolutely no idea.
I asked Gokhan moral about them, and here is my message and then his:
" Hi,
I have spent the last day or two trying to figure out how to change the names of theses partitions that are referenced in /sbin/init
mknod /dev/block/mmcblk0p13 b 179 9
mknod /dev/block/mmcblk0p16 b 179 12
But well I was doing that (I still haven't worked it out ). I noticed that when the dual boot is installed on a galaxy S3, the is 3 extra devices in dev/block
they are:
brw------- root root 179, 16 2012-12-22 12:53 mmcblk0boot0
brw------- root root 179 32 2012-12-22 12:53 mmcblk0boot1
7 1 1572864 loop1
I have already been thru the scripts lots of times, and I never noticed any partitions named this. I was just wondering if you could explain what files theses partitions are referenced in?. as I cant find them anywhere."
And here is his response:
" They are not referenced in any of my modifications because they are not needed for any of my customizations. I only create devices that I want to mount and mount them to some directories and try to understand the rom type. Once I get the rom type I initialize the corresponding init sequence by moving init files to the original location, move innt to init and exec it. That is all and there is no more in those scripts. Now try to read them once again and try to map my descriptions to that script. When I say init script I mean the symbolic link from /init to /sbin/init. "
Do u have any idea what I should do?, as i am a bit stuck
Thanks
Cheers
Corey
Sent from my GT-N7100
Okay...
First, the mmc*boot? device nodes are for the boot loaders - please ignore those device nodes. Act like they don't exist. Don't mess with them. Ever. If there's one way to brick a samsung phone, it's by messing up the bootloaders. (Thanks to people like Adam Outler, you might still be able to recover, but only via hardware tinkering.)
So, let's back up and not be concerned about what the device nodes are named, but more concerned about what the device nodes are USED FOR (in relation to dual booting.) If I'm correct, you really aren't concerned about those device node names, but are more concerned about getting the dual boot working.
Is that init script in the OP unmolested? The reason I'm asking is that parts of it aren't making sense to me. For example, it's mounting the /system directory either via an image file OR from mmcblk0p13. However, you've stated that the SGS3 has the SYSTEM partition on mmcblk0p9. It almost appears as if you (or someone else) might have started editing the init script to make it work with a device that has the system partition on p13 (such as the note2.) That would also match with the fact that p16 on the Note2 is the data (userdata) partition...
Actually, that might be exactly what's going on here. The mknod parameters are creating device nodes to the existing p9/p12 partitions, but giving them different names that just happen to match the names used on the Note2...
You could, in theory, do something similar to what you suggested in your OP, but you'd need to do it a bit differently.... Instead of making device nodes with unused names and minors of 9/12, you'd want to use unused names and minors of 13 and 16. Let me explain...
Here is the code you said was in the sgs3 init script (along with comments followed by "//")
Code:
mknod /dev/block/mmcblk0p13 b 179 9 // creates a device node called p13 but is identical to p9
mknod /dev/block/mmcblk0p16 b 179 12 // creates a device node called p16 but is identical to p12
So, in your init script, /dev/block/mmcblk0p13 is referencing the EXACT SAME DEVICE as /dev/block/mmcblk0p9 (and the same for the created p16 device and the already existing p12 device.)
Wow, I really hope that not only am I making sense, but also that you are following me. I'm going to start rambling even more.
You kind of have to understand how device nodes work, etc. The NAME of the device node doesn't matter. What matters is if it's a block or character device, the MAJOR number and the MINOR number. For block types of MAJOR 179, it's referring to a MMC device. For block/MMC (b 179). the minor number specifies the partition of the device. (I'm simplifying here - it's actually a masked value that includes a partition and device - and gets more interesting with > 16 partitions that require different majors)
So, you could (in theory) go into that script that works fine on the sgs3 and rename every occurrence of "mmcblk0p16" with "i_like_sex" and it'll still work on the sgs3 (even if you didn't like sex.)
Okay... so back to the script. Keep in mind that I'm basing EVERYTHING on that one script and haven't seen anything else related to this multi-boot thing. It'd probably help if someone gave me a link (I'm too lazy to search) to something that installs this multi-boot stuff.
Anyway, that script. I'm going to do something here for clarity. Instead of referencing the misleading "mmcblk0p13" and "mmcblk0p16" device node nodes, I'm just going to call them "extra13" and "extra16" (because they are NOT referencing partitions 13/16.)
So, in that script, extra13 is actually pointing to partition9 which (based on your information) is the SYSTEM partition (mmcblk0p9) and extra16 is actually pointing to partition12 which (again based on your info) is the USERDATA partition.
In other words, extra13 is pointing to what is normally mounted as "/system" and extra16 is pointing to what is normally mounted as "/data". However, at least for getting the dual boot stuff kick started, it's mounting extra16 in "/.secondrom" instead of "/data".
THAT should be enough information to get you going towards solving your issue.
Personally, I think that whoever decided to use mmcblk0p13 and mmcblk0p16 as fictional device node names on the sgs3 should be thumped in the head for either intentionally or unintentionally creating confusion. It might be due to one of the other dependencies of the dual booting system (what is "/sbin/choose_rom"?) that they were unwilling (or unable) to fix. It might also just be a way to try and make the stuff a pain to port. I don't know their intentions/motives.
I will offer this: If my explanation didn't make sense, you might want to take a few steps back and learn what all of it means before you keep going with the porting effort. Some of the concepts here are important to know, and some basic understanding of device nodes is important when mounting file systems.
Take care
Gary
garyd9 said:
Okay...
First, the mmc*boot? device nodes are for the boot loaders - please ignore those device nodes. Act like they don't exist. Don't mess with them. Ever. If there's one way to brick a samsung phone, it's by messing up the bootloaders. (Thanks to people like Adam Outler, you might still be able to recover, but only via hardware tinkering.)
So, let's back up and not be concerned about what the device nodes are named, but more concerned about what the device nodes are USED FOR (in relation to dual booting.) If I'm correct, you really aren't concerned about those device node names, but are more concerned about getting the dual boot working.
Is that init script in the OP unmolested? The reason I'm asking is that parts of it aren't making sense to me. For example, it's mounting the /system directory either via an image file OR from mmcblk0p13. However, you've stated that the SGS3 has the SYSTEM partition on mmcblk0p9. It almost appears as if you (or someone else) might have started editing the init script to make it work with a device that has the system partition on p13 (such as the note2.) That would also match with the fact that p16 on the Note2 is the data (userdata) partition...
Actually, that might be exactly what's going on here. The mknod parameters are creating device nodes to the existing p9/p12 partitions, but giving them different names that just happen to match the names used on the Note2...
You could, in theory, do something similar to what you suggested in your OP, but you'd need to do it a bit differently.... Instead of making device nodes with unused names and minors of 9/12, you'd want to use unused names and minors of 13 and 16. Let me explain...
Here is the code you said was in the sgs3 init script (along with comments followed by "//")
Code:
mknod /dev/block/mmcblk0p13 b 179 9 // creates a device node called p13 but is identical to p9
mknod /dev/block/mmcblk0p16 b 179 12 // creates a device node called p16 but is identical to p12
So, in your init script, /dev/block/mmcblk0p13 is referencing the EXACT SAME DEVICE as /dev/block/mmcblk0p9 (and the same for the created p16 device and the already existing p12 device.)
Wow, I really hope that not only am I making sense, but also that you are following me. I'm going to start rambling even more.
You kind of have to understand how device nodes work, etc. The NAME of the device node doesn't matter. What matters is if it's a block or character device, the MAJOR number and the MINOR number. For block types of MAJOR 179, it's referring to a MMC device. For block/MMC (b 179). the minor number specifies the partition of the device. (I'm simplifying here - it's actually a masked value that includes a partition and device - and gets more interesting with > 16 partitions that require different majors)
So, you could (in theory) go into that script that works fine on the sgs3 and rename every occurrence of "mmcblk0p16" with "i_like_sex" and it'll still work on the sgs3 (even if you didn't like sex.)
Okay... so back to the script. Keep in mind that I'm basing EVERYTHING on that one script and haven't seen anything else related to this multi-boot thing. It'd probably help if someone gave me a link (I'm too lazy to search) to something that installs this multi-boot stuff.
Anyway, that script. I'm going to do something here for clarity. Instead of referencing the misleading "mmcblk0p13" and "mmcblk0p16" device node nodes, I'm just going to call them "extra13" and "extra16" (because they are NOT referencing partitions 13/16.)
So, in that script, extra13 is actually pointing to partition9 which (based on your information) is the SYSTEM partition (mmcblk0p9) and extra16 is actually pointing to partition12 which (again based on your info) is the USERDATA partition.
In other words, extra13 is pointing to what is normally mounted as "/system" and extra16 is pointing to what is normally mounted as "/data". However, at least for getting the dual boot stuff kick started, it's mounting extra16 in "/.secondrom" instead of "/data".
THAT should be enough information to get you going towards solving your issue.
Personally, I think that whoever decided to use mmcblk0p13 and mmcblk0p16 as fictional device node names on the sgs3 should be thumped in the head for either intentionally or unintentionally creating confusion. It might be due to one of the other dependencies of the dual booting system (what is "/sbin/choose_rom"?) that they were unwilling (or unable) to fix. It might also just be a way to try and make the stuff a pain to port. I don't know their intentions/motives.
I will offer this: If my explanation didn't make sense, you might want to take a few steps back and learn what all of it means before you keep going with the porting effort. Some of the concepts here are important to know, and some basic understanding of device nodes is important when mounting file systems.
Take care
Gary
Click to expand...
Click to collapse
Hi,
Thanks for your reply, i think i uderstand what i need to do.
Just to be sure tho (i would rather not brick my phone if i dont have to ), is this what u think i should do?:
Change these lines:
Code:
mknod /dev/block/mmcblk0p13 b 179 9
mknod /dev/block/mmcblk0p16 b 179 12
To:
Code:
mknod /dev/block/extra13 b 179 13
mknod /dev/block/extra16 b 259 0
Cos if u look at the Minor and majors for the data partition (p16) u see that they have thoses ids:
Code:
[email protected]:/ # ls -l /dev/block/mmc*
brw------- root root 179, 0 2012-12-22 08:35 mmcblk0
brw------- root root 179, 1 2012-12-22 08:35 mmcblk0p1
brw-rw---- system radio 179, 10 2012-12-22 08:35 mmcblk0p10
brw-rw---- system radio 179, 11 2012-12-22 08:35 mmcblk0p11
brw------- root root 179, 12 2012-12-22 08:35 mmcblk0p12
[COLOR="Red"] brw------- root root 179, 13 2012-12-22 08:35 mmcblk0p13[/COLOR]
brw------- root root 179, 14 2012-12-22 08:35 mmcblk0p14
brw------- root root 179, 15 2012-12-22 08:35 mmcblk0p15
[COLOR="Red"] brw------- root root 259, 0 2012-12-22 08:35 mmcblk0p16[/COLOR]
brw------- root root 179, 2 2012-12-22 08:35 mmcblk0p2
brw------- root root 179, 3 2012-12-22 08:35 mmcblk0p3
brw-rw---- system radio 179, 4 2012-12-22 08:35 mmcblk0p4
brw-rw---- system radio 179, 5 2012-12-22 08:35 mmcblk0p5
brw-rw---- system radio 179, 6 2012-12-22 08:35 mmcblk0p6
brw-rw---- system root 179, 7 2012-12-22 08:35 mmcblk0p7
brw------- root root 179, 8 2012-12-22 08:35 mmcblk0p8
brw------- root root 179, 9 2012-12-22 08:35 mmcblk0p9
brw------- root root 179, 16 2012-12-22 08:35 mmcblk1
brw------- root root 179, 17 2012-12-22 08:35 mmcblk1p1
Does that look right to you?.
Here are the links to the dual boot kernel:
Here is the link to the ramfs i used to edit:
https://github.com/gokhanmoral/ramfs-sgs3
Here is the full kernel source code:
https://github.com/gokhanmoral/siyahkernel-sgs3
Here is the Completed kernel for the S3:
http://www.gokhanmoral.com/
the init scipt i sent was completely un-molested. it came from the source code provided by gokhanmoral, and it hadnt been edited or anything.
Thanks again for your help.
Cheers
Corey
It looks okay... obviously you'll have to change the script and perhaps some other stuff. I can't download the linked stuff right now (I'm on my phone) but will look more later.
Sent from my SAMSUNG-SGH-I317 using Tapatalk 2
garyd9 said:
It looks okay... obviously you'll have to change the script and perhaps some other stuff. I can't download the linked stuff right now (I'm on my phone) but will look more later.
Sent from my SAMSUNG-SGH-I317 using Tapatalk 2
Click to expand...
Click to collapse
Ok thanks. So do u mean I need to change the partition layout on all the scripts, and change any reference of thoses partitions mentioned earlier?. Or do u mean something else?.
Gokhan moral said I just needed to change the partition layout, and try it and see if it boots, and if it doesn't I can play around with the init file to try
And get it booting (he also said he would give me a copy of his modded recovery which has all the dual boot options if I get the dual boot booting via adb )
Thanks again
Cheers
Corey
Sent from my GT-N7100
If I helped you, please hit Thanks..
fishingfon said:
Ok thanks. So do u mean I need to change the partition layout on all the scripts, and change any reference of thoses partitions mentioned earlier?. Or do u mean something else?.
Click to expand...
Click to collapse
You'd have to change the references to the device nodes in the scripts (and anything else that might use device nodes that reference sgs3 partitions.)
take care
Gary
garyd9 said:
You'd have to change the references to the device nodes in the scripts (and anything else that might use device nodes that reference sgs3 partitions.)
take care
Gary
Click to expand...
Click to collapse
Hi,
Yes I have already done that, although I will go thru all the scripts again to check I haven't missed one before I repack the ramdisk.
Thanks
Cheers
Corey
Sent from my GT-N7100
If I helped you, please hit Thanks..
Great news, I just flashed the kernel, and it didn't brick my phone .
The first rom booted fine, with the only bug being that the external sd doesn't work (but i know what i did wrong with that).
I have cloned the data to the second rom system img, but i am still figuring out how to boot in to the second rom, as the one boot user promt doesn't work without the custom dual boot recovery (i think)
Corey
Sent from my GT-N7100
If I helped you, please hit Thanks..
fishingfon said:
If I helped you, please hit Thanks..
Click to expand...
Click to collapse
What would be more helpful is for you to post not only that you've had successes, but also to post the details of those successes to share with the community. What did you have to change with the scripts, what does the end result look like, etc.
It's annoying to see "I got it working" posts without details of HOW a person got it working. As well, the details will help the next person who tries to port it to another platform.
Take care
Gary
garyd9 said:
What would be more helpful is for you to post not only that you've had successes, but also to post the details of those successes to share with the community. What did you have to change with the scripts, what does the end result look like, etc.
It's annoying to see "I got it working" posts without details of HOW a person got it working. As well, the details will help the next person who tries to port it to another platform.
Take care
Gary
Click to expand...
Click to collapse
Hi,
I haven't finished getting it working yet, as only the first Rom is booting, i am still setting up the ext4 images ect for the second rom. i didn't really see much point in writing what u said till I had got the actual dual boot working. But when I have got the dual boot working I will write what u said.
Cheers
Corey
Sent from my GT-N7100
If I helped you, please hit Thanks..

Internal memory screwed up

Hallo guys,
got a little problem with my phone
it crashed while restoring an backup, now internal memory seems to be messed up.
1. Download Mode is working (flashed StockRom and Broodrom rc5)
2. I can reboot to recovery (I can flash other recovery, from internal sdcard, mounting USB works)
3. Mounting /system /data -> Recovery crashes
4. Factroy Reset does not work
3. When i try to flash a rom.zip it seems that only kernel is changed.
4. Factory Reset is not working
5. I can connect with adb
Perhaps you can have a look on the following outputs
fdisk -l
Code:
~ # ←[6nfdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0
~ # ←[6nfdisk -l /dev/block/mmcblk0p1
fdisk -l /dev/block/mmcblk0p1
fdisk: can't open '/dev/block/mmcblk0p1': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p2
fdisk -l /dev/block/mmcblk0p2
fdisk: can't open '/dev/block/mmcblk0p2': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p3
fdisk -l /dev/block/mmcblk0p3
fdisk: can't open '/dev/block/mmcblk0p3': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p4
fdisk -l /dev/block/mmcblk0p4
fdisk: can't open '/dev/block/mmcblk0p4': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p5
fdisk -l /dev/block/mmcblk0p5
fdisk: can't open '/dev/block/mmcblk0p5': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p6
fdisk -l /dev/block/mmcblk0p6
fdisk: can't open '/dev/block/mmcblk0p6': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p7
fdisk -l /dev/block/mmcblk0p7
fdisk: can't open '/dev/block/mmcblk0p7': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p8
fdisk -l /dev/block/mmcblk0p8
fdisk: can't open '/dev/block/mmcblk0p8': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p9
fdisk -l /dev/block/mmcblk0p9
fdisk: can't open '/dev/block/mmcblk0p9': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p10
fdisk -l /dev/block/mmcblk0p10
fdisk: can't open '/dev/block/mmcblk0p10': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p11
fdisk -l /dev/block/mmcblk0p11
fdisk: can't open '/dev/block/mmcblk0p11': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p12
fdisk -l /dev/block/mmcblk0p12
fdisk: can't open '/dev/block/mmcblk0p12': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p13
fdisk -l /dev/block/mmcblk0p13
fdisk: can't open '/dev/block/mmcblk0p13': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p14
fdisk -l /dev/block/mmcblk0p14
fdisk: can't open '/dev/block/mmcblk0p14': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p15
fdisk -l /dev/block/mmcblk0p15
fdisk: can't open '/dev/block/mmcblk0p15': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p16
fdisk -l /dev/block/mmcblk0p16
Disk /dev/block/mmcblk0p16: 104 MB, 104857600 bytes
4 heads, 16 sectors/track, 3200 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk /dev/block/mmcblk0p16 doesn't contain a valid partition table
~ # ←[6nfdisk -l /dev/block/mmcblk0p17
fdisk -l /dev/block/mmcblk0p17
fdisk: can't open '/dev/block/mmcblk0p17': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p18
fdisk -l /dev/block/mmcblk0p18
fdisk: can't open '/dev/block/mmcblk0p18': I/O error
mounting /data in recovery:
Code:
I:Actual block device: '/dev/block/mmcblk0p17', current file system: 'ext4'
E:Unable to mount '/data'
Same error on all recoverys CWM / TWRP
Perhaps someone can give an advice
Try formatting system, data and cache then install broodROM RC5 again, it might work.
Did you use the correct recovery while changing roms? you need to use cwm 5.0.0.4 atleast
Flash recovery through ODIN...
Sent from my GT-I9001 using Tapatalk 2
broodplank1337 said:
Try formatting system, data and cache then install broodROM RC5 again, it might work.
Did you use the correct recovery while changing roms? you need to use cwm 5.0.0.4 atleast
Click to expand...
Click to collapse
How can i format data with adb?
I used CWM 6.0.2.7
recovery stucks always at formating data... until i kill by pressing power button
In recovery all functions where mounting /data is not needed are working.
Works
format system
format cache
wipe android secur
Fails
mount data
wipe dalvik
fix permissions
buffo1987 said:
Hallo guys,
got a little problem with my phone
it crashed while restoring an backup, now internal memory seems to be messed up.
1. Download Mode is working (flashed StockRom and Broodrom rc5)
2. I can reboot to recovery (I can flash other recovery, from internal sdcard, mounting USB works)
3. Mounting /system /data -> Recovery crashes
4. Factroy Reset does not work
3. When i try to flash a rom.zip it seems that only kernel is changed.
4. Factory Reset is not working
5. I can connect with adb
Perhaps you can have a look on the following outputs
fdisk -l
Code:
~ # ←[6nfdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0
~ # ←[6nfdisk -l /dev/block/mmcblk0p1
fdisk -l /dev/block/mmcblk0p1
fdisk: can't open '/dev/block/mmcblk0p1': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p2
fdisk -l /dev/block/mmcblk0p2
fdisk: can't open '/dev/block/mmcblk0p2': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p3
fdisk -l /dev/block/mmcblk0p3
fdisk: can't open '/dev/block/mmcblk0p3': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p4
fdisk -l /dev/block/mmcblk0p4
fdisk: can't open '/dev/block/mmcblk0p4': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p5
fdisk -l /dev/block/mmcblk0p5
fdisk: can't open '/dev/block/mmcblk0p5': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p6
fdisk -l /dev/block/mmcblk0p6
fdisk: can't open '/dev/block/mmcblk0p6': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p7
fdisk -l /dev/block/mmcblk0p7
fdisk: can't open '/dev/block/mmcblk0p7': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p8
fdisk -l /dev/block/mmcblk0p8
fdisk: can't open '/dev/block/mmcblk0p8': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p9
fdisk -l /dev/block/mmcblk0p9
fdisk: can't open '/dev/block/mmcblk0p9': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p10
fdisk -l /dev/block/mmcblk0p10
fdisk: can't open '/dev/block/mmcblk0p10': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p11
fdisk -l /dev/block/mmcblk0p11
fdisk: can't open '/dev/block/mmcblk0p11': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p12
fdisk -l /dev/block/mmcblk0p12
fdisk: can't open '/dev/block/mmcblk0p12': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p13
fdisk -l /dev/block/mmcblk0p13
fdisk: can't open '/dev/block/mmcblk0p13': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p14
fdisk -l /dev/block/mmcblk0p14
fdisk: can't open '/dev/block/mmcblk0p14': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p15
fdisk -l /dev/block/mmcblk0p15
fdisk: can't open '/dev/block/mmcblk0p15': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p16
fdisk -l /dev/block/mmcblk0p16
Disk /dev/block/mmcblk0p16: 104 MB, 104857600 bytes
4 heads, 16 sectors/track, 3200 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk /dev/block/mmcblk0p16 doesn't contain a valid partition table
~ # ←[6nfdisk -l /dev/block/mmcblk0p17
fdisk -l /dev/block/mmcblk0p17
fdisk: can't open '/dev/block/mmcblk0p17': I/O error
~ # ←[6nfdisk -l /dev/block/mmcblk0p18
fdisk -l /dev/block/mmcblk0p18
fdisk: can't open '/dev/block/mmcblk0p18': I/O error
Perhaps someone can give an advice
Click to expand...
Click to collapse
did you use TWRP recovery ??
zikozoko said:
did you use TWRP recovery ??
Click to expand...
Click to collapse
cwm 6.0.2.7
Now i tried several recoverys TWRP and CWM but they are all working same without /data
flased broodrom rc5 again, stuck on boot. Can not factory reset, /data still not mountabel
I think your solution must be this:
You need to flash an empty data.img.ext4 to your phone using odin, I did it once, and it succeeded! But you first need to make it:
busybox dd if=/dev/zero of=/sdcard/data.img.ext4 bs=1M count=1024
1gb empty data.img.ext4 file, which can be flashed to restore the paritition
pack the file for odin:
tar -c data.img.ext4 > fix.tar
md5sum -t fix.tar >> fix.tar
mv fix.tar fix.tar.md5
So you either need cygwin or a native linux shell.
Or u can flash a stock rom via Odin and after booting install another recovery (ex 5.5.0.4 the most stable for me) and another costum rom.
VEREY IMPORTANT make sure u have the right AriesVE.ops. Try to download from SamMobile.
broodplank1337 said:
I think your solution must be this:
You need to flash an empty data.img.ext4 to your phone using odin, I did it once, and it succeeded! But you first need to make it:
busybox dd if=/dev/zero of=/sdcard/data.img.ext4 bs=1M count=1024
1gb empty data.img.ext4 file, which can be flashed to restore the paritition
pack the file for odin:
tar -c data.img.ext4 > fix.tar
md5sum -t fix.tar >> fix.tar
mv fix.tar fix.tar.md5
So you either need cygwin or a native linux shell.
Click to expand...
Click to collapse
Looks quite interesting.
I#m not sure what i have to do:
connect phone to ubuntu vm
Terminal:
Code:
$ adb busybox dd if=/dev/zero of=/sdcard/data.img.ext4 bs=1M count=1024
$ cd /sdcard/
$ tar -c data.img.ext4 > fix.tar
$ md5sum -t fix.tar >> fix.tar
$ mv fix.tar fix.tar.md5
2. Flash fix.tar.md5 as one package with odin
right?
broodplank1337 said:
I think your solution must be this:
You need to flash an empty data.img.ext4 to your phone using odin, I did it once, and it succeeded! But you first need to make it:
busybox dd if=/dev/zero of=/sdcard/data.img.ext4 bs=1M count=1024
1gb empty data.img.ext4 file, which can be flashed to restore the paritition
pack the file for odin:
tar -c data.img.ext4 > fix.tar
md5sum -t fix.tar >> fix.tar
mv fix.tar fix.tar.md5
So you either need cygwin or a native linux shell.
Click to expand...
Click to collapse
Hi , TNX
What about this script should run on recovery :
Code:
cat /dev/zero > /dev/block/mmcblk0pX
Code:
[email protected]:~$ adb shell
~ # busybox dd if=/dev/zero of=/sdcard/data.img.ext4 bs=1M count=1024
phone crashes -> data.img.ext4 is only 661 MB
will retry...
I think you did not meant me to do this on the phone.
Code:
[email protected]:~$ cd resc/
[email protected]:~/resc$ busybox dd if=/dev/zero of=^Cata.img.ext4 bs=1M count=1024
[email protected]:~/resc$ busybox dd if=/dev/zero of=data.img.ext4 bs=1M count=1024
1024+0 records in
1024+0 records out
[email protected]:~/resc$ tar -c data.img.ext4 > fix.tar
[email protected]:~/resc$ md5sum -t fix.tar >> fix.tar
[email protected]:~/resc$ mv fix.tar fix.tar.md5
I got the file now
Odin
Code:
Check MD5 FileName...
MD5 File Name : fix.tar
Open File Name : fix.tar
Check MD5 ...
Tail MD5 : 5654164EA05D41668D50F97731E2EB5A
Image MD5 : 5654164EA05D41668D50F97731E2EB5A
Check MD5 ... ok
<1> Added!!!
<1> Detected!!!
Download Start...
<0> Create File...
<1> StartThread Detected : 1
<2> StartThread Detected : 0
<3> StartThread Detected : 0
<4> StartThread Detected : 0
<5> StartThread Detected : 0
<6> StartThread Detected : 0
<7> StartThread Detected : 0
<8> StartThread Detected : 0
<1> setup connection...
<1> odin mode.. check plcatform verification.
<1> VerifyPlatform:V0, P0,R0
<1> START!!!
<1> e - unknown file - "data.img.ext4"
<1> set download environment.
<1> reset pda..
<0> Started Timer
<1> Close serial port and wait until rebooting.
Problem still exits
buffo1987 said:
Hallo guys,
got a little problem with my phone
it crashed while restoring an backup, now internal memory seems to be messed up.
1. Download Mode is working (flashed StockRom and Broodrom rc5)
2. I can reboot to recovery (I can flash other recovery, from internal sdcard, mounting USB works)
3. Mounting /system /data -> Recovery crashes
4. Factroy Reset does not work
3. When i try to flash a rom.zip it seems that only kernel is changed.
4. Factory Reset is not working
5. I can connect with adb
Perhaps you can have a look on the following outputs
fdisk -l
mounting /data in recovery:
Code:
I:Actual block device: '/dev/block/mmcblk0p17', current file system: 'ext4'
E:Unable to mount '/data'
Same error on all recoverys CWM / TWRP
Perhaps someone can give an advice
Click to expand...
Click to collapse
Hey Buffo,
I have the same problem after trying your test-versions. I could "revive" all partitions but data by downgrading recovery to 5.5.04 and formating system and cache then. But also data could not be formatted via 5.5.04 so I also will try broods proposal...
btw. this does not work to solve it.
Code:
cat /dev/zero > /dev/block/mmcblk0pX
magicw said:
Hey Buffo,
I have the same problem after trying your test-versions. I could "revive" all partitions but data by downgrading recovery to 5.5.04 and formating system and cache then. But also data could not be formatted via 5.5.04 so I also will try broods proposal...
btw. this does not work to solve it.
Code:
cat /dev/zero > /dev/block/mmcblk0pX
Click to expand...
Click to collapse
Sad to here that,
removed all cwm 6.0.2.7 downloads from my post.
At least flashing a stock rom makes the phone look untouched, so i will send it for repair...
I already tried to format data with adb: mke2fs -L data -b 4096 -m 0 -F /dev/block/mmcblk0p17, but also just works with /system + /cache
When exactly did it happen for you?
hey here i found something
i do not know if it helps but read it and decide it looks like your problem in a way
for another device but maybe helpful
http://forum.cyanogenmod.org/topic/6433-solved-messed-up-partitions-on-internal-storage/
krislibaeer said:
hey here i found something
i do not know if it helps but read it and decide it looks like your problem in a way
for another device but maybe helpful
http://forum.cyanogenmod.org/topic/6433-solved-messed-up-partitions-on-internal-storage/
Click to expand...
Click to collapse
interesting. I've run parted via adb and mmcblk0p17 shows 1447 MB - shouldn't this be 1024 MB only?
magicw said:
interesting. I've run parted via adb and mmcblk0p17 shows 1447 MB - shouldn't this be 1024 MB only?
Click to expand...
Click to collapse
Code:
179 0 7755776 mmcblk0
179 1 106495 mmcblk0p1 //secboot2 partition map
179 2 500 mmcblk0p2 //dbl (boot loader)
179 3 3596 mmcblk0p3 //osbl (boot loader)
179 4 1 mmcblk0p4 //mbr extended partition table
179 5 5120 mmcblk0p5 //emmcboot (boot loader, download mode)
179 6 20000 mmcblk0p6 //amss
179 7 3072 mmcblk0p7 //emmcparam
179 8 5120 mmcblk0p8 //boot
179 9 7000 mmcblk0p9 //adsp
179 10 3072 mmcblk0p10 //rmt
179 11 3072 mmcblk0p11 //rmt
179 12 8192 mmcblk0p12 //persist
179 13 7680 mmcblk0p13 //recovery
179 14 5120 mmcblk0p14 //param
179 15 532480 mmcblk0p15 //system
179 16 102400 mmcblk0p16 //cache
179 17 1413120 mmcblk0p17 //data
179 18 204800 mmcblk0p18 //preload
179 19 500 mmcblk0p19 // These
179 20 3596 mmcblk0p20 // partitions
179 21 5120 mmcblk0p21 // are
179 22 20000 mmcblk0p22 // either
179 23 5120 mmcblk0p23 // empty
179 24 7000 mmcblk0p24 // or
179 25 5120 mmcblk0p25 // backup
179 26 5120 mmcblk0p26 // partitions
179 27 5120 mmcblk0p27 //efs
179 28 5228544 mmcblk0p28 //internal sdcard
Xistance said:
Code:
# cat /proc/partitions
major minor #blocks name
179 0 3864576 mmcblk0
179 1 106495 mmcblk0p1 //secboot2 partition map
179 2 500 mmcblk0p2 //dbl (boot loader)
179 3 3596 mmcblk0p3 //osbl (boot loader)
179 4 1 mmcblk0p4 //mbr extended partition table
179 5 5120 mmcblk0p5 //emmcboot (boot loader, download mode)
179 6 20000 mmcblk0p6 //amss
179 7 3072 mmcblk0p7 //emmcparam
179 8 5632 mmcblk0p8 //boot
179 9 6488 mmcblk0p9 //adsp
179 10 3072 mmcblk0p10 //rmt
179 11 3072 mmcblk0p11 //rmt
179 12 8192 mmcblk0p12 //persist
179 13 7680 mmcblk0p13 //recovery
179 14 5120 mmcblk0p14 //param
179 15 547840 mmcblk0p15 //system
179 16 61440 mmcblk0p16 //cache
179 17 1136640 mmcblk0p17 //data
179 18 51200 mmcblk0p18 //preload
179 19 500 mmcblk0p19
179 20 3596 mmcblk0p20
179 21 5120 mmcblk0p21
179 22 20000 mmcblk0p22
179 23 5120 mmcblk0p23
179 24 7000 mmcblk0p24
179 25 5120 mmcblk0p25
179 26 5120 mmcblk0p26
179 27 5120 mmcblk0p27 //efs
179 28 1787904 mmcblk0p28 //internal sdcard
Click to expand...
Click to collapse
wtf your internal sdcard is 4gb? (if you look at the total blocks)
check my output with 8gb internal
Code:
cat proc/partitions
major minor #blocks name
179 0 7755776 mmcblk0
179 1 106495 mmcblk0p1
179 2 500 mmcblk0p2
179 3 3596 mmcblk0p3
179 4 1 mmcblk0p4
179 5 5120 mmcblk0p5
179 6 20000 mmcblk0p6
179 7 3072 mmcblk0p7
179 8 5120 mmcblk0p8
179 9 7000 mmcblk0p9
179 10 3072 mmcblk0p10
179 11 3072 mmcblk0p11
179 12 8192 mmcblk0p12
179 13 7680 mmcblk0p13
179 14 5120 mmcblk0p14
179 15 532480 mmcblk0p15
179 16 102400 mmcblk0p16
179 17 1413120 mmcblk0p17
179 18 204800 mmcblk0p18
179 19 500 mmcblk0p19
179 20 3596 mmcblk0p20
179 21 5120 mmcblk0p21
179 22 20000 mmcblk0p22
179 23 5120 mmcblk0p23
179 24 7000 mmcblk0p24
179 25 5120 mmcblk0p25
179 26 5120 mmcblk0p26
179 27 5120 mmcblk0p27
179 28 5228544 mmcblk0p28
broodplank1337 said:
wtf your internal sdcard is 4gb? (if you look at the total blocks)
check my output with 8gb internal
Code:
cat proc/partitions
major minor #blocks name
179 0 7755776 mmcblk0
179 1 106495 mmcblk0p1
179 2 500 mmcblk0p2
179 3 3596 mmcblk0p3
179 4 1 mmcblk0p4
179 5 5120 mmcblk0p5
179 6 20000 mmcblk0p6
179 7 3072 mmcblk0p7
179 8 5120 mmcblk0p8
179 9 7000 mmcblk0p9
179 10 3072 mmcblk0p10
179 11 3072 mmcblk0p11
179 12 8192 mmcblk0p12
179 13 7680 mmcblk0p13
179 14 5120 mmcblk0p14
179 15 532480 mmcblk0p15
179 16 102400 mmcblk0p16
179 17 1413120 mmcblk0p17
179 18 204800 mmcblk0p18
179 19 500 mmcblk0p19
179 20 3596 mmcblk0p20
179 21 5120 mmcblk0p21
179 22 20000 mmcblk0p22
179 23 5120 mmcblk0p23
179 24 7000 mmcblk0p24
179 25 5120 mmcblk0p25
179 26 5120 mmcblk0p26
179 27 5120 mmcblk0p27
179 28 5228544 mmcblk0p28
Click to expand...
Click to collapse
Oh yeah sorry. I took it from arco on his Galaxy W and forgot they had different sizes =.=.
Edit : Fixed ^^
Code:
(parted) check
check
check
Error: Can't have a partition outside the disk!
Code:
major minor #blocks name
179 0 [COLOR="Red"]7552000 [/COLOR]mmcblk0
179 1 106495 mmcblk0p1
179 2 500 mmcblk0p2
179 3 3596 mmcblk0p3
179 4 1 mmcblk0p4
179 5 5120 mmcblk0p5
179 6 20000 mmcblk0p6
179 7 3072 mmcblk0p7
179 8 5120 mmcblk0p8
179 9 7000 mmcblk0p9
179 10 3072 mmcblk0p10
179 11 3072 mmcblk0p11
179 12 8192 mmcblk0p12
179 13 7680 mmcblk0p13
179 14 5120 mmcblk0p14
179 15 532480 mmcblk0p15
179 16 102400 mmcblk0p16
179 17 1413120 mmcblk0p17
179 18 204800 mmcblk0p18
179 19 500 mmcblk0p19
179 20 3596 mmcblk0p20
179 21 5120 mmcblk0p21
179 22 20000 mmcblk0p22
179 23 5120 mmcblk0p23
179 24 7000 mmcblk0p24
179 25 5120 mmcblk0p25
179 26 5120 mmcblk0p26
179 27 5120 mmcblk0p27
179 28 [COLOR="Red"]5024768 [/COLOR]mmcblk0p28
buffo1987 said:
Code:
(parted) check
check
check
Error: Can't have a partition outside the disk!
Code:
major minor #blocks name
179 0 [COLOR="Red"]7552000 [/COLOR]mmcblk0
179 1 106495 mmcblk0p1
179 2 500 mmcblk0p2
179 3 3596 mmcblk0p3
179 4 1 mmcblk0p4
179 5 5120 mmcblk0p5
179 6 20000 mmcblk0p6
179 7 3072 mmcblk0p7
179 8 5120 mmcblk0p8
179 9 7000 mmcblk0p9
179 10 3072 mmcblk0p10
179 11 3072 mmcblk0p11
179 12 8192 mmcblk0p12
179 13 7680 mmcblk0p13
179 14 5120 mmcblk0p14
179 15 532480 mmcblk0p15
179 16 102400 mmcblk0p16
179 17 1413120 mmcblk0p17
179 18 204800 mmcblk0p18
179 19 500 mmcblk0p19
179 20 3596 mmcblk0p20
179 21 5120 mmcblk0p21
179 22 20000 mmcblk0p22
179 23 5120 mmcblk0p23
179 24 7000 mmcblk0p24
179 25 5120 mmcblk0p25
179 26 5120 mmcblk0p26
179 27 5120 mmcblk0p27
179 28 [COLOR="Red"]5024768 [/COLOR]mmcblk0p28
Click to expand...
Click to collapse
the partition has a shift of 203776 (both have same size )
that is weird

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

I have Samsung S 3 mini.
I did something really bad to my INTERNAL SD CARD partition layout, so now I have
Code:
~ # 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
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
Code:
~ # df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 411756 16452 395304 4% /dev
/dev/block/mmcblk1p1 3858432 1473472 2384960 38% /external_sd
Code:
~ # 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)
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
Code:
~ # 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
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
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:
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
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? Please, help.
How did you mess it up
Sent from my Nexus 4 using xda app-developers app
mattoaida said:
How did you mess it up
Click to expand...
Click to collapse
As I remember correctly, I tried to repartition my External SD card with fdisk right on Android via 'adb shell'. And I delete existed (there was only one as I recall) partition on mmcblk0 (which is appeared to be not an External, but Internal =\
I tried to create fat and ext partitions on mmcblk0, but only now I thought, that I didn't format it .. and maybe ext should be made as ext3 or ext4. Don't know exactly how to do it.
Oh, 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

[Q] Problems with partition table

I have a Prestigio 5044 Duo (PAP5044) with MTK6589. Basically, what I was trying to do was to resize /data partition, beacause it was only about 950Mb, by shrinking Internal SD card (/emmc) partition. For that I used Meteos MTK6589 Apllication.
After going all the steps I found out that Android OS was hanging during boot (like half-way to boot up, and it freezed with no error messages). Though, recovery (I have CWM) boots well.
After doing some research I found out, that partition table of the device was messed up after /cache partition. So, all system and recovery partititons are fine.
Here is fdisk output:
Code:
~ # fdisk -lu /dev/block/mmcblk0
Warning: ignoring extra data in partition table 5
Warning: ignoring extra data in partition table 5
Disk /dev/block/mmcblk0: 3853 MB, 3853516800 bytes
1 heads, 16 sectors/track, 470400 cylinders, total 7526400 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1024 1022 2147483647+ 5 Extended
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 26624 47103 10240 83 Linux
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 47104 67583 10240 83 Linux
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 93184 105471 6144 83 Linux
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 134144 1465343 665600 83 Linux
/dev/block/mmcblk0p6 7556096 1022 2143706111+ 83 Linux
And here are /proc/partitions and fstab:
Code:
~ # cat /proc/partitions
major minor #blocks name
179 0 3763200 mmcblk0
179 1 1 mmcblk0p1
179 2 10240 mmcblk0p2
179 3 10240 mmcblk0p3
179 4 6144 mmcblk0p4
179 5 665600 mmcblk0p5
179 6 129024 mmcblk0p6
179 7 2901504 mmcblk0p7
179 64 2048 mmcblk0boot1
179 32 2048 mmcblk0boot0
179 96 31338496 mmcblk1
179 97 31334400 mmcblk1p1
~ # cat /etc/fstab
/dev/block/mmcblk0p6 /cache ext4 rw
/dev/block/mmcblk0p7 /data ext4 rw
/dev/block/mmcblk0p8 /emmc vfat rw
/dev/block/mmcblk0p5 /system ext4 rw
/dev/block/mmcblk1p1 /sdcard vfat rw
/dev/block/mmcblk1p2 /sd-ext auto rw
So, on mmcblk0 there must be 10 partitions, and now there are only 6, according to fdisk.
I have two ideas how it is possible to restore partitions: 1) manually with fdisk, though it doesn't seem like a very good idea 2) I've found some info about scatter file for MTK-based devices, seems like it contains all the partitioning info; I have no idea how to get and use that file, though.
What should I do to recover my device?

Categories

Resources