[REQUEST] Systemless Filesystem Drivers for Kernel mode and FUSE support - Magisk

Hey!
I found this thread with fully compile-able code for android on most hardware platforms, I see it uses system level modifications to do its business, and would love to see it rolled into a magisk module. I regularly use external hard drives on my Pixel 2 XL for a plethora of reasons and really need legit exFat and NTFS support as I use flash kernel and I cant merge the code myself (my only machine couldn't handle the compiling). Anyway, If possible, making a ZIP that is universal and has the binaries for arm, arm64, and all x86 variants would be pretty great!
GitHub: https://github.com/Lurker00/Android-fs
XDA: https://forum.xda-developers.com/android/development/exfat-ntfs-fuse-drivers-easy-build-t3126413
I am not magisk-ninja so anyone who can help make this happen OR educate me in the process of doing so (and who can compile the above Git files for arm64 and send them to me) would be very much appreciated! I am willing to learn to help the community!
Over and out

thomasamas said:
Hey!
I found this thread with fully compile-able code for android on most hardware platforms, I see it uses system level modifications to do its business, and would love to see it rolled into a magisk module. I regularly use external hard drives on my Pixel 2 XL for a plethora of reasons and really need legit exFat and NTFS support as I use flash kernel and I cant merge the code myself (my only machine couldn't handle the compiling). Anyway, If possible, making a ZIP that is universal and has the binaries for arm, arm64, and all x86 variants would be pretty great!
GitHub: https://github.com/Lurker00/Android-fs
XDA: https://forum.xda-developers.com/android/development/exfat-ntfs-fuse-drivers-easy-build-t3126413
I am not magisk-ninja so anyone who can help make this happen OR educate me in the process of doing so (and who can compile the above Git files for arm64 and send them to me) would be very much appreciated! I am willing to learn to help the community!
Over and out
Click to expand...
Click to collapse
Hi. I just started working on this yesterday.
It seems like the perfect method to install additional filesystem support.
I am currently able to manually mount exfat or ntfs sdcard images on my phone (LG Aristo 2, Android 7).
However, a great deal has changed in how filesystem support is added to an existing kernel. Lurker00's code is for Android 4.4.2.
If you want to work together on it, I would be more than happy to do so. I will try to get together what I have so far in a post later today.
FYI, this is a TWRP installable .zip that has Lurker00's compiled binaries for arm64-v8a, armeabi-v7a, x86 and x86_64.
It also installs init.d scripts that supposedly support auto mounting of exFat and NTFS partitions. That part is not working for me, as I think it is setup for Android 5 and before. However the mount binaries work for manually mounting exFat or NTFS partitions.
Just install the .zip from TWRP.
https://forum.xda-developers.com/attachment.php?attachmentid=4600419&stc=1&d=1537390717

Hey! I just saw this, I can try my best but I was assuming it wouldn't be an android thing but rather a Linux/android kernel thing. Is there a way we can Abstract the mounting from android, solely into the kernel, basically leaving Android unaware that the introduced file system is not "officially supported"? I'm assuming FUSE can do this.
Edit: spelling.

tecknight said:
Hi. I just started working on this yesterday.
It seems like the perfect method to install additional filesystem support.
I am currently able to manually mount exfat or ntfs sdcard images on my phone (LG Aristo 2, Android 7).
However, a great deal has changed in how filesystem support is added to an existing kernel. Lurker00's code is for Android 4.4.2.
If you want to work together on it, I would be more than happy to do so. I will try to get together what I have so far in a post later today.
FYI, this is a TWRP installable .zip that has Lurker00's compiled binaries for arm64-v8a, armeabi-v7a, x86 and x86_64.
It also installs init.d scripts that supposedly support auto mounting of exFat and NTFS partitions. That part is not working for me, as I think it is setup for Android 5 and before. However the mount binaries work for manually mounting exFat or NTFS partitions.
Just install the .zip from TWRP.
https://forum.xda-developers.com/attachment.php?attachmentid=4600419&stc=1&d=1537390717
Click to expand...
Click to collapse
How exactly do you manually mount them? (your method)
Edit: also! I was thinking maybe this could become a kernel patch that I could alert kernel devs to? (see my above comment)
And... Thanks for all the hard work to get this going. Tell me how I can help!

thomasamas said:
How exactly do you manually mount them? (your method)
Edit: also! I was thinking maybe this could become a kernel patch that I could alert kernel devs to? (see my above comment)
And... Thanks for all the hard work to get this going. Tell me how I can help!
Click to expand...
Click to collapse
I installed the .zip file that I posted earlier using TWRP.
This installs these binaries to /system/xbin:
mount.exfat
mkfs.exfat
fsck.exfat
dumpexfat
exfatfsck
exfatlabel
mkexfatfs
mount.exfat-fuse
ntfs-3g
ntfsfix
probe​
I then inserted an exFat formatted SDCard into my phone and Android told me the device was corrupt.
That is due to the fact that Android no longer uses probe to determine the filesystem of a device, it now uses a program called blkid.
I would like to figure out how to add a new supported filesystem type to blkid
In any event, I mounted my exFat sdcard by launching a shell from adb, running su to get root and then I created a folder named exfatsd in the /mnt folder. I then ran this command:
mount.exfat /dev/block/mmcblk1 /mnt/exfatsd
The mount succeeded and I was able to browse the sdcard from /mnt/exfatsd
When I typed mount to enumerate the mounts, this is the entry I saw for my sdcard:
/dev/block/mmcblk1 on /mnt/exfatsd type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
By the way, even as i was browsing the exfat sdcard, Android still had a notification up telling me that my sdcard was corrupt

Is there any legit documentation on blkid?

I haven't found any, but I haven't given up on this project either. I have been busy on a couple of other things lately, but I still would like to see this work.

Making progress on this on my LG cv1 ROMs
I just wanted to let you know that I now have exFAT and NTFS support working on my phone, even though the kernel does not have support for either filesystem..
I am mounting the Micro SD using a script that runs under Magisk from the:
post.fs.data.d folder
This folder contains scripts that are to run immediately after the /data filesystem is mounted.
My script is checking the Micro SD device using the blkid command.
The blkid command will indicate the type of filesystem residing on the device, even if the kernel won't mount it.
So I use the results from the blkid command to issue mount commands myself using the binaries created by lurker00.
Here is the script I am using, it is really quite short:
Code:
#!/system/bin/sh
#
# mount NTFS / exFAT
# 06/07/2019 by TecKnight
# This script checks the inserted Micro SD--
# If Micro SD is formatted exFAT or NTFS, it mounts it
sdcard_device=`blkid /dev/block/mmcblk1`
sdcard_part1=`blkid /dev/block/mmcblk1p1`
# Uncomment next 2 lines to troubleshoot
# echo $sdcard_device > /cache/sdcard_device.txt
# echo $sdcard_part1 > /cache/sdcard_part1.txt
# output from blkid command looks like this:
# /dev/block/mmcblk1p1: LABEL="e" UUID="CEDC-3F3A" TYPE="exfat"
# create mount point
mkdir /mnt/media_rw/extsd
# mount approriate filesystem if it resides on device directly
case "$sdcard_device" in
*exfat*) mount.exfat /dev/block/mmcblk1 /mnt/media_rw/extsd ;;
*ntfs*) ntfs-3g /dev/block/mmcblk1 /mnt/media_rw/extsd ;;
esac
# mount approriate filesystem if it resides on first partition of device
case "$sdcard_part1" in
*exfat*) mount.exfat /dev/block/mmcblk1p1 /mnt/media_rw/extsd ;;
*ntfs*) ntfs-3g /dev/block/mmcblk1p1 /mnt/media_rw/extsd ;;
esac
FYI: The reason I am checking /dev/block/mmcblk1 (the actual SD card itself) and dev/block/mmcblk1p1 (the first partition on the sdcard) is that depending on where the sdcard is formatted exFAT or NTFS, it could be on the disk itself or within a parrition. This way, I will catch it either way and mount it correctly.
I was thinking of creating a subroutine to cycle through the block devices to determine the sdcard device.
This would make it compatible with practically every device.
Then I could turn the whole thing into a Magisk module.
There are still 2 minor issues that I am having:
1. The phone still displays a notification about the sdcard being corrupt. You just have to clear the notification and it never reappears.
2. The mounted card is not identified as an external SD by android.
However, the exFAT or NTFS filesystem is mounted at /mnt/media_rw/extsd and is browseable and the filesystem is readable and writable.
Tell me what you think.

TWRP installable .zip to install NTFS/exFAT suport
OK, this is a installable .ZIP that will copy the binaries to /system/xbin and copy the mounting script to:
/data/adb/post-fs-data.d.
This should enable NTFS/exFAT support to most phones.
Requirements:
1. You must have Magisk installed
2. Your Micro SD''s device address must be:
/dev/block/mmcblk1. This is the case on most devices running Android 6 or higher.
If your Micro SD's device address is different, you can fix it by modifying:
/data/adb/post-fs-data.d/mount_ntfs_exfat.sh
replacing /dev/block/mmcblk1 with the device address of your external Micro SD.
Download the installer here:
https://forum.xda-developers.com/attachment.php?attachmentid=4773292&stc=1&d=1559992139​

tecknight said:
OK, this is a installable .ZIP that will copy the binaries to /system/xbin and copy the mounting script to:
/data/adb/post-fs-data.d.
This should enable NTFS/exFAT support to most phones.
Requirements:
1. You must have Magisk installed
2. Your Micro SD''s device address must be:
/dev/block/mmcblk1. This is the case on most devices running Android 6 or higher.
If your Micro SD's device address is different, you can fix it by modifying:
/data/adb/post-fs-data.d/mount_ntfs_exfat.sh
replacing /dev/block/mmcblk1 with the device address of your external Micro SD.
Download the installer here:
https://forum.xda-developers.com/attachment.php?attachmentid=4773292&stc=1&d=1559992139​
Click to expand...
Click to collapse
Hi,
I know this post isn't new, but I tried installing this zip file and it tells me that my bootloader in't unlocked even though I'm pretty sure it's unlocked,
any way around this?

rachelld said:
Hi,
I know this post isn't new, but I tried installing this zip file and it tells me that my bootloader in't unlocked even though I'm pretty sure it's unlocked,
any way around this?
Click to expand...
Click to collapse
Same here. Maybe the template is to old? Also could use this module.

aCIDsLAM said:
Same here. Maybe the template is to old? Also could use this module.
Click to expand...
Click to collapse
Try this one:
https://www.androidfilehost.com/?fid=4349826312261782012​I removed the check for
ro.boot.bl_unlock_complete = true
---------- Post added at 11:08 PM ---------- Previous post was at 11:06 PM ----------
rachelld said:
Hi,
I know this post isn't new, but I tried installing this zip file and it tells me that my bootloader in't unlocked even though I'm pretty sure it's unlocked,
any way around this?
Click to expand...
Click to collapse
Try this one:
https://www.androidfilehost.com/?fid...26312261782012​
I removed the check for
ro.boot.bl_unlock_complete = true

I could flash it, using TWRP. In Magisk itself, it told me me, its no magisk module. Anyway. Thanks!

@thomasamas
@tecknight
Is this thread dead ?
Has these drivers been tested on Android 11 ?
I have a custom ROM and would like to use my SDCard with NTFS/exFAT but the ROM only supports FAT32.

KineSight said:
@thomasamas
@tecknight
Is this thread dead ?
Has these drivers been tested on Android 11 ?
I have a custom ROM and would like to use my SDCard with NTFS/exFAT but the ROM only supports FAT32.
Click to expand...
Click to collapse
+1

tecknight said:
TWRP installable .zip to install NTFS/exFAT suport
OK, this is a installable .ZIP that will copy the binaries to /system/xbin and copy the mounting script to:
/data/adb/post-fs-data.d.
This should enable NTFS/exFAT support to most phones.
Requirements:
1. You must have Magisk installed
2. Your Micro SD''s device address must be:
/dev/block/mmcblk1. This is the case on most devices running Android 6 or higher.
If your Micro SD's device address is different, you can fix it by modifying:
/data/adb/post-fs-data.d/mount_ntfs_exfat.sh
replacing /dev/block/mmcblk1 with the device address of your external Micro SD.
Download the installer here:
https://forum.xda-developers.com/attachment.php?attachmentid=4773292&stc=1&d=1559992139​
Click to expand...
Click to collapse
Actually, this still works! Have tested this on A11 OctaviOS GSI. You still need to have Magisk installed, but you don't necessarily have to install this as a Magisk module.
Don't flash the .zip file from TWRP, it doesn't do anything (at least not for me). Just unzip everything in the .zip file into a folder. Then, take the files inside the xbin folder and put it into /system/xbin (as per instructions). Make sure those files have execute permissions. I just set the xbin folder with full execute permissions and apply to all child files in the folder, by using Root Explorer.
Next, do the same thing by taking the script and chuck that into /data/adb/post-fs-data.d. Again, give this script full execute permissions.
Reboot phone and voila, it should work! You should also see that the script is loaded and running in Magisk logs.
Oh and the reason why Magisk is required is because Magisk creates that "post-fs-data.d" folder after it is installed. If you put scripts into /data/adb/service.d or /data/adb/post-fs-data.d, they will automatically get executed by Magisk and run with superuser rights.

chaoscreater said:
Actually, this still works! Have tested this on A11 OctaviOS GSI. You still need to have Magisk installed, but you don't necessarily have to install this as a Magisk module.
Don't flash the .zip file from TWRP, it doesn't do anything (at least not for me). Just unzip everything in the .zip file into a folder. Then, take the files inside the xbin folder and put it into /system/xbin (as per instructions). Make sure those files have execute permissions. I just set the xbin folder with full execute permissions and apply to all child files in the folder, by using Root Explorer.
Next, do the same thing by taking the script and chuck that into /data/adb/post-fs-data.d. Again, give this script full execute permissions.
Reboot phone and voila, it should work! You should also see that the script is loaded and running in Magisk logs.
Oh and the reason why Magisk is required is because Magisk creates that "post-fs-data.d" folder after it is installed. If you put scripts into /data/adb/service.d or /data/adb/post-fs-data.d, they will automatically get executed by Magisk and run with superuser rights.
Click to expand...
Click to collapse
Hello, I did everything as you said and it worked normally, but now SELinux is turned off. This is normal?

i have same issue. But i cant find xbin folder
my device is Samsung M51 on custom os

I converted this twrp zip into a magisk module https://github.com/phhusson/treble_experimentations/files/8948418/ntfs-exfat-support.zip

Hi.
I'm using Ancient OS A13 and I can't access my SD Card.It asks for format and after formatting it still asks for format.
it still works on my pc and twrp recovery. Unfortunately, this fix isn't working. Also, there is not any xbin folder in system.
What should I Do?

Related

[WIP/MOD] Adding FUSE filesystems to P500

Status: working!
The tar file has some binaries which work.
If you aren't a developer you probably don't care about this.
I'm working on getting FUSE working on my P500, and thought I'd share my experiences. FUSE is a mechanism to mount lots of filesystems (like fusecompress, sshfs, or unionfs) without needing to recompile the kernel or patch the kernel. My need is to have a writeable /system that can be 'cleaned' back to the original state with the push of a button.
The following details my initial attempt. I've had better success as detailed here:
http://forum.xda-developers.com/showpost.php?p=14619814&postcount=3
Steps:
1) get the kernel source and build it with the FUSE module enabled. this provides fuse.ko which should be usable on virtually all 2.6.32.xx kernels for the P500
2) get the fuse userspace libraries and compile. I had to use a very old version (2.4.2) because newer versions need support for statvfs which bionic doesn't have. I had to patch in apthread_rwlock which isn't in bionic for froyo, and a few other cleanups.
3) get a fuse filesystem to test. I'm using unionfs-fuse. I had to use a very old version (0.11) to go with my very old libfuse from (2)
4) Try it out:
* move the files from 1-fuse.ko, 2-fusercompress, and 3-unionfs to the p500
* become root
* make sure all files are executable and in the PATH
* load the kernel module: insmod fuse.ko
* try to use fuse: ./unionfs --roots=/sdcard /mnt/asec
The last step seems to work, but ps shows no unionfs process.
Next I try with debug enabled:
* ./unionfs --roots=/sdcard /mnt/asec -d
This gives a segfault
Lastly I try with strace to find the segfault:
* strace -ff -F ./unionfs --roots=/sdcard /mnt/asec -d
now the code no longer segfaults, and the mount works.
So my goal now is to figure out why it segfaults when not run via strace.
I found someone who got this working on the desire:
http://forum.xda-developers.com/showthread.php?t=763908
(I tried their binaries just for fun, but they're not compatible with the P500)
They did it by using scratchbox which imports glibc. I was trying to do a native bionic build, but it may be easier to try scratchbox, as it would let me have a modern libfuse. If I can't figure out this segfault, then I'll go there next. Has anyone tried building for the P500 using scratchbox?
Sweet idea man!
Ok, I have fuse fully working using the latest fuse version 2.8.5
In order to build, I got a copy of statvfs.c and statvfs.h from the shieldroid project. I had to modify the definition of f_fsid to be 'unsigned long' and adjust statvfs.c appropriately I also ended up disabling multi-threaded support in fuse as it made it made it easier to compile.
With a bunch of monkeying around, I got libfuse compiled with the apropriate utils. I verified the example filesystems worked, then went ahead and built unionfs-fuse (latest version).
Using the tar file in the 1st post you can now:
* copy all files to /data and make executable
* add the relevant directory to your path
* insmod fuse.ko
* ./unionfs /sdcard:/system/bin /data/local/tmp
* ls /data/local/tmp (should contain the contents of /system/bin and /sdcard in one merged dir)
When I get a chance, I'll build an installable zip that puts the files in the right place for easy use.
FYI, my goal is to create a utility that can temporarily enable root on a phone and then disable it when done. My idea is to move the 'su' command out of /system/bin onto /data, and then use unionfs to teporarily add it back onto /system/bin on command. When done, you'll be able to click to unmount it again, bringing the phone back to an unrooted state.
It'll work sort of like the 'temporary root' capability of z4root, but will be undoable without a reboot (it also won't inculde the code to actually break out of a stock ROM, the goal is to be able to toggle root on an already rooted phone).
I need this capability because I run some enterprise software that doesn't work on a rooted phone, and I don't want to be constantly booting to recovery for root tasks.
i dont understand most of wat u saying, but good going man.
im also computer science student but hate studying =(

[DEV][BRAINSTORM] Fully-working CWM Recovery

While the recovery we have at the moment, fruit of the hard work of xantaro, unclecracker and digitalfrost, is enough for most operations there are some things bugging me that is in our interest to fix with the ultimate aim of adding it to ROM Manager and thus get official support.
Current issues:
1. It isn't the latest version of CWM and isn't official.
2. It doesn't have USB mount working.
3. It doesn't have ADB working.
4. It doesn't support EXT4.
Now, I have tried to fix these but recoveries are a new domain for me and at a first attempt I couldn't bring some of these to work. Compiling the latest version was easy and an important first step towards official; however, all others I couldn't do it and I don't think we should talk with koush before fixing all this.
Here are my short attempts:
- For USB mount I defined on the BoardConfig the path for UMS lun0 file. The path seems to be correct and there's no other file in /platform/ as I've found out by running a ls -R. I have no idea why it's not working.
- For ADB, I made sure the persist.adb.service is set to 1 and the init.rc is starting it. This being said, I don't know what's missing. Perhaps this is of interest?
- For EXT4 support I thought it was just a matter of adding alternative FS to recovery.fstab. Seems I was wrong though.
So, does anyone want to join in and help?
This is really new territory to me and I have a quite faint idea of what I'm doing.
A few guidelines:
- Read this to get an idea.
- You'll need CM sources (repo init... repo sync...)
- The CWM recovery source is in /bootable/recovery
- Here is my device source and a patch file for some changes on recovery src *
- Run build commands (. build/envsetup.sh, lunch full_p970-eng, make -j4 recoveryimage)
* If you don't change what I did on the recovery source you won't have a key to select.
Also, I have CWM 4.x at the moment on my OB but since it does the same as the already posted 3.x I don't deem necessary to share it; but if anyone wants, I'll upload it.
I'll join the party when I come from the mini-vacations, hope there'll be some progress meanwhile!
Great
i'll try to do some help,maybe little
If anyone wants you can request a pull from my source.
Also, here's a flashing CWM 4.x. I renamed it Nova recovery for the lulz.
http://www.multiupload.com/R7WGNYTL7G
Changes on the Source to get selectbutton to work shouldn´t be necessary. Adding "BOARD_HAS_NO_SELECT_BUTTON := true" to boardconfig.mk suffices to get selectbutton to work.
EXT4 Backup and Restore worked for me after editing the fstab file.
For the ADB and USB mount problem i have no Idea what is missing. Like you said, adb daemon should get started througt the initscript.
BTW. seems like the Progressbar isn´t working on the newer Versions of CWM
xantaro said:
EXT4 Backup and Restore worked for me after editing the fstab file.
Click to expand...
Click to collapse
Could you release a new version or tell us how to do it? Thanks
To get EXT4 working in my O2X builds my /data line looks like this:
Code:
/data ext3 /dev/block/mmcblk0p9 NULL auto
xantaro said:
Changes on the Source to get selectbutton to work shouldn´t be necessary. Adding "BOARD_HAS_NO_SELECT_BUTTON := true" to boardconfig.mk suffices to get selectbutton to work.
Click to expand...
Click to collapse
I thought the flag wasn't suffice. Thanks.
Rusty! said:
To get EXT4 working in my O2X builds my /data line looks like this:
Code:
/data ext3 /dev/block/mmcblk0p9 NULL auto
Click to expand...
Click to collapse
Nice tip, I'll try.
knzo said:
While the recovery we have at the moment, fruit of the hard work of xantaro, unclecracker and digitalfrost, is enough for most operations there are some things bugging me that is in our interest to fix with the ultimate aim of adding it to ROM Manager and thus get official support.
Current issues:
1. It isn't the latest version of CWM and isn't official.
2. It doesn't have USB mount working.
3. It doesn't have ADB working.
4. It doesn't support EXT4.
Click to expand...
Click to collapse
Hey,
I know this is an old thread but still if u have not resolved the problem with ADB and USB follow these instruction:
Before we start:
My mobile is Spice Mi-410 (Qualcomm made), also known as Cherrymobile magnum, Wellcomm, Motorola triumph in different countries. So may be these tweak will not work with your device. (But you can give it a try )
I hope you know how to unpack recovery.img of your device (or boot.img if your recovery ramdisk is stored in boot.img like Xperia Arc) if not then follow this guide to unpack recovery.img and extract recovery ramdisk into a folder.
Tweak
For ADB: Open init.rc file from recovery ramdisk/initram using any editor of your choice
Put this line at the end of "on init" section
Code:
write /sys/module/g_android/parameters/product_id ####
where #### should be replaced by your device's product id.
(if you dont know what it is then connect your mobile to PC and issue "lsusb" command in ubuntu terminal, you should see something like this
Bus 001 Device 027: ID 0489:c000 Foxconn / Hon Hai
Here c000 is my devices product id and Foxconn is my device's manufacturer)
Though /sys/module/g_android is not present in our device but this worked for me.
Please note that the device id is case sensitive, so write what you see on PC
For USB: For this add following line at the end of "on boot" section in init.rc file
Code:
echo 1 > /sys/class/usb_composite/usb_mass_storage/enable
For your device first confirm the location of /sys/class/ ###### / ####/usb_mass_storage/enable
Since this location vary from device to device.
This should enable usb storage mounting from recovery.
Best of luck!!
One option for load rootfs image in native mode is necesary
enviado

sd-card blues...

Hey guys I have a question for you all about sd-cards
I sbf'd
Installed ota 5.7.894 (because of no true .906 sbf I won't flash it)
Regained root
Installed busybox 1.20 (figured newer might be better)
Installed safestrap (tweaked of course 1.08f)
Now
My phone see's the internal/external sd-cards fine and mounts/formats/explores just fine
My laptop also see's internal/external sd-cards just fine
However
Rootbrowser cannot see the sd-card
Safestrap cannot find /sdcard
But
Root explorer can see the internal and external just fine
I have tried sbfing several times to see if it will fix it
I have tried not installing the ota,changing versions of busybox ect..
Why can my phone see and work with the sd-cards just fine but programs cannot?
Because safestrap cannot see the sd-card I cannot create backups..
Any help is greatly appreciated
I think Rick#2 acknowledged this in the safestrap 1.08f thread and had this advice for those experiencing the error:
(For the record, this change almost worked for me - safestrap would now access my external sdcard (/sdcard), but when I would select a zip to flash, it would just take me back to the menu. I dropped a reply with my results in that thread.)
Rick#2 said:
While you're in Safestrap, either go into the console or "adb shell" into your phone. (Remember that for adb to work properly in the recovery your phone has to boot up with the USB cable already connected).
If you type:
Code:
ls -l /dev/block | grep mmcblk0
what output does it provide? For me, it spits out "mmcblk0" but... I'm pretty sure that for those that aren't able to mount their external sdcards it will say mmcblk0p1. In which case, the fix is easy; I'll be sure to update my package, obviously, but for those of you who want to try a little DIY, copy the file /systemorig/etc/safestrap/recovery.zip onto your computer and unzip it. Inside, there's be a file called /etc/recovery.fstab; edit this and change the line corresponding to /sdcard (It ought to be on line 3, or the second line of actual text) to the following:
Code:
/sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0
Click to expand...
Click to collapse
At this point, after copying the recovery.fstab back to my phone, I assumed I had to correct the permissions of the file, so I did. If I am wrong, someone please let me know!
continuing his reply...
Doesn't really matter how many spaces you have between; ideally you'll just need to hit tab each time.
Hopefully this is what the issue was. I remembered changing that line because I was getting random error messages about my external /sdcard and since I didn't see /dev/block/mmcblk0p1 in my /dev/block directory I assumed I must have made a typo and changed it... here's one tiny example of how easy it is to completely bork these things. Multiply it by a million and you have kernel development...
Click to expand...
Click to collapse
That might work if it was just safestrap having the issue..but its not
Even cwm cannot backup the apps on the sd-card as it cannot see it as well..
But root explorer and the stock file browser can see the internal/external sd-cards
And write on them just fine..and even mount/unmount and format...arrrggggg
This is killin me

[BOOT] NanoBoot r10 CM10 [UMS][2012-08-17]

After testing CM10 for a while (thx codeworx) I now ported my NanoBoot image to CM10.
Changes compared to original CM10 boot:
"insecure" (means: / and /system mounted read-write (easy 'adb push' into /system ...), ro.secure = 0)
support for /system/etc/init.d/ init scripts
(somewhat) easy UMS access
Changes in r10:
Use 179:24 instead of 179:25 as address for UMS (fixes UMS on Windows)
to enable UMS for external SD with this boot.img it is enough to do:
Code:
setprop sys.usb.config mass_storage,adb
to return to MTP:
Code:
setprop sys.usb.config mtp,adb
TIP:
If you use Linux you may use some function like:
Code:
ums () {
if [[ $1 == "+" ]]; then
adb root
sleep 2
adb -s c1607c00051963f shell 'setprop sys.usb.config mass_storage,adb'
else
adb root
sleep 2
adb -s c1607c00051963f shell 'setprop sys.usb.config mtp,adb'
fi
}
'ums +' will enable UMS, 'ums -' will disable UMS on your tablet (not to mention it needs to be connected (...))
replace '-s c1607c00051963f' with '-s <your adb id>' - you get the id via 'adb devices'.
If you only got one adb-enabled device, you could remove '-s c1607c00051963f' from the commands.
If there's more than one device connected adb needs to know which one should receive the commands.
I did not yet have the time to modify framework-res.apk to add UMS to the list of options...
Flash using img/pit with either Odin or Heimdall. Or use zip to flash using CWM.
Images for Odin/Heimdall
PIT:
p3100.pit http://downloads.nanolx.org/P3110/p3100.pit
p3110.pit http://downloads.nanolx.org/P3110/p3110.pit
Stock CM10 Kernel:
NanoBoot-r10-CM10.img http://downloads.nanolx.org/P3110/NanoBoot-r10-CM10.img
Johnsel's CM10OC Kernel:
-No WiFi-
Zips for CWM
Stock CM10 Kernel:
NanoBoot-r10-CM10.zip http://downloads.nanolx.org/P3110/NanoBoot-r10-CM10.zip
Johnsel's CM10OC Kernel:
-No WiFi-
Tried this on my P3113 and it broke my WiFi.
Macadamia Daze said:
Tried this on my P3113 and it broke my WiFi.
Click to expand...
Click to collapse
Here with 3110 it works... if you provide me the original 3113 boot.img, I can re-pack one, that should work.
And it only works with Cyanogen Mod 10. Not on 9 or stock rom.
Setialpha said:
Here with 3110 it works... if you provide me the original 3113 boot.img, I can re-pack one, that should work.
And it only works with Cyanogen Mod 10. Not on 9 or stock rom.
Click to expand...
Click to collapse
I am using CM10, so here's the original boot.img for CM10 on the P3113. You don't need the stock one, do you?
Macadamia Daze said:
I am using CM10, so here's the original boot.img for CM10 on the P3113. You don't need the stock one, do you?
Click to expand...
Click to collapse
try with attached CWM zip.
n00b here.....what does this do??
Sent from my GT-P3113 using Tapatalk 2
F3AR420 said:
n00b here.....what does this do??
Sent from my GT-P3113 using Tapatalk 2
Click to expand...
Click to collapse
Just as first post says. This is a modified boot image for cyanogen mod 10 (no other ROM supported!) for galaxy tab 2 7", which makes / and /system read-write, adds support for init-scripts and adds pretty easy way to access UMS (USB Mass Storage) for external SD-Card.
According to your signature you're using an incompatible rom anyway - so don't use this.
@Macadamia Daze: now also tested with a 3100 I got my hands on: WiFi works. Dunno why it doesn't work with 3113 (I got no clue whether 3113 has some special WiFi stuff or whatever). Either way, please tell me, whether the attached one for 3113 (two posts above) works with WiFi.
Setialpha said:
@Macadamia Daze: now also tested with a 3100 I got my hands on: WiFi works. Dunno why it doesn't work with 3113 (I got no clue whether 3113 has some special WiFi stuff or whatever). Either way, please tell me, whether the attached one for 3113 (two posts above) works with WiFi.
Click to expand...
Click to collapse
Silly me; the problem was an incompatible kernel (Johnsel's). I returned to the default CM10 kernel and reflashed this, so now WiFi works. Still, in Windows it doesn't work properly. While it does create a new removable disk in Computer, it gives the "Please insert a disk into drive" error when I try to open it. Haven't tested in Linux yet, but based on my earlier tests with your previous UMS solution, it probably works.
---------- Post added at 08:12 PM ---------- Previous post was at 07:22 PM ----------
Ooh, I have good news! I used Device Manager to examine the blank drive letter on the computer, and it was recognizing it basically like an SD card reader with no SD card. So, I decided to poke around some of the files referenced in your UMS script from before to check their values. When I tried to open /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file, I got an error. Thinking it may not be working properly, I created a file on my computer with the contents "/dev/block/vold/179:24" and ADB pushed it to overwrite the broken file. Instantly, my SD card mounted on the PC. I hope this is useful information for you!
Macadamia Daze said:
Silly me; the problem was an incompatible kernel (Johnsel's). I returned to the default CM10 kernel and reflashed this, so now WiFi works. Still, in Windows it doesn't work properly. While it does create a new removable disk in Computer, it gives the "Please insert a disk into drive" error when I try to open it. Haven't tested in Linux yet, but based on my earlier tests with your previous UMS solution, it probably works.
---------- Post added at 08:12 PM ---------- Previous post was at 07:22 PM ----------
Ooh, I have good news! I used Device Manager to examine the blank drive letter on the computer, and it was recognizing it basically like an SD card reader with no SD card. So, I decided to poke around some of the files referenced in your UMS script from before to check their values. When I tried to open /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file, I got an error. Thinking it may not be working properly, I created a file on my computer with the contents "/dev/block/vold/179:24" and ADB pushed it to overwrite the broken file. Instantly, my SD card mounted on the PC. I hope this is useful information for you!
Click to expand...
Click to collapse
I see... 179:24 is the sdcard itself, 179:25 (what I use) is the first partition on the sdcard... unixoid systems don't care about that, but windows seems too... I'm gonna test with 179:24 on Linux and if it works there (I'd say yes even without testing, I provide an update). Thanks for testing.
r10 is now online - fixes UMS issue on Windows.
I can't get WiFi to work with Johnsel's CM10OC Kernel - so I skiped uploading those image/zip...
You can find me in Freenode #cyanogenmod-dev if you care to sort out what's happening with the wifi on my kernel
Johnsel said:
You can find me in Freenode #cyanogenmod-dev if you care to sort out what's happening with the wifi on my kernel
Click to expand...
Click to collapse
It fails to load something and therefore can't be enabled, don't remember exact log-message right now.
I'll contact you, when I'm hacking around the next time.
This is pretty interesting.
Two things
1-Doesn't CM10 already support init.d scripts?
2-Would it be possible to swap the mountpoints for the "internal" sdcard space and the actual microSD card slot? My current method of re-mounting things right after boot is OK but not very elegant.
DivinityCycle said:
This is pretty interesting.
Two things
1-Doesn't CM10 already support init.d scripts?
2-Would it be possible to swap the mountpoints for the "internal" sdcard space and the actual microSD card slot? My current method of re-mounting things right after boot is OK but not very elegant.
Click to expand...
Click to collapse
1 - atleast not via boot.img - that's why I added it.
2 - I have an older tablet I used before (ARNOVA 7C G2) it worked with this one, so it should work with this one, too. But you should never enable UMS while some app is running... On that other tablet I had to use EXT2 or EXT4 on SD-Card else all that permission stuff didn't work (FAT only has very basic permission rules for files). Also I recommend using second partition of SD-Card for /data. (first gets used as external storage and is managed by vold - at least that is what I did on my other tablet).
I attached init.espresso.rc, so that you can play around with the mount points (re-send me the file after you're done and I can provide you a flashable zip).
Setialpha said:
1 - atleast not via boot.img - that's why I added it.
2 - I have an older tablet I used before (ARNOVA 7C G2) it worked with this one, so it should work with this one, too. But you should never enable UMS while some app is running... On that other tablet I had to use EXT2 or EXT4 on SD-Card else all that permission stuff didn't work (FAT only has very basic permission rules for files). Also I recommend using second partition of SD-Card for /data. (first gets used as external storage and is managed by vold - at least that is what I did on my other tablet).
I attached init.espresso.rc, so that you can play around with the mount points (re-send me the file after you're done and I can provide you a flashable zip).
Click to expand...
Click to collapse
That's the thing I have been wrestling with lately, what's "the best" way to manage this stuff?
It seems like the main thing that needs to be done for legacy purposes is linking the regular /storage/sdcard0/data directory over to /storage/sdcard1/data/.
One idea I had was to format the "internal" sdcard (/storage/sdcard0) with ext4, which would allow symlinks to exist there, then just remove the data directory and replace it with a symlink that points to /storage/sdcard1/data.
From what I've read, ext4 is supposed to be a better, higher performance solution, so I'm kinda curious to try it out.
It would make UMS pretty worthless to Windows guys like me, but I basically do everything via network anyways (SFTP mostly).
Is it possible to control the file systems used on the internal & external sdcards in the init? I didn't look too deeply at it cuz I don't know how to rebuild a boot.img (at least not yet)
Tested this with the current AOKP JB nightly, and it also breaks WiFi. I'm trying now to keep the rom and restore the CM10 NanoBoot backup. Fingers crossed it will be stable.

SMB/CIFS on tab S2?

I bought a tab S2 about a month ago to replace my HP touchpad i've had/been using since the firesale about 4 yrs ago. At the time of purchase, I discovered really quickly that lack of custom roms on the S2 at that time was to much of an issue, and I returned it.
I am however seeing an alpha of CyanogenMod for the tab S2 that's looking pretty close to usable. Given that the tab is also on sale this week, i'm very much inclined to repurchase it, however, question: Does cifs/smb mounting remote filesystems work with the tab s2 rom that was posted?
You can do that on the stock S2 with many different apps in the Play Store. ie. ES File Explorer, Solid Explorer, AndSMB
nrage23 said:
You can do that on the stock S2 with many different apps in the Play Store. ie. ES File Explorer, Solid Explorer, AndSMB
Click to expand...
Click to collapse
Correct me please if i'm wrong, but those applications just allow me to browse remote filesystems from the application itself. They don't smb mount them. It's the cifs.ko file i'm missing (which i'm assuming is included with cm12?)
The cifs.ko file would have to be done via a kernel module based on what I seen from other devices. I do not know if it is included in CM kernels or not.
Did you or anyone get cifs working?
I understand it may be possible to compile a cifs.ko and insmod it.
I don't know how possible that is but whilst I'm googling how to compile I thought I'd see if anyone had done it.
Cheers, Guy
I got CIFS mount working on my 710 by installing Neked_Nook_MM-710-V1 and my fork of @engine95 mm kernel which has the cifs module enabled.
Hi thanks for the reply
I don't suppose you have any tips or suggested posts/ guides I could use to recreate your setup?
I guess I could figure out how to get neked nook flashed based on the guides but the fork of the engine95 Kernel that includes cifs..? I can see a post about the permissive kernel by engine95..
Is your device fully functional and stable now?
Thanks a lot,
Guy
Neked nook is very stable. My tab s2 has not crashed so far with that rom, and my custom kernel. I have attached my boot image. This is a fork of engine95 kernel with just cifs module added. This kernel only works on MM.
Extract boot.zip and flash boot.img via twrp(boot image) or fastboot.
You can use the attached cifs manager to mount your smb/cifs drives on android as a directory.
I am only able to mount it to /mnt/drive. I could not get it to mount to /sdcard.
Awesome thanks
I use cifsmanager on a Chuwi hi12 that i've rooted, it already has the cifs modules and permissive kernel so I am able to mount the shares almost wherever I like - and I use cifsmanager to poke 1TB of satellite images into the map folder of my mapping app on the SD card. But I don't know if cifs was in the kernel (chuwi is on lollipop) already or part of the rooting process, would love to recreate the setup on my samsung as its a far superior device.
I'll give it a go this weekend, really appreciate you taking the time to upload the files you used.
Cheers,
Guy
Hi Currowth,
I know life is too short to help each noob, but can I trouble you for another pointer?
I used the full image of Neked Nook MM v1, and the boot image you provided, and the tablet is working great, and if I cat /proc/filesystems I can now see cifs listed....but..
I can't mount any cifs shares - to anywhere, including /mnt/drive. I get the mount failed Mount: I/O error.
(I think my process was along the lines of: ODIN to cf-autoroot (i'd actually done this a while before starting this thread so including in case its relevant, as i dont know if there is an issue with a /system or systemless root?) then I ODIN'd TWRP on, took a full backup with TWRP and then wiped data,cache, system etc and flashed Neked Nook on, booted into NNook, then went back to twrp and put the boot image you provided on.
Any help greatly appreciated.
If it means anything I'm not trying to watch Batman in bed, I'm trying to put together a repeatable solution for me and my overland traveller friends so we can take huge amounts of map and satellite image tiles completely offline when we're driving our landrovers, toyotas etc across deserts where sat navs or road maps are useless.
thanks again,
Guy
*Edited to add i've been googling the crap out of the mount i/o error, tried a patched version of cifsmanager, tried copying the apk to the system/apps folder and changing its permissions before reinstalling.. no joy
Looks like it can be a root issue. This is what i flashed to get root. "BETA-SuperSU-v2.74-2-20160519174328"
try to install busybox also and try again.
If that does not work:
Can you try to run this in adb shell as root?
mount -t cifs -o username="username",password="password" //smbpath/dir mnt/cifs/dir
replace "username,"password", and smbpath/dir
Guy009 said:
Hi Currowth,
I know life is too short to help each noob, but can I trouble you for another pointer?
I used the full image of Neked Nook MM v1, and the boot image you provided, and the tablet is working great, and if I cat /proc/filesystems I can now see cifs listed....but..
I can't mount any cifs shares - to anywhere, including /mnt/drive. I get the mount failed Mount: I/O error.
(I think my process was along the lines of: ODIN to cf-autoroot (i'd actually done this a while before starting this thread so including in case its relevant, as i dont know if there is an issue with a /system or systemless root?) then I ODIN'd TWRP on, took a full backup with TWRP and then wiped data,cache, system etc and flashed Neked Nook on, booted into NNook, then went back to twrp and put the boot image you provided on.
Any help greatly appreciated.
If it means anything I'm not trying to watch Batman in bed, I'm trying to put together a repeatable solution for me and my overland traveller friends so we can take huge amounts of map and satellite image tiles completely offline when we're driving our landrovers, toyotas etc across deserts where sat navs or road maps are useless.
thanks again,
Guy
*Edited to add i've been googling the crap out of the mount i/o error, tried a patched version of cifsmanager, tried copying the apk to the system/apps folder and changing its permissions before reinstalling.. no joy
Click to expand...
Click to collapse
Thanks for coming back Currowth,
Ok my SuperSU from the original cf-autoroot was 2.46. I assumed I needed to remove that so I ran the unroot function and then used twrp to flash the version you linked to, after reboot SuperSu is at 2.74.
Unfortunately i have the same I/O error.
I also ran adb root from my win10 machine and tried the manual mount command as you suggested - it returns I/O error also. Initially it said 'no such file or directory' so I manually created the dir, with the name the same as the share dir, in /mnt/cifs.
command output
255|[email protected]:/ # mount -t cifs -o username=admin,password=admin //10.10.10.254/Public1 /mnt/cifs/Public1
mount: No such file or directory
255|[email protected]:/ # cd /mnt/cifs
[email protected]:/mnt/cifs # mkdir Public1
255|[email protected]:/ # mount -t cifs -o username=admin,password=admin //10.10.10.254/Public1 /mnt/cifs/Public1
mount: I/O error
One other thing, in the NNook image thread, i see it says make sure you 'ODIN M' first. I'm embarrassed to say i don't know what that means!
update in mean time: i started again, based on doing all the flashing whilst rooted with the older supersu. So i've unrooted, rooted with your beta_xx linked above, wiped system, cache, data and dalvik, flashed the Neked Nook full MM V1 ROM, booted into that, then back to twrp to flash the boot.img you linked above, installed busybox, the linked cifsmanager, tried to mount, then updated supersu as recommended in NNook thread, rebooted and tried mount again but no joy, always getting i/o error.
just for further info, the shared folder does work on my chuwi with cifsmanager, so hopefully that is not the issue. Before I re-did the ROM and the boot image, i installed paragon ntfs and was able to successfully mount an NTFS formatted SD card into the /mnt/cifs/public1 directory.
interestingly cifsmanager couldn't create the directories under /mnt, but i was able to create them manually and then get an IO error. I changed permissions on the /mnt/cifs folder and now it can create the directory when attempting to mount but still gets IO error.
i'm beyond my depth, guess it feels like cifsmanager is either not working or not got permission - or something i've done prior to the NN and kernel flashes has caused an issue.
Its starting to feel like a lost cause. You know better than me - if this is the end of the easy flash-type fixes to try, perhaps I should just throw in the towel.
Thanks again for your help Currowth, you're a gent
I just did a clean install to replicate you issue, but was not able to reproduce it. 'ODIN M' means that install a marshmallow rom first via ODIN. If you already came from a marshmallow ROM, you can ignore it.
The steps i took to ensure that i am was able to get cifs were the following:
First i installed "Neked_Nook_MM-710-V1.zip"
Next I installed "BETA-SuperSU-v2.74-2-20160519174328.zip"
Last i installed "boot.img"
I did this all through twrp.
Reboot, dont setup knox if it asks you to.
Try to do a wipe, then reinstall the following and try again.
Guy009 said:
Thanks for coming back Currowth,
Ok my SuperSU from the original cf-autoroot was 2.46. I assumed I needed to remove that so I ran the unroot function and then used twrp to flash the version you linked to, after reboot SuperSu is at 2.74.
Unfortunately i have the same I/O error.
I also ran adb root from my win10 machine and tried the manual mount command as you suggested - it returns I/O error also. Initially it said 'no such file or directory' so I manually created the dir, with the name the same as the share dir, in /mnt/cifs.
command output
255|[email protected]:/ # mount -t cifs -o username=admin,password=admin //10.10.10.254/Public1 /mnt/cifs/Public1
mount: No such file or directory
255|[email protected]:/ # cd /mnt/cifs
[email protected]:/mnt/cifs # mkdir Public1
255|[email protected]:/ # mount -t cifs -o username=admin,password=admin //10.10.10.254/Public1 /mnt/cifs/Public1
mount: I/O error
One other thing, in the NNook image thread, i see it says make sure you 'ODIN M' first. I'm embarrassed to say i don't know what that means!
update in mean time: i started again, based on doing all the flashing whilst rooted with the older supersu. So i've unrooted, rooted with your beta_xx linked above, wiped system, cache, data and dalvik, flashed the Neked Nook full MM V1 ROM, booted into that, then back to twrp to flash the boot.img you linked above, installed busybox, the linked cifsmanager, tried to mount, then updated supersu as recommended in NNook thread, rebooted and tried mount again but no joy, always getting i/o error.
just for further info, the shared folder does work on my chuwi with cifsmanager, so hopefully that is not the issue. Before I re-did the ROM and the boot image, i installed paragon ntfs and was able to successfully mount an NTFS formatted SD card into the /mnt/cifs/public1 directory.
interestingly cifsmanager couldn't create the directories under /mnt, but i was able to create them manually and then get an IO error. I changed permissions on the /mnt/cifs folder and now it can create the directory when attempting to mount but still gets IO error.
i'm beyond my depth, guess it feels like cifsmanager is either not working or not got permission - or something i've done prior to the NN and kernel flashes has caused an issue.
Its starting to feel like a lost cause. You know better than me - if this is the end of the easy flash-type fixes to try, perhaps I should just throw in the towel.
Thanks again for your help Currowth, you're a gent
Click to expand...
Click to collapse
Thanks Currowth I will try and give it a go tomorrow
Just a thought, are you booting into Android after each step, or doing all the flashing in one twrp session then doing first boot once all items are flashed?
I flashed them in one session without rebooting.
Hi Currowth, I've had a breakthrough!
I re did the NNook/root/boot image in the order you advised.
I have been using a patriot node WiFi disk enclosure, that works with cifs manager on my other tablet. Today I was working away from the WiFi disk so I made do with a windows pc to provide a shared folder. After setting cifs manager up I was able to mount the share under /mnt, but not to any other location. I got back to my WiFi disk, and that continued to give an io error!? So windows worked but the patriot didn't. Weird. I'd ruled the patriot out as it works on my 5.1 lollipop tab.
So I continued to mess around... I had stumbled across another app called mount manager by Ryan conrad (I don't have the link but I have the apk) which has more noob-friendly options and found if I used the ntlmv2 option I could mount the patriot into /mnt !
I did try to get it to mount to other locations and although it succeeded in the app, the mounted folder was empty.
As my app - Osmand+ has the option to manually specify it data folders I created a 777 permission folder for it under /mnt, and then mounted the patriot containing my satellite images into the appropriate empty tile folder.
Working solution!!! If a little messy.
Thanks so much for your help, the Samsung s2 is about 400% faster and more practical than the other tablet so really happy
I don't know why android devices are so limited by manufacturers when the OS is capable of so much, but that's a different conversation haha
A follow up on this in case it is useful to others...
Using /mnt was a bad idea. /mnt is mounted / built on a system partition as a mount point for other file systems or devices (how I have explained it to myself). So anything you add here as a folder gets destroyed when you reboot.
So, I installed my osmand app to /data/osmand and then used a root terminal to run "chmod -R 777 /data/osmand/" to set permissions to 777 on that folder and all subfolders.
After doing this I was able to get mount manager to mount my cifs share into an empty subfolder in the apps folder tree.
I initially tried changing permissions on /data in case it was needed for folders further down the tree, but it was not needed - which is just as well because again, /data is mounted at boot with 771 permissions, so changes 777 back to 771 after reboot. To change that would involve unpacking the boot image in order to edit the init.rc file and then repacking. I didn't bother it was not required.
If anyone wants mount manager, Google 'ryan conrad mount manager' and take your chance with the apk sites, can't remember whigh site I used!

Categories

Resources