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.
Quick question, search did no good...
When running gingerbread cm7 is the file system formatted to ext4 as with the Nexus S? If no does the cm7 rom for the Nexus S use ext4?
Thanks
CM7 uses ext 4, so I believe the answer is yes. I believe it is formatted.
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?
Hope this is in the right section, I need help from a developer on this as I don't quite understand what is needed to do this.
I use Gingervillain and the DT a2sd. What I want to do is move my /cache (not dalvik cache but the partition itself) to ext.
I have the commands all ready to do this and that aspect works fine (thanks to help from droidzone).
However, as its sharing the ext partition with DT, when I mount cache there, the apps don't work. Added to which if a market app is downloaded, it downloads the apk to the cache folder I created on ext fine. When it attempts to intall, it fails.
I assume (with my limited knowledge) that there is a conflict here due to multiple mounts on the same partition. I initially thought my mount cache command needed to with the same options that DT mounts, but cant find that reference in his script or the files it calls.
So I have created a 2nd ext partition, but I dont know how to use it. I thought it would automatically be mmcblk0p3, but I cant find it that way using adb.
I know data2ext uses multiple partitions for sqlite etc, but cant for the life of me work this out.
Can anyone point me in the right direction please?
The aim of this is to develop myself a cache2sd solution. I have searched around a lot but can't find one. I thought CM had one but cannot find that either.
Further to this, ls /dev/block lists mmcblk0p3
However,
Code:
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p3 /system/sd
Returns
Code:
failed: Invalid Argument
but
Code:
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /system/sd
Works fine.
Does anyone have any idea how I can use the second EXT partition at all or any tips or info please?
format
rootSU said:
Does anyone have any idea how I can use the second EXT partition at all or any tips or info please?
Click to expand...
Click to collapse
format mmcblk0p3 in ext4 format and mount it
susmaz said:
format mmcblk0p3 in ext4 format and mount it
Click to expand...
Click to collapse
Better 2.5 years late than never
Although that would not have been the answer.
Why do you need this 2nd partition??
If i understnad correctly you want the cache on a ext partition, so the play store can download to this partition and than install the apk to intern bzw. The prim ext??
[(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!