[(KERNEL)] A dumb question about EXT4 - Galaxy S I9000 Android Development

[(KERNEL)] A dumb question about EXT4
a)Flashed CWM Kernel + EXT4 tools app. Converted system to EXT4.
b)Flashed Speedmod Kernel K15H. Convert RFS to EXT4 via recovery
c)Flashed Talon Dev 0.2.2. Automatic Convert system partition to EXT4.
1)Are there various type of EXT4?
2)Do I need to convert system into EXT4 each time I flashed a kernel?
3)Why each kernel could not recognize the system already EXT4 converted?
How do I verify the system is in EXT4? CWM EXT4 tool could not recognize ETX4 if you flashed with others kernel.
Can someone explain? many thanks

1) Ext4 or Ext4nj (nj stands for non-journalized), using Ext4nj is only for non critical data.
2) No, the new Kernel must try to know if you're already in Ext4, if it doesn't, it's stupid.
3) use the "mount" command in a terminal or via adb, if you see Ext4 in line with /system, /data, etc. etc., you're under Ext4 Lagfix.

No, there is no different kind of ext4. If you flashed stock rom with odin between each kernel transition, know that this reformat the file system to RFS. Ususally, i use chainfire ext4 tool to know if my FS is in ext4. Also, you should not haveto worry about changing FS to ext4 again after changing as you only change the kernel and not the FS. Next time can you post your question in question & answer sub-forum plz.

.Slane. said:
1) Ext4 or Ext4nj (nj stands for non-journalized), using Ext4nj is only for non critical data.
2) No, the new Kernel must try to know if you're already in Ext4, if it doesn't, it's stupid.
3) use the "mount" command in a terminal or via adb, if you see Ext4 in line with /system, /data, etc. etc., you're under Ext4 Lagfix.
Click to expand...
Click to collapse
true that there is journalised and non-journalised, but both can be mount the same way and are seen the same way by the system.

.Slane. said:
1) Ext4 or Ext4nj (nj stands for non-journalized), using Ext4nj is only for non critical data.
2) No, the new Kernel must try to know if you're already in Ext4, if it doesn't, it's stupid.
3) use the "mount" command in a terminal or via adb, if you see Ext4 in line with /system, /data, etc. etc., you're under Ext4 Lagfix.
Click to expand...
Click to collapse
Thanks man. I would strongly agree that each kernel should try to reconize the EXT4. Somehow, this not the case.

chadouming said:
No, there is no different kind of ext4. If you flashed stock rom with odin between each kernel transition, know that this reformat the file system to RFS. Ususally, i use chainfire ext4 tool to know if my FS is in ext4. Also, you should not haveto worry about changing FS to ext4 again after changing as you only change the kernel and not the FS.
Click to expand...
Click to collapse
Hi. As i said. Once you flashed another kernel, chainfire ext4 would not able to identify wheather your system is in Ext4. I'm using custom rom not stock.

Just to add on, frequent converting from/to Ext4 would cause some app to be force close. You have to reinstall the apps. What the hack!

Related

ext4 to ext3 script ?

Is it possible for someone to create a script to convert ext3 to ext4 and backwards.
I'v flashed my recovery menu with unrevoked, and clockmodwork doesn't support ext partitions in their recovery image.
http://forum.xda-developers.com/showthread.php?t=689778&highlight=AMon
This recovery allows you to convert your ext3 partition to ext4 (not backwards)
But you can easily do it within Linux using GParted
I've tried that.
When i start gparted it indeed can let me format back to ext3, only when i format back to ext3 i will lose my data on the ext4 partition.
I thought maybe there was a option to create a GScript script, so i can run it on my phone.
Have you try to mount ext4 as ext3?
http://en.wikipedia.org/wiki/Ext4
The ext3 file system is partially forward compatible with ext4, that is, an ext4 filesystem can be mounted as an ext3 partition (using "ext3" as the filesystem type when mounting). However, if the ext4 partition uses extents (a major new feature of ext4), then the ability to mount the file system as ext3 is lost.
peewster said:
I've tried that.
When i start gparted it indeed can let me format back to ext3, only when i format back to ext3 i will lose my data on the ext4 partition.
I thought maybe there was a option to create a GScript script, so i can run it on my phone.
Click to expand...
Click to collapse
PULL the files from the ext4 partition, then format it to ext3 and PUSH them back.
globalm said:
PULL the files from the ext4 partition, then format it to ext3 and PUSH them back.
Click to expand...
Click to collapse
i should had figured that out myself

[Dev Kernel] 2.6.29 Support for ext2/ext3/ext4/yaffs2

Here is the kernel with yaffs2 and MTD block support, I am missing some mtd util tools like nandwrite so i cannot continue. Those that have the tools like mkyaffs2image, nandwrite, flash_eraseall can try to create an image and mount it
here are the steps that i think should work:
# mknod /dev/mtd0 c 90 0
# flash_eraseall /dev/mtd0
# mkyaffs2image /data/data yaffs2.img
# nandwrite -p /dev/mtd0 yaffs2.img
# mkdir /data/data2
# mount -t yaffs2 /dev/mtdblock0 /data/data2
If you have the tools, please attach so we can continue.. Its getting late so I am going to bed, have fun
Download
yaffs2_support.tar
Oh my god! I was just about to post similar findings, what a coincidence!
I just had compiled a kernel with yaffs2 support. My idea was to modify /init.rc in the kernel to mount the partitions with yaffs2 instead of rfs. Problem: we can't just change the filesystem without backing up and restoring all the files inside. My idea was to do that inside the recovery. Mount a mountpoint, backup with tar to /sdcard, unmount, format with dd (in theory a partition filled with 0's is ok for yaffs2), mount again with yaffs2 and restore from tar.
I'm stuck at the point that I can't seem able to mount any partition with yaffs2 previously formatted (with /system/xbin/busybox dd if=/dev/zero of=/dev/block/stl10). If I mount (/system/xbin/busybox mount -t yaffs2 /dev/block/stl10 /dbdata) there is always an "Invalid argument" error. It happens with /dev/block/stl*, /dev/block/bml* and /dev/block/mmcblk*
I'm no kernel expert, neither I know a lot about yaffs2, but I think I read you can't mount a yaffs2 partition anywhere, it has to be an MTD flash device.
Anyway, I'm going to try with the tools you said. Wish me luck.
Thanks for your work rasdeep! Is it only YAFFS2 and MTD support that you added? Because the kernel already had support for EXT2 and EXT3.
darksnarfer said:
I think I read you can't mount a yaffs2 partition anywhere, it has to be an MTD flash device.
Click to expand...
Click to collapse
Does the kernel that rasdeep posted load the existng flash devices/partitions as MTD devices?
I think as a start you only have to worry about formatting the /dev/block/mmcblk0p2 device which is mapped to the /data directory. With the new lag fix we are only moving directories stored in /data and that is what gives a big performance improvement. RyanZA did tests and found that the /dbdata partition was already quite fast and I don't think we have to worry about the /system partition etc. because we don't really write to them.
I think after a new firmware flash the /dev/block/mmcblk0p2 (mounted as /data) will be safe to format into YAFFS2 without loosing anything important.
I think these are the steps we can do:
1. Flash new firmware with repartition option on to erase everything.
2. Boot into recovery and format /dev/block/mmcblk0p2 as YAFFS2 filesystem.
3. Copy on new a init.rc script which will mount /dev/block/mmcblk0p2 to /data as a YAFFS2 filesystem and not a RFS filesytem to get much faster speeds.
bub181 said:
Does the kernel that rasdeep posted load the existng flash devices/partitions as MTD devices?
Click to expand...
Click to collapse
Just checked, there isn't any /dev/block/mtd* so I guess the kernel still can't see them as mtd.
/data is on the internal SD not in NAND so will we be able to use yaffs2 at all? I was working on formatting to EXT4 and adding the init.rc to match as well as compiling with EXT4 support, but if yaffs2 works, I'm fine with that.
modifying the init.rc is secondary because that is easy.. the main problem now is to be able to manually setup yaffs2 to mount properly.. if everything works like it should, init.rc can be change in matter of seconds
its funny now u said mtd not found.. i know we can mknod /dev/mtd* but there should be /dev/mtdblock* when booting with kernel right? hmm.. something to investigate further..
keep suggestions and finding coming, we may hit something that i've missed
problem is im lacking those tools that will do write to flash directly.. for example nandwrite.. anyone has that can share so i can try more stuff?
also, are my steps for "preparing" yaffs2 partitions/image correct? if anyone familiar with yaffs, please give some insight
raspdeep said:
modifying the init.rc is secondary because that is easy..
Click to expand...
Click to collapse
Do you need to recompile the kernel to modify the init.rc? If not could you post some instructions on how to do it please? I would like to try some things in there before /data gets mounted as a RFS filesystem.
bub181 said:
Do you need to recompile the kernel to modify the init.rc? If not could you post some instructions on how to do it please? I would like to try some things in there before /data gets mounted as a RFS filesystem.
Click to expand...
Click to collapse
i'm afraid so for now until someone found a way to extract the initramfs from later kernel and restore it back after modification..
I think it would be easier to start out with EXT2 since we can easily format that. Just as a proof of concept. I'm planning to do so tonight. Then I'll add support for EXT4 formatting and try that.
raspdeep said:
problem is im lacking those tools that will do write to flash directly.. for example nandwrite.. anyone has that can share so i can try more stuff?
Click to expand...
Click to collapse
Have you seen these pages rasdeep? They seem to describe how to create the YAFFS filesystem. Also, are there any /dev/mtdblock* devices using the kernel that you created? According to what I read elsewhere it is supposed to create both /dev/mtd* and /dev/mtdblock*. I think we have to use /dev/mtdblock* to create the new filesystem.
http://processors.wiki.ti.com/index.php/Create_a_YAFFS_Target_Image
http://processors.wiki.ti.com/index.php/MTD_Utilities
http://processors.wiki.ti.com/index.php/Put_YAFFS_Image_to_Flash
Also, I know that the Nexus One uses YAFFS2 for its internal filesystem. Maybe someone has worked out a way to write a new image file for that and we can use what they have learnt?
Can we potentially use this kernal (with the right tools) to format the NAND in YAFFS2 instead of RFS? Then still have way of flashing firmware onto it?
If so, that would be awesome and it would seem to have the least draw backs.
Currently the A2SD lag fix requires an external microsd card, and the one click lag fix, mounts a EXT2 image ontop of the RFS NAND, and that could drastically affect NAND life.
This is great !!!
Thank you raspdeep and all the devs here, this is one step closer to a stable kernel and a permanent genuine solution for the lag problem as far as a n00b like me understands
cheers !
Daemos said:
Can we potentially use this kernal (with the right tools) to format the NAND in YAFFS2 instead of RFS? Then still have way of flashing firmware onto it?
If so, that would be awesome and it would seem to have the least draw backs.
Click to expand...
Click to collapse
Not if we can't mount the NAND as a MTD-device instead of STL-device.
Daemos said:
Currently the A2SD lag fix requires an external microsd card, and the one click lag fix, mounts a EXT2 image ontop of the RFS NAND, and that could drastically affect NAND life.
Click to expand...
Click to collapse
Say what? /data/ is mounted on the internal SSD, not the NAND. /dbdata/ is however mounted on the NAND. Just do a df -h and you can see all the mountpoints.
Also, mounting and using a ext2-image that reside on an rfs-partition will not damage your drive. The rfs filesystem is still the one used to store the image itself (the ones and the zeros), even though you write it inside an image that uses another filesystem.
I stumbled upon these documents while Googling for STL-devices:
http://www.samsung.com/global/busin...y/downloads/LinuStoreII_GPL Compliance_10.pdf
http://www.samsung.com/global/busin...ionmemory/downloads/RFS_130_Porting_Guide.pdf
I haven't had the time to read them through yet. But if there's a porting guide, there must be a way to reverse it
Go go reverse engineers!
Is it really necessary to format the NAND with another filesystem? /dbdata seems fast enough as it is. Wouldn't it be enough (and easier?) to only convert the internal SD to yaffs2?
Quote from someone that knows a lot more than I do:
yaffs2 won't work on a sdcard
Click to expand...
Click to collapse
http://twitter.com/wesgarner/status/20805997718
So right now we have /data that is mounted in the second partition of the internal sdcard (mmcblk0p2), where all the critical files are stored (data, dalvik-cache, etc..) but we can't use yaffs2 there because it's not MTD.
We could, however, format and mount the other partitions (/system, /dbdata, /cache, etc...) with yaffs2, but that might not help because there isn't many heavy read/write there. And we should figure out how to make the kernel see them as /dev/block/mtdblock* instead of /dev/block/stl*.
rasdeep, can you share the .config for the kernel you used? I managed to get some mtd devices (atleast in /proc/mtd) but they were virtual devices. Maybe we need some more options enabled in the kernel.
Also, anybody knows why there are /dev/block/stl* and /dev/block/bml* they seem the same though.
darksnarfer said:
Also, anybody knows why there are /dev/block/stl* and /dev/block/bml* they seem the same though.
Click to expand...
Click to collapse
According to http://www.samsung.com/global/busin...ducts/fusionmemory/Products_XSR_Brochure.html
STL and BML are independent layers for managing I/O to the NAND devices
STL manages the sector translations while BML manages the invalid blocks (whatever that means)
Did any of you notice that in init.rc there are many references to yaffs2 ? Perhaps in engineering Samsung did use it ?
Chainfire said:
Did any of you notice that in init.rc there are many references to yaffs2 ? Perhaps in engineering Samsung did use it ?
Click to expand...
Click to collapse
Yeah, I think they are just android standard (maybe they took them from a template) and commented to use their better(?) filesystem.
darksnarfer said:
Quote from someone that knows a lot more than I do:
http://twitter.com/wesgarner/status/20805997718
So right now we have /data that is mounted in the second partition of the internal sdcard (mmcblk0p2), where all the critical files are stored (data, dalvik-cache, etc..) but we can't use yaffs2 there because it's not MTD.
We could, however, format and mount the other partitions (/system, /dbdata, /cache, etc...) with yaffs2, but that might not help because there isn't many heavy read/write there. And we should figure out how to make the kernel see them as /dev/block/mtdblock* instead of /dev/block/stl*.
rasdeep, can you share the .config for the kernel you used? I managed to get some mtd devices (atleast in /proc/mtd) but they were virtual devices. Maybe we need some more options enabled in the kernel.
Also, anybody knows why there are /dev/block/stl* and /dev/block/bml* they seem the same though.
Click to expand...
Click to collapse
Ok, so what filesystem does the internal SD use currently? Would it help if we change that to EXT4? That would emulate the current mimocan fix, but without having to use an external SD card.

[Q] Ext4 on CM7

I did a search on this as I was curious. I remember seeing in the merges about ext4 being supported for CM7 and a google search and forum search came with nothing. I was able to find information about ext4 replacement for Samsung phones such as Galaxy S and Nexus S.
I posted this on the EVO forum as someone there had a similar question:
tiny4579 said:
teh roxxorz said:
CM7 uses ext 4, so I believe the answer is yes. I believe it is formatted.
Click to expand...
Click to collapse
I actually am not sure if it defaults to ext4. I found this thread when I was about to post the same thing asking in the Dinc forums. I run CM7 RC4 and a simple mount command from the terminal shows ext3 instead of ext4.
For me /system and /data are yaffs2 and /data/data is ext3.
EDIT: Looked at it again, /system and /data/data are yaffs2 and /data and /cache are ext3. Anyone know how to format in CWM?
Click to expand...
Click to collapse
I'm thinking if I could nandroid backup, reformat ext3 as ext4 and then restore, it should work for me. I know at least the Tiamat kernel currently supports ext4.
Any ideas?
Anyone? I'm curious if at least doing this could help performance as I believe ext4 is definitely faster than ext3.
Sent from my ADR6300 using Tapatalk
So I tried a nandroid backup then formatting /system /data and /cache using CWM 3.0.0.8 and restoring backup but no change. /system and /data/data are still yaffs2 and /data and /cache are still ext3. I think if I use mke2fs with the correct options it might work. I remember seeing support in CM7 for it and the kernel I'm using definitely supports it.
EDIT: So this is more of a because-I-want-to project than because I think significant improvements will be made. Next step would be to see if I can use a command line format using adb in recovery.
I converted ext3 to ext4 for /data and /cache as follows but when I reboot it mounts as ext3 (maybe I have to reflash rom?):
From adb shell:
Code:
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p1
e2fsck -fpDC0 /dev/block/mmcblk0p1
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p2
e2fsck -fpDC0 /dev/block/mmcblk0p2
The best post for this is:
http://forum.xda-developers.com/showthread.php?t=534714
Still trying to convert /system and /data/data to ext4.
For anyone reading, the file to be edited is /init.inc.rc which is part of the ramdisk so the actually ramdisk needs to be modified or any changes will not stick on a reboot. It proves quite challenging. Maybe the rom or kernel do not prefer ext4 over ext3.
tiny4579 said:
For anyone reading, the file to be edited is /init.inc.rc which is part of the ramdisk so the actually ramdisk needs to be modified or any changes will not stick on a reboot. It proves quite challenging. Maybe the rom or kernel do not prefer ext4 over ext3.
Click to expand...
Click to collapse
Can you provide instruction on how to change /init.inc.rc ? Thanks !
vikstk said:
Can you provide instruction on how to change /init.inc.rc ? Thanks !
Click to expand...
Click to collapse
I can actually do something a little simpler than that.
Basically I took Chad's 4/19 kernel and extracted the file and edited it and put it back in. It took a bit of work to figure it out. Thanks to Chad and Conap I got it working. If I missed anyone else I apologize.
The prerequisite for this to do anything is to make sure you have actually converted the current ext3 partitions to ext4. You can check by running mount from adb or terminal emulator.
Then flash the below zip which will load Chad's 4/19/11 kernel and also allow mounting as ext4. If you want a different kernel you can just flash over it and it should still be ext4. If you want to undo it just wipe and reinstall any ROM.
http://dl.dropbox.com/u/31805083/2.6.37.6-incredikernel-gb-4192011-ext4.zip

[Q] ext4 on rooted stock 2.3.3 and unity kernel?

Hi!
I have now this setup:
1. 4EXT 2.2.7 RC5
2. Rooted sock ROM from this thread: http://forum.xda-developers.com/showthread.php?t=1169004 (exactly this link was used: http://www.multiupload.com/RZSJELJ5MR)
3. Unity V8 kernel with ext4 support (great kernel, by the way! )
I want to go to ext4 partitions for my system, data and cache.
I tryed this:
1. Boot to 4EXT.
2. Backup all my partitions (tar, ext3).
3. Convert my backup to ext4 with "EXT3 - 4EXT - EXT4" menu item.
4. WIPE all my partitions to ext4.
5. Restore backup.
6. Verify that all my partitions are still ext4 type -- OK.
7. Reboot.
After that system stops booting with white screen & HTC logo.
Then I can reboot to 4EXT, convert backup back to ext3 and restore it. After this system will boot.
I think, by some reason system can't mount /system partition. I've check in /proc/config.gz that kernel have ext4 support (no module, compiled into kernel).
And I think that the reason may be wrong kernel boot parameters line or wrong init script (for ext4 case, i mean). I can't find any /etc/fstab... and I don't know how does it mount filesystems (where to check parameters)?
So, the question is: what else should I change in my system to boot from ext4 partitions? I don't want to switch to custom ROMs.
I'm not sure why you need to wipe anything at all... I converted my partitions from ext 3 to 4 and all my data was preserved. Also my understanding was that if you've converted to ext 4 and then you restore a backup made with ext 3 your partitions would revert back... unless something has changed and I'm not aware of it...
Sent from my HTC Vision using XDA App
Ditamae said:
Also my understanding was that if you've converted to ext 4 and then you restore a backup made with ext 3 your partitions would revert back... unless something has changed and I'm not aware of it...
Click to expand...
Click to collapse
This is true for ClockWorkMod. But I'm using 4EXT Recovery. It's "killing feature" is that it serve backups and partition types in the right way.
.bva said:
This is true for ClockWorkMod. But I'm using 4EXT Recovery. It's "killing feature" is that it serve backups and partition types in the right way.
Click to expand...
Click to collapse
You do know its based of cwm right?
Sent from my HTC Vision using XDA Premium App
I was also talking about 4EXT Recovery... not CWM. Why don't you ask Madmaxx82 in his thread?
Sent from my HTC Vision using XDA App
I am a new user and as i have less then 10 messages, i can not post to developer's forums. That is why...
.bva said:
Hi!
I have now this setup:
1. 4EXT 2.2.7 RC5
2. Rooted sock ROM from this thread: http://forum.xda-developers.com/showthread.php?t=1169004 (exactly this link was used: http://www.multiupload.com/RZSJELJ5MR)
3. Unity V8 kernel with ext4 support (great kernel, by the way! )
I want to go to ext4 partitions for my system, data and cache.
I tryed this:
1. Boot to 4EXT.
2. Backup all my partitions (tar, ext3).
3. Convert my backup to ext4 with "EXT3 - 4EXT - EXT4" menu item.
4. WIPE all my partitions to ext4.
5. Restore backup.
6. Verify that all my partitions are still ext4 type -- OK.
7. Reboot.
After that system stops booting with white screen & HTC logo.
Then I can reboot to 4EXT, convert backup back to ext3 and restore it. After this system will boot.
I think, by some reason system can't mount /system partition. I've check in /proc/config.gz that kernel have ext4 support (no module, compiled into kernel).
And I think that the reason may be wrong kernel boot parameters line or wrong init script (for ext4 case, i mean). I can't find any /etc/fstab... and I don't know how does it mount filesystems (where to check parameters)?
So, the question is: what else should I change in my system to boot from ext4 partitions? I don't want to switch to custom ROMs.
Click to expand...
Click to collapse
Not all ROMs support ext4 partitions; I'd assume, since the stock ROM came as ext3 and wasn't "supposed" to be rooted that it only supports ext3.
Sent from my HTC Vision using XDA App
OriginalGabriel said:
Not all ROMs support ext4 partitions; I'd assume, since the stock ROM came as ext3 and wasn't "supposed" to be rooted that it only supports ext3.
Sent from my HTC Vision using XDA App
Click to expand...
Click to collapse
I didn't think of that... I bet you're 100% right.
Ditamae said:
I didn't think of that... I bet you're 100% right.
Click to expand...
Click to collapse
For mounting any partition with some spacific FS type, we need only kernel module (or support build into kernel) and right mount parameters passed to init.
So, any ROM can be modified for this, i think...

[Q] how to create ext4 system partition?

like the title says, I want an EXT4 partition from my system, wich is needed to install mods.
im currently running cyanogenmod 7.2 rc1 rooted, clockworkmod installed.
to install the script, I need an EXT4 system partition. I know how to do this on my SD card, but how to do this on your system?
thanks
You find the tutorial in this thread:
http://forum.xda-developers.com/showthread.php?t=1397120
But you need a card reader, you can't format to ext4 with usb cable.
LegoGabi: he's talking about the internal memory.
IIRC the CM7 install script did the formatting for you.
Starting from RFS partitions, either:
-Install a ROM with CWM that includes the reformatting utilities in its zip along with the required commands in the script.
-Use an appropriate ext4 CWM recovery and use the format functions in there.
-You could also make your own script, there's a few out there for other devices that could be adapted...
Oh, i thought he wants to make app2sd work.
I think cyanogen are already EXT4, so you don't need to convert it anymore
Cyanogenmods for Gio are in EXT4.
It formats internal partitions during installation.
Sent from my GT-S5660

Categories

Resources