Related
Hi, my problem is as follows: I have an ext3 partition and I have no idea how to convert it to ext4 as there aren't any scripts to automate it (at least I didn't found one). Can anyone help?
Suggest not doing it yet. not all ROMS support it.
Yes but there are some of them, which support so... what should I do?
What ROM are you using?
What recovery image are you using?
Do you have a linux install on any machine?
Assuming you do not have a Linux install already I would get a bootable Linux CD (Jaunty bootable would be fine), put the micro SD in a card reader, then convert from there.
http://buranen.info/?p=345
the short version is
Code:
tune2fs -O extents,uninit_bg,dir_index /dev/<partition>
I believe cyanogen's recovery image has the capability as well. For that matter his ROM has the disk tools, only problem there is the fact that you need to have the partition unmounted during the process. Therefore my opinion is if you are really set on updating to EXT4, then get a bootable Linux CD.
EDIT:
Yes Cyanogen's recovery image has e2fsprogs, so you could do it from there http://forum.xda-developers.com/showthread.php?t=523558 I still stick with my original recommendation of a Linux install and a card reader.
OK thanks, I'll try that. I have latest Cyanogen, recovery 1.3.1, I don't have linux, but I have an Ubuntu 8.04 LiveCD, latest SPL and radio with ext3 and linux-swap on SD. Thanks again, I'll post back results.
8.04 won't have ext4 support. So you will need to do it either from the recovery console or get a 9.04 disk.
The basic idea of this mod is moving all partitions to the SD card, and running the full OS from the SD card.
There are many reasons why not to do this and probably is a bad idea, but the main reason behind this mod is just a proof of concept that can potentially result in a better internal and external memory utilization and speed improvements.
Reasons I can think of for not doing this:
- Reduced responsiveness and overall speed.
- Over stress on the SD card that can potentially leed to permanent damage to the card.
- The need to use modified boot and recovery images, thus leading to an install incompatible with any rom update (as it is) out there.
- Reduced battery autonomy.
- Many more I can't think of right now.
Reasons to do this:
- Because we can.
- As a proof of concept.
- For developing purposes.
- We get the ability to switch between 2 installations just by switching the SD card (of the same rom or roms with compatible boot images: kernel+ramdisk).
Don't do any of this if you don't know what you are doing!!!
Simplified steps (I've only tested this with Mik's CM7 (betas 6.2 and 6.3) + ClockWorkMod recovery on a Ubuntu machine):
- Download and flash ClockWorkMod recovery.
- Download and flash Mik's CM7.
- Do a full backup from recovery.
- Turn the phone off.
- Take out the SD card and put it on a Card reader on your PC.
- Backup the SD Card contents (including the full backup).
- Use Gparted (or any partition manager that has support for ext4 partition creation) to create the following partition structure:
Code:
num mount point size type
1: /sdcard REST fat32
2: /data 500M ext4
3: /system 190M ext4
4: /cache 64M ext4
The partition number is important, so you should calculate the fat32 partition beforehand or resize the existing one.
- Put new boot and recovery images on the fat32 partition. *
- Put the card on the phone and boot into recovery.
- Mount the sdcard trough menu.
- Connect the phone to your pc and start adb shell.
- Flash custom boot and recovery images:
Code:
flash_image boot /sdcard/boot-everything2sd.img
flash_image recovery /sdcard/recovery-everything2sd.img
- Reboot recovery.
- Through menu, mount all partitions.
- Connect trough adb shell and copy your data:
Code:
adb shell
cp -a /int-cache/* /cache/
cp -a /int-system/* /system/
cp -a /int-data/* /data/
- In adb shell, remove the sd_ext mount script:
Code:
rm /system/etc/init.d/05mountsd
- Reboot the phone.
Off course, no other method of storing the apps on the SD is desired as they are already there.
* I've attached custom boot and recovery images for Mik's CWM and CM7 beta 6.2 (updated boot images to Mik's CM7.02 beta 6.3 in post #3), but, the steps for creating them are next:
- Extract the original images (boot.img and recovery.img) from the root of the downloaded zips (signed-recovery.zip and cyanogen_thunderg-ota-eng.mik.zip).
- Unpack the images following this guide: HOWTO: Unpack, Edit, and Re-Pack Boot Images: Alternative Method (Perl scripts are attached, you'll need compiled mkbootfs and mkbootimg for your OS).
- On recovery ramdisk, change the etc/recovery.fstab file as follows:
Code:
# mnt pnt fstype device [device2] [fstype2]
/boot mtd boot
/cache ext4 /dev/block/mmcblk0p4
/data ext4 /dev/block/mmcblk0p2
/misc mtd misc
/recovery mtd recovery
/sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0 ext4
/system ext4 /dev/block/mmcblk0p3
/int-cache yaffs2 cache
/int-data yaffs2 userdata
/int-system yaffs2 system
- On boot ramdisk, change the init.rc file as follows (diff output):
Code:
[email protected]:~/Descargas/bootimages$ diff boot.img-orig_ramdisk/init.rc boot.img-ramdisk/init.rc
22d21
< export SD_EXT_DIRECTORY /sd-ext
68,69d66
< mkdir /sd-ext 0771 system system
<
100,103c97,100
< mount yaffs2 [email protected] /system
< mount yaffs2 [email protected] /system ro remount
< mount yaffs2 [email protected] /data nosuid nodev
< mount yaffs2 [email protected] /cache nosuid nodev
---
> mount ext4 /dev/block/mmcblk0p3 /system
> mount ext4 /dev/block/mmcblk0p3 /system ro remount
> mount ext4 /dev/block/mmcblk0p2 /data nosuid nodev
> mount ext4 /dev/block/mmcblk0p4 /cache nosuid nodev
- Recreate the ramdisks and images following the guide posted above, changing the mkbootimg command line to (notice the base and cmdline parameters; for recovery, change boot to recovery on all instances):
Code:
mkbootimg --base 0x12800000 --cmdline 'mem=471M console=ttyMSM2,115200n8 androidboot.hardware=thunderg' --kernel boot.img-kernel --ramdisk boot.img-ramdisk.gz -o boot-new.img
Ahaha another sleepless night ahead to test this out. Any Quadrant Advanced I/O score for comparison?
I've updated boot images to Mik's CM7.02 beta 6.3, attached below.
I'm going to run a Quadrant Advanced and let you know. Anyway, I don't think I will get good results, as my SD card is cheap and buggy, half the time it doesn't get mounted, with or without this mod. Also, I think we'll get better scores with your tweaks, especially with the modded libsqlite.so.
The idea behind this is not to get impressive results or leave it as a definitive mod (as it is right now). Instead, the idea I have is to start moving some things back to the internal memory, for instance, mounting [email protected] as /data/dalvik-cache (just an idea). Basically, leaving the things that need fast reading times, but infrequent writes in the SD, and the things that are constantly being written to, in the internal memory.
Seems awesome. I already booted up perfectly with the modded .imgs, no issues.
so what class of sd card do you preffer?
still class 4 above?
well, sorry about what im going to say , but if **** happened and luckily sd card got corrupted, then the phone does as well?
ive not read all of your first post,
but if ever we are changing sd cards, like example upgrading from 4g-8g,
is it necessary to repeat the whole process or copy paste is enough?(i bet not due to ext)
cmangalos said:
so what class of sd card do you preffer?
still class 4 above?
well, sorry about what im going to say , but if **** happened and luckily sd card got corrupted, then the phone does as well?
ive not read all of your first post,
but if ever we are changing sd cards, like example upgrading from 4g-8g,
is it necessary to repeat the whole process or copy paste is enough?(i bet not due to ext)
Click to expand...
Click to collapse
If **** happened you could mount it in a computer with a card reader and perform a disk check + recovery. If the sd card broke, well.. I think there's still hope, since you may boot in recovery and replace the mount points back to the internal memory ( right ? )
As for the storage upgrade, well, it's not exactly copy-paste but you should be able to duplicate the partitions without much hassle..
I really like this idea,we could get 3000+ quadrant score
But can be potentially dangerous. If anything goes wrong i think that Phone can't boot anymore.
how abt two separate roms in 6 separate partitions ???? is the bootloader cracked ??? Can we have a grub like menu to select two roms ???Way 2: Maybe somebody cud mod android's initramfs and add options there to select two different fstabs ...just a thought
a dual boot would be cool... one rom on the internal nand memory and the other on SD card...
Having fastboot disabled is such a pain in the ass...
ciaox said:
I really like this idea,we could get 3000+ quadrant score
Click to expand...
Click to collapse
Not me, because my SD card is very buggy. Anyway, it depends very much on the card, the card reader and the kernel. Anyway, it's just a proof of concept and it opens a great window for experimentation.
ciaox said:
But can be potentially dangerous. If anything goes wrong i think that Phone can't boot anymore.
Click to expand...
Click to collapse
Not at all, recovery can boot even if the SD card is damaged or not present. Then you can flash the original recovery, boot it and flash any ROM without this mod.
Steps:
- Extract recovery.img from your desired custom recovery.
- Boot recovery.
- Mount /int-cache from mounts and storage menu.
Code:
adb push recovery.img /int-cache/recovery.img
adb shell
flash_image recovery /int-cache/recovery.img
- Reboot recovery
- Flash desired ROM from any SD card.
OR: Just flash an original (released by LG) ROM through emergency mode.
sarfaraz1989 said:
how abt two separate roms in 6 separate partitions ???? is the bootloader cracked ??? Can we have a grub like menu to select two roms ???Way 2: Maybe somebody cud mod android's initramfs and add options there to select two different fstabs ...just a thought
Click to expand...
Click to collapse
Bootloader isn't cracked yet, so it would have to be implemented on the boot.img (kernel and/or ramdisk), and I don't know how. Right now is easier to swith SD cards. Anyway, ROMs should be able to share boot.img (kernel + ramdisk).
ciaox said:
Having fastboot disabled is such a pain in the ass...
Click to expand...
Click to collapse
+1. But bootloader isn't cracked yet.
Just a little heads up, but if anyone is paying attention to the Nook Color development, this is exactly how the boot process on that device works, I am running one os off the sd card and if I remove it I am back to stock. The main point of my brining this up is you create the sd card with all it's partitions by flashing an image of the sd card with the WinImage application on windows. Might at least save you some steps. Hope this helps.
tsukisan said:
Just a little heads up, but if anyone is paying attention to the Nook Color development, this is exactly how the boot process on that device works, I am running one os off the sd card and if I remove it I am back to stock. The main point of my brining this up is you create the sd card with all it's partitions by flashing an image of the sd card with the WinImage application on windows. Might at least save you some steps. Hope this helps.
Click to expand...
Click to collapse
Possibilities seem to be limitless.
Sent from my LG-P500 using Tapatalk
First of all sorry about my english
I have SGS GT I9000 i got the error "System UIDs Inconsistent" so i started to read on internet and try to fixit by my own but i cant solved it, the problem is i have internal sdcard with 6GB fat32 and 2GB rfs (fat32 + journal) and this 2GB have a corrupts blocks, the internal sdcard it's ok i dont recive I/O errors or something like that, so i try to fixit following this steps:
i redirect the internal sdcard to the usb port so on my mac i use the disk utility to fix this blocks, i repair the disk and make new partitions and everythings looks right but when i restart the phone all be like i dont do anythings :S
i give privileges 777 to /dev/block/mmcblok0
echo /dev/block/mmcblk0 > /sys/devices/platform/s3c-usbgadget/gadget/lun1/file
repair the disk and make partitions on "macosx disk utility"
I installed diferents roms like JVK JVO or CM7 with CM7 the phone works fine because this rom dont use rfs so dont read the 2GB with problems, but the problem became when i restart with this room the /data partition is mount over mmcblk0p1 => 6GB and when i restart the phone all the data will overwrite with my old data so CM7 launch again the start assistent and lost my wifi confg, etc...
I trie to use diferrents .pit files 512 513 812 but this doesnot work.
Maybe i can redirect /data to /system/data over CM7 but how can i made this change permanet?
What's the problem? maybe is the sdcard on readonly mode? i dont have priveliges? i cant work over rfs file system without their special tools?
Thanks to everyone...
I Found this user and he have the same problem maybe he english is better than mine and you can understand him better:
I have a similiar problem with my internal SD on my I9000. Somehow I am unable to change anything on my sd...be it copying new files to it, deleting existing files or formating it.
It actually tells me that it did those actions and I can use programs that I copy on to my sd, but after every reboot my sd is like I never touched it(which obviously is a bad thing).
I'm using Clockwork for Recovery.
Using the print command from parted I get:
Model: MMC M8G4DD (sd/mmc)
Disk /dev/block/mmcblk0: 8221MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32.8kB 6208MB 6208MB primary fat32 lba
2 6208MB 8221MB 2013MB primary lba
It seems my 2nd partition is broken.
I then tried to repair the partition with mkfs on partition 1 and 2 using ext2.
In both cases I get:
Error: Invalid superblock. Are you sure this is an ext2 file system?
{random useless information from parted concerning potential bugs}
Error: SEGV_MAPERR (Address not mapped to object)
[1] Aborted parted /dev/block/mmcblk0
I read somewhere that I should try using e2fsck to repair the partition and I tried that too.
And I got this:
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/block/mmcblk0p2
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>
Deleting Partitions via parted doesn't do anything. No errors but the partitions remain.
I can still flash any firmware on my I9000 and I can even install updates via recovery.
But no matter what I do no changes to my data partition stay after I reboot my mobile.
Anyone got an idea what else I could try?
Click to expand...
Click to collapse
I have the same problem. did you look inside /dev/block/ ?
A normal phone has mmcblk0, mmcblk0p1 and mmcblk0p2.
Mine has only mmcblk0 and partition table looks broken.
Probably the internal storage is broken, this covers /data and /sdcard.
On froyo i was able to tweak /system/etc/vold.fstab to mount /sdcard from external sd, but no luck with mounting /data from external sd.
im sure you already found the solution to the problem, or perhaps you reinstalled fresh, but I just ran into the problem myself and was able to fix it by going into cwm and restoring permissions under the advanced tab. hope this helps anyone who has this same issue, it took me a while to find a solution
Hey there...!
lordscipio said:
im sure you already found the solution to the problem, or perhaps you reinstalled fresh, but I just ran into the problem myself and was able to fix it by going into cwm and restoring permissions under the advanced tab. hope this helps anyone who has this same issue, it took me a while to find a solution
Click to expand...
Click to collapse
Fixing permissions by CWM does´nt solve the problem in my case...! Ext-SD ist stil r/o and not r/w as it should be. Flashing different Fw´s, CWM´s etc. all about useless to get the UID´s persistant again. Any idea what i can try to do next...?
Regards Ede
(Please let me know if this is the correct forum!)
I have a Motorola Milestone 1 (A853) with Open Recovery 1.46 on a 16GB card. I've been using this to try new roms for over 2 years now. Everything was fine until I tried to create an ext 2 partition using MiniTool Partition Wizard, but things went sideways. Needless to say I wiped the card, created a new 10GB Primary Partition on it and a 4 GB ext2 for further usage. Then, I restored backup items on the card (pictures etc.) plus a fresh new version of Open Recovery. Now, every time I am at the Recovery menu and try to apply sdcard:update.zip I get this message:
E:Can't open cache/recovery/command (<-- this is nothing new - seen it many times before but still able to boot into open recovery)
-- Install from sdcard...
Finding update package...
E:Can't mount /dev/block/mmcblk0p1 (or /dev/block/mmcblk0)
(Invalid argument)
E:Can't mount SDCARD:update.zip
Installation aborted
.. any ideas what to do?
It seems like your phone dont mount the sdcard properly.
Try out a 2ndboot OR. (there is one from kabaldan and one from FuFu)
get a proper sdcard, and unzip to the root OpenRecovery from this url: http://forum.xda-developers.com/showthread.php?t=1897048
And voila! :good:
Thanks for the assistance guys.
The card is fine, It is seen in Windows perfectly with the 2 new partitions, but the phone is not seeing it. I was following MrTapa's guide here before the trouble started: http://forum.xda-developers.com/showthread.php?t=1750888 . When the card worked before, it was formatted using NTFS and both Windows and the phone could see it. Now, the 10 GB partition is NTFS and it has the additional 4 GB ext2 partition. Windows sees it, the phone does not.
Does Skrilax_CZ's note have anything to do with it? "If file "/system/etc/install-recovery.sh" exists on your Milestone, delete it (prior to flashing the SBF)" <-- from http://modmymobile.com/forums/563-m.../531599-open-recovery-v1-46-11-21-2010-a.html
lezztor said:
Thanks for the assistance guys.
The card is fine, It is seen in Windows perfectly with the 2 new partitions, but the phone is not seeing it. I was following MrTapa's guide here before the trouble started: http://forum.xda-developers.com/showthread.php?t=1750888 . When the card worked before, it was formatted using NTFS and both Windows and the phone could see it. Now, the 10 GB partition is NTFS and it has the additional 4 GB ext2 partition. Windows sees it, the phone does not.
Does Skrilax_CZ's note have anything to do with it? "If file "/system/etc/install-recovery.sh" exists on your Milestone, delete it (prior to flashing the SBF)" <-- from http://modmymobile.com/forums/563-m.../531599-open-recovery-v1-46-11-21-2010-a.html
Click to expand...
Click to collapse
NTFS?
Replace it with FAT32. Then it should work.
In the link you provided check step 9 (though FAT32 should work fine even with 2GB cards)
Ok - so reformatted 10GB partition to Fat32 and loaded OpenRecovery again to root of sd card - same error. I might also mention that I tried Fat32 on another smaller (2GB) card with an ext2 partition and it gave the same error. I'm beginning to believe that this phone has a problem with multi-partition sd cards?
Just tried the original way - one partition using NTFS ... same error. Frustrating .. over 3 days on this now ...
NTFS and Android can not work.
Unless someone included ntfs-3g into the kernel - but that would be a madman's work...
Delete every partition off your sd card, boot up Android, it will prompt you to format it, do it.
Copy recovery (OpenRecovery directory + update.zip) to sd card, try booting to recovery.
If it works resize FAT partition created by android to make space for an ext partition, boot Android again to see if it's ok with the changes.
Solved - if anyone is trying create an additional ext2 partition remember that BOTH the FAT32 and EXT2 must be created as PRIMARY. The app I was using defaulted to logical ...
I'm attempting to format my external sdcard to ext2, just one single partition (no apps2sd magic).
The reasons are to have the ability to store >4GB files on the card, faster read times, and not needing compatibility with any M$ systems/PCs/Junk, journaling (>ext2) is not needed.
At the moment, I'm running a CM based ROM (cyanfox) and will likely try this out on a moto/stock based ROM after.
Here is my progress so far :
I'm able to mount the SD manually, though with some hoops being involved. The bionic will not mount it automatically, and is constantly telling me that it is unsupported/empty/needs to be formatted in the storage menu, and a permanent notification.
In a terminal shell, I can mount the device (/dev/block/vold/179:97) by specifying the type only as ext4. This is definitely not ideal, but I get errors when the type is specified as ext2 or ext3. (error : mount: Operation not supported on transport endpoint ).
At the moment, I've made an init script to mount the sd at /storage/sdcard1 but this doesn't cause android to think that the actual sd is mounted properly (empty sd notification still exists). Though it is at least mounted.
And I have edited the fstab file at root to change the sd type from vfat to ext2, but this file rewrites itself at boot. Unfortunately I'm not able to set an immutable bit on the file.. (android is not a type writer).
The ext2 filesystem has been checked for errors, does have files written to it, and is able to be read/written to in android after manually mounting it. Android just insists on a fat partition though.
Any help/tips would be appreciated. I'll update this thread in case anyone else would like to apply this as well.
Also, if I'm missing something blatantly obvious, please let me know