[REF] manual partition of sdcard w/parted,goto ext3/4 from adb. no liveCD req'd - G1 Android Development

i needed a way to format my sdcard & install swap capable rom with no card reader...grrr...my gray hair is your gain!
READ THIS FIRST: i wrote a script that automagically partitions the sdcard. get it here.
if you still want to partition manually, read on.
i did this with a BLANK 8gb card and a fresh rom install, so i had no data to lose..be careful. i take no responsibility for what happens to your phone, sdcard, data, sanity, etc if you follow these instructions. remember to backup your sdcard to your pc before you begin.
technically, you don't need adb for this, as you can partition your card in the recovery console on the g1(...not the terminal app) using the commands in this post. however, once you wipe your sdcard, you may want some way of getting a new rom onto the phone. ;p
these instructions apply to both, the windows command prompt and the mac terminal.
just about any size and/or class of sdcard will work, but you will want to use a class 6 cause it's wicked fast. 16gb transcend sdcards seem to be giving some people trouble and throwing "ERROR: input/output error during write on /dev/block/mmcblk0" when trying to partition. use them at your own peril.
the example in this thread is for MY sdcard...YOUR sdcard will be different and the partition sizes may vary. apply ur information(sdcard size, partition size) when appropriate. following the instructions in this post will erase ALL DATA on the sdcard before creating new partitions.
read the ENTIRE post VERY carefully BEFORE proceeding or asking questions...
#####
note #1: all typed commands are in bold. adb/console commands in black. windows prompt commands in green.
note #2: if all else fails...remove all partitions and create new. this seems to solve 99.9% of non-hardware related problems.
note #3: if note #2 fails...try 'mklabel msdos'. see below for more info.
note to ext3/ext4 fs users: parted does NOT support CREATING ext3/ext4 partitions..you MUST create with ext2 and upgrade. also, parted CAN RESIZE ext3 partitions, but with restrictions. check out the table on the features page, of their website. i will NOT go into resizing partitions in this post as there are many variations...
#####
need to backup your ext partition?
note: these backup commands must be run while phone is booted, not recovery.
to backup your ext partition to your current directory: adb pull /system/sd/ %CD%\sdbackup
to restore back to sdcard: adb push %CD%\sdbackup /system/sd
#####
having issues? please post the following when asking for help:
output from the following commands
parted /dev/block/mmcblk0 print
parted /dev/block/mmcblk0 check 1, if any.
parted /dev/block/mmcblk0 check 2, if any.
parted /dev/block/mmcblk0 check 3, if any.
what rom are you using?
what brand/size/class sdcard?
can you see fat32 partition on the phone? ie. through andExplorer or similar..
#####
materials:
g1 with cm-recovery-1.4
sdcard <--class 6 recommended(adata makes good ones...they max out the g1 hw in terms of speed)
rooted rom with ext3/4 support & swap capability <--recommend CyanogenMod
adb
fingas(or toes if you're this guy)​
part i - prepare the sdcard:
boot your g1 into recovery (using home + power)
drop to console (alt + x)
open windows command prompt and enter:
adb shell
now at the # prompt enter:
parted /dev/block/mmcblk0
you are now in parted...hopefully. if not, check your typing, start over, do more research, or give up.
to find out the size of your sdcard & the partitions that it contains, enter:
print
you may receive a message from the program:
Code:
"No Implementation: Partition 1 isn't aligned to cylinder boundaries. This is
still unsupported."
the error says it all.. ;P
not sure what this means exactly(besides our partitions being out of alignment), but it is not good for our purposes.
also, if your "Partition Table" is reported as being "loop", i suggest repairing with the following procedure as well since it seems to be causing some problems too.
to fix, type:
mklabel msdos
it may give you some guff about:
Code:
Warning: The existing disk label on /dev/block/mmcblk0 will be destroyed and all data on
this disk will be lost. Do you want to continue?
parted: invalid token: msdos
answer y to the 'yes/no'..
and then:
Code:
New disk label type?
confirm with: msdos
re-enter: print​
you should get something like:
Code:
print
print
Model: Unknown (unknown)
Disk /dev/block/mmcblk0: 7969MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 512B 7469MB 7469MB primary fat32 lba
2 7469MB 7969MB 500MB primary ext2
or, if your sdcard is new/empty you'll get:
Code:
print
print
Model: Unknown (unknown)
Disk /dev/block/mmcblk0: 7969MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
if no numbered partitions come up, move onto next step. if not, delete ALL partitions that you see with the rm command. it has the format: rm <partition number>.
in this case:
rm 1
rm 2
the fourth line in the 'print' command output shows you the total size of sdcard in MB(or GB if you card is large)..mine says: Disk /dev/block/mmcblk0: 7969MB
use this number(XXXXMB) and do some simple math to get the size of your partitions.
7969MB - 32MB linux-swap = 7937MB
7937MB - 500MB ext2 = 7437MB fat32​
32MB seems to be alright size for swap, though it can be lower depending on your sdcard size.
500 MB is a good round number for the ext2 partition...no need for more.
that leaves us with 7437MB for fat32 storage.​
part ii - create partitions:
for a2sd & swap to work properly, partitions MUST be created in this order: fat32, ext2, linux-swap
the command to create partitions is mkpartfs...command format is:
mkpartfs <partition type> <fs type> <start> <end>
note#1: the <start>/<end> numbers in the following section correspond to the italicized numbers above. your partition information will most likely be different.
note#2: by default parted assumes ur using MB as the units in commands. say you have a card that is LARGE(like 16GB) and want a partition of 12GB...all you do is use the proper units(ie. mkpartfs primary fat32 0 12GB) and parted will oblige. you can use decimals as well...if you want a similar setup to my calculations above, you would have a fat32 partition of 15.4GB(ie. mkpartfs primary fat32 0 15.4GB), 500MB ext2, and 32MB swap
now we create the partitions:
mkpartfs primary fat32 0 7437
mkpartfs primary ext2 7437 7937
mkpartfs primary linux-swap 7937 7969
to check out our handy work, enter:
print
output should be similar to:
Code:
print
print
Model: Unknown (unknown)
Disk /dev/block/mmcblk0: 7969MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 512B 7437MB 7437MB primary fat32 lba
2 7437MB 7937MB 500MB primary ext2
3 7937MB 7969MB 32.2MB primary linux-swap(v1)
to exit parted type:
quit
after quitting you may receive a message containing:
Code:
Information: You may need to update /etc/fstab.
no need to worry. fyi, fstab is a file that keeps track of disks & partitions in *nix. more info on fstab can be found here.​
part iii - convert ext2 to ext3/ext4:
parted will not create ext3/ext4 partitions...see beginning of post
to upgrade, enter:
upgrade_fs
you now have journaling(aka ext3)! if ext3 is all you want, skip next two commands.
you want ext4?
enter:
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p2
e2fsck -fpDC0 /dev/block/mmcblk0p2​
part iv - copy rom to sdcard and install, enable swap:
open another win cmd prompt, enter:
adb shell mount /sdcard
adb push /update-path/update.zip /sdcard
exit
in original cmd prompt, enter:
reboot recovery
after reboot:
wipe data (alt + w) <--this one is optional, but i like fresh installs
install rom (alt + s)
to enable swap, see this page.
note: you do not need to enable swap if your rom does it automagically.​
#####
all told, i end up with:
~7.5GB fat32
~500MB ext4
~32MB swap
cyanogen-v3.6.8.1 running faster than ever!
hope this wasn't too painful.
btw, you could use a live cd, but i think this is easier and maybe a little more fun!

very nice guide! I will have to test it out later on! Thanks! .

does this damage the sd card in anyway? i was running jac hero with swapper and it killed my sd card...but nice tut..might try it

wow... I never knew you were allowed to partition straight from terminal or I wouldn't have wasted a CD on g-parted... =/ nice guide, next time I need to partition, I'll use this method.
jay22are, partitioning the card will not damage it, but if you use it for swap you will always run the risk of corrupting your card, however, I read that someone calculated that it would still take 2yrs for your card to start having problems using swapper. So good luck.

Is their a noticeable increase in speed when running a non hero rom with swapper?

marixsmith said:
Is their a noticeable increase in speed when running a non hero rom with swapper?
Click to expand...
Click to collapse
extremely noticeable. apps run & transition much smoother than without the swap partition. although, i must say that most of the speed & stability in my setup is cyanogen's rom...it's awesome.
now i have a question...
does anyone know if there are speed/reliability differences between using the swapfile(like with the swapper app) and the swap partition? i did the partition b/c that's how i've always configured linux installs and it let's me mount the sdcard w/o issues.

when i'm trying to do the commands I run into this:
(parted) mkpartfs fat32 0 7584
mkpartfs fat32 0 7584
mkpartfs fat32 0 7584
parted: invalid token: fat32
Partition type? primary/extended?
doesn't seem like the guide covers all of the steps.

same problem as engaged...

Was wondering when someone would write this guide!
h.nocturna said:
wow... I never knew you were allowed to partition straight from terminal or I wouldn't have wasted a CD on g-parted... =/ nice guide, next time I need to partition, I'll use this method.
Click to expand...
Click to collapse
I just built and included Parted on the new recovery image (1.3.1). I was just waiting for someone to do a writeup about it because I'm lazy
engagedtosmile said:
when i'm trying to do the commands I run into this:
(parted) mkpartfs fat32 0 7584
mkpartfs fat32 0 7584
mkpartfs fat32 0 7584
parted: invalid token: fat32
Partition type? primary/extended?
doesn't seem like the guide covers all of the steps.
Click to expand...
Click to collapse
Should be "mkpartfs primary fat32 0 7584".
Parted can also resize your existing partitions without erasing data.

cyanogen said:
Parted can also resize your existing partitions without erasing data.
Click to expand...
Click to collapse
I'm gonna try when I get home always wanted to resize my partition without apps and data being loss

cyanogen said:
Parted can also resize your existing partitions without erasing data.
Click to expand...
Click to collapse
I'm gonna try when I get home always wanted to resize my partition without apps and data being loss. By the way great job with the roms, recovery's, and all the rest of the hard work you guys do. You guys are genious

cyanogen said:
Was wondering when someone would write this guide!
I just built and included Parted on the new recovery image (1.3.1). I was just waiting for someone to do a writeup about it because I'm lazy
Should be "mkpartfs primary fat32 0 7584".
Parted can also resize your existing partitions without erasing data.
Click to expand...
Click to collapse
@engage & others: fixed my mistake in original post
thanks cyanogen!
guess that's what i get for typing too fast... ;p

what am i doing wrong?
Im using a 2gb card.
following the guide after i use the print command it tells me my card is 2033MB in size
and it lists my start point at 32.3kB
i typed: mkpartfs primary fat32 32.3kB 1458MB
it states it cant make the partition and the closest it can do is 31.7kb to 31.7.
is it something im doing?

CC CEO said:
Im using a 2gb card.
following the guide after i use the print command it tells me my card is 2033MB in size
and it lists my start point at 32.3kB
i typed: mkpartfs primary fat32 32.3kB 1458MB
it states it cant make the partition and the closest it can do is 31.7kb to 31.7.
is it something im doing?
Click to expand...
Click to collapse
i believe the reason it is not exactly 0 is because it needs room for the partition information. mine was similar...i believe 31.9kb.
you don't need to use the 'kb' / 'mb'...i just use whole numbers and the prg figures out the hard stuff..
hmm...maybe remove all partitions (using the rm command) and start from scratch.
check out this site
can you paste/link to the console output to the forum?

What about ext4
I got brave and decided to "resize" my ext4 partition down 32MB to create a swap space.
First, I backed up everything using windoze after mounting.
But then it occured to me perhaps I should do a complete backup of my sd card first, including my ext4. But HOW?
Also, cyanogen said parted will resize with no data loss, so I assume you just use the "resize part# start stop" ??
Anyway, when I did my print command, it listed my FAT32 and an ext3. When I try and do anything to ext3, I get a "Error: File system has an incompatible feature enabled" message. I am guessing this is the ext4 stuff?
Will just sit tight for now, before I blow my entire SD card and have to start from scratch till someone can tell me safest way to backup sd card to pc completely and what to do about the ext4 errors.
Thanks in advance for the help!

very cool, I feel like such a dork doing it this way and it feels good! When i put in my command for the partition I got this error:
Warning: You requested a partition from 0.00B to 7216MB.
The closest location we can manage is 512B to 31.7kB. Is this still acceptable
to you?
Click to expand...
Click to collapse
not sure why I think its because the disk already had partitions. I couldn't remove them because parted said the disc was mounted. So I still couldn't avoid booting to the live cd and reformating though :*(
edit: actually rebooting the phone allowed me to use the rm command and remove my partitions and follow your instructions. Worked great thank you! this is going to save me loads of hassle in the future
edit2: spoke too soon when I run upgrade_fs I get this message
e2fsck 1.41.6 (30-May-2009)
/sbin/e2fsck: Superblock invalid, trying backup blocks...
/sbin/e2fsck: Bad magic number in super-block while trying to open /dev/block/mm
cblk0p2
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>
Click to expand...
Click to collapse
so i use the repair ext filesystems on the recovery image and it says
Checking filesystems. Error checking filesystem! Run e2fsck manually from console.
Click to expand...
Click to collapse
any help?
edit3: deleted the partitions and did it again, worked this time

This is exactly what i was looking for, thank you so much for this!

51dusty said:
extremely noticeable. apps run & transition much smoother than without the swap partition. although, i must say that most of the speed & stability in my setup is cyanogen's rom...it's awesome.
now i have a question...
does anyone know if there are speed/reliability differences between using the swapfile(like with the swapper app) and the swap partition? i did the partition b/c that's how i've always configured linux installs and it let's me mount the sdcard w/o issues.
Click to expand...
Click to collapse
first, IMHO and research, the swap partition does nothing to cyanogen's roms because of his magic touch, however, it does work wonders with the browser, and with all other builds besides cyan's
second, The swap file is placed on your fat32 partition, when you mount your sd card to your pc, the swap file disappears and your rom crashes...
stick with a linux-swap partition. you shouldn't go over 32mb tho, it gets glitchy after that.

yes you DO HAVE remove pre-existing partitions with rm command... obviously if you don't want to resize them.
genez

jklong03 said:
I got brave and decided to "resize" my ext4 partition down 32MB to create a swap space.
First, I backed up everything using windoze after mounting.
But then it occured to me perhaps I should do a complete backup of my sd card first, including my ext4. But HOW?
Also, cyanogen said parted will resize with no data loss, so I assume you just use the "resize part# start stop" ??
Anyway, when I did my print command, it listed my FAT32 and an ext3. When I try and do anything to ext3, I get a "Error: File system has an incompatible feature enabled" message. I am guessing this is the ext4 stuff?
Will just sit tight for now, before I blow my entire SD card and have to start from scratch till someone can tell me safest way to backup sd card to pc completely and what to do about the ext4 errors.
Thanks in advance for the help!
Click to expand...
Click to collapse
to backup ext partition just cp /system/sd it has the apps dirs and dalvik-cache
this ver of parted does not handle ext3/4...that's why you have to upgrade after partitioning. as far as resizing goes...i would imagine it can't do that to ext3/4 either.
maybe cyanogen can provide complete explanation of ext3/4 support...?
my advice would be to delete all and start fresh..i'm not a huge fan of resizing partitions...it seems to let gremlins into the fs. ;p

Related

Boot Loop Fix Threw Parted.

I am not responsible for any lost data or damage to your phone.
Was done on a G1.
if you are installing a hero ROM for your first time visit this thread: http://forum.xda-developers.com/showthread.php?t=534479
I have seen some people with Boot Loop Problems while trying to update a Hero ROM Here is a simple way to fix this issue. Hero ROM's cannot have any files in the ext3 file system in order for it to boot correctly, this tutorial remakes your ext3 partition clearing it of all data, so backup any apps you wish to save threw adb pull or simply download again threw market.
Reboot into recovery mode and do alt + x to get into terminal.
When you get into terminal type:
Remember this is my 16GB card and the way I partitioned my Card. You will have to change the commands a little for your personal setup as explained below.
/# parted /dev/block/mmcblk0
(parted) print
(parted) rm
Partition Number? 2
(parted) print
(parted) mkpartfs primary ext2 15200 15700 !Note:(15200 & 15700 represent (in megabytes) where the ext2 file system begins and ends. you will have to make this represent your configuration)
(parted) print
(parted) quit
/# upgrade_fs (this will upgrade your file system to ext3... Dizzy's Hero ROM uses ext3 file system)
/# recovery
After this apply ROM update on your phone and enjoy =]
I added images to help answer questions and make it easier.

[INFO] Clarification: reformatting ext partition

I'm posting this because I am seeing lots of confusion in this area.
Most of the guides found on this forum as well as answers given in the q/a section pertaining to this give the following advice for formatting/wiping a ext parition:
Code:
rm -rf /system/sd/*
Although this may fix a lot of problems it does not really reformat the partion.
"rm -rf" just means "remove(delete) --recursively(subfolders as well) --force(don't ask if ok)". This only deletes the files by removing the inode entries from the filesystem table.
To truly reformat and ensure there are no remnants on the partition you need to make a new filesystem on that partition. This will build a new inode table completely instead of just removing entries in the table.
Enter recovery console (filesystem should NOT be mounted when formatted)
Code:
mke2fs /dev/block/mmcblk0p2 #for ext2 partitions
mke2fs -j /dev/block/mmcblk0p2 #for ext3 partitions
"mke2f2" means "make extended2 filesystem"
"-j" means "add a journal"(ext2+journal=ext3)
Hope this helps
Printing this out right now this is a keeper
Thankyou
Thanks buddy...printing now...
Ok, even though I am just begining at Linux I do understand the difference here between the 2 methods (its like the quick format option under windows). My question is, does it matter? Can you explain why the quick method may be detramental or unsafe.
Thanks for the advice dumfuq, but what if you have a ext4 partition?
Total Noob:
I've just been removing the partition and creating a new one.. is that just as effective (obviously the longer route)?
Also, how would you go about reformatting a linux-swap partition? Again, I've just been removing and recreating every time I flash.. I realize this isn't the fastest way.
Thanks a lot. This is very helpful.
Baldyman1966 said:
Ok, even though I am just begining at Linux I do understand the difference here between the 2 methods (its like the quick format option under windows). My question is, does it matter? Can you explain why the quick method may be detramental or unsafe.
Click to expand...
Click to collapse
I don't think just deleting the files is detrimental or unsafe...its just not formatting. For the most part it doesn't matter but if you want a fresh filesystem make a new one.
Thanks for the advice dumfuq, but what if you have a ext4 partition?
Click to expand...
Click to collapse
It should be
Code:
mke2fs -T ext4 /dev/block/mmcblk0p2
But I haven't tried it
I've just been removing the partition and creating a new one.. is that just as effective (obviously the longer route)? Also, how would you go about reformatting a linux-swap partition? Again, I've just been removing and recreating every time I flash.. I realize this isn't the fastest way
Click to expand...
Click to collapse
Yup...just as effective.
For swap
Code:
mkswap /dev/block/mmcblk0p3
But I don't think it is usually necessary to remake the swap after the initial creation (could be wrong on that though and I guess it can't really hurt)
This thread should be listed in the "Informative Links" sticky
simliarly, how would you go about removing the entire ext3 partition, so reclaim that 500mb back into the fat32? i have a htc magic and no longer need apps2sd, so having a ext partition isnt neccesary in my case. i rather use that extra 500mb for media and storage.
is there a special command to do this? i dont want to reformat the entire card since i have a lot of stuff on my fat32. i was hoping there was an easy way. thanks for any advice!
NguyenHuu said:
simliarly, how would you go about removing the entire ext3 partition, so reclaim that 500mb back into the fat32? i have a htc magic and no longer need apps2sd, so having a ext partition isnt neccesary in my case. i rather use that extra 500mb for media and storage.
is there a special command to do this? i dont want to reformat the entire card since i have a lot of stuff on my fat32. i was hoping there was an easy way. thanks for any advice!
Click to expand...
Click to collapse
Not really.
To do this you have to modify the partition table. Personally I would just back up the data, use fdisk (available in recovery console) to delete old and create new partitions, use windows to format the new fat32 partition created with fdisk, and then restore the data.
However since you don't want to reformat, you could try using gparted(or even parted for that matter) to remove the ext3 partition and resize the fat32. Still probably want to backup first though. There are a few tutorials already that walk you through adding an ext3 partition without losing your fat32. It shouldn't be to hard to follow one of them and tweak the commands to remove ext3 and expand the fat32.
thanks for all the advice, i have removed the ext partitions and resize my fat32 successful without data lost. i backed up just in case too. thanks.

[REF] Fix internal SD partitions

DISCLOSURE: Not responsible for you being retarded and breaking what doesn't need fixed.
DISCLOSURE 2: Do not use this on the O2x as it has a slightly different partition table.
Here is my step by step for repairing the internalsd Partitions... I don't think I've forgotten anything in this. If anyone knows how to write this into a .zip for flash via CWR it would be great. Credit goes to TeamWhiskey for helping me out when I screwed my partition table up...
WARNING: This can destory your internalSD card partitions. If it's not broke don't fix it!
ALL ENTRIES ARE IN RED
I am not responsible for any damage you do to your phone.
I did this same thing to my phone... I was still able to get into recovery though. You can repair the internal partitions through ADB if you can still get into recovery.
Steps to recreate partitions.
Boot into recovery
from your PC open cmd prompt
change to your ADB directory
run adb shell
mkfs /dev/block/mmcblk0
fdisk -H 1 /dev/block/mmcblk0
if the above fails try fdisk -l /dev/block/mmcblk0
then fdisk -H 1 /dev/block/mmcblk0
once in the fdisk of ../mmcblk0 you might as well delete all the partitions if you believe that they are corrupted
d
1
repeat for partition 2-8
one all of your partitions are gone you now have a blank internal SD and will need to execute the following to restore all the proper partition sizes
Partition 1
n
p
1
First Cylinder start 129
First Cylinder stop 55168
We will repeat this for partitions 2 and 3
Partition 2
n
p
2
Start 55169
Stop 63360
Partition 3
n
p
3
Start 63361
Stop 63616
On to partition 4 which will be extended (this is the last partion you will choose primary or extended)
Partition 4
n
e
4
Start 63617
Stop 975424
Now onto partition 4-8 which are automatically selected as logicall partions (no option is given)
Partition 5
n
Start 63681
Stop 64704
Partition 6
n
Start 64769
Stop 65088
Partition 7
n
Start 65153
Stop 261760
Partition 8
n
Start 261825
Stop 975424
Once you have done this the partitions are ready to be written to the internalSD
I would recommend choosing the command p to verify that all of your start and stop blocks are correct.
From this point you have the option to either quit without saving changes "q" or to write the partition table itself "w". Once you are sure that you have entered all of your partitions correctly you can choose the command w
At this point you have recreated all the partitions on your InternalSD card. If you have a nandroid backup at this point you should be able to restore it without a problem once you copy it over to the internal or external (depending on which CWR you are running).
I didn't have to go through the format portion of the fdisk as I had a nandroid backup which formats all the partitions itself.
If I've forgotten any steps please feel free to comment and include them.
Thanks to TeamWhiskey for helping me resolve this issue when I had it...
Don't forget to click the Thanks button if this helped...
When i get to
Code:
fdisk -h 1 /dev/block/mmcblk0
I get
Code:
unknown option -- hBusyBox v1.16.2androidminimal (2010-03-28 22:34:51 EDT) multi
-call binary.
Did i do anything wrong ?
exPos3D said:
When i get to
Code:
fdisk -h 1 /dev/block/mmcblk0
I get
Code:
unknown option -- hBusyBox v1.16.2androidminimal (2010-03-28 22:34:51 EDT) multi
-call binary.
Did i do anything wrong ?
Click to expand...
Click to collapse
My apologies it is the correct code but should be
Code:
fdisk -H 1 /dev/block/mmcblk0
"I sometimes forget linux commands are case sensitive"
After doing all the steps
When its time to write the tables by executing the "w" command i get this error
Code:
Command (m for help): w
w
The partition table has been altered!
Calling ioctl() to re-read partition table
fdisk: WARNING: rereading partition table failed, kernel still uses old table: D
evice or resource busy
exPos3D said:
After doing all the steps
When its time to write the tables by executing the "w" command i get this error
Code:
Command (m for help): w
w
The partition table has been altered!
Calling ioctl() to re-read partition table
fdisk: WARNING: rereading partition table failed, kernel still uses old table: D
evice or resource busy
Click to expand...
Click to collapse
seems as if I may have forgotten a step but I don't think that I did....
before doing the fdisk command try
Code:
mkfs /dev/block/mmcblk0
if that doesn't work goin into your adb shell and do an
Code:
fdisk -l /dev/block/mmcblk0
and
Code:
fdisk -H 1 /dev/block/mmcblk0
p
and paste the output
It worked thanks but now my sdcard still wont mount for any of my apps, or camera. I can add items to my sd card and install to it, but it still wont mount
I'm not in this area so i do not know where to find files ADB on my computer. If you have time, can you be more detailed instructions to help me ? thank you very much . I waiting for your answer,.
chulun9999 said:
I'm not in this area so i do not know where to find files ADB on my computer. If you have time, can you be more detailed instructions to help me ? thank you very much . I waiting for your answer,.
Click to expand...
Click to collapse
Please use the search function....
http://www.xda-developers.com/android/adb-easy-tutorial/
So I can boot into CWM, but when I try to use ADB it says "Device not found" ...
The phone will boot into the o2x OS, but I get no cell signal. When it boots into the OS, ADB finds it no problem.
Any suggestions?? Does ADB work with all versions of CWM??
Thanks so much for the partition table info!
Try this ... Stock nandroid
Command in windows
Can you post the command you mentioned for linux , to do it in windows . Am using windows 7 . LG update tool screwed my mobile and i have to proceed only with restoring the partition tables .
casper200519 said:
DISCLOSURE: Not responsible for you being retarded and breaking what doesn't need fixed.
DISCLOSURE 2: Do not use this on the O2x as it has a slightly different partition table.
Here is my step by step for repairing the internalsd Partitions... I don't think I've forgotten anything in this. If anyone knows how to write this into a .zip for flash via CWR it would be great. Credit goes to TeamWhiskey for helping me out when I screwed my partition table up...
WARNING: This can destory your internalSD card partitions. If it's not broke don't fix it!
ALL ENTRIES ARE IN RED
I am not responsible for any damage you do to your phone.
I did this same thing to my phone... I was still able to get into recovery though. You can repair the internal partitions through ADB if you can still get into recovery.
Steps to recreate partitions.
Boot into recovery
from your PC open cmd prompt
change to your ADB directory
run adb shell
fdisk -h 1 /dev/block/mmcblk0
once in the fdisk of ../mmcblk0 you might as well delete all the partitions if you believe that they are corrupted
d
1
repeat for partition 2-8
one all of your partitions are gone you now have a blank internal SD and will need to execute the following to restore all the proper partition sizes
Partition 1
n
p
1
First Cylinder start 129
First Cylinder stop 55168
We will repeat this for partitions 2 and 3
Partition 2
n
p
2
Start 55169
Stop 63360
Partition 3
n
p
3
Start 63361
Stop 63616
On to partition 4 which will be extended (this is the last partion you will choose primary or extended)
Partition 4
n
e
4
Start 63617
Stop 975424
Now onto partition 4-8 which are automatically selected as logicall partions (no option is given)
Partition 5
n
Start 63681
Stop 64704
Partition 6
n
Start 64769
Stop 65088
Partition 7
n
Start 65153
Stop 261760
Partition 8
n
Start 261825
Stop 975424
Once you have done this the partitions are ready to be written to the internalSD
I would recommend choosing the command p to verify that all of your start and stop blocks are correct.
From this point you have the option to either quit without saving changes "q" or to write the partition table itself "w". Once you are sure that you have entered all of your partitions correctly you can choose the command w
At this point you have recreated all the partitions on your InternalSD card. If you have a nandroid backup at this point you should be able to restore it without a problem once you copy it over to the internal or external (depending on which CWR you are running).
I didn't have to go through the format portion of the fdisk as I had a nandroid backup which formats all the partitions itself.
If I've forgotten any steps please feel free to comment and include them.
Thanks to TeamWhiskey for helping me resolve this issue when I had it...
Click to expand...
Click to collapse
Can you post the commands to do it from windows ?
bibinkalarikkal said:
Can you post the commands to do it from windows ?
Click to expand...
Click to collapse
Read and go step by step, these are for windows
Sent from my LG-P999 using XDA Premium App
Is there a way to use this app to create one partition just for user app storage? I don't want or need an internal sdcard partition!
Sent from my LG-P999 using xda premium
DUDE!!
Thanks to your instructions and one hour of simple restoration work and my G2X was back in the game. This is for those not faint of heart, but if you've made it far enuff to delete your Internal partitions...Then you could handle these instructions...
PROPZ!!!!
I couldn't do it.When I wrote fdisk -h 1 /dev/block/mmcblk0 to adb shell there was 4 different options.
Usage:fdisk [-ull] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b DISK
Change partition table
-u Starts and End are in sectors <instead of cylinders>
-l Show partition table for each DISK, then EXIT
-b 2048 <for certain MO disks>use 2048-byte sectors
-C CYLINDERS Set number of cylinders/heads/sectors
-H HEADS
-S SECTORS
~ #
I don't know what to do.Can you please help me with this?
I tried this because my device was failing while OneClickRecoveryFlash. NVError 0x120000
I'm about to get a g2x, however I have a question..
What causes bad partitioning table? Or messed up partition table?
nitrogen618 said:
I'm about to get a g2x, however I have a question..
What causes bad partitioning table? Or messed up partition table?
Click to expand...
Click to collapse
Flashing a G2X or WIND Optimus 2X which are the same LG-P999 handset with anything for the Optimus 2X (O2X) which is the LG-P990. They use the same internal hardware except for the cell radio modem and use different partition tables so their firmware and ROMs are incompatible. When the LG-P999 is flashed with LG-P990 stuff the LG-P999 will boot as an LG-P990 but there won't be any cell services.
Another reason is an incomplete flashing with LG-P999 firmware.
Core Memory said:
Flashing a G2X or WIND Optimus 2X which are the same LG-P999 handset with anything for the Optimus 2X (O2X) which is the LG-P990. They use the same internal hardware except for the cell radio modem and use different partition tables so their firmware and ROMs are incompatible. When the LG-P999 is flashed with LG-P990 stuff the LG-P999 will boot as an LG-P990 but there won't be any cell services.
Another reason is an incomplete flashing with LG-P999 firmware.
Click to expand...
Click to collapse
Ah, so basically they flashed a p990 rom on a p999.
Another question, when flashing a new rom on cwm you do
-clear data/factory reset
-clear cache partition
-clear dalvik cache
-install rom from sd
Right?

[GUIDE] Repartition your gpt partitioned device after custom rom install(Huawei Y6)

This guide was written for the Huawei y6 with a gpt partition table, mounts that use partition names not numbers and the userdata partition is the last one on disk however with a little adaption this should work for most gpt devices.
If you are unsure if your system uses partition names for the mount system look in /fstab."hardware" to see if your devices are labelled in the following manner. "/dev/block/bootdevice/by-name/system".
If the fstab file does not exist all is not lost look in your root directory at the .rc files for the command mounting system.
If you are unsure ask in the thread before doing anything. Better to ask than be stuck with a brick.
This guide covers modification to only system and userdata partitions but if you use great care the basics covered here will allow for modification to other partitions as long as you understand the risk and know that backups are your friend.
If you are unable to follow instructions and end up with a bricked device that is your own fault and attempts to blame me will be laughed at.
I obtained the attached parted binary from here
So you have flashed a custom ROM and without all the OEM bloatware you now have some unused free space in your system partition just sitting there gathering dust.
You are stuck with this space... Wrong.
You can repartition your device with a little paitence, time and work.
Read along if you are curious about how to get the space you deserve.
Prerequisites:
Free space (Duh).
The ability to follow instructions and to read ALL steps before you start so you know what your plan is.
An unlocked bootloader which you already have if you flashed a custom ROM.
A custom recovery (twrp preferred).
Parted binary (see attachment at the bottom of this post).
A computer with adb installed and working (there are many guides out there if you don't have it, Google is your friend).
A calculator (well I'm sure your computer has one but just so you know).
Some knowledge using terminal commands.
Risk of Bricking your device:
Low if you backup and can double check typing and calulations.
High if you can't do one of the above.
Because parted does not allow resizing of ext4 partitions you must delete partitions you want to change then recreate them.
All steps must be performed while in recovery because you are going to have to unmount any partition before you can change it.
Step 1:
Boot into recovery and make a backup. You MUST do this otherwise you will have nothing to restore.
Step 2:
Plug your device into your computer.
Copy the parted binary into your working directory on your PC.
Open your Command Prompt (Windows) or Terminal (Linux) and navigate to where adb is installed and you also put parted, or if you have adb in your PATH just go to where parted is.
Run
Code:
~ # adb devices
to ensure your device is present.
Run
Code:
~ # adb root
to get root priviliges.
Run
Code:
~ # adb push parted /sbin/parted
/sbin is in your devices PATH so you don't have to worry about typing /parted.
Run
Code:
~ # adb shell
Run
Code:
~ # chmod 755 /sbin/parted
If you get an error about a read only file system run
Code:
mount -o remount,rw /
then try again.
Step 3: Now you need to do some homework to find your sector size, sector count and how much free space you have available.
DO NOT shrink your filesystem to smaller than you need to operate. I always add at LEAST 50 mb to the used space however I recommend you think for the future, are you planning on restoring to stock?, are you planning on flashing OpenGAPPS?, are you planning on moving third party apps into the system?, are you planning on adding media or custom boot animations to the system?
So in the case below I would not make the partition any smaller than 800 MB.
Code:
~ # df
Filesystem Size Used Free Blksize
/system 1.2G 748.5M 441.8M 4096
/data 5.2G 3.5G 1.6G 4096
/cache 147.2M 4.7M 142.5M 4096
Now issue the following command to get your disks sector size in bytes remember to note this down.
Code:
~ # blockdev --getss /dev/block/mmcblk0
512
Time to use parted.
Issue the following commands to get some info on your current partitions.
"unit s" tells parted to show sectors instead of blocks, bytes etc.
Code:
~ # parted /dev/block/mmcblk0
(parted) unit s
(parted) print
Number Start End Size File system Name Flags
22 876562s 1191132s 314571s ext4 cache
23 1191133s 3990839s 2799707s ext4 system
24 3990840s 15269854s 11279015s ext4 userdata
Remember to not the partition number as you will need it later.
Remember to note your partition name with exact case, if you changed "system" to "System" you will have problems.
Also note the start sector of your system partition for the later steps.
Also note the end sector number for your userdata partition for the later steps.
Now get your calulator ready.
Some things to keep in mind here are that the number of sectors times sector size is the size of your partition in bytes and your starting sector must be 1 after the end of the previous partition.
So the following equation will give you the numbers you need.
Desired size in MB * 1024 * 1024 / Sector Size = Number of sectors
Starting sector + Number of sectors - 1 = Last Sector
If you want a 1.1 Gb partition, you have 512 byte sectors and the starting sector is 1191133 you would then use the following equation.
1100 * 1024 * 1024 / 512 = 2252800
1191133 + 2252800 - 1 = 3443932
Step 4:
Now using the info you have gathered you can change your partitions.
So I would issue the following commands to delete, create and name the system partition with the size I want.
Code:
(parted) rm 23
(parted) mkpart 23 ext4 1191133 3443932
(parted) name 23 system
Now to resize the data partition.
You need to start with the first available sector after the end of system and end with the last available sector noted earlier.
Code:
(parted) rm 24
(parted) mkpart 24 ext4 3443933 15269854
(parted) name 24 userdata
Now that your partitions are all done you can exit parted with the following.
Code:
(parted) quit
Step 5:
Now restore the backup you made earlier.
If you get an error restoring which usually only happens if you have altered partition numbers just reboot back into recovery and restore then so the kernel gets to update its own info.
Reboot.
Congratulations you now have repartitioned your device.
Don't forget to thank this post if you are grateful.
Is there anything diferent to do about moderm mmcblkop14(/firmware)? I want to reduce it to 100 mb but i noticed its blocksize it's different from the others (others =4096, firmware=16384). I saw in your pictures you reduce it, so i will try it to do that. I have a nandroid so i hope this try works.
OK, i should probably been the first idiot to bricked his phone by reading a tutorial.
I need some help. I was trying to make this extra space and i have a few problems during the process.
First of all, in my case i have a partition 23 called cust, exactly the same in size with the cache. So i started with the cache calculating and then the other 3( 23 cust, 24 system, 25 userdata). For that moment i already made my nandroid, buy for some stupid reason I saved to my pc.
My problems came when i began with step 4. When i tried to put the cache it told me that it can't do it because it was in use. So i twrp y put on mount and desmounted that partition and then i could keep going. Same thing happened with Data partition, i did the same.
Finally, i did it all the tutorial, just needed to restore as it said in step 5 because i didn't have it in my phone. So i tried with adb push but nothing and i couldn't mount again those partition with twrp. Then, in a desperate move, i tried to reflash my cm rom, so i did that. And later, it bootloop with te huawei logo and i can´t flash a rom o restore my nandroid. It doesn't read a sdcard.
And now, when i see the script in twrp (sorry i don't know how is the name, i talking about the center botton in twrp) it appears in red "unable to mont '/data', '/system', '/cache'.
I don't know what to do, really, i need a hand.
beatLeo said:
OK, i should probably been the first idiot to bricked his phone by reading a tutorial.
I need some help. I was trying to make this extra space and i have a few problems during the process.
First of all, in my case i have a partition 23 called cust, exactly the same in size with the cache. So i started with the cache calculating and then the other 3( 23 cust, 24 system, 25 userdata). For that moment i already made my nandroid, buy for some stupid reason I saved to my pc.
My problems came when i began with step 4. When i tried to put the cache it told me that it can't do it because it was in use. So i twrp y put on mount and desmounted that partition and then i could keep going. Same thing happened with Data partition, i did the same.
Finally, i did it all the tutorial, just needed to restore as it said in step 5 because i didn't have it in my phone. So i tried with adb push but nothing and i couldn't mount again those partition with twrp. Then, in a desperate move, i tried to reflash my cm rom, so i did that. And later, it bootloop with te huawei logo and i can�´t flash a rom o restore my nandroid. It doesn't read a sdcard.
And now, when i see the script in twrp (sorry i don't know how is the name, i talking about the center botton in twrp) it appears in red "unable to mont '/data', '/system', '/cache'.
I don't know what to do, really, i need a hand.
Click to expand...
Click to collapse
Ok this is difficult because of your wording but it sounds like data, system and cache no longer exist.
Is your device the y6?
Do you have adb access?
Did you finish recreating the partitions?
Did you manage to name them if so?
Are you able to use recovery?
If you have adb can use please issue the following code, if you don't have adb can you please use twrp, advanced, terminal command to issue it.
Code:
ls /dev/block/bootdevice/by-name/
and let me know if it shows your cache, userdata and system.
DestructoSphere said:
Ok this is difficult because of your wording but it sounds like data, system and cache no longer exist.
Is your device the y6?
Do you have adb access?
Did you finish recreating the partitions?
Did you manage to name them if so?
Are you able to use recovery?
If you have adb can use please issue the following code, if you don't have adb can you please use twrp, advanced, terminal command to issue it.
Code:
ls /dev/block/bootdevice/by-name/
and let me know if it shows your cache, userdata and system.
Click to expand...
Click to collapse
- Yes, my device is Y6 (SCL-L03).
- Seems that i don't have access to adb, because in cmd show me "offline" device.
-Yes, i fineshed with that, but couldn't do the restore of backup.
- I did all step 4.
- Yes, i'm using twrp.
I put the code with twrp... and here it says not found.
Any ideas? I hope you could help me.
beatLeo said:
Ok this is difficult because of your wording but it sounds like data, system and cache no longer exist.
Is your device the y6?
Do you have adb access?
Did you finish recreating the partitions?
Did you manage to name them if so?
Are you able to use recovery?
If you have adb can use please issue the following code, if you don't have adb can you please use twrp, advanced, terminal command to issue it.
- Yes, my device is Y6 (SCL-L03).
- Seems that i don't have access to adb, because in cmd show me "offline" device.
-Yes, i fineshed with that, but couldn't do the restore of backup.
- I did all step 4.
- Yes, i'm using twrp.
I put the code with twrp... and here it says not found.
Any ideas? I hope you could help me.
Click to expand...
Click to collapse
You need to put a space between ls and the /
DestructoSphere said:
You need to put a space between ls and the /
Click to expand...
Click to collapse
ups, ok, i did that and i see all the partitions including cache, cust, system and userdata. Please, what is next?
beatLeo said:
ups, ok, i did that and i see all the partitions including cache, cust, system and userdata. Please, what is next?
Click to expand...
Click to collapse
Ok I suspect maybe the filesystems never got created.
Can you run
Code:
df
this will show you the currently mounted partitions free space.
Output will look something like this
Code:
Filesystem Size Used Free Blksize
/dev 442.6M 60.0K 442.5M 4096
/system 1.2G 948.5M 241.8M 4096
/data 5.2G 2.8G 2.4G 4096
/cache 147.2M 176.0K 147.0M 4096
/persist 3.9M 776.0K 3.1M 4096
/firmware 99.8M 46.8M 52.9M 2048
If you dont see data or cache they never got mounted at twrp start, system is not mounted by default.
Then if data is not listed try
Code:
mount -t ext4 /dev/block/bootdevice/by-name/userdata /data
Remember to have spaces between arguments.
Or try system by replacing "userdata" with "system" and "/data" with "/system"
If you get an error trying to mount please do the following referring to the attached screenshots.
In twrp, go to "wipe", "advanced wipe". Then select one of the partitions and select "repair or change filesystem".
This should give you info about the partition.
If you wish to reformat it select "change filesystem" then select "ext4" and swipe to confirm.
Now retry the mount command and hopefully it will succeed.
Do this for each partition then retry your backup/flash.
Hopefully this works, good luck.
Thanks for your help. At first i couldn't see cache or data partition. I did what you told me, and i made cache to appears with df command. System too. But i couldn't made the same with the userdata partition. I tried to repair but it didn't work.
Is there another way to remount that partition?
A question apart: what was that "cust" partiton i've got and you didn't in your images posted in cm12.1 post? Because i recalculated it too.
beatLeo said:
Thanks for your help. At first i couldn't see cache or data partition. I did what you told me, and i made cache to appears with df command. System too. But i couldn't made the same with the userdata partition. I tried to repair but it didn't work.
Is there another way to remount that partition?
A question apart: what was that "cust" partiton i've got and you didn't in your images posted in cm12.1 post? Because i recalculated it too.
Click to expand...
Click to collapse
Hi,
Does twrp show the userdatas partition filesystem type? Like in my previous screenshot cache is shown as ext4.
If not can you try change filesystem instead of the repair option and choose ext4.
I removed my cust partition altogether as I had no use for it.
DestructoSphere said:
Hi,
Does twrp show the userdatas partition filesystem type? Like in my previous screenshot cache is shown as ext4.
If not can you try change filesystem instead of the repair option and choose ext4.
I removed my cust partition altogether as I had no use for it.
Click to expand...
Click to collapse
Yes, it shows current file system: ext4. I tried repair and change file system but nothing. When i'm trying to use "mount -t ext4 /dev/..." it says "failed: invalid argument"
What else could i do?
I really appeciate your help man.
P.S: Sorry, i don't know why the screenshot looks not vertical.
beatLeo said:
Yes, it shows current file system: ext4. I tried repair and change file system but nothing. When i'm trying to use "mount -t ext4 /dev/..." it says "failed: invalid argument"
What else could i do?
I really appeciate your help man.
P.S: Sorry, i don't know why the screenshot looks not vertical.
Click to expand...
Click to collapse
Ok for some reason filesystem seems to have issues.
Can you please try
Code:
mkfs.ext2 -j /dev/block/bootdevice/by-name/userdata
to manually format it?
Remember spaces before and after -j option.
DestructoSphere said:
Ok for some reason filesystem seems to have issues.
Can you please try
Code:
mkfs.ext2 -j /dev/block/bootdevice/by-name/userdata
to manually format it?
Remember spaces before and after -j option.
Click to expand...
Click to collapse
It says mkfs.ext2: lseek: Value too large for define data type
beatLeo said:
Ok for some reason filesystem seems to have issues.
Can you please try
It says mkfs.ext2: lseek: Value too large for define data type
Click to expand...
Click to collapse
As far as I know that happens when you break some size limit.
How big did you make your userdata partition? Maybe you had a typo so I'm thinking you may want to run through the guide again to check but first can you let me know what you get if you write
Code:
blockdev --getsize64 /dev/block/bootdevice/by-name/userdata
DestructoSphere said:
As far as I know that happens when you break some size limit.
How big did you make your userdata partition? Maybe you had a typo so I'm thinking you may want to run through the guide again to check but first can you let me know what you get if you write
Code:
blockdev --getsize64 /dev/block/bootdevice/by-name/userdata
Click to expand...
Click to collapse
it says 5465161216
beatLeo said:
As far as I know that happens when you break some size limit.
How big did you make your userdata partition? Maybe you had a typo so I'm thinking you may want to run through the guide again to check but first can you let me know what you get if you write
it says 5465161216
Click to expand...
Click to collapse
Ok the number seems ok.
Can you please try using parted again with the guide to delete then recreate the partition making sure to specify the filesystem.
Hopefully that works but if not I think you need to rewrite the partition table a start again.
If it doesn't work can you please post the output from
Code:
parted
unit s
print free
DestructoSphere said:
Ok the number seems ok.
Can you please try using parted again with the guide to delete then recreate the partition making sure to specify the filesystem.
Hopefully that works but if not I think you need to rewrite the partition table a start again.
If it doesn't work can you please post the output from
Code:
parted
unit s
print free
Click to expand...
Click to collapse
Hi DestructoSphere,
tried to do that, but remember i can't get to adb so i can't find a way to paste the parted file into de sbin. Any ideas about that?
beatLeo said:
Ok the number seems ok.
Can you please try using parted again with the guide to delete then recreate the partition making sure to specify the filesystem.
Hopefully that works but if not I think you need to rewrite the partition table a start again.
If it doesn't work can you please post the output from
Hi DestructoSphere,
tried to do that, but remember i can't get to adb so i can't find a way to paste the parted file into de sbin. Any ideas about that?
Click to expand...
Click to collapse
In twrp can you mount mtp or usb storage and copy it to sdcard then twrp filemanager to copy to sbin?
Ok, i tried with a sdcard, but i couldn't either. It didn't recognize my sdcard. And i don't have an otg's usb.
But in twrp's cmd showed "mtp enabled". Could this means that i have to mounted the sd partition? If that is a yes, could you please write me the code ?
beatLeo said:
Ok, i tried with a sdcard, but i couldn't either. It didn't recognize my sdcard. And i don't have an otg's usb.
But in twrp's cmd showed "mtp enabled". Could this means that i have to mounted the sd partition? If that is a yes, could you please write me the code ?
Click to expand...
Click to collapse
Hi DestructoSphere, i finally resolve this. It was a lot simplier than you ever thought. I tried changing to ext2 my data partion, and then change it again to ext4 and that's how it works again.
Take a look into my partitions. But i still want to reduce to 100mb the modem partition.

Unable to create second partition on SD card

I've been trying to partition my SD card, but all steps I take to try and diagnose why I am unable to partition the card is getting me nowhere.
Initially, I used gparted on my laptop to partition the SD card with a v-fat partition and a f2fs partition, both primary partitiond. This was when I found out that no matter what I do the second partition on the SD card, it doesn't seem like the format actually takes. Whatever tool I use complete the partitioning and formatting steps successfully by all appearances but it doesn't seem like the partition is ever actually formatted. What I mean by that is that no matter what the second partition is it never mounts. I get an invalid argument error or bad super blocks and so forth. I can make the first partition anything I want: fat, v-fat, f2fs, ext4 and so forth and that will mount in my terminal without issue, but no matter what I do the 2nd partition always fails to mount. I've also noticed that blkid never has any fs info for the second partition. It gives me the partition UUID and that's all, while the first partition has both part UUID & fs UUID.
I've even gone so far as to just recently get a brand new SD card thinking that perhaps the first SD card was corrupted but I'm still getting the exact same behavior. Also of note is that in gparted when I try to create a secondary partition, I'm unable to mount the second partition so I don't think it has anything to do with my device. I've tried using fdisk, gdisk, parted in the terminal and I've tried using extended partitions and logical partitions and only primary partitions. I've done this before in the past so I know that it is possible.
It almost seems like the SD cards that I have are simply not capable of being partitioned in any way but it's strange that I now have two 512 GB SD cards and they're both giving the exact same behavior so I'm thinking that I'm missing something obvious. Any help anyone could provide as far as trying to figure this out or debug what's going on what I'm doing wrong would be greatly appreciated.
Thanks,
Ryan
only the first partition is mounted from vold. that is normal behaviour on every device. if you want have all partitions mounted automatically install LineageOS.
furthermore, although sdcardfs supports ext4, f2fs, for file transfer via USB MTP afaik fat32, exfat or ntfs is required.
what do you need f2fs partition for? maybe I can point you to workaround.
aIecxs said:
only the first partition is mounted from vold. that is normal behaviour on every device. if you want have all partitions mounted automatically install LineageOS.
furthermore, although sdcardfs supports ext4, f2fs, for file transfer via USB MTP afaik fat32, exfat or ntfs is required.
what do you need f2fs partition for? maybe I can point you to workaround.
Click to expand...
Click to collapse
I don't need anything to mount automatically. I'm saying I can't manually mount these partitions. I also don't need f2fs, that was just an example. I've tried multiple partitions that are just fat, ext4 and many other combinations. Under no partition scheme can I get anything other than the first partition to mount--using the mount command as root.
can you please try gdisk binary from here
https://forum.xda-developers.com/t/...-on-qmobile-z8-with-bricked-dead-emmc.3712171
please post the result of partitioning and formatting.
if you're interested in alternative solution, you can actually format the whole MicroSD card as exfat, and create ext4 partition image on top as regular file. I have done that for my mothers Huawei for Link2SD because it doesn't support adoptable storage.
aIecxs said:
can you please try gdisk binary from here
https://forum.xda-developers.com/t/...-on-qmobile-z8-with-bricked-dead-emmc.3712171
please post the result of partitioning and formatting.
if you're interested in alternative solution, you can actually format the whole MicroSD card as exfat, and create ext4 partition image on top as regular file. I have done that for my mothers Huawei for Link2SD because it doesn't support adoptable storage.
Click to expand...
Click to collapse
I have tried with gdisk but I can try with that specific version and report back. I understand we can create imaged file systems, but one of the main reasons I do this is that I find fat partitions are fickle and can easily be corrupted where the whole partition requires wiped. By having a non fat partition I use that as a better backup option where I find it's easier to recover data in case of corruption or other issues. For such use, being tied to the fat FS would still incur the possibility of data loss so that doesn't work for my purpose.
Thanks and I'll report back,
Ryan
oh I wouldn't rely on f2fs for backups it still has bugs and there are no recovery tools for f2fs
https://forum.xda-developers.com/t/4550931
https://android.stackexchange.com/q/250389
alecxs said:
oh I wouldn't rely on f2fs for backups it still has bugs and there are no recovery tools for f2fs
https://forum.xda-developers.com/t/4550931
https://android.stackexchange.com/q/250389
Click to expand...
Click to collapse
Thanks for the suggestion to use gdisk. I downloaded the version you linked, but I still get the same behavior. I believe it is related to the fact that only the first partition gets a filesystem UUID in blkid. I'm not sure what this means, but it seems clear that the second filesystem isn't being properly created no matter what I do.
that's strange, especially the fact you tried on PC too. on the phone, can you create partitions inside a blank disk image just for double check to rule out kernel issue?
I'll give that a try and report back
alecxs said:
that's strange, especially the fact you tried on PC too. on the phone, can you create partitions inside a blank disk image just for double check to rule out kernel issue?
Click to expand...
Click to collapse
Yeah I'm able to create an image, partition it into a vfat & ext4, then mount both of those partitions.
can you dd the file into mmcblk1 for testing purposes?
alecxs said:
can you dd the file into mmcblk1 for testing purposes?
Click to expand...
Click to collapse
Sorry this isn't clear to me. What am I using to dd into the partition, and do you mean mmcblk1p1/2? As mmcblk1 is the whole disk.
Thanks,
Ryan
yes, I meant the whole disk you created a test file that contains MBR or GPT and two partitions including UUIDs and file systems? If you dd it into the mmcblk1 it should create 1:1 copy of that disk image with two partitions including partition table.
Well I'll be:
Code:
/dev/block/mmcblk1p2 on /data/data/com.termux/files/home/i2 type ext4 (rw,relatime,seclabel) /dev/block/mmcblk1p1 on /data/data/com.termux/files/home/i2 type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
Code:
/dev/block/mmcblk1p2 23M 46K 23M 1% /data/data/com.termux/files/home/i2 /dev/block/mmcblk1p1 4.9M 0 4.9M 0% /data/data/com.termux/files/home/i1
I can possibly use gparted to just resize those! Any thoughts on what was going on, why this method worked? Hrmm looks like resizing fat could be a challenge, but this certainly gets me closer!
there is also parted binary you can use on phone
I have it and I'm playing around with it, thanks for all your help

Categories

Resources