First - I'll explain why I want this - my SD Card is a mess. So I decided to reorganize the entire folder structure using symlinks. Unfortunately no version of FAT doesn't support symlinks - so I decided to change the file system to either NTFS or ext4. I have basic Linux knowledge so I'm not able to change anything in the kernel, but because Gingerbread supports ext4, I have found a way to mount an ext4 sdcard. I basically change the default file system in vold.fstab (I replace "auto" with "ext4"). All seems to be working fine, but when I restart the phone I am unable to mount the sdcard again - I don't even get prompted by Android, it just doesn't detect my card. But whenever I dual-mount my card (using Root Toolbox) Windows detects my card (and reads it using Ext2Fsd). I know it probably has something to do with init scripts, but I haven't found anything about file systems in the any of the scripts in the init.d folder. I have found that the modified official Gingerbread kernel supports ext4 sd cards, but I want to know how to use the card with other kernels.
original vold.fstab:
Code:
dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.1/mmc_host/mmc0
modified version:
Code:
dev_mount sdcard /mnt/sdcard ext4 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.1/mmc_host/mmc0
I am using CyanogenMod 7.1 (Mik's version, beta 6.6.1), Franciscofranko's latest 2.6.35.14 kernel (16 august version) and Franko's tweaks if that is of any difference.
Well, sorry... but... eh.
State what you are after wrt "organizing" and someone can suggest a saner way to do it.
NTFS in R/W is only doable in a reasonable way with a FUSE-based driver, not the in-kernel one; ext4 or whatever other ext on the other way is a stupid idea when your computer uses Windows.
dr.notor said:
ext4 or whatever other ext on the other way is a stupid idea when your computer uses Windows.
Click to expand...
Click to collapse
I know that, but I'm using the card on the phone, not on my computer. And by the way, I have a full-featured Ubuntu Server (on VMware Workstation) for everything that Windows isn't able to do.
It isn't much of a cataclysm that I can't mount ext4, but I'm trying to understand why doesn't my method work.
Ianis G. Vasilev said:
It isn't much of a cataclysm that I can't mount ext4, but I'm trying to understand why doesn't my method work.
Click to expand...
Click to collapse
The stuff using vold.fstab assumes that the partition is FAT and not a random other filesystem.
The old vold supports vfat/ext2/ext3 filesystem, but the new vold only supports vfat filesystem. This is because Android frameworks does not support sdcard mounted on other filesystems. Even we can forcely mount an ext2/ext3 filesystem as the sdcard, it doesn't work well in some situations. So we decide to stop supporting them unless AOSP changes.
Click to expand...
Click to collapse
http://www.android-x86.org/documents/sdcardhowto
N.B. "Old" there means pre-Froyo
In case you insist that partitioning the SD card to ext? is the right way of "organizing", you need to mount that stuff via some initscript and be prepared for random stuff to break.
Thanks for the reply
Related
I made this to tide myself over until $auron can finish UrukDroid 0.6. This is a combination of the stock Archos 2.1.04 firmware, Ardatdat's Overclocked Kernel, and a manual EXT4 Conversion. It is permanently rooted and includes SuperUser. My main reason for making it was to enable read/write access to the filesystem, which rooting DOES NOT do on the stock Archos firmware, as the squashfs will still be mounted read only by /etc/mountpoints. Also, EXT4 is much faster than the compressed squashfs Archos uses. Quadrant gives ~2200 with the data partition converted to EXT4 as well, ~1800 without conversion. I have already updated Busybox to a fully compiled version, 1.16, another thing Archos decided to "secure" despite the supposed Open Source status. I have NOT edited the .hosts file to block ads, as I believe the app developers deserve to make some money, you'd be amazed how little they make, but you can do it yourself without Archangel scripts now, as the filesystem will be read/write again.
I designed it on an A101it, but it should work on any Gen8 with internal flash storage. A70H users, I can't remember your block allocations, it may work fine, but I'll need someone to post the storage layout of /dev/block/ to be sure.
For the power users, here's a quick install outline: First, make a second partition on your storage/sdcard in EXT4, extract the rootfs.tar.gz to it, and flash the appropriate initramfs and zimage. Pretty easy.
For the rest of you(probably most of you):
There is only one short step in Linux, which is setting up an EXT4 partition on your Internal Storage or your SD Card. You must make it as a second partition, not 1st, 3rd, or anything else. This means you can still use it as a storage device as well as running Android. I find it incredibly simple, and can be done in less than 3 minutes, but I will be relying on you guys to tell me what you don't understand, and I will update the instructions as needed.
This can be run off the SD Card or the Internal Storage, both versions are included in the download. It will use the existing data partition if you already have the SDE installed and 2.1.04 firmware. Otherwise, you will need to flash the SDE, which erases your data, so please use Titanium Backup first if necessary.
Step 1:
Download my files:http://www.multiupload.com/HR6SRRR8P8
And install the SDE from Archos: http://www.archos.com/support/download/firm_dev/firmware_archos_android_gen8.aos.
Step 2: Boot into stock Android and connect to a Linux PC. If you do not have Linux, download Tuxboot and use it to create a GParted Live Disk:http://gparted.sourceforge.net/liveusb.php
Step 3:
Mount your Internal Storage/SD Card from the Archos. It should now show up in GParted on the Linux PC, make sure you have the correct device selected, it should be called Archos A101T(make note of the location, e.g. /dev/sdb). Resize your existing partition with GParted, leaving about 300MB at the end of the Internal Storage/SD Card. Make a new partition in the empty space, and select ext4 as filesystem. Apply Changes. Now open a terminal, elevate yourself to root by typing
Code:
sudo -s
and format the new partition by typing
Code:
mkfs.ext4 -O ^huge_file /dev/sdb2
Substitute "sdb" for whatever your device location was in GParted. The "2" on the end of "sdb" denotes that it is the second partition. Do NOT format "sdb1" or any other "sd"s. Mount the new partition by opening Nautilus or any other file manager and double clicking on the "300MB Filesystem" entry on the left. Untar the rootfs.tar.gz from my files with the Archive Manager, it works just like winzip or winrar, into the root of the new partition. Eject the device from Linux, then reboot into the Developer Menu by holding vol- or vol+ while booting.
Step 4:
Flash the initramfs.cpio.gz and the zimage from my files. Use the files from the "internal" folder if you are running from Internal Storage, or the files from "sdcard" if you are running from the SD Card.
Step 5:
Use the Dev Menu to boot into Developer Edition. Let me know about any bugs. After I removed the Android Boot option from the Dev Menu, I had a few strange loops of the Archos animation while booting, but it did boot, and function, just fine.
Thanks go to Ardatdat for the kernel, Archos for the crappy "securing" of the squashfs, and $auron for motivating me to get back into development.
Hi msticninja ,
I did it It seems so smooth. I used my internal storage. But linux steps were not so simple for me I used a Fedora 14 VMWare image.
I'm at work so I can't play with it but it seems stable and it can awake.
Quadrant (I know it's not accurate) score is about 1900 (internal and ext4).
I think that you should add some descriptions about linux steps (for noobs like me).
Thanks...
PS: Did I move my DATA partition to EXT4? (I did all steps you wrote). If no how can I do?
Nice work! I'll be trying to add more instructions for the Linux section for the next couple of days.
Your data partition is still EXT3, I haven't found a very easy way to convert it yet. Basically, I made another partition on the Internal Storage, copied the data partition there, and flashed a new initramfs to boot off the new data partition. Then you fdisk and format the original partition from a terminal in the Archos or ADB, copy everything back, and flash ANOTHER initramfs to use the original, now EXT4, partition.
So far, I don't think the performance gain for the data partition is worth all that work.
It works and installs well but your guide how to install it is not complete. For example, I had to manually maintain write permissions of the partition and sudo is needed by the mkfs.ext4 -O ^huge_file /dev/sdb2
Hondaracer said:
It works and installs well but your guide how to install it is not complete. For example, I had to manually maintain write permissions of the partition and sudo is needed by the mkfs.ext4 -O ^huge_file /dev/sdb2
Click to expand...
Click to collapse
Sorry, i automatically elevate permissions when I do stuff like this. I've added sudo to the instructions. As far as manually maintaining the partition permission, what did you have to do there?
msticninja said:
Sorry, i automatically elevate permissions when I do stuff like this. I've added sudo to the instructions. As far as manually maintaining the partition permission, what did you have to do there?
Click to expand...
Click to collapse
I had to type this: sudo chown -R username:usergroup /media By the way thanks for the work you've done
Hondaracer said:
I had to type this: sudo chown -R username:usergroup /media By the way thanks for the work you've done
Click to expand...
Click to collapse
If that was before using mkfs.ext4, then that is strange. After mkfs though, the owner should be root. I should point out that the rootfs.tar.gz should be extracted as root, which means you have to open the archive manager from a terminal. I need to find an easy process that will work on all distros, as I don't know how many have nautilus installed.
Thanks for your replies, this is much needed feedback.
msticninja said:
If that was before using mkfs.ext4, then that is strange. After mkfs though, the owner should be root. I should point out that the rootfs.tar.gz should be extracted as root, which means you have to open the archive manager from a terminal. I need to find an easy process that will work on all distros, as I don't know how many have nautilus installed.
Thanks for your replies, this is much needed feedback.
Click to expand...
Click to collapse
I had to do this to be able to write the rootfs to dev/sdb2. But I must say I did a reboot before I copied the files cause Ubuntu started to act very weird. And for the beginner I'd might be good to mention that you have to unmount in GParted.
I've tried it and feels slower than Uruk 0.6RC2 on Scandisk SDHC 8GB Class 4 (without OC).
Thank you for your great work!
chisco said:
I've tried it and feels slower than Uruk 0.6RC2 on Scandisk SDHC 8GB Class 4 (without OC).
Thank you for your great work!
Click to expand...
Click to collapse
I'm not surprised. This is the stock firmware with none of Uruk's enhancements, other than ext4 and a new kernel. As i said, this is to tide people over until the official Uruk thread gets 0.6. You're already on the beta 0.6, so there's not much need for my firmware.
I just wrote an automatic install script. All you have to do is copy a file to your internal storage or sd card, and flash the initramfs/zimage in the Dev Menu. This one will replace the current Archos partition so you won't lose any space on your storage device. Should be uploaded tonight.
I tried this method with last OC Kernel (11 FEB): very good... With this method, we use same data as for stock ROM, so no need to reinstall all apps...
Thanks.
Hi, is there a way to format the Internal SD of a Vibrant as ext4?
I'm running Team Whiskey's Bionix-V 1.3.1. The Internal SD mounts as vfat.
The main reason for asking is because BeyondPod stops working every day or two because of a read issue on a podcast file. The recommendation is to do a reformat on the SD.
(can't post a link because I'm a new user)
My thinking is that if I have to reformat Internal SD anyway, I might as well make it ext4.
Thanks.
Doesn't work well
I tried doing this over the weekend. This worked poorly, I think because vold on Froyo can't see ext4.
I was able to mount the internal SD over USB to my Linux box. After copying the files off the vfat partition, I reformatted it as ext4 (using tools on the Linux box).
vold.conf and vold.fstab were modified not to try to mount /mnt/sdcard, as it wasn't able to see ext4 anyway. I put in a file in /etc/init.d to run the "mount" command for /dev/block/mmcblck0p1 to /mnt/sdcard so as to do the manual mount.
Permissions were an issue; the vfat mount was effectively mode 777, and I tried doing a chmod on the ext4 filesystem to the same effect.
Some apps started to work better, but, the original purpose of the exercise -- to get BeyondPod to work on ext4 -- did not work out. The operating system didn't seem to know that the SD was mounted; in Settings, the OS kept thinking that the SD wasn't mounted at all (it probably knows through vold) and apps such as BeyondPod probably takes its cue from that, rather than looking to see if its files are present at the expected mount point. I'm sure other applications will have similar issues.
After I realized that Froyo was not going to recognize ext4 through vold, I rolled back to vfat. I guess I just have to wait for a Gingerbread on the Vibrant (e.g., CM7 finalizes for the Vibrant, or the recent 2.3.3 for the international Galaxy gets into Team Whiskey's hands).
My sdcard(class 4 8gb sandisk) is causing problems with fat32 fs...i use debian all the time and wud like to have a much advanced fs like ext4 for saving my music,videos,pictures etc instead of fat32...how can i achieve taht...Does android use a fstab or something for mounting on boot ???
I'm quite sure android uses fstab for mounting, you just need to set the proper mounting option on your FS to force it to check fstab options. I have one question(since I don't use a linux machine), can you access your ext(2nd) partition(if you have one) when you connect your phone to the PC using debian?
Yep,Android uses fstab to mount all.
anybody interested in setting it up i dont have the requisite knowhow
I have not toyed with fstab myself... but I did find this page which seems to have want your looking for.
http://androidandme.com/2009/08/news/how-to-manually-partition-your-sd-card-for-android-apps2sd/
It isn't exactly what your explaining, BUT seems to go through the commands needed for what you are wanting to try.
Just remember to back up! Good luck!
Sent from my LG-P500 using XDA App
Instructions:
-Suggested at least fat32 partition to be 1gig and the rest to your ext partition. Also, try to use root explorer for everything else. Must have init.d support.
1. On your SD card, make a folder to serve as a door/portal to access your ext partition files.(When testing this, I just used the default "/sdcard/media" folder)
2. Make a blank text file and name it as "11usext"
3. Using root explorer, edit the file and add this line inside it:
Code:
#!/system/bin/sh
busybox mount -t auto /dev/block/mmcblk0p2 /mnt/sdcard/media
change media to the folder that you just made on step 1. Exit and save.
4. Using root explorer move this file to /system/etc/init.d
5. Again using root explorer, change the permission to "rwxrwxrwx"
6. Reboot and play. This would allow you to access your ext partition through the /media or the folder that you have created.
If this does not work, then you should give more details on what setup you are running.
ungaze said:
Instructions:
-Suggested at least fat32 partition to be 1gig and the rest to your ext partition. Also, try to use root explorer for everything else. Must have init.d support.
1. On your SD card, make a folder to serve as a door/portal to access your ext partition files.(When testing this, I just used the default "/sdcard/media" folder)
2. Make a blank text file and name it as "11usext"
3. Using root explorer, edit the file and add this line inside it:
Code:
#!/system/bin/sh
busybox mount -t auto /dev/block/mmcblk0p2 /mnt/sdcard/media
change media to the folder that you just made on step 1. Exit and save.
4. Using root explorer move this file to /system/etc/init.d
5. Again using root explorer, change the permission to "rwxrwxrwx"
6. Reboot and play. This would allow you to access your ext partition through the /media or the folder that you have created.
If this does not work, then you should give more details on what setup you are running.
Click to expand...
Click to collapse
That's a quite dirty implementation. All he want's is an ext4 partition mounted as /sdcard. I want to do the same, but right now I'm messing with the internal fs. I'll look into it.
That's a quite dirty implementation.
Click to expand...
Click to collapse
Dirty it might be(I even tried a dirtier one), but that's all he's got at the moment. If you have a better solution(even just a rough plan), please do share. Maybe we can exchange knowledge on stuff like these.
Using 2 Ext4 partitions on SD instead of one Ext+fat32
Click to expand...
Click to collapse
Would mean that no Fat32 partition exist, and I've never heard of anything like that.
I have one question(since I don't use a linux machine), can you access your ext(2nd) partition(if you have one) when you connect your phone to the PC using debian?
Click to expand...
Click to collapse
And since no one answered this, I have no idea how you could transfer files to your phone without using card readers.
ungaze said:
Dirty it might be(I even tried a dirtier one), but that's all he's got at the moment. If you have a better solution(even just a rough plan), please do share. Maybe we can exchange knowledge on stuff like these.
Click to expand...
Click to collapse
Probably it involves messing with the init.rc (and I think that involves messing with boot and recovery images, but, I'm not sure) or init.d scripts or fstab. Anyway, I'm not sure, but it should be possible.
ungaze said:
Would mean that no Fat32 partition exist, and I've never heard of anything like that.
Click to expand...
Click to collapse
Yes. The /sdcard partition would exist, just not fat32 formatted.
ungaze said:
And since no one answered this, I have no idea how you could transfer files to your phone without using card readers.
Click to expand...
Click to collapse
Linux systems can read and write to ext4 partitions without problems. In fact, it's a linux filesystem. I had problems once when I had a sd_ext partition (for Apps2SD), because both partitions would get mounted when using mass storage mode, while Android only unmounts the /sdcard (fat32) partition, leading to file corruption (because of the same partition being mounted on both systems at once).
We could create the partitions using gparted or cfdisk on a pc. I'm not sure, but maybe simply mounting it with different params (like the filesystem type and other options) at /sdcard would do the trick. Everything else that follows would be easy.
I've been doing some testing and research.
On recovery side:
I've done a little modification in Mik's ClockWork recovery to make it accept ext4 and vfat as valid file systems for the first partition on sdcard. It involves just a little change on /etc/recovery.fstab file, but then you need to rebuild the recovery image.
This is working fine.
On the OS side:
It's not an easy mod. It involves patching the vold (volume manager) and recompiling. There are some proposed patches to Cyanogenmod, but I don't know if it's been accepted and if it made it to Miks CM7 port.
I'll do some tests and post results.
ilarrain said:
I've been doing some testing and research.
On recovery side:
I've done a little modification in Mik's ClockWork recovery to make it accept ext4 and vfat as valid file systems for the first partition on sdcard. It involves just a little change on /etc/recovery.fstab file, but then you need to rebuild the recovery image.
This is working fine.
On the OS side:
It's not an easy mod. It involves patching the vold (volume manager) and recompiling. There are some proposed patches to Cyanogenmod, but I don't know if it's been accepted and if it made it to Miks CM7 port.
I'll do some tests and post results.
Click to expand...
Click to collapse
This got my interest
Mik's CM7 (beta 6.2) recognizes and mounts the ext4 partition just fine.
BUT:
As vfat is a non posix fs, there wasn't any need for the OS to manage permissions, so it's a mess.
Applications on the SD card (I'm not using Apps2SD or Data2SD) don't load, internal applications can't be moved to SD, and many apps can't store data on the SD, even I've set read+write permissions on all files and directories (chmod -R 777 /sdcard/). I have no idea why. I'm stuck.
But you can use Ext4 ... what formats are supported?
braintheboss said:
But you can use Ext4 ... what formats are supported?
Click to expand...
Click to collapse
Questions go to the Q&A ..
I gave it a try of formatting the external microsd to ext3/4 but it appears that vold on the stock rom (and roms based on it) does not support ext4
If you neext ext3/4 support on the microSD you will need to use a CM9 based rom
Hi,
im using CM10. How did you do that and are there any restrictions???
How do we format our cards to ext4?
Sent from my GT-I9300 using Tapatalk 2
It seems that auto mount its not implemented for ext file system on android. At least I discovered that on my tablet when I tried to copy files on an ext3 hard drive. It's a shame as ext is the default filesystem for android...
I had to mount it manually. There are guides on the net. It's the classical mount Linux command. To automate it you should add a script in init.d folder. There must be examples on the net too.
Striatum_bdr said:
It seems that auto mount its not implemented for ext file system on android. At least I discovered that on my tablet when I tried to copy files on an ext3 hard drive. It's a shame as ext is the default filesystem for android...
I had to mount it manually. There are guides on the net. It's the classical mount Linux command. To automate it you should add a script in init.d folder. There must be examples on the net too.
Click to expand...
Click to collapse
Could you attach it here? thanks
Sent from my GT-I9300 using Tapatalk 2
Thirty seconds search on Google.
Idea abandoned. Reason - "The old vold supports vfat/ext2/ext3 filesystem, but the new vold only supports vfat filesystem. This is because Android frameworks does not support sdcard mounted on other filesystems. Even we can forcely mount an ext2/ext3 filesystem as the sdcard, it doesn't work well in some situations. So we decide to stop supporting them unless AOSP changes."
I was bored so I figured out in half an hour how to reformat the SDCard as ext2/3/4 instead of FAT32. From what I know, ext2 is much faster and more reliable than FAT32 but I still need to do some SDCard benchmarks to compare (e.g. in antuntu).
Current issues:
Vold in Turbo UI does not understand non-VFAT partition and won't mount it on startup (nor after UMS disable). Once you've setup the SDCard as ext2, you need to go to shell and run these commands to get SDCard mounted:
Code:
mount /dev/block/mmcblk0p1 /sdcard
vold
The first command mounts SDCard, the second seems to refresh vold and actually make the OS recognize that it's inserted. If you use an init.d script to mount sdcard like that first command, there is no need for vold (until you use UMS). This would not matter for ROM's in MTP mode.
Setting up SDCard as ext2:
Note that I chose ext2 as it is the most compatible/stable in Windows. More below.
(1) Backup the SDCard, obviously.
(2) Boot to recovery, unmount sdcard, go in to ADB shell
(3) Format first SDCard partition as Windows-compatible ext2 like so:
Code:
mke2fs -m 0 -I 128 -T ext2 /dev/block/mmcblk0p1
(4) (Windows users) Install "Ext2 IFS" from http://www.fs-driver.org (Yes, works on x64 Windows too).
- install with all defaults
- Check "assign drive letter automatically" when prompted with the Drive Letters screen
(5) Profit.
What's next?
While researching this, I found that CM9/CM10 Vold code was patched already to support ext4 filesystems. However this is ext2 so I am not sure it works. I would move to ext4, but there is no write-access driver or software for Windows that works reliably with ext4. Ext2 IFS however is widely regarded as very reliable these days.
I'll check it out more when I get some time and my Linux machine is finished (to compile a vold that supports ext2-4 and not just 4). But I'm making his thread now so other hackers can try it out, benchmark, or share ideas.
Cheers.
Grrr.... CM7 had ext fs support in vold and it was merged, but CyanogenMod rejected it in CM9 and CM10. Wtf?
Looks like I will have to edit vold sources and rebuild myself. But since I only do Jellybean work I don't know how to handle this....
...the only other alternative is that ext# SDCard has MTP as a requirement. Then I could have the SDCard mounted manually in kernel and vold would not complain. The SDCard is not unmounted in MTP transfer, so it would be usable - with the one exception of requiring a reboot if the user manually unmounts or removes the SDCard.
R: [DEV][MOD][WIP] Format SDCard as ext2 (instead of FAT32)
so it is possible to have the sdcard partition in ext? I have tried one year ago and if I remember correctly cm7 doesn't support it (or maybe it was a stock based rom, too much time passed ), but for people like me that use Windows veeeery rarely would be great, ext2 or ext3 are better than fat32 (ext4 for what I've seen is less reliable in this case)
Inviato dal mio Nexus 7 con Tapatalk 2
[email protected] said:
so it is possible to have the sdcard partition in ext? I have tried one year ago and if I remember correctly cm7 doesn't support it (or maybe it was a stock based rom, too much time passed ), but for people like me that use Windows veeeery rarely would be great, ext2 or ext3 are better than fat32 (ext4 for what I've seen is less reliable in this case)
Inviato dal mio Nexus 7 con Tapatalk 2
Click to expand...
Click to collapse
Yes, very possible. The instructions here all work well if the ROM has MTP mode. Because Vold cannot remount ext after UMS is enabled. So for Linux users with poor MTP support, that's still painful.....
My main concern right now is that ext2 seems to be more vulnerable to filesystem errors. Unlike FAT32, there is no quick/easy way to check if the filesystem needs repair. Not that I know of anyway.
So, I think I am going to abandon this. It might be why CyanogenMod rejected it.