[Tweak] Vold - NTFS support - v0.2 - Folio 100 Android Development

This patch allows mounting of NTFS volumes through vold (i.e the disk is automatically mounted when pluged into the device).
Mountpoint is:
/mnt/sdcard/usb<disk-number>-disk0
Known issues:
- NTFS volumes are mounted read-only, this has been explicitly added to the vold to prevent data loss or filesystem corruption until we know that the patch is stable.
Tested on FolioMod v1.3c
Installation:
copy zip file to your sdcard, rename to update.zip and flash using recovery.
vold-update-0.2.zip - this is the patch for vold containing ntfs support
vold-rollback.zip - rollback to default FolioMod 1.3 vold
source-0.2.zip - source code for updated vold
v0.1
- Initial release
- Ntfs support, multiple disks working
v0.1.1
- make sure that the mount point directory exists, create if necessary
v0.2
- multiple partitions are working
- fixed asec handling as discussed
- mount point directories are removed, when unmounting disk (if empty)

I know vold also handles sdcard + multiple usb stick is that part still included?
and the strange vold.fstab with wildcards? otherwise it will be hard to use for a toshiba rom, i think.

Yes this should all be still included, until now I had no issues with my sdcard.
What the patch does is try to mount everythin with FAT like before, if that fails, it tries NTFS.
The vold.fstab is still included, only change is what partitions should be mounted, this was 'all' before and has been changed to 'auto' (as the 'all' seems to be a toshiba addition)
Still need to figure out how to use this, hope to get a new disk on Monday, so I can test that.

weeds2000 said:
The vold.fstab is still included, only change is what partitions should be mounted, this was 'all' before and has been changed to 'auto' (as the 'all' seems to be a toshiba addition)
Click to expand...
Click to collapse
Could that also help recognizing some strange formatted SD cards? E.g. I have a digicam (Panasonic) that modifies the FAT32 somehow that the folio tells me the card is defective (but still works perfectly fine in Windows or the Digicam)?

I doubt it, as nothing has changed for sdcard.
But as this vold is compiled with additional debug output you may as well trry to use it. Maybe the output will give some more information on what is going wrong.
But I guess this is because your cam actually uses the "secure" part in your Secure Digital Memory Card. See http://en.wikipedia.org/wiki/Secure_Digital#DRM_features for more info on that.

Very interesting! Thank you !!

Tested with FolioTNT 4.0a and 2 usb sticks (16 and 8 gigs) and working perfectly on both
Great job

Is write supported already or is only for read?
Can large files be read?!?! (i mean no laggy?)
Thanks

Great job, thank you very much Mr. Weeds!

OK partition support is somehow working now, but not really a solution I like to release.
Looks like vold was not intended to handle that.
The main reason for this post is, that the handling of /mnt/asec and /mnt/asec_secure is somewhat bad (again vold was not intended to even handle multiple external storage devices at the same time)
Just to make sure anyone know what that is: Apps2SD stores the packages in that folder.
At the moment vold will create (and mount) an asec container for every storage device attached to the folio. So if I insall an app (or move it manually) with SDCard inserted it will use the asec dir of the SDCard. If I install an app without SDCard it will use the asset directory of the internal storage.
The problem is it seems I cannot change on the fly between those two directories. If I unmount SDCard /mnt/asec does not contain the package if put there. So I need to take out the SDCard and reboot the device.
Fixing this behaviour would be quite simple. The question rather is where to put it?
Internal storage or SDCard?
The same question goes for what should be the default SDCard (i.e. the one mounted under /sdcard, the one where apps download their resources). Internal Storage or external SDCard.
The one thing I can think of is creating a selection setting within the settings app where I can select which device should be mounted as primary SDCard.
If that is switched the systrem may copy contens from asec to the new device.
So the layout of /mnt may look like that
/mnt/sdcard (linked to /sdcard) - the primary sdcard device as selected by the user (defaults to internal storage)
/mnt/sdcard2 - well, the other one (either internal or sdcard depending on what the first device is)
/mnt/usb-storage/usb<disk-number>-disk<partition-number> - hdd's mounted over USB
Just waiting for anyone to come up wither other/better ideas...

weeds2000 said:
Fixing this behaviour would be quite simple. The question rather is where to put it?
Internal storage or SDCard?
The same question goes for what should be the default SDCard (i.e. the one mounted under /sdcard, the one where apps download their resources). Internal Storage or external SDCard.
Just waiting for anyone to come up wither other/better ideas...
Click to expand...
Click to collapse
proper behaviour would be internal storage for apps.. as its not nice that the apps you install disappear if you remove the sdcard or usbsticks.
i noticed this problem early on..but no one mentioned it as a problem.
do you see why the .android_secure mountpoint does not happen?
i think somehow this relate to the problem of downloading paid apps.

If this is OK for everyone, then this would be a much simpler approach, so /sdcard and /mnt/sdcard always point to internal storage.
If someone needs more storage (i.e. for downloaded resources) we may simply create a tool wich does some linking (e.g. link /sdcard/gameloft to /sdcard2/gameloft)
The mount point for asec_secure exists as well, 2 times with the same issues as asec. I don't know if this is related to paid apps. According to the logs I get a 403 response from the google servers.
Is there any specific reason, why SDCard is put under /sdcard/sdvcard-disk0?
I'd like to move that to /mnt/sdcard where usb-storage will go as well.
Using that approach it might be unessesary to unmount the external storage when a USB-connection is made.

weeds2000 said:
Is there any specific reason, why SDCard is put under /sdcard/sdvcard-disk0?
I'd like to move that to /mnt/sdcard where usb-storage will go as well.
Using that approach it might be unessesary to unmount the external storage when a USB-connection is made.
Click to expand...
Click to collapse
normally its a good reason.. the Toshiba filemanager looks at a location where all users got access..
no regular user would look into a /mnt/sdcard2 unless the toshiba pointed to the location.
so /mnt/sdcard offers both internal storage + sdcard + usbstick here which i think works well and all users easily find it as its within the sdcard default location.
i dont think that logic should change..

updated to 0.2 write support is still disabled.
As I always used NTFS-3G I cannot tell if the driver implementation is reliable and complete. However I think it is, as my knowledge from incomplete write support is 3 or 4 years old...

From weeds2000:
"This patch allows mounting of NTFS volumes through vold (i.e the disk is automatically mounted when pluged into the device)...."
------------------
This patch was tested by me on FolioMod v1.3c.
It readed well one HD NTFS, and recognized all of SD cards that were not recognized before.
Many thanks.

weeds2000 said:
updated to 0.2 write support is still disabled.
As I always used NTFS-3G I cannot tell if the driver implementation is reliable and complete. However I think it is, as my knowledge from incomplete write support is 3 or 4 years old...
Click to expand...
Click to collapse
do you consider this ok to be included in a new update?
I of course let you approve if its ok for regular use..

denver-tempor said:
From weeds2000:
"This patch allows mounting of NTFS volumes through vold (i.e the disk is automatically mounted when pluged into the device)...."
------------------
This patch was tested by me on FolioMod v1.3c.
It readed well one HD NTFS, and recognized all of SD cards that were not recognized before.
Many thanks.
Click to expand...
Click to collapse
You have NTFS formatted SD Cards? Or FAT cards which weren't recognized before?

Nemo0815 said:
You have NTFS formatted SD Cards? Or FAT cards which weren't recognized before?
Click to expand...
Click to collapse
I have some SD cards (several trades and capacities) FAT formatted that weren't recognised before applying this patch. Now, they are.
Also, I tested a 2.5 USB HD, NTFS, and it was readed without problems.

weeds2000 said:
As I always used NTFS-3G I cannot tell if the driver implementation is reliable and complete. However I think it is, as my knowledge from incomplete write support is 3 or 4 years old...
Click to expand...
Click to collapse
OK, so I was wrong, this is from the kernel documentation on NTFS Write support.
This enables the partial, but safe, write support in the NTFS driver.
The only supported operation is overwriting existing files, without
changing the file length. No file or directory creation, deletion or
renaming is possible. Note only non-resident files can be written to
so you may find that some very small files (<500 bytes or so) cannot
be written to.
While we cannot guarantee that it will not damage any data, we have
so far not received a single report where the driver would have
damaged someones data so we assume it is perfectly safe to use.
Click to expand...
Click to collapse
So it looks like ntfs-3g is the way to go, this will take some time however.
@dexter
I played around with various disks today, watched a movie, etc... Seems like everything is OK, so I would consider 0.2 be a candidate for regular use.

I will include this in the next update..
You seem to have many downloads, but not really any complaints
that should tell us something.

Related

[Q] Mount EXT3 Partitions

I have some external drives I would like to mount to my Transformer, they contain large sets of pictures and music that I keep on a USB drive. When I plug the USB drive in it finds partition 1 which is FAT32 and happily mounts that but claims that the file system on partition 2 is unrecognized. Is there a way to adjust their mounting scripts to support ext3 partitions on external drives? I use Ext3 because it supports large files and I sometimes dump 10 to 15 G tar packages onto the drive. I guess since most new Linux installs will support read/write to NTFS maybe I should move these drives to NTFS but that just seems so wrong ;-).
I am guessing the answer will be, I have to root and probably do some crazy changes under the covers but if that is what it takes then maybe it will mean I finally take that step (although I need to wait till I decide if I am keeping my transformer).
Check to see if the kernel has support for ext3, did you try mounting it manually from the terminal? Since your'e using ext3 I'm assuming you know how to do this

[Q] gingerbread better file system mounting support (ext4 or btrfs) on sd card?

I have a Samsung galaxy tab 7" currently running the latest version of the overcome rom (but i'm not married to it if others here have better recommendations), and for whatever reason, whenever i try to format my newly purchased 32gb sd card that i've placed inside, it wants to format it in fat32, which is one of the worst filesystems for data integrity ever devised (no journaling or data protection features of any kind). I have attempted to use my fat32 formatted sd card for a few ebooks that i've got, but when i move them from one folder to another, and then reboot, I get a lost+found directory full of corrupt, errant data and an empty folder where i attempted to move my stuff... this is, of course, unacceptable.
first off, why is fat32 used for the sd card in the first place when the system clearly uses rfs by default (upgraded to ext4 by my overcome installation), and anyone who is technologically inclined knows the pretty extreme limitations of fat32 (4gb single file data limit, no file protection mechanisms)?
and secondly, how do I fix this problem? the tab doesn't seem to accept my sd card when i format it in ext4 using my ubuntu desktop and an sd card reader, nor does gingerbread seem to have any advanced mount controls at all (including strangely the lack of mount support for cifs/smb, which i think is crazy as well but probably well out of the scope of this particular post).
tldr: external storage support on gingerbread is archaic and broken, how do i fix it for regular use?
Pinging this thread for IMPORTANCE
I very much hate FAT32, yet am forced to keep using it in my external SD card on phone in the same way. I would love to see all devs add full ROM support for reformatting and mounting external SD cards with full suite of OS supported file systems. How is it OS supports EXT4 yet I am still bound to FAT32 on SD card !!!!????
This is very important to me, and should be to you all too. we need file system journaling and large file support!
Wouldn't hurt to build in advanced visual presentation for formatting/converting any partition on phone from/to all supported types with ability to setup swap partitions. I know I ask for a lot.
------Running--------
SPH-D710, Starburst ROM v2.0, EK02 modem, custom startup screen/sounds
---------------------
cpgeek said:
I have a Samsung galaxy tab 7" currently running the latest version of the overcome rom (but i'm not married to it if others here have better recommendations), and for whatever reason, whenever i try to format my newly purchased 32gb sd card that i've placed inside, it wants to format it in fat32, which is one of the worst filesystems for data integrity ever devised (no journaling or data protection features of any kind). I have attempted to use my fat32 formatted sd card for a few ebooks that i've got, but when i move them from one folder to another, and then reboot, I get a lost+found directory full of corrupt, errant data and an empty folder where i attempted to move my stuff... this is, of course, unacceptable.
first off, why is fat32 used for the sd card in the first place when the system clearly uses rfs by default (upgraded to ext4 by my overcome installation), and anyone who is technologically inclined knows the pretty extreme limitations of fat32 (4gb single file data limit, no file protection mechanisms)?
and secondly, how do I fix this problem? the tab doesn't seem to accept my sd card when i format it in ext4 using my ubuntu desktop and an sd card reader, nor does gingerbread seem to have any advanced mount controls at all (including strangely the lack of mount support for cifs/smb, which i think is crazy as well but probably well out of the scope of this particular post).
tldr: external storage support on gingerbread is archaic and broken, how do i fix it for regular use?
Click to expand...
Click to collapse

Swap sdcard with external_sd under CM 11

Hi there,
I got a little problem swapping the "internal" sdcard with the external_sd card (64gb micro SD). I tried some ways already:
- App "external 2 internal"
- Add this line "persist.sys.vold.switchexternal=1" to /System/build.prop
- Try to modify the vold.fstab in etc folder, but there is no file with that name. Only a file called vold, but it contains only bytecode
All of them fails =(
I'm running CM 11 (cm-11-20140104-SNAPSHOT-M2-xt897).
I would say it's an easy task, done with 1 or 2 simple commands in a shell, isn't it? Please help me.
Thanks a lot.
Greetings Meik
No idea, someone?
There were some options for this added to customized builds of CM10.2...
But this has not persisted for CM11. Emulated storage makes this quite a bit more difficult than it used to be.
I guess most of us just "deal" with the small 8gb internal SD.
Since yesterday I go rid of the emulated sdcard mount.
It involved hacking boot.img and framework-res.apk to be inline with the legacy devices like the nexus one.
Now I just have the external sd mounted as /sdcard and all the internal memory on /data is available for apps.
The storage overview also correctly displays the configuration. And it should now be possible to move apps to sd, at least the menu entries are shown.
I will try to put together a flashable zip and start a new thread so everybody can easily achieve this.
Stay tuned!
It's done!
You will find the thread here:
http://forum.xda-developers.com/photon-q-4g-lte/development/mod-classic-sdcard-mount-t2804085/post53883989

[Q] Is fat32 the only filesystem supported for microsd?

I tried formatting to ext4 and the phone did not recognize the card. Just wondered if anyone else had sucessfully tried any other filesystems?
Right now 64GB microsd's seem to be the best deal and name brand versions can be found as cheap as $20-25 where 128gb cards will still cost you $70+ and usually involve rebates at the lower end prices.
Exfat and fat32. I have mine formatted to fat32.
Sent from my Alcatel OneTouch Idol 3 using Tapatalk
Applications that can write to SD card can only write to a SD card format to FAT 32. The system file manager can write to Exfat, but that's it.
Still not all apps will have permissions. I can't get Utorrent to save to the ext sd for anything
Sent from my 6045I using XDA Free mobile app
jvs60 said:
Still not all apps will have permissions. I can't get Utorrent to save to the ext sd for anything
Sent from my 6045I using XDA Free mobile app
Click to expand...
Click to collapse
Syncthing is the same way...you should still be able to use the kitkat workaround though which is to save your files to a folder under the android\data\<appname> folder on the sdcard since each app has access to it's own data area.
I never knew about this workaround. So i create the folders on my ext sd card?
Sent from my 6045I using XDA Free mobile app
jvs60 said:
I never knew about this workaround. So i create the folders on my ext sd card?
Sent from my 6045I using XDA Free mobile app
Click to expand...
Click to collapse
Try this: http://www.instructables.com/id/How-to-bypass-Android-44-KitKat-external-SD-write-/
damn... i'll try that
how come the sdcard can't be used for anything
camera 360 can't use it to save, there's no option to choose applications installation on sdcard ect.
had to use link2sd to move almost all my apps without error
seriously now...
keyra74 said:
damn... i'll try that
how come the sdcard can't be used for anything
camera 360 can't use it to save, there's no option to choose applications installation on sdcard ect.
had to use link2sd to move almost all my apps without error
seriously now...
Click to expand...
Click to collapse
It can be used if you are rooted...requires adding a line to platform.xml. If you find the thread about what camera software to use I posted some instructions on how to fix it where 3rd party's can use the external sd...or you can google on "platform.xml android external sd".
http://forum.xda-developers.com/showpost.php?p=62100041&postcount=37
famewolf said:
It can be used if you are rooted...requires adding a line to platform.xml. If you find the thread about what camera software to use I posted some instructions on how to fix it where 3rd party's can use the external sd...or you can google on "platform.xml android external sd".
http://forum.xda-developers.com/showpost.php?p=62100041&postcount=37
Click to expand...
Click to collapse
thx i used the goold old sdfix app. it's normally for kitkat and we have to use some trick like that on lollipop bad alcatel bad
keyra74 said:
thx i used the goold old sdfix app. it's normally for kitkat and we have to use some trick like that on lollipop bad alcatel bad
Click to expand...
Click to collapse
Blame google, not Alcatel. The external sd card issue is due to Lollipop..
That app makes the same change...you can uninstall it after it modifies the file. Simpler for me to just edit the file and push the change.
I'm on exfat on a 64gb. Works fine.
The 200gb I had in my g3 worked just fine.
Just realized the card cost more than this phone...
scatoclysm said:
I'm on exfat on a 64gb. Works fine.
Click to expand...
Click to collapse
+1
My 32 gb HDSC card came formatted with FAT32. I preferred ExFAT, so I reformatted the card using Disk Utility on my Mac. The Icon 3 didn't recognize it until I reformatted back to FAT32. Maybe I should have tried formatting it on a Windows machine. I may try a 64 GB HDXC card that probably comes formatted with ExFAT.
maigre said:
My 32 gb HDSC card came formatted with FAT32. I preferred ExFAT, so I reformatted the card using Disk Utility on my Mac. The Icon 3 didn't recognize it until I reformatted back to FAT32. Maybe I should have tried formatting it on a Windows machine. I may try a 64 GB HDXC card that probably comes formatted with ExFAT.
Click to expand...
Click to collapse
Really not much of a benefit to exfat over fat32...especially if you set cluster size when formatting. I also read about some folks having permission issues writing to the exfat till they reformatted. The samsung 128GB I put in my idol3 worked like a champ.
NooB....Thank Google lollypop for sdcard problems. U can write to sdcard with some apps not all if the code is written for this.
It seems TWRP doesn't recognise exfat partitions if the sdcard doesn't contain a partition table (GPT works, I haven't tried old-style msdos partition table).
This could be partly explained by the fact that, without a partition table, the external sdcard is called /dev/block/mmcblk1 instead of /dev/block/mmcblk1p1
To put it another way, if you want your sd card to be both readable when the phone is normally booted AND when it's booted into TWRP, you have to make a GPT table on the sdcard, and create an exfat partition inside.
=> In windows, it just fell into place after messing around with it for a bit. Your mileage will vary, depending on if you had an msdos partition table, a pre-existing GPT partition table (easiest) or no partition table at all. I gave up trying to figure it out.
=> Under TWRP adb shell, using the image containing gdisk, I did it this way (data-destructive operation !) :
- Use gdisk to create a new GPT table on /dev/block/mmcblk1 (or /dev/sdX outside from adb shell)
- Also with gdisk, create a new partition (types 8300 or 0700 should do) on the device targeted previously
- Then, exit gdisk and use "mkfs.exfat -n extsd /dev/block/mmcblk1p1" (or /dev/sdX1 if you didn't do it from TWRP adb shell) to reformat the partition created previously to exfat format.
However => do NOT use mkfs.exfat command on the /dev/block/mmcblk1 device (or /dev/sdX), else you'll have to redo step 1 again
Also, under adb shell, make sure you don't accidentally wipe /dev/block/mmcblk0 device, else you'll brick your phone !
I hope this helps a few people
DarkZell666 said:
It seems TWRP doesn't recognise exfat partitions if the sdcard doesn't contain a partition table (GPT works, I haven't tried old-style msdos partition table).
This could be partly explained by the fact that, without a partition table, the external sdcard is called /dev/block/mmcblk1 instead of /dev/block/mmcblk1p1
To put it another way, if you want your sd card to be both readable when the phone is normally booted AND when it's booted into TWRP, you have to make a GPT table on the sdcard, and create an exfat partition inside.
=> In windows, it just fell into place after messing around with it for a bit. Your mileage will vary, depending on if you had an msdos partition table, a pre-existing GPT partition table (easiest) or no partition table at all. I gave up trying to figure it out.
=> Under TWRP adb shell, using the image containing gdisk, I did it this way (data-destructive operation !) :
- Use gdisk to create a new GPT table on /dev/block/mmcblk1 (or /dev/sdX outside from adb shell)
- Also with gdisk, create a new partition (types 8300 or 0700 should do) on the device targeted previously
- Then, exit gdisk and use "mkfs.exfat -n extsd /dev/block/mmcblk1p1" (or /dev/sdX1 if you didn't do it from TWRP adb shell) to reformat the partition created previously to exfat format.
However => do NOT use mkfs.exfat command on the /dev/block/mmcblk1 device (or /dev/sdX), else you'll have to redo step 1 again
Also, under adb shell, make sure you don't accidentally wipe /dev/block/mmcblk0 device, else you'll brick your phone !
I hope this helps a few people
Click to expand...
Click to collapse
Or just keep it formatted as fat32 and skip the above which was my choice.
Just my two cents - why would you want to format SD to ext4? Journaling filesystems don't work very well with flash drives, cells die much quicker.

Android SD cards and the ext4 filesystem

Hello. What filesystem do you format your SD cards in for using with Android? I suspect most keep the factory format - exFAT or FAT32, which is a garbage filesystem, but can be read by Windows without extra trouble.
When I was preparing a new card to put in a new phone the other day, I faced that choice, and being a Linux user, decided on ext4, which has journaling, is tried and tested, and a default for most Linux systems. I also threw in a couple of extra partitions, one of them with FAT32, just in case some app had trouble saving to ext4.
Everything seamed to work well, no complains from Android. One app could not save to the ext4 partition, but that was expected, it had no trouble saving to the FAT32 one. However I later noticed problems with the card. It took me a bit to map out the problematic behavior, but here it is:
- Can read/write files in all dirs on the FAT32 partition
- Can read/write files in the root dir of the ext4 partition
- Can't write files on any sub-directory of the ext4 partition, regardless if the dir was created in the computer or by the phone's file explorer.
- Reading from sub-dir seams weird. Video files written when the SD was on the computer don't open, but I was able to read a file created by TWRP.
- TWRP can read and write to it's default directories inside the ext4 partition (which are sub-directories).
Just in case, I tried multiple file explorer apps. This kinda suggest some user read/write permission issues, however I can't find anyone reporting anything similar anywhere on the web.
Any ideas?
Anyone using ext4?
Could the multi-partitioning of the SD card be an issue somehow?
Thanks
I have same issue with my External H.D.D and my NSTV box, I have to format it as ext4 (because many issue about fragmentation)
Such as TitaniumBackup can't create backup on it! I tried multiple file explorer apps but toes can't write file/folder on it I set it 777 but not success
temporally solution is adb command or Primitive FTPd as root (not stable)

Categories

Resources