Behold... a long awaited partitioning guide
WARNING! This GUIDE is to actually learn something not just to copy/paste commands!
Requirements
rooted phone
busybox installed
parted (optional)
backup your SD card (optional)
calculator
Click to expand...
Click to collapse
Background
Before we begin partitioning, we need to elaborate some key points:
block storage units are divided into logical blocks known as sectors
sector has a size of 512 bytes
NAND flash chips are divided into blocks known as erase blocks
our SD cards consist of those NAND flash chips and controller
erase block on our SD cards has a size of 128 kB, that's 256 sectors
CHS (cylinder, head, sector) alignment has an insignificant importance here
1st sector is sector 0 (not 1) and is used as MBR (master boot record)
1st partition begins at cylinder boundary to maintain MS-DOS compatibility
raw access to block storage units is done via special block device files under /dev/block directory
our SD card is represented by block device file /dev/block/mmcblk0
Click to expand...
Click to collapse
Instructions
Here I will provide you with two methods of partitioning. For 1st method you will be using fdisk utility which is part of busybox and for 2nd a standalone utility called parted will be used. Both methods can be used in normal mode via adb shell or some terminal app. I will explain both methods using adb shell as it is more convenient and handy than typing commands via touch keyboard on your phone.
1st thing to do before you begin is to unmount your SD card via "Settings->SD & phone storage" and then you issue "adb shell" command ony your PC. 2nd thing you will do is erasing of your SD card (actually you will erase just first few erase blocks of your SD card) using dd utility:
Code:
dd if=/dev/zero of=/dev/block/mmcblk0 bs=131072 count=16
...that will overwrite 1st 2 MB of your SD card with null characters. Next you may begin with partitioning.
fdisk
As I already stated, fdisk is a (interactive) utility that is part of busybox so I will assume it is available under /system/xbin directory. Now you can run fdisk with device file of your SD card as parameter/argument:
Code:
fdisk /dev/block/mmcblk0
...this will bring you some notes on your screen you should not worry about and a command prompt:
Code:
Command (m for help):
...which you can leave at any time by pressing CTRL+C. Next you will change unit display type to sectors:
Code:
Command (m for help): [B]u[/B]
Changing display/entry units to sectors
...and print your SD's current info (this is info of my SD card actually, yours may vary):
Code:
Command (m for help): [B]p[/B]
Disk /dev/block/mmcblk0: 8018 MB, 8018460672 bytes
4 heads, 16 sectors/track, 244704 cylinders, total 15661056 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
...and you write down the number of sectors. In my case it is 15661056 sectors of 512 bytes which is exactly 7647 MB if we divide them by 2048. For example you would take 7000 MB for fat32 1st partition and 647 MB for ext 2nd partition. and it is handy that way coz megabytes are divisible by our SD card's erase block size which is 128 kB as stated before. Calculation would give you start sector for 2nd partition and this would be 14336000 (7000*2048).
Now you need to create 2 primary partitions:
Code:
Command (m for help): [B]n[/B]
Command action
e extended
p primary partition (1-4)
[B]p[/B]
Partition number (1-4): [B]1[/B]
...now there's a catch. You will be offeread a start of 1st partition at 1st to 2nd cylinder boundary which is sector 16 in my case and you push it to SD card's erase block boundary (256):
Code:
First sector (16-15661055, default 16): [B]256[/B]
Last sector or +size or +sizeM or +sizeK (256-15661055, default 15661055): [B]14335999[/B]
...and continue to the next partition which should also be primary:
Code:
Command (m for help): [B]n[/B]
Command action
e extended
p primary partition (1-4)
[B]p[/B]
Partition number (1-4): [B]2[/B]
First sector (16-15661055, default 16): [B]14336000[/B]
Last sector or +size or +sizeM or +sizeK (14336000-15661055, default 15661055): [B]15661055[/B]
...now print what you have just done:
Code:
Command (m for help): [B]p[/B]
Disk /dev/block/mmcblk0: 8018 MB, 8018460672 bytes
4 heads, 16 sectors/track, 244704 cylinders, total 15661056 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 256 14335999 7167872 83 Linux
/dev/block/mmcblk0p2 14336000 15661055 662528 83 Linux
...it looks OK but you need to change 1st partition's hex id which needs to be fat32 (c):
Code:
Command (m for help): [B]t[/B]
Partition number (1-4): [B]1[/B]
Hex code (type L to list codes): [B]c[/B]
Changed system type of partition 1 to c (Win95 FAT32 (LBA))
...now you're am set, print again your configuration and write changes to SD card:
Code:
Command (m for help): [B]p[/B]
Disk /dev/block/mmcblk0: 8018 MB, 8018460672 bytes
4 heads, 16 sectors/track, 244704 cylinders, total 15661056 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 256 14335999 7167872 c Win95 FAT32 (LBA)
/dev/block/mmcblk0p2 14336000 15661055 662528 83 Linux
Command (m for help): [B]w[/B]
The partition table has been altered!
There's a possibility you would need to shutdown and power on again your phone at this point. Do not reboot via adb or some 3rd party app!
Click to expand...
Click to collapse
parted
Parted is one of interactive partitioning utilities that can also use external formatting utilities. It can be found in some recovery images but can be copied to your internal phone storage and run from there in normal mode too. To run it you have to use your SD card's device file as a parameter/argument:
Code:
parted /dev/block/mmcblk0
...and you will be presented with an interactive shell:
Code:
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)
I probably shouldn't mention that there's an interactive help available and that it is invoked by issuing "help" into shell's command prompt. Next thing to do is making a MS-DOS disklabel:
Code:
(parted) [B]mklabel msdos[/B]
...and switch to display sector as a unit:
Code:
(parted) [B]unit s[/B]
Now you can print some useful info:
Code:
(parted) [B]print all[/B]
Model: SD USD (sd/mmc)
Disk /dev/block/mmcblk0: 15661056s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
Mind and write down the size in sectors (15661056 in my case).If you divide number of sectors by 2048, you get how big in MB is actually your SD card (7647 in my case).You should mind that erase block of your SD card is 128 kB and all of your partitions should start at the beginnings of those erase blocks. It is safe to say that 1st partition should begin at sector 256 and 2nd at any MB boundary. Let say you want 512 MB big ext partition and the rest for fat32 one. Mind tho that 1st partition is to be fat32! So we say 7135 MB for fat32 1st partition and 512 MB for ext 2nd partition. Now you calculate the start sector of 2nd partition... number of MB for 1st partition multiplied by 2048 should give you the number (14612480). And you are set for partitioning:
Code:
(parted) [B]mkpart primary fat32 256 14612479[/B]
(parted) [B]mkpart primary ext2 14612480 15661055[/B]
...and print result:
Code:
(parted) [B]print all[/B]
Model: SD USD (sd/mmc)
Disk /dev/block/mmcblk0: 15661056s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 256s 14612479s 14612224s primary fat32 lba
2 14612480s 15661055s 1048576s primary ext2
...and quit:
Code:
(parted) [B]quit[/B]
Click to expand...
Click to collapse
At this point you have partitioned your SD card but not yet formatted it. Format fat32 partition with mkfs.vfat and ext partition with mkfs.ext2:
Code:
mkfs.vfat /dev/block/mmcblk0p1
...and:
Code:
mkfs.ext2 -m0 -b4096 /dev/block/mmcblk0p2
If there is a mke2fs utility on your phone system (standalone - not part of busybox), you may use it to format second partition as ext3:
Code:
mke2fs -j -m0 -b4096 /dev/block/mmcblk0p2
...or even as ext4 (if your mke2fs supports that):
Code:
mke2fs -j -m0 -b4096 -Oextents,uninit_bg,dir_index /dev/block/mmcblk0p2
Click to expand...
Click to collapse
Blayo,
thanks for the post. You always manage to take things to an entirely different level of understanding
Is this guide for the successful implementation of the latest data2ext scripts in roms ? in comparison to methods like the Rom Manager and partition through recovery ?
No, it is general guide to better understand partitioning etc.
BlaY0 said:
No, it is general guide to better understand partitioning etc.
Click to expand...
Click to collapse
I totally agree! After going through parted I think it's the best way to partition your SD, you have complete control!
I can't wait will my new SD card arrives, and give this a shot!
The Kingston 16GB class 10 sucks even when set-up to the best parameters and the reason for that is simple: Although class 10, it is like 4 times slower than my 8GD sandisk mobile ultra Class 4 when random writing and 3 times slower when reading...
So Thanks BlaY0 for this cool guide/lesson
I have problem with fdisk . when i press p i got this info and there a no sector:
PHP:
Command (m for help): p
p
Disk /dev/block/mmcblk0: 16.0 GB, 16001269760
4 heads, 16 sectors/track, 488320 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Did you change units display to sectors?
Thanks, with the "u" option comes later in your manual
A last newbie question: i have now 2 part. and formated the FAT, but i dont know, how to get the "mke2fs" on the phone to format the Linux part.?
Sorry Blay0 but Linux is another Word for me...
tasar said:
Thanks, with the "u" option comes later in your manual
Click to expand...
Click to collapse
Thanx, I have changed that.
A last newbie question: i have now 2 part. and formated the FAT, but i dont know, how to get the "mke2fs" on the phone to format the Linux part.?
Sorry Blay0 but Linux is another Word for me...
Click to expand...
Click to collapse
If you have busybox on your phone you also have mke2fs or mkfs.ext2 as these two are part of it. If you have CM based ROM there should already be standalone e2fsprogs in /system/bin directory and if you have a stock based one, you can find mke2fs_recvy + e2fsck_recvy in /system/bin directory. In B ROM you have all e2fsprogs available in /system/xbin directory.
Many thanks!!! Now i install your 0.5
Code:
# mkfs.vfat /dev/block/mmcblk0p1
mkfs.vfat /dev/block/mmcblk0p1
mkfs.vfat: not found
help?
Try "busybox mkfs.vfat"...
BlaY0 said:
Try "busybox mkfs.vfat"...
Click to expand...
Click to collapse
Code:
# busybox mkfs.vfat /dev/block/mmcblk0p1
busybox mkfs.vfat /dev/block/mmcblk0p1
mkfs.vfat: applet not found
its ok, before you replied i tried doing it in recovery and i believe it worked, but i think i missed a digit in my partitioning and it was only 98mb for my fat drive instead of about 988 or something (1gb) so ill try it again and let you know
EDIT: ok yeah i had the digits wrong so now its formatted/partitioned correctly. now im gonna apply the data2ext thing and see what happens. i didnt actually do anything about my darktremor a2sd so ive probably got bits and pieces of all my apps missing but if **** starts to screw up ill just put a fresh copy of cm on since ive ruined all my apps basically already
EDIT: alright its working, thanks heaps!
DT has some commands to disable itself.
As for mkfs.vfat... it is part of busybox but not necesarily. There are several versions lying around the internets. Type just "busybox" and you'll see all the utils available in it.
BlaY0 said:
DT has some commands to disable itself.
As for mkfs.vfat... it is part of busybox but not necesarily. There are several versions lying around the internets. Type just "busybox" and you'll see all the utils available in it.
Click to expand...
Click to collapse
Code:
# busybox
busybox
BusyBox v1.16.2androidfull (2010-08-01 14:57:25 EDT) multi-call binary.
Copyright (C) 1998-2009 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.
Usage: busybox [function] [arguments]...
or: function [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use and BusyBox
will act like whatever it was invoked as.
Currently defined functions:
[, [[, arp, ash, awk, basename, bbconfig, brctl, bunzip2, bzcat, bzip2,
cal, cat, catv, chgrp, chmod, chown, chroot, cksum, clear, cmp, cp,
cpio, cut, date, dc, dd, depmod, devmem, df, diff, dirname, dmesg,
dnsd, dos2unix, du, echo, ed, egrep, env, expr, false, fdisk, fgrep,
find, fold, free, freeramdisk, fuser, getopt, grep, gunzip, gzip, head,
hexdump, id, ifconfig, insmod, install, ip, kill, killall, killall5,
length, less, ln, losetup, ls, lsmod, lspci, lsusb, lzop, lzopcat,
md5sum, mkdir, mke2fs, mkfifo, mkfs.ext2, mknod, mkswap, mktemp,
modprobe, more, mount, mountpoint, mv, nc, netstat, nice, nohup,
nslookup, ntpd, od, patch, pgrep, pidof, ping, pkill, printenv, printf,
ps, pwd, rdev, readlink, realpath, renice, reset, rm, rmdir, rmmod,
route, run-parts, sed, seq, setsid, sh, sha1sum, sha256sum, sha512sum,
sleep, sort, split, stat, strings, stty, swapoff, swapon, sync, sysctl,
tac, tail, tar, tee, telnet, test, tftp, time, top, touch, tr,
traceroute, true, tty, tune2fs, umount, uname, uniq, unix2dos, unlzop,
unzip, uptime, usleep, uudecode, uuencode, vi, watch, wc, wget, which,
whoami, xargs, yes, zcat
yeah so that mkfs.vfat isnt there and neither is parted
and then when i go to android recovery
Code:
# busybox
busybox
BusyBox v1.15.3 (2010-02-06 17:13:19 CET) multi-call binary
Copyright (C) 1998-2008 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.
Usage: busybox [function] [arguments]...
or: function [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use and BusyBox
will act like whatever it was invoked as!
Currently defined functions:
[, [[, arping, ash, awk, basename, bbconfig, bunzip2, bzcat, bzip2,
cat, catv, chattr, chgrp, chmod, chown, chroot, chrt, chvt, cksum,
clear, cmp, cp, crond, crontab, cut, date, dc, dd, deallocvt, depmod,
devmem, df, dhcprelay, diff, dirname, dmesg, dnsd, dnsdomainname,
dos2unix, du, dumpkmap, dumpleases, echo, egrep, env, ether-wake, expr,
false, fbset, fbsplash, fdisk, fgrep, find, fold, free, freeramdisk,
fsck, fuser, getopt, grep, gunzip, gzip, head, hexdump, hostname,
hwclock, ifconfig, ifdown, ifup, insmod, install, ip, ipaddr, ipcalc,
iplink, iproute, iprule, iptunnel, kbd_mode, kill, killall, killall5,
last, length, less, ln, loadfont, loadkmap, losetup, ls, lsattr, lsmod,
makedevs, md5sum, mdev, mkdir, mkdosfs, mkfifo, mkfs.vfat, mknod,
mkswap, mktemp, modprobe, more, mount, mountpoint, mv, nameif, nc,
netstat, nice, nmeter, nohup, nslookup, od, openvt, patch, pidof, ping,
pipe_progress, pivot_root, printenv, printf, ps, pscan, pwd, rdate,
rdev, readlink, readprofile, realpath, renice, reset, resize, rm,
rmdir, rmmod, route, run-parts, sed, seq, setconsole, setkeycodes,
setlogcons, setsid, sh, sha1sum, showkey, sleep, sort, split, stat,
strings, stty, sum, swapoff, swapon, switch_root, sync, sysctl, tac,
tail, tar, tcpsvd, tee, telnet, telnetd, test, tftp, time, top, touch,
tr, traceroute, true, tty, tunctl, udhcpd, udpsvd, umount, uname,
uncompress, uniq, unix2dos, unzip, uptime, usleep, uudecode, uuencode,
vconfig, vi, watch, wc, wget, which, who, whoami, xargs, yes, zcat
and boom, a lot more stuff is there (except parted.. but it works anyways, and mkfs.ext2 is missing, and doesnt work). it should be okay to do everything in recovery anyways right? and i can just use mke2fs -m0 -b4096 /dev/block/mmcblk0p2 to format the ext2 partition?
EDIT: just tried the parted method and i dont think it works, i get this
Code:
(parted) mkpart primary fat32 256 2813951
mkpart primary fat32 256 2813951
mkpart primary fat32 256 2813951
(parted) mkpart primary ext2 2813952 3862527
mkpart primary ext2 2813952 3862527
mkpart primary ext2 2813952 3862527
(parted) print all
print all
print all
Model: SD SU02G (sd/mmc)
Disk /dev/block/mmcblk0: 3862528s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 256s 2813951s 2813696s primary lba
2 2813952s 3862527s 1048576s primary
anyways i used the first method and its fine, although the partitioning isnt spot on accurate, i just put on data2ext for cm6 and my available space is 504mb instead of 512mb and i checked all my calculations and everything, ah well close enough. thanks again!
It looks OK.
Sent from my HTC Legend
Need some help.
There's a possibility you would need to shutdown and power on again your phone at this point.
Click to expand...
Click to collapse
Possibility?
I got this:
Code:
Command (m for help): p
p
Disk /dev/block/mmcblk0: 7973 MB, 7973371904 bytes
4 heads, 16 sectors/track, 243328 cylinders, total 15572992 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 256 13475839 6737792 c Win95 FAT32 (LBA)
/dev/block/mmcblk0p2 13475840 15572991 1048576 83 Linux
Then i got
Code:
Command (m for help): mkfs.vfat /dev/block/mmcblk0p1
mkfs.vfat /dev/block/mmcblk0p1
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)
The same with the mkfs.ext2 -m0 -b4096 /dev/block/mmcblk0p2
And now the phone says than my flash is empty or uses wrong format, dont want to mount it and want to format it. I press cancel.
if i make p again it shows:
Code:
Command (m for help): p
p
Disk /dev/block/mmcblk0: 7973 MB, 7973371904 bytes
4 heads, 16 sectors/track, 243328 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
What is my mistake?
UPD: Seems like it worked with the parted
Spoiler
Code:
C:\androidsdk\platform-tools>adb shell
adb server is out of date. killing...
* daemon started successfully *
# dd if=/dev/zero of=/dev/block/mmcblk0 bs=131072 count=16
dd if=/dev/zero of=/dev/block/mmcblk0 bs=131072 count=16
16+0 records in
16+0 records out
2097152 bytes transferred in 0.568 secs (3692169 bytes/sec)
# parted /dev/block/mmcblk0
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) mklabel msdos
mklabel msdos
mklabel msdos
(parted) unit s
unit s
unit s
(parted) print all
print all
print all
Model: SD SA08G (sd/mmc)
Disk /dev/block/mmcblk0: 15572992s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
(parted) mkpart primary fat32 256 13475839
mkpart primary fat32 256 13475839
mkpart primary fat32 256 13475839
(parted) mkpart primary ext2 13475840 15572992
mkpart primary ext2 13475840 15572992
mkpart primary ext2 13475840 15572992
Error: The location 15572992 is outside of the device /dev/block/mmcblk0.
(parted) mkpart primary ext2 13475840 15572991
mkpart primary ext2 13475840 15572991
mkpart primary ext2 13475840 15572991
(parted) print all
print all
print all
Model: SD SA08G (sd/mmc)
Disk /dev/block/mmcblk0: 15572992s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 256s 13475839s 13475584s primary lba
2 13475840s 15572991s 2097152s primary
(parted) quit
quit
quit
Information: You may need to update /etc/fstab.
# mkfs.vfat /dev/block/mmcblk0p1
mkfs.vfat /dev/block/mmcblk0p1
# mkfs.ext2 -m0 -b4096 /dev/block/mmcblk0p2
mkfs.ext2 -m0 -b4096 /dev/block/mmcblk0p2
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
65536 inodes, 262144 blocks
0 blocks (0%) reserved for the super user
First data block=0
Maximum filesystem blocks=4194304
8 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
playahate said:
Need some help.
Code:
Command (m for help): p
p
Disk /dev/block/mmcblk0: 7973 MB, 7973371904 bytes
4 heads, 16 sectors/track, 243328 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
What is my mistake?
Click to expand...
Click to collapse
I got this too... seems I forgot to enter the "w" command to write the partitions.
Absolutely. You neet to write the partition table exiting fdisk. And you can't execute mkfs.vfat and mke2fs inside fdisk shell! It's the same as you would try to microwave your sandwich in the fridge... it won't work that way...
agrrrrr. didnt see the next line with the w.
anyway i made it by parted. very good guide, very good rom =)
lil question: can i make ext3 or ext4 at any time? (after using data2ext).will it work correctly or wipe all data? or just when i make partitionong?
Yes. Just search the interwebs on how to convert ext2 -> ext3 -> ext4...
Just wondering if anyone has the original nook color's partition layout. I attempted to push HoneyComb to emmc with dd; however, that didn't work the way I expected. Now I'm missing the correct partition layout. In other words, I just need
fdisk -l /dev/mmcblk0
So I can correctly setup the partitions again and install Stock again.
Any word on this would be greatly appreciated.
Thanks.
bdkoepke said:
Just wondering if anyone has the original nook color's partition layout. I attempted to push HoneyComb to emmc with dd; however, that didn't work the way I expected. Now I'm missing the correct partition layout. In other words, I just need
fdisk -l /dev/mmcblk0
So I can correctly setup the partitions again and install Stock again.
Any word on this would be greatly appreciated.
Thanks.
Click to expand...
Click to collapse
I suspect that's the least of your worries if you did a dd to the DEVICE rather than partitions...... Geez.
Code:
# busybox fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7944 MB, 7944011776 bytes
255 heads, 63 sectors/track, 965 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 * 1 9 72261 c Win95 FAT32 (LBA)
/dev/block/mmcblk0p2 10 18 72292+ c Win95 FAT32 (LBA)
/dev/block/mmcblk0p3 19 56 305235 83 Linux
/dev/block/mmcblk0p4 57 935 7060567+ 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
/dev/block/mmcblk0p8 282 935 5253223+ c Win95 FAT32 (LBA)
Thanks
I will let you know how I make out.
(If it doesn't work, then there is probably just a little bit of boot code in the beginning of the device, but I suspect that it simply runs the boot code from the first partition. This is how it is done in OpenBoot, and pretty much every other system besides x86/bios)
Perhaps I should have done a full dd backup beforehand.
bdkoepke said:
Thanks
I will let you know how I make out.
(If it doesn't work, then there is probably just a little bit of boot code in the beginning of the device, but I suspect that it simply runs the boot code from the first partition. This is how it is done in OpenBoot, and pretty much every other system besides x86/bios)
Perhaps I should have done a full dd backup beforehand.
Click to expand...
Click to collapse
In the developers forums theres a recovery thread that has the partitions backed up. As for Honeycomb on internal I will be posting an install image in a bit under an hour (it's uploading now) that will allow you to use honeycomb on internal.
Thank you khaytsus and MattJ951.
I was able to get this to work properly after restoring the partition layout.
Something of interest, there are 935 cylinders allocated in the default partition layout (assuming khaytsus didn't modify it at all). There are actually 965 cylinders, so there is some extra space there for the vfat partition.
Thanks again.
bdkoepke said:
Thank you khaytsus and MattJ951.
I was able to get this to work properly after restoring the partition layout.
Something of interest, there are 935 cylinders allocated in the default partition layout (assuming khaytsus didn't modify it at all). There are actually 965 cylinders, so there is some extra space there for the vfat partition.
Thanks again.
Click to expand...
Click to collapse
Heh, no, rooted stock B&N ROM. Even knowing how fixable it is, I haven't experimented beyond booting NF or HC off SD.
So I have been able to get stock loaded again, but it can't detect the Mac Address/Serial Number... (Uh oh...)
Now this isn't the end of the world, but I can't use Market.apk on stock roms.
As I understand it:
/dev/block/mmcblk0p1 /boot (This should be fine, you can dd this)
/dev/block/mmcblk0p2 /rom (I'm guessing this is what I'm missing)
/dev/block/mmcblk0p3 /emmc (I just copied factory.zip here, there are no other files)
/dev/block/mmcblk0p5 /system (This should be fine...)
/dev/block/mmcblk0p6 /data (This is definitely fine to dd)
/dev/block/mmcblk0p7 /cache (Definitely fine as well)
/dev/block/mmcblk0p8 /sdcard (And also fine...)
So I'm just wondering what the original files are in /rom and /emmc.
I can't imagine the final blocks (935 and on) being used for hard-coded serial numbers/etc. That would be pretty stupid... Also the dual/froyo would clear these values.
I'm assuming the identity information is in /rom and /emmc.
Any word on this would be appreciated.
bdkoepke said:
So I have been able to get stock loaded again, but it can't detect the Mac Address/Serial Number... (Uh oh...)
Now this isn't the end of the world, but I can't use Market.apk on stock roms.
As I understand it:
/dev/block/mmcblk0p1 /boot (This should be fine, you can dd this)
/dev/block/mmcblk0p2 /rom (I'm guessing this is what I'm missing)
/dev/block/mmcblk0p3 /emmc (I just copied factory.zip here, there are no other files)
/dev/block/mmcblk0p5 /system (This should be fine...)
/dev/block/mmcblk0p6 /data (This is definitely fine to dd)
/dev/block/mmcblk0p7 /cache (Definitely fine as well)
/dev/block/mmcblk0p8 /sdcard (And also fine...)
So I'm just wondering what the original files are in /rom and /emmc.
I can't imagine the final blocks (935 and on) being used for hard-coded serial numbers/etc. That would be pretty stupid... Also the dual/froyo would clear these values.
I'm assuming the identity information is in /rom and /emmc.
Any word on this would be appreciated.
Click to expand...
Click to collapse
/dev/block/mmcblk0p2 contains the device specific information...
/dev/block/mmcblk0p3 contains factory.zip and a backup of /rom/devconf which also contains device specific info.
I think my mmcblk0p3 is hosed... thus my 8 failed boots always fails to install... I have yet to be able to mount it in adb to push new factory.zip... would love to get this fixed.
Got it... had to mke2fs /dev/block/mmcblk0p3 then i could copy mmcblk0p2's devconf and push factory.zip to it.... 8 failed boots work as it should now.
DizzyDen said:
/dev/block/mmcblk0p2 contains the device specific information...
/dev/block/mmcblk0p3 contains factory.zip and a backup of /rom/devconf which also contains device specific info.
I think my mmcblk0p3 is hosed... thus my 8 failed boots always fails to install... I have yet to be able to mount it in adb to push new factory.zip... would love to get this fixed.
Got it... had to mke2fs /dev/block/mmcblk0p3 then i could copy mmcblk0p2's devconf and push factory.zip to it.... 8 failed boots work as it should now.
Click to expand...
Click to collapse
DizzyDen, I am having the same problem i.e. 8 failed boots always fails to install. I am also unable to boot a CM7 image off of uSD card (hangs at Android) step. I can boot into CWM but it fails on installing a stock build.
I am hoping maybe my problems are related to yours. How did you accomplish the above? What tools did you use. I am fairly tech literate but a little loss with the tools and procedures for the Nook Color. I have tried several posts on restoring to stock non of which have worked. My assumption is that my partitions are messed up somehow such that it prevents my Nook from booting stock. I don't know why I have the same problem booting an image from a uSD card but it hangs on those. I am desperate at this point and any help would be much appreciated!
Thanks,
John
JoJa15 said:
DizzyDen, I am having the same problem i.e. 8 failed boots always fails to install. I am also unable to boot a CM7 image off of uSD card (hangs at Android) step. I can boot into CWM but it fails on installing a stock build.
I am hoping maybe my problems are related to yours. How did you accomplish the above? What tools did you use. I am fairly tech literate but a little loss with the tools and procedures for the Nook Color. I have tried several posts on restoring to stock non of which have worked. My assumption is that my partitions are messed up somehow such that it prevents my Nook from booting stock. I don't know why I have the same problem booting an image from a uSD card but it hangs on those. I am desperate at this point and any help would be much appreciated!
Thanks,
John
Click to expand...
Click to collapse
If you boot off a CWR sd... adb shell into NC... do a fdisk -l mmcblk0... verify your info against this one:
Code:
~ # fdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7944 MB, 7944011776 bytes
255 heads, 63 sectors/track, 965 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 * 1 9 72261 c Win95 FAT32 (LBA)
/dev/block/mmcblk0p2 10 18 72292+ c Win95 FAT32 (LBA)
/dev/block/mmcblk0p3 19 56 305235 83 Linux
/dev/block/mmcblk0p4 57 935 7060567+ 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
/dev/block/mmcblk0p8 282 935 5253223+ c Win95 FAT32 (LBA)
as long as the partition is present as listed above...
mke2fs /dev/block/mmcblk0p3
You will now have a file system on the mmcblk0p3 partition that you can mount to /emmc...
mount /dev/block/mmcblk0p3 /emmc
exit from adb shell
You can then push the sideload.zip (or factory zip... fyi 1.1.0 will not work)...
adb push sideload.zip /emmc/factory.zip (replace sideload.zip with whatever zip file you intend to use for the 8 failed boot recovery file)
you will want to do the following in a blank folder on your computer... keeps cleanup a lot easier....
I then pulled mmcblk0p2 to my computer and zipped the contents to rombackup.zip and pushed it to mmcblk0p2 also...
adb shell mkdir /temp
adb shell mount /dev/mmcblk0p2 /temp
adb pull /temp
zip everything you pulled from mmcblk0p2 into a zip file named rombackup.zip
then push it to /emmc
adb shell push rombackup.zip /emmc
ALTERNATIVELY: the first time I did this... I merely copied the devconf folder from mmcblk0p2 to mmcblk0p3...
adb shell
cd /temp
cp -a devconf /emmc
and it seemed fine... so I don't know if you MUST do the rombackup or not... also note....
I did delete all the files and did the zip as mentioned above.
I am not 100% certain of exactly WHAT rombackup is supposed to have in it....I just know that what I listed (both methods) has worked so far.
I kind of like the idea of the cp instead... seems it would be eaiser to just cp them back should anything ever happen to mmcblk0p2... but currently have my version of rombackup.zip trying to stay with stock setup.
Hoping someone else will pull the rombackup.zip from theirs and give me the filestructure in it.
I hope this has been explicit enough... if you need any more help let me know.
ALSO... the CM7 off uSD... are you by chance using one larger than 8 Gb? We've discovered an issue with the mke2fs on 16 Gb cards.
Thanks DizzyDen, currently I have not been able to get ADB to work. I have it installed but it does not see my device when in CWM. I did get a Froyo and Honeycomb off of uSD booting which is good. I can probably add market place and then get ADB wi-fi app to do my copying to the nook. Once I get that setup I will follow your instructions above and report back.
You might want to mount mmcblk0p3 to /emmc before you do any of the more advanced stuff I listed... just to make sure.... IF it mounts... list files before you do anything else.
I was having issues mounting the partition... that's why I had to go to the extent of formatting it.... you may be luckier and only have a corrupt factory.zip
DizzyDen said:
You might want to mount mmcblk0p3 to /emmc before you do any of the more advanced stuff I listed... just to make sure.... IF it mounts... list files before you do anything else.
I was having issues mounting the partition... that's why I had to go to the extent of formatting it.... you may be luckier and only have a corrupt factory.zip
Click to expand...
Click to collapse
OK, I got ADB working now but it seems fairly complex. Please bear with me as I am a newb when it comes to ADB. I did ADB Shell and then the command you listed. Here is the output:
Code:
# fdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7944 MB, 7944011776 bytes
255 heads, 63 sectors/track, 965 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 * 1 9 72261 c Win95 FAT32 (LBA)
/dev/block/mmcblk0p2 10 18 72292+ c Win95 FAT32 (LBA)
/dev/block/mmcblk0p3 19 56 305235 83 Linux
/dev/block/mmcblk0p4 57 965 7301542+ 5 Extended
Let me know what I need to do next.
Comparing your listing and mine it appears I am missing the 5-8 partitions. Also my mmcblk0p4 partition has a different ending then yours. So how do I go about adding the 5-8 partitions back and fixing the mmcblk0p4 one?
Those are partitions that are actually created on the logical partition mmcblk0p4... as you can see in the listing I posted.
Did you use ADB from and installed ROM or did you use a cwm bootable uSD ?
anyway to check your recovery options....
in adb mount mmcblk0p3 to /emmc and list its contents:
adb shell
mount /dev/block/mmcblk0p3 /emmc
ls /emmc
See if it has either recovery file... or both... or nothing
Post back whe you can and we'll go further.
If you want I could post the img files I got of ALL my partitions... well... won't share my mmcblk0p2 or mmcblk0p3 since they have my device specific information. They may help in getting your partitions straightened out.
Another option would be that we could use teamviewer to remote connect and look through it.
DizzyDen said:
Those are partitions that are actually created on the logical partition mmcblk0p4... as you can see in the listing I posted.
Did you use ADB from and installed ROM or did you use a cwm bootable uSD ?
Click to expand...
Click to collapse
I used ADB from my PC connecting to my nook that was running a bootable Froyo build from a uSD card
One other note, when booting from CWM on the uSD card when I try to do the fdisk command I get the following. I was still able to mount the partitions though in the shell example later in this message.
Code:
~ # fdisk -l mmcblk0
fdisk -l mmcblk0
fdisk: can't open 'mmcblk0': No such file or directory
~ #
anyway to check your recovery options....
in adb mount mmcblk0p3 to /emmc and list its contents:
adb shell
mount /dev/block/mmcblk0p3 /emmc
ls /emmc
See if it has either recovery file... or both... or nothing
Post back whe you can and we'll go further.
Click to expand...
Click to collapse
Here is what it shows. This is connecting to ADB via my PC with the nook booting into CWM on a uSD card. I do not have CWM installed on the Nook.
Code:
~ # mount /dev/block/mmcblk0p3 /emmc
mount /dev/block/mmcblk0p3 /emmc
~ # ls /emmc
ls /emmc
factory.zip lost+found rombackup.zip
~ # mount /dev/block/mmcblk0p1 /boot
mount /dev/block/mmcblk0p1 /boot
~ # ls boot
ls boot
charging.zip romrestore.zip uImage uRecImg
mlo u-boot.bin uRamdisk uRecRam
~ # mount /dev/block/mmcblk0p2 /rom
mount /dev/block/mmcblk0p2 /rom
mount: mounting /dev/block/mmcblk0p2 on /rom failed: No such file or directory
~ # mount /dev/block/mmcblk0p4 /system
mount /dev/block/mmcblk0p4 /system
mount: mounting /dev/block/mmcblk0p4 on /system failed: Invalid argument
~ # mount /dev/block/mmcblk0p5 /system
mount /dev/block/mmcblk0p5 /system
mount: mounting /dev/block/mmcblk0p5 on /system failed: No such file or director
y
~ # mount /dev/block/mmcblk0p6 /data
mount /dev/block/mmcblk0p6 /data
mount: mounting /dev/block/mmcblk0p6 on /data failed: No such file or directory
~ # mount /dev/block/mmcblk0p7 /cache
mount /dev/block/mmcblk0p7 /cache
mount: mounting /dev/block/mmcblk0p7 on /cache failed: No such file or directory
~ # mount /dev/block/mmcblk0p8 /sdcard
mount /dev/block/mmcblk0p8 /sdcard
mount: mounting /dev/block/mmcblk0p8 on /sdcard failed: No such file or director
If you want I could post the img files I got of ALL my partitions... well... won't share my mmcblk0p2 or mmcblk0p3 since they have my device specific information. They may help in getting your partitions straightened out.
Another option would be that we could use teamviewer to remote connect and look through it.
Click to expand...
Click to collapse
I'll PM you.
I really appreciate all the help!
I've been doing mine from bootable CWR SD... just to get the commands and make sure I am seeing actual internal emmc...
THAT may be why you can't get list of mmcblk0... not certain... but I responded to your pm's.
You couldn't get fdisk -l mmcblk0 to work cause I gave you the wrong command... it should be...
fdisk -l /dev/block/mmcblk0
The same as you did earlier....
It does look like we may get away with just replacing your factory.zip file...
I can send you the 1.0.1 file... the newest 1.1.0 won't work for recover for whatever reason B&N did it.
You are getting the fails (I think) because you are trying to mount all those partitions to /system...
Try this:
adb shell
mkdir /tmp4
mount /dev/block/mmcblk0p4 /tmp4
If that works... try doing the same for the remainder (5,6,7,8) increasing the tmpx each time... to match the partition you are trying to mount.
If it DOES NOT work... then I would suspect because of corrupt mmcblk04p partition... and we'll find out together if the factory.zip will fix that or if we have to go other methods.
With correct fdisk command
Code:
c:\android-sdk-windows\platform-tools\rombackup>adb shell
~ # fdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7944 MB, 7944011776 bytes
255 heads, 63 sectors/track, 965 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 * 1 9 72261 c Win95 FAT32 (LBA)
/dev/block/mmcblk0p2 10 18 72292+ c Win95 FAT32 (LBA)
/dev/block/mmcblk0p3 19 56 305235 83 Linux
/dev/block/mmcblk0p4 57 965 7301542+ 5 Extended
~ #
Looks like we will be trying to fix mmcblk0p4.... I'm gonna have to reseach exactly how to repartition it (maybe my mmcblk0p4 dd image will fix that) and how to fix the logical partitions that should be on that partition.
Will talk to ya in a bit.
here.....
DizzyDen said:
Looks like we will be trying to fix mmcblk0p4.... I'm gonna have to reseach exactly how to repartition it (maybe my mmcblk0p4 dd image will fix that) and how to fix the logical partitions that should be on that partition.
Will talk to ya in a bit.
here.....
Click to expand...
Click to collapse
That file at least helped me see my other partitions:
Code:
~ # dd if=/sdcard/mmcblk0p4-logical.img of=/dev/block/mmcblk0p4
dd if=/sdcard/mmcblk0p4-logical.img of=/dev/block/mmcblk0p4
2+0 records in
2+0 records out
1024 bytes (1.0KB) copied, 0.013641 seconds, 73.3KB/s
~ # fdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7944 MB, 7944011776 bytes
255 heads, 63 sectors/track, 965 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 * 1 9 72261 c Win95 FAT32 (LBA)
/dev/block/mmcblk0p2 10 18 72292+ c Win95 FAT32 (LBA)
/dev/block/mmcblk0p3 19 56 305235 83 Linux
/dev/block/mmcblk0p4 57 965 7301542+ 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
/dev/block/mmcblk0p8 282 965 5494198+ c Win95 FAT32 (LBA)
~ #
Now I need to figure out why my 4 and 8 partitions end at 965 instead of 935. I a going to try a factory reset first and then if that does not work try messing with resizing the partition.
John, glad we got it working for you... might want to check the fdisk -l /dev/block/mmcblk0 now and see if it still shows mmcblk0p2 ending at 965 after the factory reset and data clear.
Nonetheless... I'm glad we got the 8 failed boots/factory resets working for you.
I'm sure we can mess with parted enough to fix it... or REALLY mess it up ;-)
BTW... in messing with this... we have you enough posts now to post in the dev forums
Please, i need really need ur help, somebody, why do i keep losing my swap partition???
Please somebody, help me
i have problem with swap and ext3 partition with alfs kernel too, that's why i change the kernel..i don't know why alfs kernel have bug with partitions, because he don't mount the partitions. i want to see this problem solved too
sorry my bad english
akaSk8krew said:
i have problem with swap and ext3 partition with alfs kernel too, that's why i change the kernel..i don't know why alfs kernel have bug with partitions, because he don't mount the partitions. i want to see this problem solved too
sorry my bad english
Click to expand...
Click to collapse
Thanks for ur help, right now i had it solved by restored sd ext partition and wipe dalvik cache before reboot. for now it works but i cant sure that i wont lost my swap partition again. thanks for ur help
phoenix883 said:
Thanks for ur help, right now i had it solved by restored sd ext partition and wipe dalvik cache before reboot. for now it works but i cant sure that i wont lost my swap partition again. thanks for ur help
Click to expand...
Click to collapse
yes, if i clean dalvik cache and boot, the device recognize again the ext partition..but for me if i boot again, i loose again the partition. and swap don't work..i need boot million times to make swap work, but if i reboot again i loose the swap too..the solution for me is don't use ext partition, (but have problems with swap too) but i use much apps, then i have less memory.
alfs kernel in performance it's the best..alfs could fix the partition bug, i don't know..
sorry my bad english
akaSk8krew said:
yes, if i clean dalvik cache and boot, the device recognize again the ext partition..but for me if i boot again, i loose again the partition. and swap don't work..i need boot million times to make swap work, but if i reboot again i loose the swap too..the solution for me is don't use ext partition, (but have problems with swap too) but i use much apps, then i have less memory.
alfs kernel in performance it's the best..alfs could fix the partition bug, i don't know..
sorry my bad english
Click to expand...
Click to collapse
same hope for me also...its not that i dont want to use nAa kernel but the fps uncap make gaming in x8 much more better...thats why i choose alfs kernel...and because of this kernel i can use mdpi theme much more smoother....let's wait patiently for his new update....i believe this will be fix by alfs soon...by the way, thanks for helping me akaSk8krew
with versio 6 of alfs the problem persists..anybody helps?? anybody knows why this kernel dont mount the partitions? because in alfs thread, in first post, alfsamsung said that ext2\3\4 works..but for me and for much people don't work too
I want to help you guys,but I don't have this problem and I can't reproduce your errors....
Try this:
1 format sd card with fat32,ext*,swap if you not allready have done this
2 remove system/etc/init.d/10app2sd Remove swapper and use link2sd to move apps
3 edit system/etc/fstab to look like this
Code:
/dev/block/mtdblock3 /system yaffs2 rw
/dev/block/mtdblock4 /cache yaffs2 rw
/dev/block/mtdblock5 /data yaffs2 rw
/dev/block/mmcblk0p1 /sdcard vfat rw
/dev/block/mmcblk0p2 /sd-ext auto rw
[B]/dev/block/mmcblk0p3 /swap swap rw[/B]
now all 3 partitions will be mounted at boot
4 add this to system/etc/hw_config.sh
This will turn on swap on swap partition
Code:
#enable swap
swapon /dev/block/mmcblk0p3 #turn on swapp
echo "60" > /proc/sys/vm/swappiness #swap amount
To turn off swap do this and reboot
Code:
#enable swap
#swapon /dev/block/mmcblk0p3 #turn on swapp
#echo "60" > /proc/sys/vm/swappiness #swap amount
check on terminal if swap is working using #free
If you used app2sd before,then try and put it back to see if app2sd is the problem
@alfsamsung
thanks for your reply..the swap partition is mounted with app2sd or without thanks..the ext partition dont work..i test app2sd link2sd and nothing..a few days ago, i test without swap and link2sd and ext work..but also 1 or two days passed and stopped working..this only happens to me with your kernel..in stock or nAa works always..but your kernel is the best. the problem is in kernel..please: can you fix this? it's just a request
same here the ext wont work for me
Can you test this.I patched mmc with fixes.
Please post output from adb shell or terminal if it's not working
Code:
dmesg | grep mmc
alfsamsung said:
Can you test this.I patched mmc with fixes.
Please post output from adb shell or terminal if it's not working
Code:
dmesg | grep mmc
Click to expand...
Click to collapse
don't work i flah your kernel 07 wipe device, flash gingerDx v22, flash vold patch, wipe device again and boot..with root explorer go to \sd-ext and nothing..reboot, go again with root explorer and nothing..i put your code in terminal, but how i post it here, or better, how i make a txt file with output? can you put the code for this? i'm sorry. and thanks for your work
edit: i attached the files..is this what you want??
Tis is my output
Code:
<6>mmc0: Qualcomm MSM SDCC at 0x00000000a0400000 irq 24,113 dma 8
<6>mmc0: 8 bit data mode disabled
<6>mmc0: 4 bit data mode enabled
<6>mmc0: polling status mode disabled
<6>mmc0: MMC clock 144000 -> 49152000 Hz, PCLK 100000000 Hz
<6>mmc0: Slot eject status = 0
<6>mmc0: Power save feature enable = 1
<6>mmc0: DM non-cached buffer at ffc21000, dma_addr 0x0cdca000
<6>mmc0: DM cmd busaddr 0x0cdca000, cmdptr busaddr 0x0cdca300
<4>mmc0: host does not support reading read-only switch. assuming write-enable.
<6>mmc0: new high speed SDHC card at address b368
<6>mmcblk0: mmc0:b368 USD 7.46 GiB
<6> mmcblk0: p1 p2 p3
<6>EXT4 FS on mmcblk0p2, no journal
<6>EXT4-fs: mounted filesystem mmcblk0p2 without journal
and everything is working fine here.I use link2sd and my sd-ext is empty to,because link2sd is using data/sdext2.
why do you have this output: mmcblk0: p1 p2 p3 < p5 >
This is my output from parted in adb shell or terminall.Run the comands in bold
Code:
# [B]parted /dev/block/mmcblk0[/B]
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)[B] print[/B]
print
print
Model: SD USD (sd/mmc)
Disk /dev/block/mmcblk0: 8018MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 4194kB 7600MB 7596MB primary fat32
2 7600MB 7921MB 321MB primary ext2
3 7921MB 7987MB 65.8MB primary linux-swap(v1)
(parted)
alfsamsung said:
Tis is my output
Code:
<6>mmc0: Qualcomm MSM SDCC at 0x00000000a0400000 irq 24,113 dma 8
<6>mmc0: 8 bit data mode disabled
<6>mmc0: 4 bit data mode enabled
<6>mmc0: polling status mode disabled
<6>mmc0: MMC clock 144000 -> 49152000 Hz, PCLK 100000000 Hz
<6>mmc0: Slot eject status = 0
<6>mmc0: Power save feature enable = 1
<6>mmc0: DM non-cached buffer at ffc21000, dma_addr 0x0cdca000
<6>mmc0: DM cmd busaddr 0x0cdca000, cmdptr busaddr 0x0cdca300
<4>mmc0: host does not support reading read-only switch. assuming write-enable.
<6>mmc0: new high speed SDHC card at address b368
<6>mmcblk0: mmc0:b368 USD 7.46 GiB
<6> mmcblk0: p1 p2 p3
<6>EXT4 FS on mmcblk0p2, no journal
<6>EXT4-fs: mounted filesystem mmcblk0p2 without journal
and everything is working fine here.I use link2sd and my sd-ext is empty to,because link2sd is using data/sdext2.
why do you have this output: mmcblk0: p1 p2 p3 < p5 >
Click to expand...
Click to collapse
i don't know why i have this <p5> lol..you don't have.
and the parted output, mine is different..how i can make the output to a txt file?? lol i'm sorry but i don't know..can you help me?
If you are on win7 you have Windows Powershell.Use this instead of cmd.
Just mark the text and right click on it and now you can paste the text anywhere
Code:
# parted /dev/block/mmcblk0 print
parted /dev/block/mmcblk0 print
Model: SD SD08G (sd/mmc)
Disk /dev/block/mmcblk0: 7969MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 6597MB 6596MB primary fat32 boot, lba
2 6597MB 7666MB 1069MB primary ext3
3 7666MB 7937MB 271MB extended lba
5 7666MB 7937MB 271MB logical ntfs
#
with mini tool partition wizard i put a 1gb ext3, 256 mb of swap and the rest is fat 32...
the "p5" is ntfs????? why??? look at the atachment pls:/
try to remove the 2 partitions that is wrong.and make a new swap partition.Remember all partitions must be primary.
You can try this guide which you can run from recovery with card inside phone
And you need an external card reader if you use mini tool partition.Are you using this?
alfsamsung said:
try to remove the 2 partitions that is wrong.and make a new swap partition.Remember all partitions must be primary.
You can try this guide which you can run from recovery with card inside phone
And you need an external card reader if you use mini tool partition.Are you using this?
Click to expand...
Click to collapse
no. always when i partition my sdcard, i only connect the usb cable to the pc and click on "select to copy files to sdcard" and next use mini tool partition manager..using your link to tutorial, if i use the command to reboot recovery, the phone only boot, don´t go to recovery..if i manually put in recovery mode and proceed with the tutorial, the command give me this:
parted /dev/block/mmcblk0
/sbin/sh: parted: not found
i don´t have an external reader. laptop have but is for sd..i have a pen vodafone internet in home that have a reader too.will it work well with this?
i'm sorry something alfsamsung..i am limited at 8 thanks per day, so tomorrow i click thanks to you and again, thanks for this.thanks.
After you entered recovery, mount system, then continue with parted
don't work..always give me the same error:
parted /dev/block/mmcblk0
/sbin/sh: parted: not found
i don't know why
Are you on gingerdx?
Hello !
Here you will find the information needed to change the system partition from 2GB to 5GB - this operation is somewhat useful for installing any version of GApps on your device : Huawei MediaPad M3 8.4 Kirin version ( BTV-DL09; BTV-L0J; BTV-W09 )
Thanks to @accerian for his help, and you can also check out this tutorial for more information !
Download mkfs.ext4 and parted from here : https://forum.xda-developers.com/attachments/parted_gdisk_fdisk_mkfs-ext4-arm-zip.4494671/
Warning : the entire data partition will be deleted following this procedure, make sure you have backed up and saved it to a microsd card
Step I : extended system partition from about 2GB to 5GB ( example for a 32GB device, for 64GB devices the procedure is 99% similar, only one operation differs which will be specified at the appropriate time ) - also this example is for BTV-DL09 which is with LTE capabilities.
- extract "mkfs.ext4" and "parted" from previously download archive and put them into a new created tmp directory
- connect the device to the computer via the USB cable and bring the device into TWRP revovery with this command :
> adb reboot recovery
- copy the two executable files from the computer to the device :
> adb push tmp data/local
> adb shell
# cp -r data/local/tmp/mkfs.ext4 sbin/mkfs.ext4
# chmod 0777 sbin/mkfs.ext4
# cp -r data/local/tmp/parted sbin/parted
# chmod 0777 sbin/parted
- launch the "parted" function as follows :
# parted /dev/block/mmcblk0
- display all properties of all partitions : (I wrote what needs to be displayed as a command before pressing enter, so you just have to type "print" and press enter because (parted) is already displayed as promter ... be careful not to type (parted) twice in the following commands)
(parted) print
- go to line 43, which should be the same for all devices :
43 1174MB 3255MB 2080MB ext2 system msftdata
44 3255MB 3456MB 201MB ext4 cust msftdata
45 3456MB 3490MB 33.6MB ext4 version msftdata
46 3490MB 4127MB 638MB ext2 vendor msftdata
47 4127MB 4329MB 201MB ext4 product msftdata
48 4329MB 4333MB 4194kB hisitest2 msftdata
49 4333MB 31.3GB 26.9GB userdata msftdata
Click to expand...
Click to collapse
- if line 43 is not identical to this one here, please stop the process by writing quit and enter, I'm waiting for a private message with what is written on line 43 in the case of your device so that I can guide you correctly .
- assuming that all devices have the same system partition ( the same 43 line ) - approximately 2GB, we go to the next steps:
- access the Mount menu in TWRP and uncheck Data, and follow the steps below step by step :
(parted) rm 49
(parted) rm 48
(parted) rm 47
(parted) rm 46
(parted) rm 45
(parted) rm 44
(parted) rm 43
(parted) mkpart system ext2 1174 6501
(parted) name 43 system
(parted) set 43 msftdata on
(parted) mkpart cust ext4 6501 6702
(parted) name 44 cust
(parted) set 44 msftdata on
(parted) mkpart version ext4 6702 6736
(parted) name 45 version
(parted) set 45 msftdata on
(parted) mkpart vendor ext2 6736 7374
(parted) name 46 vendor
(parted) set 46 msftdata on
(parted) mkpart product ext4 7374 7575
(parted) name 47 product
(parted) set 47 msftdata on
(parted) mkpart hisitest 7575 7579
(parted) name 48 hisitest2
(parted) set 48 msftdata on
- for devices with 32GB :
(parted) mkpart userdata 7579 31.3GB
- for devices with 64GB :
(parted) mkpart userdata 7579 62.5GB
(parted) name 49 userdata
(parted) set 49 msftdata on
(parted) quit
Step II : activating partitions for reuse :
# mkfs.ext4 /dev/block/mmcblk0p43
# mkfs.ext4 /dev/block/mmcblk0p44
# mkfs.ext4 /dev/block/mmcblk0p45
# mkfs.ext4 /dev/block/mmcblk0p46
# mkfs.ext4 /dev/block/mmcblk0p47
# mkfs.ext4 /dev/block/mmcblk0p49
- go to TWRP -> Wipe -> Advanced Wipe -> select System -> Repair or Change File System -> Change File System -> EXT4 -> Swipe to Change
- go to TWRP -> Wipe -> Advanced Wipe -> select Vendor -> Repair or Change File System -> Change File System -> EXT4 -> Swipe to Change
- go to TWRP -> Wipe -> Format Data -> yes
- reboot device from TWRP to TWRP in order to use data again after formated !
- go to TWRP -> Wipe -> Advanced Wipe -> select Dalvik/ART Cache, Cache, Data, Internal Storage, System, Vendor -> Swipe to wipe
- copy the new updated of LOS 17.1 with system partition of 5GB into your device
- copy any GApps arm64 Android 10 to your device
- Install them like always, enjoy !
Mention :
- if your device is WiFi only, you may have fewer partitions .... the above instructions can be easily adapted from case to case !
The main idea is that we must first find out what position the system partition is in, in this case it was at position 43 which corresponds to /dev/block/mmcblk0p43 - then we need to delete all partitions from userdata to system, and recreate them in the same order !
To calculate the start and end position, it is again very easy : for example the system partition starts from the initial position 1174, which is the same as the end position of the previous partition 42 (42 1160MB 1174MB 14.7MB reserved3 msftdata), and the end position was incremented by 5327 in this case (almost 5GB), resulting in 6501. .. the next partition 44 (cust) will have the starting position 6501, and the end position will be incremented by 201 (i.e. 201MB) as shown on line 44 (44 3255MB 3456MB 201MB ext4 cust msftdata)
If really needed, a concrete example will be added here for WiFi only devices !
Thanks for this guide.
Thank you surdu_petru.
The internal storage size of BTV-L0J is 16GB, is the above procedure effective?
Is it possible to restore a partition size back to its original size? I sometimes use a dd command as a way to restore from LineageOS to stock ROM. So I need to restore it to its original size before using a dd command.
According to z3DD3r, who created a tool to resize the Nexus 5 system partition, it is recommended that after changing the partition size, TWRP should also be changed.
z3DD3r said:
Because TWRP includes size of system partition. This size should match the size of system partition on device. Otherwise bad things can happen...
Click to expand...
Click to collapse
Is there any problem without changing TWRP?
I am sorry for asking so many questions. I am cautious about changing the partition size because it is perilous.
Me said:
Thank you surdu_petru.
The internal storage size of BTV-L0J is 16GB, is the above procedure effective?
Is it possible to restore a partition size back to its original size? I sometimes use a dd command as a way to restore from LineageOS to stock ROM. So I need to restore it to its original size before using a dd command.
According to z3DD3r, who created a tool to resize the Nexus 5 system partition, it is recommended that after changing the partition size, TWRP should also be changed.
Is there any problem without changing TWRP?
I am sorry for asking so many questions. I am cautious about changing the partition size because it is perilous.
Click to expand...
Click to collapse
If you still have 49 partitions, and partition 43 (system) shows that in the above tutorial then the procedure is identical, you just have to put a lower value of the user data partition in the last corresponding line of 16GB!
- for devices with 16GB:
(parted) mkpart userdata 7579 ?? GB
Click to expand...
Click to collapse
There is no need to change anything, neither TWRP nor the partition to the initial value ... the most important thing is to pay attention to the Start and End position of system partition to make the calculations as accurate as possible !
I can help you if you can send me a screenshot of what the command below displays on your device (from the system down to the last partition):
> adb shell
# parted /dev/block/mmcblk0 print
surdu_petru said:
If you still have 49 partitions, and partition 43 (system) shows that in the above tutorial then the procedure is identical, you just have to put a lower value of the user data partition in the last corresponding line of 16GB!
There is no need to change anything, neither TWRP nor the partition to the initial value ... the most important thing is to pay attention to the Start and End position of system partition to make the calculations as accurate as possible !
I can help you if you can send me a screenshot of what the command below displays on your device (from the system down to the last partition):
> adb shell
# parted /dev/block/mmcblk0 print
Click to expand...
Click to collapse
Thank you for your reply.
It is good news that if each partition has the same number it is effective.
I am currently not having trouble with the size of system partitions, so I will give it some more thought.
@surdu_petru - many thanks for this guide, I found it very clear and straightforward. I wasn't sure if you were wanting confirmation that these instructions work with other models of the tablet - if so, I can confirm it works perfectly with my (wifi only, 32GB) BTV-W09.
Herby007 said:
@surdu_petru - many thanks for this guide, I found it very clear and straightforward. I wasn't sure if you were wanting confirmation that these instructions work with other models of the tablet - if so, I can confirm it works perfectly with my (wifi only, 32GB) BTV-W09.
Click to expand...
Click to collapse
Thanks for confirmation. I'm not waiting especially confirmation, but it's always better if you can confirm. I'm here to help in case that something goes wrong.
I'm going for the 3rd time as the first I messed up. Second I did it right but I think I have to switch it up a little as I have the WIFI, and I can't do mkfs.ext4 after doing the parted commands. But I'll keep on it to see if all the partitions are exactly correct. I know 43 is the same as the directions said to make sure. 3rd times the charm. Good luck out there
Hey man, things are kinda messed up for me at the moment.
I've followed your steps however my cmd crashed for some reason during the process. Now I can't mount data to start the process again. Using the genuine EMUI Recovery offerd at startup doesn't work because the partitions are messed up and my own recovery points are inaccessible probably due to a currupted ext sd card (you can't make this up )
Do you have any tips on how to regain control? Or are all hopes lost?
I've tried using pro-team multi tool, however their database/website seems to be unavailable at the moment...
Edit: I have it fixed now, using a sd-card I did a force update to stock firmware, that fixed the storage. Had to restart the entire process starting with TWRP installation, device was still unlocked though. Don't be stupid like me and always check your recovery data before and not after you already messed things up
hey guys,
I somehow messed it up and I'm getting this error message
/data is not present!
Failed to mount '/data'
Partitions are formatted:
43 1174MB 6501MB 5327MB ext4 system msftdata
44 6501MB 6702MB 201MB ext4 cust msftdata
45 6702MB 6736MB 33.6MB ext4 version msftdata
46 6736MB 7374MB 638MB ext4 vendor msftdata
47 7374MB 7575MB 201MB ext4 product msftdata
48 7575MB 7579MB 4194kB hisitest2 msftdata
49 7579MB 31.3GB 23.7GB userdata msftdata
Here is an output of "df" command:
~ # df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 1.8G 184.0K 1.8G 0% /dev
tmpfs 1.8G 2.0M 1.8G 0% /tmp
/dev/block/mmcblk0p36 232.0M 756.0K 223.6M 0% /cache
/dev/block/mmcblk0p46 582.4M 468.0K 563.7M 0% /vendor
/dev/block/mmcblk1p1 59.5G 5.0G 54.5G 8% /external_sd
I can't continue with "TWRP -> Wipe"
Any ideas what went wrong?
BlueLife98 said:
Hey man, things are kinda messed up for me at the moment.
I've followed your steps however my cmd crashed for some reason during the process. Now I can't mount data to start the process again. Using the genuine EMUI Recovery offerd at startup doesn't work because the partitions are messed up and my own recovery points are inaccessible probably due to a currupted ext sd card (you can't make this up )
Do you have any tips on how to regain control? Or are all hopes lost?
I've tried using pro-team multi tool, however their database/website seems to be unavailable at the moment...
Edit: I have it fixed now, using a sd-card I did a force update to stock firmware, that fixed the storage. Had to restart the entire process starting with TWRP installation, device was still unlocked though. Don't be stupid like me and always check your recovery data before and not after you already messed things up
Click to expand...
Click to collapse
hey man, how did you install the stock firmware? tried to install these firmware's but didn't work at all https://firmwarefile.com/huawei-mediapad-m3-btv-dl09