(SM-T280) How to extract IMG files from stock rom like a zip file? - Samsung Galaxy Tab A series Questions & Answers

I downloaded the stock rom for the SM-T280 and extracted the zip, ap and other files, but i got stuck at the .img files, main one is system.img, attempting to open them gives me "Corrupted Disk Image", Linux doesnt help either, cant recognize the FS, but if i try to export to disk image it will give me the file, but i cannot open. Any Ideas?

If you are tying to mount the image locally (on computer) you will need to use raw image.
More than likely the image files you have are sparse images.
In linux, you can convert them to raw images using the simg2img command.
Example
Code:
[[email protected] P5a]$ ls -la
total 872116
drwxr-xr-x. 2 ip ip 4096 Feb 16 17:10 .
drwxr-xr-x. 44 ip ip 4096 Feb 16 17:05 ..
-rw-r--r--. 1 ip ip 893030692 Feb 16 17:05 system.img
[[email protected] P5a]$
[[email protected] P5a]$ mkdir system
[[email protected] P5a]$ ls -la
total 872120
drwxr-xr-x. 3 ip ip 4096 Feb 16 17:10 .
drwxr-xr-x. 44 ip ip 4096 Feb 16 17:05 ..
drwxr-xr-x. 2 ip ip 4096 Feb 16 17:10 system
-rw-r--r--. 1 ip ip 893030692 Feb 16 17:05 system.img
[[email protected] P5a]$ sudo mount -o ro system.img system
mount: /ip/P5a/system: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
dmesg(1) may have more information after failed mount system call.
[[email protected] P5a]$
[[email protected] P5a]$ simg2img system.img raw_system.img
[[email protected] P5a]$ ls -la
total 1744220
drwxr-xr-x. 3 ip ip 4096 Feb 16 17:11 .
drwxr-xr-x. 44 ip ip 4096 Feb 16 17:05 ..
-rw-r--r--. 1 ip ip 895975424 Feb 16 17:11 raw_system.img
drwxr-xr-x. 2 ip ip 4096 Feb 16 17:10 system
-rw-r--r--. 1 ip ip 893030692 Feb 16 17:05 system.img
[[email protected] P5a]$ sudo mount -o ro raw_system.img system
[[email protected] P5a]$ ls -la
total 1744224
drwxr-xr-x. 3 ip ip 4096 Feb 16 17:11 .
drwxr-xr-x. 44 ip ip 4096 Feb 16 17:05 ..
-rw-r--r--. 1 ip ip 895975424 Feb 16 17:11 raw_system.img
drwxr-xr-x. 26 root root 4096 Dec 31 2008 system
-rw-r--r--. 1 ip ip 893030692 Feb 16 17:05 system.img
[[email protected] P5a]$
Cheers.

You can always use a hex editor and look at the start of the image.
Sparse files begin with:
Code:
3a ff 26 ed
ed26ff3a (little endian)

ipdev said:
Code:
-rw-r--r--. 1 ip ip 895975424 Feb 16 17:11 raw_system.img
-rw-r--r--. 1 ip ip 893030692 Feb 16 17:05 system.img
Click to expand...
Click to collapse
This is an example of the most pointless use of sparse files.
Going through the hassle to save 3 MB on 900 MB?

Renate said:
This is an example of the most pointless use of sparse files.
Going through the hassle to save 3 MB on 900 MB?
Click to expand...
Click to collapse
What do you expect from Google.
System image I had readily available to use for an example.
Pixel 5a (barbet-sq3a.220705.003.a1)​
The example was primarily to show the error when trying to mount a sparse image.
Then how to use simg2img to convert the image.
Cheers.

Renate said:
You can always use a hex editor and look at the start of the image.
Sparse files begin with:
Code:
3a ff 26 ed
ed26ff3a (little endian)
Click to expand...
Click to collapse
I was searching for
Code:
1f 8b 08
when doing this.

Dexrn said:
I was searching for 1f 8b 08 when doing this.
Click to expand...
Click to collapse
That's the gzip header. (But you knew that.)

Renate said:
That's the gzip header. (But you knew that.)
Click to expand...
Click to collapse
Yep, for some reason it worked when trying to extract the Recovery and Boot.img, i assume because maybe one of the CPIO images use the same header (if that is even how it works), either way i was extracting some kind of zip file, I dont remember if it was the ramdisk or the actual image that was extracted though.

Dexrn said:
Yep, for some reason it worked when trying to extract the Recovery and Boot.img, i assume because maybe one of the CPIO images use the same header (if that is even how it works), either way i was extracting some kind of zip file, I dont remember if it was the ramdisk or the actual image that was extracted though.
Click to expand...
Click to collapse
I also wonder if there is some way (other than binwalk) to extract the sboot.bin file as it would give us the original filenames inside, and it also contains the boot images (i attached one)

ipdev said:
If you are tying to mount the image locally (on computer) you will need to use raw image.
More than likely the image files you have are sparse images.
In linux, you can convert them to raw images using the simg2img command.
Example
Code:
[[email protected] P5a]$ ls -la
total 872116
drwxr-xr-x. 2 ip ip 4096 Feb 16 17:10 .
drwxr-xr-x. 44 ip ip 4096 Feb 16 17:05 ..
-rw-r--r--. 1 ip ip 893030692 Feb 16 17:05 system.img
[[email protected] P5a]$
[[email protected] P5a]$ mkdir system
[[email protected] P5a]$ ls -la
total 872120
drwxr-xr-x. 3 ip ip 4096 Feb 16 17:10 .
drwxr-xr-x. 44 ip ip 4096 Feb 16 17:05 ..
drwxr-xr-x. 2 ip ip 4096 Feb 16 17:10 system
-rw-r--r--. 1 ip ip 893030692 Feb 16 17:05 system.img
[[email protected] P5a]$ sudo mount -o ro system.img system
mount: /ip/P5a/system: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
dmesg(1) may have more information after failed mount system call.
[[email protected] P5a]$
[[email protected] P5a]$ simg2img system.img raw_system.img
[[email protected] P5a]$ ls -la
total 1744220
drwxr-xr-x. 3 ip ip 4096 Feb 16 17:11 .
drwxr-xr-x. 44 ip ip 4096 Feb 16 17:05 ..
-rw-r--r--. 1 ip ip 895975424 Feb 16 17:11 raw_system.img
drwxr-xr-x. 2 ip ip 4096 Feb 16 17:10 system
-rw-r--r--. 1 ip ip 893030692 Feb 16 17:05 system.img
[[email protected] P5a]$ sudo mount -o ro raw_system.img system
[[email protected] P5a]$ ls -la
total 1744224
drwxr-xr-x. 3 ip ip 4096 Feb 16 17:11 .
drwxr-xr-x. 44 ip ip 4096 Feb 16 17:05 ..
-rw-r--r--. 1 ip ip 895975424 Feb 16 17:11 raw_system.img
drwxr-xr-x. 26 root root 4096 Dec 31 2008 system
-rw-r--r--. 1 ip ip 893030692 Feb 16 17:05 system.img
[[email protected] P5a]$
Cheers.
Click to expand...
Click to collapse
This didnt work well for me for some reason, sometimes it just wouldnt work, and I do not know why.

Dexrn said:
I also wonder if there is some way (other than binwalk) to extract the sboot.bin file as it would give us the original filenames inside, and it also contains the boot images (i attached one)
Click to expand...
Click to collapse
I also want to find out how to extract the bootsamsung.qmg file

Related

[TUTORIAL] Unpack and repack boot.img + a2sd support for XXKPH

Hi ppl,
Today I will tell you howto unpack and repack your Galaxy Ace boot.img files. First the base and page size:
Code:
The base parameter is 0x13600000 and pagesize is 4096
- First get your boot.img from CWM backup / odin package / dump etc.
- In linux make a folder on your desktop called something like bootrepack
- Place your original boot.img there along with the extracted files from the attached zip.
- Run this command to split your boot.img
Code:
./split_bootimg.pl boot.img
This will split your boot.img in kernel and ramdisk.
If you get permission error try to chmod the file to 755
- Now extract your ramdisk to make modifications to init.rc for example.
Code:
mkdir ramdisk
cd ramdisk
gzip -dc ../boot.img-ramdisk.gz | cpio -i
cd ..
- Make the required modifications.
- You can also replace kernel by deleting boot.img-kernel, and replace it by zImage.
- After all the necessary modifications are done you can make a new boot.img using this:
Code:
./repack_bootimg.pl boot.img-kernel ramdisk bootnew.img
- Finally move your bootnew.img to a new location and rename it to boot.img. From there you can create update.zip to flash it using CWM
Always make sure you have a proper nandroid backup before you flash a new boot.img
If your repack fails you can always restore using CWM - > Backup and Restore - > Advanced Restore - > Date/time bla bla -> Restore boot
--------
Added bonus: I've edited coolya's ext4 kernel for XXKPH to also run install_recovery.sh for a2sd support. Flash using CWM -> Install zip -> ext4-a2sd-update.zip
--------
Sources:
- Android-dls on Unpacking and editing boot images
- Ysgace for base and pagesize
- k0mpresd/original author for repack script
nice job!!...will help people immensely to build their own ROMs!!...
Can you make a noob tutorial for enabling a2sd?
Sent from my Galaxy ace using Tapatalk
There already is one: Enabling Darktremor a2sd on Samsung s5830 Galaxy ACE
After apply this update ext4-a2sd-update.zip link2sd will be working on S5830XXKPH Rom and mount SD ext2 partition?
bizon69 said:
After apply this update ext4-a2sd-update.zip link2sd will be working on S5830XXKPH Rom and mount SD ext2 partition?
Click to expand...
Click to collapse
The kernel will run install-recovery.sh on boot
peeter123 said:
There already is one: Enabling Darktremor a2sd on Samsung s5830 Galaxy ACE
Click to expand...
Click to collapse
"This method has been tested on a rooted Galaxy ACE running Android 2.2.1. It might work on other devices, but I don't guarantee."
is this work on KPH ?
install_recovery.sh didnt work for me. i Flashed using CWM -> Install zip -> ext4-a2sd-update.zip.
Here's what "cat /system/etc/install-recovery.sh" shows:
#!/system/bin/sh
/system/bin/mount -t ext2 /dev/block/mmcblk0p2 /system/sd
/system/bin/sh /system/etc/init.d/dtapp
/system/bin/sh /system/etc/init.d/99complete
but didnt work a2sdgui
sametpoyraz said:
install_recovery.sh didnt work for me. i Flashed using CWM -> Install zip -> ext4-a2sd-update.zip.
Here's what "cat /system/etc/install-recovery.sh" shows:
#!/system/bin/sh
/system/bin/mount -t ext2 /dev/block/mmcblk0p2 /system/sd
/system/bin/sh /system/etc/init.d/dtapp
/system/bin/sh /system/etc/init.d/99complete
but didnt work a2sdgui
Click to expand...
Click to collapse
Did you chmod 755 install-recovery.sh?
yeah i did
i have S5830XXKPH rom. and kernel 2.6.35.7-perf-CL260130. what is the problem ?
can it work on jellybean?
peeter123 said:
- Now extract your ramdisk to make modifications to init.rc for example.
Code:
mkdir ramdisk
cd ramdisk
gzip -dc ../boot.img-ramdisk.gz | cpio -i
cd ..
- Make the required modifications.
Click to expand...
Click to collapse
Hi,
I have problem while extracting "boot.img-ramdisk.gz" file. I hope this is not getting created as zip file during the extracting process.
[email protected]:~/VIJAY/andriod/work2$ ./split_bootimg.pl boot.img
Page size: 2048 (0x00000800)
Kernel size: 3477896 (0x00351188)
Ramdisk size: 596322 (0x00091962)
Second size: 0 (0x00000000)
Board name:
Command line:
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
[email protected]:~/VIJAY/andriod/work2$
[email protected]:~/VIJAY/andriod/work2$ ls
boot.img data/ LeWa_A919build.1.09.zip META-INF/ repack_bootimg.pl* split_bootimg.pl*
Bootimgutils.zip installbusybox logo.bin mkbootimg* sdcard/ system/
[email protected]:~/VIJAY/andriod/work2$ mkdir ramdisk
[email protected]:~/VIJAY/andriod/work2$
[email protected]:~/VIJAY/andriod/work2$
[email protected]:~/VIJAY/andriod/work2$ ls -lrt
total 336788
-rwxrwxrwx 1 vramaraj sw-team 28614 Dec 24 2010 mkbootimg*
-rwxrwxrwx 1 vramaraj sw-team 6773 Jul 17 2011 split_bootimg.pl*
-rwxrwxrwx 1 vramaraj sw-team 569 Jul 17 2011 repack_bootimg.pl*
drwxr-xr-x 3 vramaraj sw-team 4096 Oct 9 2011 data/
-rw-r--r-- 1 vramaraj sw-team 70 May 16 2012 installbusybox
drwxr-xr-x 4 vramaraj sw-team 4096 Oct 6 19:03 sdcard/
-rw-r--r-- 1 vramaraj sw-team 333103 Jan 10 16:02 logo.bin
drwxr-xr-x 16 vramaraj sw-team 4096 Jan 21 06:20 system/
-rw-r--r-- 1 vramaraj sw-team 4079616 Jan 21 21:07 boot.img
-rw-r--r-- 1 vramaraj sw-team 15413 Jan 31 21:58 Bootimgutils.zip
-rw-r--r-- 1 vramaraj sw-team 197379000 Jan 31 21:59 LeWa_A919build.1.09.zip
drwxr-xr-x 3 vramaraj sw-team 4096 Jan 31 21:59 META-INF/
-rw-r--r-- 1 vramaraj sw-team 3477896 Jan 31 22:00 boot.img-kernel
-rw-r--r-- 1 vramaraj sw-team 596322 Jan 31 22:00 boot.img-ramdisk.gz
drwxr-xr-x 2 vramaraj sw-team 4096 Jan 31 22:00 ramdisk/
-rw-r--r-- 1 vramaraj sw-team 138215424 Jan 31 22:14 YONIP_MP_A919_v1.zip
[email protected]:~/VIJAY/andriod/work2$
[email protected]:~/VIJAY/andriod/work2$ cd ramdisk
[email protected]:~/VIJAY/andriod/work2/ramdisk$ gunzip -c ../boot.img-ramdisk.gz | cpio -i
gunzip: ../boot.img-ramdisk.gz: not in gzip format
cpio: premature end of archive
[email protected]:~/VIJAY/andriod/work2/ramdisk$ unzip ../boot.img-ramdisk.gz
Archive: ../boot.img-ramdisk.gz
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of ../boot.img-ramdisk.gz or
../boot.img-ramdisk.gz.zip, and cannot find ../boot.img-ramdisk.gz.ZIP, period.
[email protected]:~/VIJAY/andriod/work2/ramdisk$ tar zvf ../boot.img-ramdisk.gz
tar: You must specify one of the `-Acdtrux' options
Try `tar --help' or `tar --usage' for more information.
[email protected]:~/VIJAY/andriod/work2/ramdisk$ tar xvf ../boot.img-ramdisk.gz
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
tar: Read 2402 bytes from ../boot.img-ramdisk.gz
tar: Error exit delayed from previous errors
[email protected]-swe-09:~/VIJAY/andriod/work2/ramdisk$
[email protected]:~/VIJAY/andriod/work2/ramdisk$
Click to expand...
Click to collapse
I tried to read the contents in the file. But it has having binary code. Which confirms it is not a zip file. Any clues..?
---------- Post added at 11:53 AM ---------- Previous post was at 11:41 AM ----------
Update:
Is this the process it will do?
gzip decompresses the ramdisk archive to stdout, pipe it into cpio with the -i switch to read from stdin and it will correctly extract the data
Click to expand...
Click to collapse
.
But I am getting this..
Code:
[email protected]:~/VIJAY/andriod/work3/ramdisk$ gzip -dc ../boot.img-ramdisk.gz | cpio -i
[COLOR="Red"][B]gzip: ../boot.img-ramdisk.gz: not in gzip format
cpio: premature end of archive[/B][/COLOR]
[email protected]:~/VIJAY/andriod/work3/ramdisk$
Isn't this just copy + pasted from anonymous's kernel guide?:sly:
Sent from my GT-I9070 using xda premium
hello, please, its wat to decompile file "recovery" in "sbin" folder and translate it? I would like to translate recovery into my language.
Thanks....
hello mi have a problem with my scroll basic plus 54860 boot not starting do you have root to this tablet?? b1 and b

[Q] /system/ directory corrupted, Salvage?

~ # e2fsck -c /dev/block/mmcblk0p9
e2fsck 1.41.12 (17-May-2010)
/dev/block/mmcblk0p9: Updating bad block inode.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Directory inode 46753, block #0, offset 0: directory corrupted
Salvage<y>?
Is this supposed to happen or do I indeed have a corrupted directory?
I went ahead anyway and this was my result
/dev/block/mmcblk0p9: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p9: 1576/54544 files (0.2% non-contiguous), 71430/218112 blocks
Narada2XK said:
I went ahead anyway and this was my result
/dev/block/mmcblk0p9: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p9: 1576/54544 files (0.2% non-contiguous), 71430/218112 blocks
Click to expand...
Click to collapse
hmmm what it shows? ;D it means that your emmc isnt fcked? or smt like that
EdgaBimbam said:
hmmm what it shows? ;D it means that your emmc isnt fcked? or smt like that
Click to expand...
Click to collapse
~ # umount /cache
~ # umount /system
~ # 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
Model: MMC VYL00M (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 4194kB 25.2MB 21.0MB ext4 EFS
2 25.2MB 26.5MB 1311kB SBL1
3 27.3MB 28.6MB 1311kB SBL2
4 29.4MB 37.7MB 8389kB PARAM
5 37.7MB 46.1MB 8389kB KERNEL
6 46.1MB 54.5MB 8389kB RECOVERY
7 54.5MB 264MB 210MB ext4 CACHE
8 264MB 281MB 16.8MB MODEM
9 281MB 1174MB 893MB ext4 FACTORYFS
10 1174MB 3322MB 2147MB ext4 DATAFS
11 3322MB 15.2GB 11.9GB fat32 UMS
12 15.2GB 15.8GB 537MB ext4 HIDDEN
(parted) quit
quit
~ # e2fsck -n -f -v /dev/block/mmcblk0p9
e2fsck 1.41.12 (17-May-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
1568 inodes used (2.87%)
3 non-contiguous files (0.2%)
1 non-contiguous directory (0.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 1293/1
70009 blocks used (32.10%)
0 bad blocks
0 large files
1190 regular files
103 directories
0 character device files
0 block device files
0 fifos
0 links
266 symbolic links (266 fast symbolic links)
0 sockets
--------
1559 files
~ #
I don't have any bad blocks and so far I don't see any problems, however, when I checked mmcblk0p10, that came back with errors, which I am not sure if I should have or not. I didn't bother to fix that though.
I suppose it's supposed to be that was because I re-install CM9, factory reset / wiped and...
~ # umount /cache
~ # umount /system
~ # e2fsck -n -f -v /dev/block/mmcblk0p9
e2fsck 1.41.12 (17-May-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Directory inode 46753, block #0, offset 0: directory corrupted
Salvage? no
e2fsck: aborted
~ #
going to restore my nandroid now.

[Q] Stock NC bricked, acts as if theres no internal memory.

Hi guys, Total Noob here.
I've been reading through the forums over the last week and am still at a total loss. Despite trying numerous things, nothing I've tried has worked.. If anything, I'm afraid I've made things worse.
The back story: The NC we have is a newer one purchased *just* over a year ago, given to my 10yr old daughter as a bday gift. It's never been rooted or modded in anyway whatsoever. Two weeks ago while she was playing a game on it, it locked up, and wouldn't power off. We let it sit for a couple of days for the battery to drain. After that, the battery wouldn't charge, the NC would not boot and the cable indicator stayed orange. So I purchased, and replaced the battery. I let it sit overnight after replacing the battery, and we got a green light. On boot up, it would hang at the 'N Screen', and do nothing more.
I tried running the NC recovery, but that only resulted in an "INSTALL FAILED" error message, and that was the last sign of life to have been seen coming out of the NC.
At this point, it will only boot off the SD card, (currently using an 8gb with CWR 6.0.1.2), I no longer get even the 'N screen' anymore. I've tried leapinlars partitioning and formatting .zips, I've tried every stock image I could find, but the result is always the same. No partitions are mounted, and nothing but errors are generated.
I've tried connecting through ADB, but 'ADB DEVICES" only returns:
Code:
C:\android-sdk-windows\platform-tools>adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
0000000000000000 recovery
...and nothing more.
Since this NC is for my daughters use, I'm really not interested in rooting or opening up android for her, I'd really like it to be nothing more than stock, but at this point I'd be grateful just to see some sign of life come out of this thing. All help would be greatly appreciated.
I hope I've provided enough info, anybody have a clue whats going on here?
Some other screen grabs from adb:
Code:
C:\android-sdk-windows\platform-tools>adb shell
~ # ls -l
ls -l
drwxr-xr-x 2 root root 0 Jan 9 05:40 boot
drwxr-xr-x 2 root root 0 Jan 9 05:40 cache
drwxr-xr-x 2 root root 0 Jan 1 1970 data
drwxr-xr-x 2 root root 0 Jan 9 05:40 datadata
-rw-r--r-- 1 root root 2553 Jan 1 1970 default.prop
drwxr-xr-x 10 root root 2440 Jan 9 05:40 dev
drwxr-xr-x 2 root root 0 Jan 9 05:40 emmc
drwxr-xr-x 2 root root 0 Jan 9 05:40 etc
-rwxr-x--- 1 root root 98756 Jan 1 1970 init
-rwxr-x--- 1 root root 1415 Jan 1 1970 init.rc
dr-xr-xr-x 64 root root 0 Jan 1 1970 proc
drwxr-xr-x 3 root root 0 Jan 1 1970 res
drwxrwxrwx 2 root root 0 Jan 9 05:40 rom
drwx------ 2 root root 0 Sep 21 2011 root
drwxr-x--- 2 root root 0 Jan 1 1970 sbin
drwxr-xr-x 2 root root 0 Jan 9 05:40 sd-ext
drwxr-xr-x 2 root root 0 Jan 9 05:40 sdcard
drwxr-xr-x 12 root root 0 Jan 1 1970 sys
drwxr-xr-x 3 root root 0 Jan 1 1970 system
drwxr-xr-x 2 root root 0 Jan 9 05:40 tmp
-rw-r--r-- 1 root root 32 Jan 1 1970 ueventd.encore.rc
-rw-r--r-- 1 root root 272 Jan 1 1970 ueventd.goldfish.rc
-rw-r--r-- 1 root root 3825 Jan 1 1970 ueventd.rc
~ #
and
Code:
fdisk -l
returns nothing except for the command 'fdisk -l' being echoed back to the screen.
Even though I can boot with CWM; when booting CWM, it displays the following error messages
Code:
E: Can't mount /cache/recovery/command
E: Can't mount /cache/recovery/log
E: Can't open /cache/recovery/log
E: Can't mount /cache/recovery/last_log
E: Can't open /cache/recovery/last_log
When trying to install "NookColor-emmc-repair-partitions-1-4-5-6-7-8.zip", I get:
Code:
-- Installing: /sdcard/NookColor-emmc-repair-partitions-1-4-5-6-7-8.zip
E:Can't mount /cache/recovery/last_install
E:failed to open last_install: No such file or directory
Finding update package...
Opening update package...
Installing update...
Repartition /boot, /system, /data (1GB), /cache and /media
Repartitioning internal memory - be patient this may take a while
Done. YOU MUST REBOOT TO RELOAD THE PARTITION TABLE
Install from sdcard complete.
Then, rebooting and installing "NookColor-emmc-format-partitions-5-6-7-8.zip" generates the following output instantly, with absolutely no delay when the formatting should be occuring:
Code:
-- Installing: /sdcard/NookColor-emmc-format-partitions-5-6-7-8.zip
E:Can't mount /cache/recovery/last_install
E:failed to open last_install: No such file or directory
Finding update package...
Opening update package...
Installing update...
Reformatting /system, /data, /cache, and /media
Reformatting /system (0p5)
This may take some time, please be patient
Reformatting /data (0p6)
This may take some time, please be patient
Reformatting /cache (0p7)
This may take some time, please be patient
Reformatting /media (0p8)
This may take some time, please be patient
Done.
Install from sdcard complete.
Trying "NookColor-emmc-repair-partition-2.zip", ends with:
Code:
-- Installing: /sdcard/NookColor-emmc-repair-partition-2.zip
E:Can't mount /cache/recovery/last_install
E:failed to open last_install: No such file or directory
Finding update package...
Opening update package...
Installing update...
Repair /rom partition (P2)
Checking for /factory - if not found will return error message and repair will be aborted.
assert failed: mount("ext2", "EMMC", "/dev/block/mmcblk0p3", "/factory") == "/factory"
E:Error in /sdcard/NookColor-emmc-repair-partition-2.zip
(Status 7)
Installation aborted.
and then after not making progress with those; trying "NookColor-emmc-stockrecovery-CWM6012asAlt.zip" returns:
Code:
-- Installing: /sdcard/NookColor-emmc-stockrecovery-CWM6012asAlt.zip
E:Can't mount /cache/recovery/last_install
E:failed to open last_install: No such file or directory
Finding update package...
Opening update package...
Installing update...
Installing Stock Recovery to EMMC with CWM 6.0.1.2 as Alternate
-----------------------------------------
Done
Install from sdcard complete.
, ...with still no recovery process being possible.
MaGoober said:
Some other screen grabs from adb:
Code:
C:\android-sdk-windows\platform-tools>adb shell
~ # ls -l
ls -l
drwxr-xr-x 2 root root 0 Jan 9 05:40 boot
drwxr-xr-x 2 root root 0 Jan 9 05:40 cache
drwxr-xr-x 2 root root 0 Jan 1 1970 data
drwxr-xr-x 2 root root 0 Jan 9 05:40 datadata
-rw-r--r-- 1 root root 2553 Jan 1 1970 default.prop
drwxr-xr-x 10 root root 2440 Jan 9 05:40 dev
drwxr-xr-x 2 root root 0 Jan 9 05:40 emmc
drwxr-xr-x 2 root root 0 Jan 9 05:40 etc
-rwxr-x--- 1 root root 98756 Jan 1 1970 init
-rwxr-x--- 1 root root 1415 Jan 1 1970 init.rc
dr-xr-xr-x 64 root root 0 Jan 1 1970 proc
drwxr-xr-x 3 root root 0 Jan 1 1970 res
drwxrwxrwx 2 root root 0 Jan 9 05:40 rom
drwx------ 2 root root 0 Sep 21 2011 root
drwxr-x--- 2 root root 0 Jan 1 1970 sbin
drwxr-xr-x 2 root root 0 Jan 9 05:40 sd-ext
drwxr-xr-x 2 root root 0 Jan 9 05:40 sdcard
drwxr-xr-x 12 root root 0 Jan 1 1970 sys
drwxr-xr-x 3 root root 0 Jan 1 1970 system
drwxr-xr-x 2 root root 0 Jan 9 05:40 tmp
-rw-r--r-- 1 root root 32 Jan 1 1970 ueventd.encore.rc
-rw-r--r-- 1 root root 272 Jan 1 1970 ueventd.goldfish.rc
-rw-r--r-- 1 root root 3825 Jan 1 1970 ueventd.rc
~ #
and
Code:
fdisk -l
returns nothing except for the command 'fdisk -l' being echoed back to the screen.
Even though I can boot with CWM; when booting CWM, it displays the following error messages
Code:
E: Can't mount /cache/recovery/command
E: Can't mount /cache/recovery/log
E: Can't open /cache/recovery/log
E: Can't mount /cache/recovery/last_log
E: Can't open /cache/recovery/last_log
When trying to install "NookColor-emmc-repair-partitions-1-4-5-6-7-8.zip", I get:
Code:
-- Installing: /sdcard/NookColor-emmc-repair-partitions-1-4-5-6-7-8.zip
E:Can't mount /cache/recovery/last_install
E:failed to open last_install: No such file or directory
Finding update package...
Opening update package...
Installing update...
Repartition /boot, /system, /data (1GB), /cache and /media
Repartitioning internal memory - be patient this may take a while
Done. YOU MUST REBOOT TO RELOAD THE PARTITION TABLE
Install from sdcard complete.
Then, rebooting and installing "NookColor-emmc-format-partitions-5-6-7-8.zip" generates the following output instantly, with absolutely no delay when the formatting should be occuring:
Code:
-- Installing: /sdcard/NookColor-emmc-format-partitions-5-6-7-8.zip
E:Can't mount /cache/recovery/last_install
E:failed to open last_install: No such file or directory
Finding update package...
Opening update package...
Installing update...
Reformatting /system, /data, /cache, and /media
Reformatting /system (0p5)
This may take some time, please be patient
Reformatting /data (0p6)
This may take some time, please be patient
Reformatting /cache (0p7)
This may take some time, please be patient
Reformatting /media (0p8)
This may take some time, please be patient
Done.
Install from sdcard complete.
Trying "NookColor-emmc-repair-partition-2.zip", ends with:
Code:
-- Installing: /sdcard/NookColor-emmc-repair-partition-2.zip
E:Can't mount /cache/recovery/last_install
E:failed to open last_install: No such file or directory
Finding update package...
Opening update package...
Installing update...
Repair /rom partition (P2)
Checking for /factory - if not found will return error message and repair will be aborted.
assert failed: mount("ext2", "EMMC", "/dev/block/mmcblk0p3", "/factory") == "/factory"
E:Error in /sdcard/NookColor-emmc-repair-partition-2.zip
(Status 7)
Installation aborted.
and then after not making progress with those; trying "NookColor-emmc-stockrecovery-CWM6012asAlt.zip" returns:
Code:
-- Installing: /sdcard/NookColor-emmc-stockrecovery-CWM6012asAlt.zip
E:Can't mount /cache/recovery/last_install
E:failed to open last_install: No such file or directory
Finding update package...
Opening update package...
Installing update...
Installing Stock Recovery to EMMC with CWM 6.0.1.2 as Alternate
-----------------------------------------
Done
Install from sdcard complete.
, ...with still no recovery process being possible.
Click to expand...
Click to collapse
You need to type
fdisk -l /dev/block/mmcblk0
in ADB. That will show you the partition structure of emmc. I suspect your cylinder/head/sector count is messed up. That is why my zips appear to work, but do not.
Report here the output of the command.
Sent from my Galaxy Tab 2 using XDA Premium
leapinlar said:
You need to type
fdisk -l /dev/block/mmcblk0
in ADB. That will show you the partition structure of emmc. I suspect your cylinder/head/sector count is messed up. That is why my zips appear to work, but do not.
Report here the output of the command.
Sent from my Galaxy Tab 2 using XDA Premium
Click to expand...
Click to collapse
Thanks for the suggestion leapinlar, I assumed fdisk -l would show all disk info by default if a specific disk wasnt specified. For some reason when I plugged the NC into the USB port today, My Win7 box did not recognize it or want to reload the drivers the same way it did last night, and I was unable to connect to the NC through ADB.
I will try to figure out that later on, or try to use ADB through my Fedora box when I get a chance. In the meantime, I once again tried your repair-partions.zip and copied CWM's error log, which is pasted below. Hopefully this gives some insight:
Starting recovery on Sun Jan 9 18:13:58 2000
framebuffer: fd 4 (1024 x 600)
CWM-based Recovery v6.0.1.2
recovery filesystem table
=========================
0 /tmp ramdisk (null) (null) 0
1 /boot vfat /dev/block/mmcblk0p1 (null) 0
2 /system ext4 /dev/block/mmcblk0p5 (null) 0
3 /data ext4 /dev/block/mmcblk0p6 (null) 0
4 /cache ext4 /dev/block/mmcblk0p7 (null) 0
5 /emmc vfat /dev/block/mmcblk0p8 (null) 0
6 /sdcard vfat /dev/block/mmcblk1p1 (null) 0
7 /sd-ext ext4 /dev/block/mmcblk1p8 (null) 0
W:Unable to get recovery.fstab info for /datadata during fstab generation!
I:Completed outputting fstab.
Irocessing arguments.
W:failed to mount /dev/block/mmcblk0p7 (No such file or directory)
E:Can't mount /cache/recovery/command
I:Checking arguments.
I:device_recovery_start()
Command: "/sbin/recovery"
ro.secure=0
ro.allow.mock.location=0
ro.debuggable=1
persist.sys.usb.config=mtp,adb
ro.build.id=IMM76D
ro.build.display.id=IMM76D
ro.build.version.incremental=eng.larry.20121021.181637
ro.build.version.sdk=15
ro.build.version.codename=REL
ro.build.version.release=4.0.4
ro.build.date=Sun Oct 21 18:17:05 PDT 2012
ro.build.date.utc=0
ro.build.type=userdebug
ro.build.user=larry
ro.build.host=larry-HP-Pavilion-dm4-Ubuntu
ro.build.tags=test-keys
ro.product.model=NookColor
ro.product.brand=bn
ro.product.name=encore
ro.product.device=encore
ro.product.board=encore
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.manufacturer=bn
ro.product.locale.language=en
ro.product.locale.region=US
ro.wifi.channels=
ro.board.platform=omap3
ro.build.product=encore
ro.build.description=encore-user 4.0.4 IMM76D 228551 release-keys
ro.build.fingerprint=bn/bn_encore/encore:4.0.4/IMM76D/228551:user/release-keys
ro.build.characteristics=tablet
ro.cm.device=encore
wifi.interface=tiwlan0
wifi.supplicant_scan_interval=30
ro.additionalmounts=/mnt/emmc;/mnt/usbdisk
ro.vold.switchablepair=/mnt/sdcard,/mnt/emmc
ro.pm.awake_on_usb=1
ro.cwm.forbid_format=/boot
ro.sf.hwrotation=270
ro.emmc=1
com.ti.omap_compat=true
ro.magic.optimization=ZOMG
ro.com.android.dateformat=MM-dd-yyyy
dalvik.vm.heapstartsize=5m
dalvik.vm.heapgrowthlimit=48m
dalvik.vm.heapsize=256m
alsa.mixer.playback.master=default
alsa.mixer.capture.master=Analog
ro.opengles.version=131072
ro.rommanager.developerid=cyanogenmod
keyguard.no_require_sim=true
ro.url.legal=(link removed)
ro.url.legal.android_privacy=(link removed)
ro.com.google.clientidbase=android-google
ro.com.android.wifi-watchlist=GoogleGuest
ro.setupwizard.enterprise_mode=1
ro.com.android.dataroaming=false
ro.cm.version=9-20121022-UNOFFICIAL-encore
ro.modversion=9-20121022-UNOFFICIAL-encore
ro.config.ringtone=CyanTone.ogg
ro.config.notification_sound=CyanMessage.ogg
ro.config.alarm_alert=CyanAlarm.ogg
dalvik.vm.lockprof.threshold=500
dalvik.vm.dexopt-flags=m=y
net.bt.name=Android
net.change=net.bt.name
dalvik.vm.stack-trace-file=/data/anr/traces.txt
ro.factorytest=0
ro.serialno=
ro.bootmode=unknown
ro.baseband=unknown
ro.carrier=unknown
ro.bootloader=unknown
ro.hardware=encore
ro.revision=5
init.svc.recovery=running
service.adb.root=1
init.svc.adbd=running
I:Checking for extendedcommand...
I:Skipping execution of extendedcommand, file not found...
W:failed to mount /dev/block/mmcblk0p7 (No such file or directory)
E:Can't mount /cache/recovery/log
E:Can't open /cache/recovery/log
W:failed to mount /dev/block/mmcblk0p7 (No such file or directory)
E:Can't mount /cache/recovery/last_log
E:Can't open /cache/recovery/last_log
W:failed to mount /dev/block/mmcblk0p7 (No such file or directory)
W:Can't unlink /cache/recovery/command
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
-- Installing: /sdcard/NookColor-emmc-repair-partitions-1-4-5-6-7-8.zip
W:failed to mount /dev/block/mmcblk0p7 (No such file or directory)
E:Can't mount /cache/recovery/last_install
E:failed to open last_install: No such file or directory
Finding update package...
I:Update location: /sdcard/NookColor-emmc-repair-partitions-1-4-5-6-7-8.zip
Opening update package...
Installing update...
Repartition /boot, /system, /data (1GB), /cache and /media
Repartitioning internal memory - be patient this may take a whileabout to run program [/tmp/repartition.sh] with 1 args
Archive: /tmp/boot.zip
inflating: boot.img
144522+0 records in
144522+0 records out
73995264 bytes (70.6MB) copied, 1.259857 seconds, 56.0MB/s
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that the previous content
won't be recoverable.
The number of cylinders for this disk is set to 236032.
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): No partition is defined yet!
Command (m for help): 4: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): Command action
e extended
p primary partition (1-4)
Partition number (1-4): Value is out of range
Partition number (1-4): Value is out of range
Partition number (1-4): Partition number (1-4): Value is out of range
Partition number (1-4): Value is out of range
Partition number (1-4): Partition number (1-4): Value is out of range
Partition number (1-4): Value is out of range
Partition number (1-4): Partition number (1-4): Value is out of range
Partition number (1-4): Value is out of range
Partition number (1-4): Partition number (1-4): Value is out of range
Partition number (1-4): Value is out of range
Partition number (1-4): Partition number (1-4): Value is out of range
Partition number (1-4): Partition number (1-4): Partition number (1-4): script result was [Done. You MUST REBOOT TO RELOAD THE PARTITION TABLE]
Done. You MUST REBOOT TO RELOAD THE PARTITION TABLE
Install from sdcard complete.
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
W:failed to mount /dev/block/mmcblk0p7 (No such file or directory)
E:Can't mount /cache/recovery/log
E:Can't open /cache/recovery/log
W:failed to mount /dev/block/mmcblk0p7 (No such file or directory)
E:Can't mount /cache/recovery/last_log
E:Can't open /cache/recovery/last_log
W:failed to mount /dev/block/mmcblk0p7 (No such file or directory)
W:Can't unlink /cache/recovery/command
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
I:Can't partition unsafe device: /dev/block/mmcblk1p1
I:Can't format unknown volume: /external_sd
I:Can't partition unsafe device: /dev/block/mmcblk0p8
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
failed to open /sys/class/android_usb/android0/state: No such file or directory
Click to expand...
Click to collapse
leapinlar said:
You need to type
fdisk -l /dev/block/mmcblk0
....
Click to expand...
Click to collapse
Okay, got adb working again. Here's the result:
Code:
fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7734 MB, 7734296576 bytes
4 heads, 16 sectors/track, 236032 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk /dev/block/mmcblk0 doesn't contain a valid partition table
~ #
Well now, isnt that special?
So that got me curious and I took a look/see in the /dev/block folder:
Code:
/dev/block # ls
ls
loop0 loop4 mmcblk0 ram1 ram13 ram3 ram7
loop1 loop5 mmcblk0p1 ram10 ram14 ram4 ram8
loop2 loop6 platform ram11 ram15 ram5 ram9
loop3 loop7 ram0 ram12 ram2 ram6
/dev/block # ls -l
ls -l
brw------- 1 root root 7, 0 Jan 9 18:13 loop0
brw------- 1 root root 7, 1 Jan 9 18:13 loop1
brw------- 1 root root 7, 2 Jan 9 18:13 loop2
brw------- 1 root root 7, 3 Jan 9 18:13 loop3
brw------- 1 root root 7, 4 Jan 9 18:13 loop4
brw------- 1 root root 7, 5 Jan 9 18:13 loop5
brw------- 1 root root 7, 6 Jan 9 18:13 loop6
brw------- 1 root root 7, 7 Jan 9 18:13 loop7
brw------- 1 root root 179, 0 Jan 9 18:13 mmcblk0
-rw-rw-rw- 1 root root 73995264 Jan 9 18:14 mmcblk0p1
drwxr-xr-x 4 root root 80 Jan 9 18:13 platform
brw------- 1 root root 1, 0 Jan 9 18:13 ram0
brw------- 1 root root 1, 1 Jan 9 18:13 ram1
brw------- 1 root root 1, 10 Jan 9 18:13 ram10
brw------- 1 root root 1, 11 Jan 9 18:13 ram11
brw------- 1 root root 1, 12 Jan 9 18:13 ram12
brw------- 1 root root 1, 13 Jan 9 18:13 ram13
brw------- 1 root root 1, 14 Jan 9 18:13 ram14
brw------- 1 root root 1, 15 Jan 9 18:13 ram15
brw------- 1 root root 1, 2 Jan 9 18:13 ram2
brw------- 1 root root 1, 3 Jan 9 18:13 ram3
brw------- 1 root root 1, 4 Jan 9 18:13 ram4
brw------- 1 root root 1, 5 Jan 9 18:13 ram5
brw------- 1 root root 1, 6 Jan 9 18:13 ram6
brw------- 1 root root 1, 7 Jan 9 18:13 ram7
brw------- 1 root root 1, 8 Jan 9 18:13 ram8
brw------- 1 root root 1, 9 Jan 9 18:13 ram9
/dev/block # fdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7734 MB, 7734296576 bytes
4 heads, 16 sectors/track, 236032 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk /dev/block/mmcblk0 doesn't contain a valid partition table
/dev/block # fdisk -l /dev/block/mmcblk0p1
fdisk -l /dev/block/mmcblk0p1
Disk /dev/block/mmcblk0p1: 73 MB, 73995264 bytes
255 heads, 63 sectors/track, 8 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block #
Strange, today when I opened adb, it appears that some of the entries in /dev/block have changed. mmcblk0p1 is gone and replaced with mmcblk1p1.
Yesterday I saw this
Code:
/dev/block # ls
ls
loop0 loop4 mmcblk0 ram1 ram13 ram3 ram7
loop1 loop5 mmcblk0p1 ram10 ram14 ram4 ram8
loop2 loop6 platform ram11 ram15 ram5 ram9
loop3 loop7 ram0 ram12 ram2 ram6
This is what I see today:
Code:
/dev/block # ls
ls
loop0 loop4 mmcblk0 ram0 ram12 ram2 ram6
loop1 loop5 mmcblk1 ram1 ram13 ram3 ram7
loop2 loop6 mmcblk1p1 ram10 ram14 ram4 ram8
loop3 loop7 platform ram11 ram15 ram5 ram9
/dev/block #
If my understanding is correct (and it's usually not) the "P1" indicates that this is "partition one" on the "mmcblock one" device. (or 'disk'). I'm further assuming that of the two devices shown (mmcblk0, and mmcblk1) one of them is my 8gb microsd card, and the other is the NC's internal 8gb memory. Which makes me wonder why yesterday's "ls" did not show both devices. Also makes me wonder what the 'p1' partition is, which disk it's really on, and why it appears to have moved.
I took a look at the geometries of the disks and the partition using fdisk again, I dont know what I should be looking for here, and dont know whats relevant and what isn't. I can see I have two disks of slightly different sizes, and a mystery partition of some sort that doesnt seem like it should fit on either of the two disks.
Code:
/dev/block # fdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7734 MB, 7734296576 bytes
4 heads, 16 sectors/track, 236032 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk /dev/block/mmcblk0 doesn't contain a valid partition table
/dev/block # fdisk -l /dev/block/mmcblk1
fdisk -l /dev/block/mmcblk1
Disk /dev/block/mmcblk1: 7948 MB, 7948206080 bytes
255 heads, 63 sectors/track, 966 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk1p1 * 1 38 305203+ b Win95 FAT32
/dev/block # fdisk -l /dev/block/mmcblk1p1
fdisk -l /dev/block/mmcblk1p1
Disk /dev/block/mmcblk1p1: 312 MB, 312528384 bytes
4 heads, 16 sectors/track, 9537 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
/dev/block #
Ok. I feel real stupid, obviously the mmcblk1 device is the sdcard and the p1 partition on it is the fat32 partition on it. Still leaves me wondering what happened to the geometry on the internal memory. CHS looks way off. shouldn't it be more like that of my sdcard?
*** Second Update***
I'm pulling my hair out here. I tried to correct the CHS values...no love there, even after rebooting it remains unchanged.
Code:
~ # fdisk -C 965 -H 255 -S 63 /dev/block/mmcblk0
fdisk -C 965 -H 255 -S 63 /dev/block/mmcblk0
Device contains neither a valid DOS partition table, nor Sun, SGI, OSF or GPT disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that the previous content
won't be recoverable.
Command (m for help): w
w
The partition table has been altered.
Calling ioctl() to re-read partition table
~ # fdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7734 MB, 7734296576 bytes
4 heads, 16 sectors/track, 236032 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk /dev/block/mmcblk0 doesn't contain a valid partition table
After trying to fix the geometry several times, and failing. I said Eff this, and tried living with the incorrect values and creating the partitions anyway. I keep getting fdisk: short write, when creating partition 8.
Anway....from start to finish here - notice the # of cylinders as I progress.
Code:
~ # fdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7734 MB, 7734296576 bytes
4 heads, 16 sectors/track, 236032 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk /dev/block/mmcblk0 doesn't contain a valid partition table
~ # fdisk -C 965 -H 255 -S 63 /dev/block/mmcblk0
fdisk -C 965 -H 255 -S 63 /dev/block/mmcblk0
Device contains neither a valid DOS partition table, nor Sun, SGI, OSF or GPT disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that the previous content
won't be recoverable.
Command (m for help): n
n
Command action
e extended
p primary partition (1-4)
p
p
Partition number (1-4):
Value is out of range
Partition number (1-4): 1
1
First cylinder (1-940, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-940, default 940): 9
9
Command (m for help): n
n
Command action
e extended
p primary partition (1-4)
p
p
Partition number (1-4): 2
2
First cylinder (10-940, default 10):
Using default value 10
Last cylinder or +size or +sizeM or +sizeK (10-940, default 940): 18
18
Command (m for help): n
n
Command action
e extended
p primary partition (1-4)
p
p
Partition number (1-4): 3
3
First cylinder (19-940, default 19):
Using default value 19
Last cylinder or +size or +sizeM or +sizeK (19-940, default 940): 56
56
Command (m for help): n
n
Command action
e extended
p primary partition (1-4)
e
e
Selected partition 4
First cylinder (57-940, default 57):
Using default value 57
Last cylinder or +size or +sizeM or +sizeK (57-940, default 940):
Using default value 940
Command (m for help): n
n
First cylinder (57-940, default 57):
Using default value 57
Last cylinder or +size or +sizeM or +sizeK (57-940, default 940): 114
114
Command (m for help): n
n
First cylinder (115-940, default 115):
Using default value 115
Last cylinder or +size or +sizeM or +sizeK (115-940, default 940): 236
236
Command (m for help): n
n
First cylinder (237-940, default 237):
Using default value 237
Last cylinder or +size or +sizeM or +sizeK (237-940, default 940): 281
281
Command (m for help):
at this point, I'll stop and review the changes before I commit (w) them to disk...
Code:
Command (m for help): p
p
Disk /dev/block/mmcblk0: 7734 MB, 7734296576 bytes
255 heads, 63 sectors/track, 940 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 9 72261 83 Linux
/dev/block/mmcblk0p2 10 18 72292+ 83 Linux
/dev/block/mmcblk0p3 19 56 305235 83 Linux
/dev/block/mmcblk0p4 57 940 7100730 5 Extended
/dev/block/mmcblk0p5 57 114 465853+ 83 Linux
/dev/block/mmcblk0p6 115 236 979933+ 83 Linux
/dev/block/mmcblk0p7 237 281 361431 83 Linux
Okay, Now the number of cylinders originally being reported was 236032, I specified 965 using the -C switch, and somehow ended up with a value of 940 - still leaving the geometry out of whack. Before I go any further I will commit and (w) the pending partition table here ...
Code:
Command (m for help): w
w
The partition table has been altered.
Calling ioctl() to re-read partition table
~ # fdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7734 MB, 7734296576 bytes
255 heads, 63 sectors/track, 940 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 9 72261 83 Linux
/dev/block/mmcblk0p2 10 18 72292+ 83 Linux
/dev/block/mmcblk0p3 19 56 305235 83 Linux
/dev/block/mmcblk0p4 57 940 7100730 5 Extended
/dev/block/mmcblk0p5 57 114 465853+ 83 Linux
/dev/block/mmcblk0p6 115 236 979933+ 83 Linux
/dev/block/mmcblk0p7 237 281 361431 83 Linux
~ #
So it appears my partition table has been written successfully. I just need to create partition 8. ... before I do that, I will reboot the NC to make sure the partition table is persistent...
Code:
fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7734 MB, 7734296576 bytes
4 heads, 16 sectors/track, 236032 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk /dev/block/mmcblk0 doesn't contain a valid partition table
...and that's a big fat fail.
At this point, It looks like my only option to ever use this NC again, is to have a stand alone bootable sd card. If anybody has a suggestion, please throw it my way.
Do either of these things indicate anything of importance that could potentially be of help?
1) 'adb devices' lists the Device ID as "RECOVERY"
2) The internal memory seems to be in a 'read only' mode of some sort.
The last time this NC did power up under its own free will, was when the stock recovery was being attempted - and crashed.
MaGoober said:
Do either of these things indicate anything of importance that could potentially be of help?
1) 'adb devices' lists the Device ID as "RECOVERY"
2) The internal memory seems to be in a 'read only' mode of some sort.
The last time this NC did power up under its own free will, was when the stock recovery was being attempted - and crashed.
Click to expand...
Click to collapse
Your CHS (cylinder, head, sector) settings are wrong. It should be 255 heads, 63 sectors/track and 965 cylinders. You need to run fdisk CHS to fix it. You need to type the following command in ADB shell.
fdisk -C 965 -H 255 -S 63 /dev/block/mmcblk0
Then do an
fdisk -l /dev/block/mmcblk0
to see what you get.
If the CHS is right you can do my 145678 repair and format. I don't know if the p2 repair will work though. If not, I may be able to help.
Sent from my Galaxy Tab 2 using XDA Premium
leapinlar said:
Your CHS (cylinder, head, sector) settings are wrong. It should be 255 heads, 63 sectors/track and 965 cylinders. You need to run fdisk CHS to fix it. You need to type the following command in ADB shell.
fdisk -C 965 -H 255 -S 63 /dev/block/mmcblk0
Then do an
fdisk -l /dev/block/mmcblk0
to see what you get.
If the CHS is right you can do my 145678 repair and format. I don't know if the p2 repair will work though. If not, I may be able to help.
Sent from my Galaxy Tab 2 using XDA Premium
Click to expand...
Click to collapse
Here's the result - as before, it just doesn't 'stick'.
Code:
C:\android-sdk-windows\platform-tools>adb shell
~ # fdisk -C 965 -H 255 -S 63 /dev/block/mmcblk0
fdisk -C 965 -H 255 -S 63 /dev/block/mmcblk0
Device contains neither a valid DOS partition table, nor Sun, SGI, OSF or GPT disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that the previous content
won't be recoverable.
Command (m for help): w
w
The partition table has been altered.
Calling ioctl() to re-read partition table
~ # fdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7734 MB, 7734296576 bytes
4 heads, 16 sectors/track, 236032 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk /dev/block/mmcblk0 doesn't contain a valid partition table
~ #
Thanks for your help, I really do appreciate it.
I may be crazy here, but what are the odds my NC does not have the same emmc chip? This thing sure acts like its fallen victim to the 'brick bug'. I cant seem to write anything at all, Tried creating new partitions with parted, no go. Even tried overwriting the mbr with dd if=/dev/zero of=/dev/block/mmcblk0 bs=512 count=1 and it didnt even touch it.
MaGoober said:
I may be crazy here, but what are the odds my NC does not have the same emmc chip? This thing sure acts like its fallen victim to the 'brick bug'. I cant seem to write anything at all, Tried creating new partitions with parted, no go. Even tried overwriting the mbr with dd if=/dev/zero of=/dev/block/mmcblk0 bs=512 count=1 and it didnt even touch it.
Click to expand...
Click to collapse
I have had SD chips that became ready only by some mysterious means. It is possible that your emmc has done the same. In fact, one other user said that happened to his emmc.
Sent from my Galaxy Tab 2 using XDA Premium
Alrighty then, I confirmed this much at least:
with
Code:
dmesg | grep mmc0
The emmc chip in my NC is the Samsung M8G2FA, which is prone to the "Brick Bug", and from the little I've read on it so far, the bug is brought on merely by wiping the cache partitions clean. I got me some more reading up to do...
Today, I called BN tech support for the second time in a week, after visiting the local store to see if anybody there could offer up assistance. Long story short, because our NC was just out of warranty (by three weeks) they did offer to exchange it with a 'certified pre-owned' . When that comes in, the very first thing I'm going to do is see what memory chip it has in it, Evidently just trying to do a 'hard reset' and run the stock recovery bricks the M8G2FA EMMC. However, I still don't know what caused our NC to lock up in the first place. I guess at this point, that's moot.
leapinlar, I've read through many of your posts, although I couldn't fix my problems, you were instrumental in keeping me sane. ... well, depending on how loosely you define sane,

First things I did before and just after rooting

Hey all.
Tools I used for flashing and backup:
on PC linux box:
- heimdall - which does the flashing
- netcat - (nc, ncat or netcat) tool for writing to or reading from network.
- partx - assigns partitioned disk images as kernel's loop devices like: loop0p2...loop0p25
on s3 mini:
- busybox
- "Rooted SSH/SFTP Daemon"
Before rooting reboot the phone to the download mode and download
the pit file with:
Code:
heimdall download-pit --output goldenxx.pit --no--reboot
Root your phone and install busybox and ssh daemon on it.
Start sshd but close all other apps to keep filesystem activity so low as possible.
start netcat on your PC:
Code:
netcat -l 192.168.0.11 5050 > mmcblk0.gz
Now netcat is listening for input from your lan (Replace address to corresponding your PC's IP address)
Now try to connect to your phone with ssh. When you got an # prompt then:
Code:
sync
and send your whole internal storage from phone to your PC:
Code:
cat /dev/block/mmcblk0 | gzip | nc 192.168.0.11 5050
Do not start any apps on your phone before you got back the command prompts both on phone and PC.
when you got a command prompt again and no error messages was printed. you should have an
gzip compressed disk image of you phones mmc on your PC.
Check its integrity running
Code:
gzip -t mmcblk0.gz
If the package is ok, copy the goldenxx.pit and mmcblk0.gz to the sure location.
Now you can make an uncompressed copy of mmcblk0.gz for example:
Code:
zcat Backup/mmcblk0.gz > ~/mmcblk0
With partx you can use the image like any other partitioned disks running as root:
Code:
partx -v -a ~/mmcblk0
it should print something like this:
Code:
partition: none, disk: mmcblk0, lower: 0, upper: 0
Trying to use '/dev/loop0' for the loop device
/dev/loop0: partition table type 'gpt' detected
/dev/loop0: partition #2 added
/dev/loop0: partition #3 added
/dev/loop0: partition #4 added
...
/dev/loop0: partition #25 added
and print out the data of partitions associated within kernel:
Code:
partx -s ~/mmcblk0
Code:
3 1024 3071 2048 1M PIT 52444e41-494f-2044-5049-540000000000
4 6144 8191 2048 1M MD5HDR 52444e41-494f-2044-4d44-354844520000
5 8192 9215 1024 512K STEboot1 52444e41-494f-2044-5354-45626f6f7431
6 9216 10239 1024 512K STEboot2 52444e41-494f-2044-5354-45626f6f7432
7 10240 11263 1024 512K Dnt 52444e41-494f-2044-446e-740000000000
8 11264 12287 1024 512K reserved 52444e41-494f-2044-7265-736572766564
9 16384 18431 2048 1M CSPSAFS 52444e41-494f-2044-4353-505341465300
10 18432 20479 2048 1M CSPSAFS2 52444e41-494f-2044-4353-505341465332
11 20480 53247 32768 16M EFS 52444e41-494f-2044-4546-530000000000
12 53248 86015 32768 16M ModemFS 52444e41-494f-2044-4d6f-64656d465300
13 86016 118783 32768 16M ModemFS2 52444e41-494f-2044-4d6f-64656d465332
14 118784 221183 102400 50M Fota 52444e41-494f-2044-466f-746100000000
15 380928 381055 128 64K IPL Modem 52444e41-494f-2044-4950-4c204d6f6465
16 385024 413695 28672 14M Modem 52444e41-494f-2044-4d6f-64656d000000
17 417792 421887 4096 2M Loke4 52444e41-494f-2044-4c6f-6b6534000000
18 421888 425983 4096 2M 2ndLoke4 52444e41-494f-2044-326e-644c6f6b6534
19 425984 458751 32768 16M PARAM 52444e41-494f-2044-5041-52414d000000
20 458752 491519 32768 16M Kernel 52444e41-494f-2044-4b65-726e656c0000
21 491520 524287 32768 16M Kernel2 52444e41-494f-2044-4b65-726e656c3200
22 524288 2981887 2457600 1.2G SYSTEM 52444e41-494f-2044-5359-5354454d0000
23 2981888 4702207 1720320 840M CACHEFS 52444e41-494f-2044-4341-434845465300
24 4702208 5357567 655360 320M HIDDEN 52444e41-494f-2044-4849-4444454e0000
25 5357568 15249407 9891840 4.7G DATAFS 52444e41-494f-2044-4441-544146530000
now you can explore the partitions and make images of it. For example:
Code:
file -s /dev/loop0p11
/dev/loop0p11: Linux rev 1.0 ext4 filesystem data, UUID=1b70457a-e011-c65a-87c6-f346bd874821, volume name "efs" (extents) (large files)
Code:
cat /dev/loop0p11 > ~/efs.ext4
and...
Code:
file -s /dev/loop0p16
Code:
/dev/loop0p16: data
It is modem.bin so:
Code:
cat /dev/loop0p16 > ~/modem.bin
Note that ext4 images must be transformed to the right .img-file form with ext2simg tool before flashing.
Be careful before flash your phone with these files.
remember to unmount all /dev/loop0 -partitions and finally
Code:
partx -d /dev/loop0
losetup -d /dev/loop0
because the images was copied from running system,
all writeable filesystems are not clean. So you might want to e2fsck these partitions.
KrRain said:
Hey all.
Tools I used for flashing and backup:
on PC linux box:
- heimdall - which does the flashing
- netcat - (nc, ncat or netcat) tool for writing to or reading from network.
- partx - assigns partitioned disk images as kernel's loop devices like: loop0p2...loop0p25
on s3 mini:
- busybox
- "Rooted SSH/SFTP Daemon"
Before rooting reboot the phone to the download mode and download
the pit file with:
Code:
heimdall download-pit --output goldenxx.pit --no--reboot
Root your phone and install busybox and ssh daemon on it.
Start sshd but close all other apps to keep filesystem activity so low as possible.
start netcat on your PC:
Code:
netcat -l 192.168.0.11 5050 > mmcblk0.gz
Now netcat is listening for input from your lan (Replace address to corresponding your PC's IP address)
Now try to connect to your phone with ssh. When you got an # prompt then:
Code:
sync
and send your whole internal storage from phone to your PC:
Code:
cat /dev/block/mmcblk0 | gzip | nc 192.168.0.11 5050
Do not start any apps on your phone before you got back the command prompts both on phone and PC.
when you got a command prompt again and no error messages was printed. you should have an
gzip compressed disk image of you phones mmc on your PC.
Check its integrity running
Code:
gzip -t mmcblk0.gz
If the package is ok, copy the goldenxx.pit and mmcblk0.gz to the sure location.
Now you can make an uncompressed copy of mmcblk0.gz for example:
Code:
zcat Backup/mmcblk0.gz > ~/mmcblk0
With partx you can use the image like any other partitioned disks running as root:
Code:
partx -v -a ~/mmcblk0
it should print something like this:
Code:
partition: none, disk: mmcblk0, lower: 0, upper: 0
Trying to use '/dev/loop0' for the loop device
/dev/loop0: partition table type 'gpt' detected
/dev/loop0: partition #2 added
/dev/loop0: partition #3 added
/dev/loop0: partition #4 added
...
/dev/loop0: partition #25 added
and print out the data of partitions associated within kernel:
Code:
partx -s ~/mmcblk0
Code:
3 1024 3071 2048 1M PIT 52444e41-494f-2044-5049-540000000000
4 6144 8191 2048 1M MD5HDR 52444e41-494f-2044-4d44-354844520000
5 8192 9215 1024 512K STEboot1 52444e41-494f-2044-5354-45626f6f7431
6 9216 10239 1024 512K STEboot2 52444e41-494f-2044-5354-45626f6f7432
7 10240 11263 1024 512K Dnt 52444e41-494f-2044-446e-740000000000
8 11264 12287 1024 512K reserved 52444e41-494f-2044-7265-736572766564
9 16384 18431 2048 1M CSPSAFS 52444e41-494f-2044-4353-505341465300
10 18432 20479 2048 1M CSPSAFS2 52444e41-494f-2044-4353-505341465332
11 20480 53247 32768 16M EFS 52444e41-494f-2044-4546-530000000000
12 53248 86015 32768 16M ModemFS 52444e41-494f-2044-4d6f-64656d465300
13 86016 118783 32768 16M ModemFS2 52444e41-494f-2044-4d6f-64656d465332
14 118784 221183 102400 50M Fota 52444e41-494f-2044-466f-746100000000
15 380928 381055 128 64K IPL Modem 52444e41-494f-2044-4950-4c204d6f6465
16 385024 413695 28672 14M Modem 52444e41-494f-2044-4d6f-64656d000000
17 417792 421887 4096 2M Loke4 52444e41-494f-2044-4c6f-6b6534000000
18 421888 425983 4096 2M 2ndLoke4 52444e41-494f-2044-326e-644c6f6b6534
19 425984 458751 32768 16M PARAM 52444e41-494f-2044-5041-52414d000000
20 458752 491519 32768 16M Kernel 52444e41-494f-2044-4b65-726e656c0000
21 491520 524287 32768 16M Kernel2 52444e41-494f-2044-4b65-726e656c3200
22 524288 2981887 2457600 1.2G SYSTEM 52444e41-494f-2044-5359-5354454d0000
23 2981888 4702207 1720320 840M CACHEFS 52444e41-494f-2044-4341-434845465300
24 4702208 5357567 655360 320M HIDDEN 52444e41-494f-2044-4849-4444454e0000
25 5357568 15249407 9891840 4.7G DATAFS 52444e41-494f-2044-4441-544146530000
now you can explore the partitions and make images of it. For example:
Code:
file -s /dev/loop0p11
/dev/loop0p11: Linux rev 1.0 ext4 filesystem data, UUID=1b70457a-e011-c65a-87c6-f346bd874821, volume name "efs" (extents) (large files)
Code:
cat /dev/loop0p11 > ~/efs.ext4
and...
Code:
file -s /dev/loop0p16
Code:
/dev/loop0p16: data
It is modem.bin so:
Code:
cat /dev/loop0p16 > ~/modem.bin
Note that ext4 images must be transformed to the right .img-file form with ext2simg tool before flashing.
Be careful before flash your phone with these files.
remember to unmount all /dev/loop0 -partitions and finally
Code:
partx -d /dev/loop0
losetup -d /dev/loop0
because the images was copied from running system,
all writeable filesystems are not clean. So you might want to e2fsck these partitions.
Click to expand...
Click to collapse
Cool.... What for...?
S3miniFin said:
Cool.... What for...?
Click to expand...
Click to collapse
Because now I have a backup of all partitions of my S3 Mini.

[SCRIPT] Fix partition table for Android 4.4

Since the gapps for 4.4 need very much space wee need bigger system partitions.
I've created a script which automates this process and increases them both to 840MB.
the space is taken from the userdata partition.
You should backup your whole phone before doing this(storage will not be touched but you shouldn't take the risk)
I tested it with 32GB version only so if you want to know if it will work for 16gb, too give me the output of this command:
parted -s /dev/block/mmcblk0 print
Download:
http://d-h.st/FWz
Instructions:
1) boot into CWM
2) adb push repartition.sh /tmp
3) adb shell chmod 0777 /tmp/repartition.sh
4) adb shell /tmp/repartition.sh
5) adb reboot recovery
6) now you can do all the usual stuff like enabling TDB and installing ROM's
Sounds great but I cannot test it, since I dont have any parted binaries (at least in my 4.1.1 Wajk Wiui ROM) ? Can you please tell me where I can get them.
Second Question:
Im currently running TDB:
System 1 latest WIUI 4.1.1 v5 ROM
System 2 MIUI v6 1.9.19
Both system partitions are completely full (usage 98 %) and the same with the data partitions ( usage 97 % )!
Would it be possible to decrease /sdcard space and repartition it like the following with TDB enabled:
system 800 mb
system1 800 mb
data 1500 mb
data1 1500 mb
sdcard *the rest*
thanks in advance
sounds like you tried to repartition from Android
You need to boot to CWM - you have parted there.
Sorry I hate people who just ask stupid questions before reading the instructions carefully ...silly me sorry for that...
What about the second question, is it possible to either increase the data partitions for less space on /sdcard ?
there isn't sth. like a data1 partition. we have one data partition only that's why we need the TDB hack.
other than that it's possible but you should backup all your data and restore it afterwards.
m11kkaa said:
there isn't sth. like a data1 partition. we have one data partition only that's why we need the TDB hack.
other than that it's possible but you should backup all your data and restore it afterwards.
Click to expand...
Click to collapse
Ok got it.
So following your instructions and editing script like the following should work ?
Code:
change_table() {
ui_print "parted: delete"
parted -s /dev/block/mmcblk0 rm 23 || return 1 # system
parted -s /dev/block/mmcblk0 rm 24 || return 1 # system1
parted -s /dev/block/mmcblk0 rm 25 || return 1 # cache
parted -s /dev/block/mmcblk0 rm 26 || return 1 # userdata
parted -s /dev/block/mmcblk0 rm 27 || return 1 # storage
ui_print "parted: create"
parted -s /dev/block/mmcblk0 mkpartfs primary ext2 336MB 1176MB || return 1
parted -s /dev/block/mmcblk0 mkpartfs primary ext2 1176MB 2016MB || return 1
parted -s /dev/block/mmcblk0 mkpartfs primary ext2 2016MB 2419MB || return 1
parted -s /dev/block/mmcblk0 mkpartfs primary ext2 2419MB 6515MB || return 1
parted -s /dev/block/mmcblk0 mkpartfs primary ext2 6515MB 31.3GB || return 1
ui_print "parted: name"
parted -s /dev/block/mmcblk0 name 23 system || return 1
parted -s /dev/block/mmcblk0 name 24 system1 || return 1
parted -s /dev/block/mmcblk0 name 25 cache || return 1
parted -s /dev/block/mmcblk0 name 26 userdata || return 1
parted -s /dev/block/mmcblk0 name 27 storage || return 1
return 0
}
Code:
ui_print "format partitions"
for NUM in 23 24 25 26 27
do
if ! format_partition "$NUM"; then
ui_print "Failed format partition $NUM"
exit 1
fi
done
already did full backup of sdcard, i just dont know if i should disable TDB before i stat repartitioning ... I dont know how TDB works to split the data partition thats my problem :/
yes that should work.
You don't need to disable TDB because your whole data partition will be wiped and it stores the TDB configuration(that means that TDB automatically gets disabled).
Had some errors but now its working fine ..thanks
unmount sdcard in CWM. It's a bug of this script.
Nice to hear it works now.
7 days ago Phone not start because partition corrupt
Hello
First do not panic is not the fault of your script but for you experience with mi2s and partitions are the few people in the world that can save my phone.
I'm playing a game phone(Xiaomi m2s 16GB) hang and one or more partitions are corrupt (I think this is the problem). But all de documentation than i find to delete o edit partition not work. Fastboot rom installation all ok but always only start with white logo. Mirecovery works perfectly and CWM by ivan works but temporally with this command sudo fastboot boot recovery.img
This is the result of your script
check environment
/sbin/mount
/sbin/umount
/sbin/parted
/sbin/tune2fs
/sbin/e2fsck
dump old table
unmount partitions
umount: can't umount /system: Invalid argument
umount: can't umount /system1: No such file or directory
umount: can't umount /data: Invalid argument
umount: can't umount /data_root: Invalid argument
umount: can't umount /sdcard: Invalid argument
change partition table
parted: delete
parted: create
Error: Unable to satisfy all constraints on the partition.
Failed changing table
OTHER TEST
/dev/block # e2fsck -fDp /dev/block/mmcblk0p24
e2fsck: Bad magic number in super-block while trying to open /dev/block/mmcblk0p24
/dev/block/mmcblk0p24:
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
/dev/block # tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p24
tune2fs 1.41.14 (22-Dec-2010)
tune2fs: Bad magic number in super-block while trying to open /dev/block/mmcblk0p24
Couldn't find valid filesystem superblock.
I try to delete partition and create a new one but fail.
(parted) rm 24
rm 24
(parted) mkpartfs primary ext2 872 1409
mkpartfs primary ext2 872 1409
Error: Unable to satisfy all constraints on the partition.
I FOUND THIS IN XDA FORUM BUT I HAVEN'T IMAGE TO TEST
adb push mmcblk0p19_repaired.img /tmp/
adb shell dd if=/tmp/mmcblk0p19_repaired.img of=/dev/block/mmcblk0p19
adb reboot bootloader
MY PARTITION TABLE SYSTEM1 NOT HAVE FILESYSTEM EXT4
[email protected]:~/Escritorio/recovery$ sudo adb shell parted -s /dev/block/mmcblk0 print
Model: MMC SEM16G (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 89.1MB 89.1MB fat16 modem
2 89.1MB 178MB 89.1MB fat16 modem1
3 178MB 179MB 524kB sbl1
4 179MB 179MB 524kB sbl2
5 179MB 180MB 1049kB sbl3
6 180MB 181MB 1049kB rpm
7 181MB 182MB 1049kB tz
8 182MB 183MB 524kB DDR
9 183MB 187MB 4194kB aboot
10 187MB 188MB 1049kB misc
11 188MB 191MB 2990kB logo
12 191MB 192MB 799kB m9kefs1
13 192MB 193MB 799kB m9kefs2
14 193MB 193MB 1024B m9kefsc
15 193MB 201MB 8501kB bk1
16 201MB 202MB 799kB m9kefs3
17 202MB 268MB 66.3MB bk2
18 268MB 284MB 15.7MB boot
19 284MB 300MB 15.7MB boot1
20 300MB 316MB 15.7MB recovery
21 316MB 327MB 11.5MB bk3
22 327MB 336MB 8389kB ext4 persist
23 336MB 872MB 537MB ext4 system
24 872MB 1409MB 537MB system1
25 1409MB 1812MB 403MB ext4 cache
26 1812MB 5570MB 3758MB ext4 userdata
27 5570MB 15.8GB 10.2GB ext4 storage
Xiaomi Mi2 32GB
XIAOMI MI2 32GB ONLY
For those using a single MIUI ROM I've made a partition table with system1 set to 1024Mb.
Run the attached from CWM (in /tmp).
Aternus said:
XIAOMI MI2 32GB ONLY
For those using a single MIUI ROM I've made a partition table with system1 set to 1024Mb.
Run the attached from CWM (in /tmp).
Click to expand...
Click to collapse
Can you explain a little more? Does it only leave 1 system partition? Can I flash it like a regular zip?
Enviado desde mi MI 2S mediante Tapatalk
any step by step manual how to change partition? with all necessary downloads etc...
or.... is it possible to delete system2 with all its parts? - for me I'd to use system1 only
Why can not I change the size of the system partition?
Already tried several times, with disabled TDB and with enabled TDB.
Full wipe did and still no result.
P.S. I have already been able to do any repartitioning.
Code:
PS C:\Android> adb push repartition.sh /tmp
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
21 KB/s (3797 bytes in 0.169s)
PS C:\Android> adb shell chmod 0777 /tmp/repartition.sh
PS C:\Android> adb shell /tmp/repartition.sh
check environment
/sbin/mount
/sbin/umount
/sbin/parted
/sbin/tune2fs
/sbin/e2fsck
dump old table
__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
unmount partitions
umount: can't umount /system: Invalid argument
umount: can't umount /system1: No such file or directory
umount: can't umount /data: Invalid argument
umount: can't umount /sdcard: Invalid argument
change partition table
parted: delete
parted: create
parted: name
format partitions
format: /dev/block/mmcblk0p23
tune2fs 1.41.14 (22-Dec-2010)
tune2fs: No such file or directory while trying to open /dev/block/mmcblk0p23
Couldn't find valid filesystem superblock.
e2fsck 1.41.14 (22-Dec-2010)
e2fsck: No such file or directory while trying to open /dev/block/mmcblk0p23
Possibly non-existent device?
tune2fs 1.41.14 (22-Dec-2010)
e2fsck 1.41.14 (22-Dec-2010)
Adding dirhash hint to filesystem.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/block/mmcblk0p23: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p23: 11/500856 files (0.0% non-contiguous), 62917/1000445 blocks
format: /dev/block/mmcblk0p24
tune2fs 1.41.14 (22-Dec-2010)
Creating journal inode: done
This filesystem will be automatically checked every 30 mounts or
0 days, whichever comes first. Use tune2fs -c or -i to override.
e2fsck 1.41.14 (22-Dec-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/block/mmcblk0p24: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p24: 11/262144 files (0.0% non-contiguous), 49386/524289 blocks
tune2fs 1.41.14 (22-Dec-2010)
e2fsck 1.41.14 (22-Dec-2010)
Adding dirhash hint to filesystem.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/block/mmcblk0p24: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p24: 11/262144 files (0.0% non-contiguous), 49386/524289 blocks
format: /dev/block/mmcblk0p25
tune2fs 1.41.14 (22-Dec-2010)
Creating journal inode: done
This filesystem will be automatically checked every 30 mounts or
0 days, whichever comes first. Use tune2fs -c or -i to override.
e2fsck 1.41.14 (22-Dec-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/block/mmcblk0p25: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p25: 11/196608 files (0.0% non-contiguous), 32935/393217 blocks
tune2fs 1.41.14 (22-Dec-2010)
e2fsck 1.41.14 (22-Dec-2010)
Adding dirhash hint to filesystem.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/block/mmcblk0p25: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p25: 11/196608 files (0.0% non-contiguous), 32935/393217 blocks
format: /dev/block/mmcblk0p26
tune2fs 1.41.14 (22-Dec-2010)
Creating journal inode: done
This filesystem will be automatically checked every 30 mounts or
0 days, whichever comes first. Use tune2fs -c or -i to override.
e2fsck 1.41.14 (22-Dec-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/block/mmcblk0p26: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p26: 11/399200 files (9.1% non-contiguous), 28951/798348 blocks
tune2fs 1.41.14 (22-Dec-2010)
e2fsck 1.41.14 (22-Dec-2010)
Adding dirhash hint to filesystem.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/block/mmcblk0p26: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p26: 11/399200 files (9.1% non-contiguous), 28951/798348 blocks
Done.
PS C:\Android> adb reboot recovery
PS C:\Android>
UPD. The problem was that I was using Windows Povershell
Run the script from the command line and everything turned out.
Thanks!
I have to format first system and system1 in recovery to apply this script, because I have and error :
tmp/repartition.sh lin 115 can´t create /sdcard/parted_12_06_2014_FDFD6F4CB043F4956D9CAD053C3738AA.
DO MOUNT your SDCARD
then Follow the instruction
duhh...
I modified the script a little bit for 1 ROM usage. System1 is 840MB as in the original and System2 is 5MB. The rest goes into userdata. This is for the 16GB version.
Ok! I did again and umount the sdcard abd it worked fine.
Thanks
I found a better way
If u reboot into dload mode, u can change the partition table from your computer
The problem is that most partition managers don't support changing the GPT Partition names and that's why I added support for that to GParted.
GParted supports booting from Live CD/USB so Windows/Mac users aren't left out.
http://i.imgur.com/3SwSXs2.png
I pushed the patch to GParted repo's and I'll inform u once there're any news.
from my point of view the best way for use is:
- system (system1) - let 1024 MB
- system1 (system2) - let 10 MB
- userdata (apps) - let 4096 MB (take it from sdcard) - but maybe more

Categories

Resources