Related
many of you, including me, may find that it's time consuming to rebuild the kernel even for minor changes to init.rc, or to modify the init itself. with this small tip, you can change the init process on boot time and perhaps to perform different init processes easily.
reminded and inspired by sztupy's work, i change the whole init for easy customization and be able to let the init to process in a more dynamic way (for the term 'dynamic', it's borrowed from the internet - dynamic and static internet web pages)
let's start
the original file structure on the root looks like this (extracted):
init.rc
init
where init will be processed on boot time, and init.rc will be read to create dir/mount and services, etc
with dynamic init, the root will look like (sample):
init --> myinit.sh
init.original
myinit.sh
the original init is moved/renamed to init.original, with a symlink created named init pointing to a shell script or program, in this case, myinit.sh. a sample myinit.sh looks like this (u need to have a busybox resides on /sbin in this case):
#!/sbin/busybox sh
mount -t ext2 -o rw,noatime,nodiratime /dev/block/stl9 /system
mount -t rfs -o rw,noatime,nodiratime /dev/block/stl9 /system
/system/scripts/init/myinit2.sh
exec /init.original
###end###
in this example, the /system will be mounted, by attempt to mout it as ext2 first (it wont mount if /system is not in ext2), followed by mounting it as rfs. note that only one mount command line will be succeessfully performed here (PS -o remount is needed for remounting the system, so no need to worry the system will be mounted as ext2 first, and then mounted again as rfs).
i also added a file called myinit2.sh under /system/scripts/init/ (you can choose other dir but make sure u've mounted it), which contains some commmands you want to perform like a while loop, etc (becareful, if a infinite loop is used in myinit2.sh, append a "&" at the end to run it in background, so it will look like:
/system/scripts/init/myinit2.sh &
and finally, call init.original (if you wish)
the reason i call it dynamic is, the original init can be replaced or generated base on certain criteria in myinit.sh or myinit2.sh. below is an example which the original init is completely replaced in myinit2.sh:
#!/sbin/busybox sh
mount -o remount,rw rootfs /
rm /init.rc
rm /init.original
ln -s /system/scripts/init/myinit.rc /init.rc
ln -s /system/scripts/init/myinit /init.original
### end
since root is mounted as rw, the original init and init.rc can be removed and link to your own init and init.rc
that's it! you can now modify init and init.rc without the need to recmpile the kernel again
some possible usages:
- add/remove/modify services contained in init.rc
- change the filesystem for specific mount point in init.rc like switching from rfs to ext2 or jfs
- remove repeating dir creations in init.rc, and much more..
hope this help!
PS do it at ur own risk
Have you tried this? I don't think it's going to work without 'mknod' before doing the mounts.
RyanZA said:
Have you tried this? I don't think it's going to work without 'mknod' before doing the mounts.
Click to expand...
Click to collapse
Yes.
I don need mknod
Hello everyone. I see a lot of very basic android questions floating around the forums, so I figured I'd give a VERY basic rundown of the android filesystem for those who don't know. (If you're even slighty experienced, this'll seem like a "duh" thread, you should skip this. This is for new people.)
Ok, to understand android, first thing you need to understand are the basic partition structures. There are 5 android partitions.
boot
cache
recovery
system
data
Before I get into the partitions, you'll have to understand what a mount point is. When you "mount" a drive, you are making it available to the system. On linux (and by extension, android), you need to have a mount point. This is a directory somewhere that serves as a path for the mounted filesystem. So for example, let's say I wanted to mount mmcblk0p1 to a temp directory to edit it. For this example I'll create a directory /data/temp. Now you'd mount mmcblk0p1 /data/temp. When you read the contents of the directory temp under the directory data, you'll see all the info stored on mmcblk0p1. Even something as simple as a flash drive needs to be mounted under linux. If you're an ubuntu user, usually it automounts to /mnt/name of device.
Now, when you boot android, the first thing it does is boot up the linux kernel (when you see the tmobile splashscreen, that's when the kernel is loading.) Next, it loads up the ramdisk. Both of these files are on the boot partition. (When you open up a cwm zip file, you'll see boot.img in there, that's where these reside.) There are two files on the boot partition. zImage (the linux kernel), and initrd.gz (the cpio archive containing the ramdisk.)
What is the ramdisk you ask? Well, very simply, it's the place where the root file system is loaded, and where the init.rc resides. The init.rc is the android startup script (again, basic analogy). If you'd really like to learn about android and how it works, this is the first file I'd start reading.
On to the partitions:
boot - Described above, containing the zimage and initrd.gz
recovery - this is where either the stock recovery or clockwork recovery is located. This is only accessed when entering recovery mode.
cache - You guessed it, this is where some parts of android cache it's file. (Not to be confused with the dalvlik cache, that's located on the data partition.)
system - this is where the system is located. (Esentially the rom you're flashing.)
data - this is the partition where all your installed apps go, as well as the location of a couple parts of the system, like the dalvik-cache and the batterystats.bin file. (Quite a few more, just givinig examples.)
So what does all this mean to you? Well, I see a LOT of people asking about wipes before installs, or asking about flashing kernels, this is why I took the time to explain this.
When you enter cwm, and do a backup, it creates 5 .img files on your sdcard. (One for each of the partitions mentioned above.) When you flash a kernel, it only replaces the boot.img, and a couple files in the system folder. Usually these are kernel modules like the wifi module, and any other modules that aren't compiled into the system. (Although most kernel builders build cifs.ko and all that right into the kernel so the modules aren't needed.)
When you flash a rom, it will always replace the /system and /boot partitions. The rest, that depends on the rom. If you'd like to know what your rom is doing, open up the cwm zip file, and go to meta-inf/com/google/android and you'll see 2 files. Updater-script and update-binary. Updater-script will tell you what it does on install. (You'll see it mounting the partitions it needs, what it does and doesn't format, and also it does a whole bunch of simlinks.) Simlinks, or symbolic links, are either files or directories that point to somewhere else. For example, let's say you are a user who uses ext-sd. What you do is create a simlink for /data that points to the ext3 partition on your sdcard. This way, anytime the system goes to /data it writes somewhere else. Most of the simlinks created in android are more for busybox commands, but that's for another post
If you'd like to see what your mount points are, from an android terminal emulator (or of course adb, but if you are experienced with adb chances are you don't need any of this info in the first place ), type mount. (You might need to type su first, hit enter, then mount). This will list all your mount info. If you'd like to know the actual device name of the mount point, you'd look here. On ours, for example, it's:
mmcblk0p24 is /system
mmcblk0p26 is /cache
mmcblk0p25 is /data
and so on.
Ok, finally, a couple other questions I see often:
Why does my system "hotboot"?
When a system hotboots, it means that zygote has crashed. This is the virtual machine that android runs in. So if you are using your phone, and you all of a sudden go back to the boot animation (NOT the splashscreen with the kernel logo), you just hot-booted. When an application allows you to hotboot all it does is the following command from inside linux: pkill zygote (or pkill -9 zygote).
How do I calibrate my battery?
The batter calibration is a file called batterystats.bin. This is located in /data/system. When you get to 100% charge, if you delete this file, it'll start over on the battery calibration. (There are also market apps to do this for you for the squeamish.)
Other notable files:
gps.conf
Located in the /system/etc folder. This has all the gps configuration, nameservers, and things like this.
build.prop
Located in /system
A lot of device info is stored in here. For more info, google it.
Hopefully this wasn't too mashed together and confusing. I tried to follow a logical order, but I've had way too much turkey and beer today, so I'll post this and let it fly.
Have a happy thanksgiving everyone!
Good stuff, thanks OP.
Powered by the SGSII....
Very very useful for someone like me who knows a bit here a bit there but not sure of the whole picture.
Thanks!!
this should be useful for alot of noobs!
Thanks so much for this, being new to android this is incredibly useful. Bookmarking!
Sent from my SGH-T989 using xda premium
This thread should help alot of new people that just joined this forum and that are new .
Very informative, thank you.
So here's the thing i've been exploring the possibilities of USBHost and decided to try an usb stick so i installed Paragon https://play.google.com/store/apps/details?id=com.paragon.mounter
It took me a while to get the hang of things. At first my usbstick was formatted in fat32. I specified in paragon i would like the default mount point to be USBStorage instead of /paragonNTFS. I made a small typo at first and named the folder usbStorage
now here comes the problem.
for some reason the app created 2 subfolders called sdb1 and sdb2 and i cannot remove them
Things i've tried:
cyanogenmod file manager in root access mode
-- delete directory > "This operation needs elevated permissions. Try switching to root access mode" (translated from dutch so wording may be a bit off
-- modifying permissions of folders > denied > changing permissions failed. for security reasons some filesystems, such as on sdcards do not allow changing permissions
Same problem for Astro file manager
Same problem when attaching the tablet to computer. parent directory (and sub dirs) get "removed" in windows but when checking the file system on the tablet, the opposite is true and the directories is still present
and now it's starting to piss me off. I want that folder "usbStorage" and it's subfolders "sdb1" and "sdb2" removed. so my guess is it'll have to be done by terminal commands but my terminal experience is ZERO.
in preperation of you guys helping me installed https://play.google.com/store/apps/details?id=jackpal.androidterm the same one used in cyanogenmod roms. I tried a bit of tinkering myself but prob doing something wrong
what i've tried (in sequence, --ok behind the command means it was succesfully executed)
su --ok
cd sdcard --ok
*rm -rf /usbStorage >> *rm: not found
rm -rf /usbstorage --ok, but folder was still present
rm -rf usbstorage --rm failed for usbStorage, Directory not empty
cd usbStorage --ok
rm -rf sdb1 --ok, rm failed for sdb1, Permission denied
at that point i gave up. I hope you guys can help me out
I do have paragon configured properly now and my USBstick in NTFS is getting recognised. Upon mounting of the usbstick, it now creates a folder called "USBStorage" where the contents of the usb stick is properly displayed.
so where are those android terminal / linux masters to help me out
only thing i can add is that when opening paragon with the stick attached but unmounted i do see a line above it /dev/block/sda1 but that doesn't seem to affect mounting in the specified directory
Bump, anyone? I want and need this folder removed
Verstuurd vanaf mijn Nexus 7 met Tapatalk
From my understanding of your post.
You are rooted and using cyanogenmod?
Did you try going into the app information and clear data?
In the app drawer hold the app and then drag it to App Info
Clear data.
Did that solve it? If not continue below.
Make sure you don't have the USB stick mounted and or plugged in.
Then go into terminal and type
su
Then type.
mount
The mount command shows all listed mount points. If you don't see the usbStorage or whatever mounted.
Then type.
busybox rm -rf usbStorage
Or whatever the main directory is...
For example directory is at.
/sdcard/usbStorage
cd /sdcard
rm -rf usbStorage
Let me know how you make out.
Sent from my Galaxy Nexus using xda app-developers app
nope, my phone is running CM 10.2 (not relevant to the question) this is the nexus section and its my nexus 7 2013 running stock rom but rooted yes that needs the folders removed.
The folders i need to delete according to the Nexus 7 mount main mount path SD content
main path: /storage/emulated/0 or /storage/emulated/legacy (both are the same according according to ParagonNTFS as a folder the mount path /sdcard/USBStorage = /storage/emulated/0/USBStorage or /storage/emulated/legacy/USBStorage
important lines?
/dev/fuse /storage/emulated/0/ fuse rw,nosuid,nodev,realtime, user_id=1023, default_permissions,allow_other 0 0
/def/fuse /storage/emulated/legacy fuse rw,nosuid,nodev,relatimeuser,user_id=1023, group_id=1023,default_permissions,allow_other 0 0
folders to delete are
/storage/emulated/0/usbStorage
/storage/emulated/0/usbStorage/sdb1 <= can select these just fine
/storage/emulated/0/usbStorage/sdb2
/storage/emulated/0/ParagonNTFS <= simply selecting this folder prompts CM manager "this operation needs elevated priviledges. Try switching to rootmodus, even when the CM filemanager already is in root mode
so i went
Opening terminal
su
cd sdcard (command ok)
cd usbStorage (commando ok)
busybox rm -rf sdb1
rm: can't remove 'sdb1': permission denied
Then i tried
cd /sdcard
rm -rf usbStorage
rm failed for usbStorage, Directory not empty
cd usbStorage
rm -rf sdb1
rm failed for sdb1, Permisison denied
busybox rm -rf sdb1
rm: can't remove 'sdb1': Permision denied
According to Cyanogen mod file manager:
Filesysteminfo:
Status: rw
linkpath?: /storage/emulated/0
Device: /dev/fuse
Type: fuse
Options: rw,nosuid,nodev,relatime,user_id=1023,default_permissions,allow_other
Dump / Pass: 0 / 0
even with the app ParagonNTFS uninstalled it doesnt work
hmm
try
close the app ParoganNTFS and uninstall it.
then try to delete those directories.
Also when you type
mount
does it show any of the directories you are trying to delete as mounted?
if it is try
umount /sdcard/usbStorage/sdb1
rm -rf /sdcard/usbStorage/sda1
were you able to delete the dir?
I had the same problems under very similar circumstances. Stickmount rather than paragon. The only way I could delete the dir was to boot into recovery (team win recovery project v2.7.1.1) and delete it with TWRP's terminal command. Something in the OS apparently locks on to the mount and simply will not let it go ever. It has to be done before android starts. It's very annoying. I am beginning to really be disgusted with many of the decisions google is making with regard to android. Why do they hate sdcard expansion so much? its absurd.
---------- Post added at 04:22 AM ---------- Previous post was at 04:17 AM ----------
Oh and by the way, even though the OS latched on to that folder as if its very existence depended on it, I was never able to even see the files on the USB memory stick with any file explorer. Worked just fine in kit kat and before. In some ways lollipop really sucks.
SM-T705, cf-autoroot (incl. SuperSU) checked with root-checker, platform.xml adapted
e.g. if I want to copy /dev to my sdcard ... there comes a message similar to "copying went wrong ... 4.4+ .... in non-root mode some limitations ..."
I won't search for you, please have a read through Q&A and General for a number of other similar questions and corresponding answer I would suggest you please contact a Mod to delete this unneeded thread
Sorry I searched and read a lot of older suggestions but did not get a clue ... and I know about the kitkat probs regarding SD (platform.xml). But still dont understand, why there are just few folders affected ...
So sorry but it seem I need a Little push into the right direction
+1 solid explorer has struggled for me, but root explorer hasn't. Seems to be only certain directories. ...idk
just to make shure - we are talking about Root Explorer (File Manager) non free app. Did you try to copy System dirs like /dev ??
if yes, where to did you copy them. I just figured out that my ext3 partition (1st=exFat, 2nd=ext3) on the SD is mounted to /data/sdext2.
but copying /dev to /data/sdext2 doesnt work either
Could someone please tell me how to Mount /mnt RW
some folder cant be copy. the only way for you to have those are extracting it from the original firmware.
THX - 2 Pprobs now
1
mount -o remount rw /System worked, but still
[email protected]:/ # mkdir /mnt/extSD2
mkdir failed for /mnt/extSD2, Read-only file System
a) with Root Explorer it seemed to work, but was gone after restart ?
b) where to mount my ext3 SDcard partition (1st exfat, 2nd ext3)
c) can I do it by modifying init.rc, universal5420.rc or fstab.goldfish ...
2 how to extract Folders from Firmware files like T705XXU1ANF7_T705DBT1ANF1_T705XXU1ANF7_HOME.tar
I extracted the files within. But how can I Mount those Image files on W8 (ext2fs does not work with my sdcard) ?
2nd best would be to go to my Linux PC (but I'm a Linux DAU) ...
try learn about kitchen or use this software on windows... ^_^ http://sourceforge.net/projects/ext2read/
sorry my english is not good enough ... kitchen seems to be a Linux tool ... this seems to be a good start http://www.modaco.com/topic/366230-tools-useful-tools-for-tinkerers/ or this http://www.diskinternals.com/linux-reader/
Best use OSFMount to Mount the *.img and "Paragon ExtFS for Windows" to view the files
mount -o remount rw /System worked, but still
[email protected]:/ # mkdir /mnt/extSD2
mkdir failed for /mnt/extSD2, Read-only file System
a) with Root Explorer it seemed to work, but was gone after restart ?
b) where to mount my ext3 SDcard partition (1st exfat, 2nd ext3)
c) can I do it by modifying init.rc, universal5420.rc or fstab.goldfish ...
mounting system.img does not work
del
It's my first relevant post in here so please be benevolent and friendly to me .
Hello everyone,
After long hours of roaming around on the internet, Moto forums, PowerAMP forums (you wouldn't believe how many people posted this problem in there), huge exchange of emails and debugs to the Nexus Media Importer dev, and checking out many many topics here on XDA, I finally came across the only way to use an USB-OTG pendrive as a music library, and having Android detect it (through the Media Service) and build the music library for other media apps to use.
tl dr; Problem: You wanted loads of music without wasting precious internal memory. You tried using an USB pen but no mp3 apps were able to find the files, nor stickmount, nor whatever.
This is so far the only way to do this on android Marshmallow.
Believe me, I've tried almost everything one can do, including using the Nexus Media Importer, Stickmount, OTG Helper, etc (spoiler alert, none of these worked).
Why is this happening, you ask? Well, Google changed things on Android 6.x.x so much regarding filesystems and USB support that full read/write on USB OTG with other apps no longer works, although I've never tested on previous versions of Android. But I finally managed to find a way to do it, and here I intend to share it with you guys.
Requirements - Rooted phone and permissive SELinux (what is that and how do I do it? don't worry, it's easy and I'll explain a bit later)
1st step - Verify that your phone is capable of using USB-OTG. If it is not, check on play store for other apps that supposedly can enable USB Host support on your phone, although I've never tried them because I never needed, so I can't say anything. My phone is a Moto X 2014 and it comes with OTG support embedded.
2nd step - Format your pendrive as NTFS. This is very important because...
If you use your pendrive as Fat32, Android will mount it to a folder in /data/media_rw/blablabla with GID and UID 1023 (media_rw), which most apps don't have permissions to access, thus they won't be able to find your pendrive and build a music library. Why? Well, glad you asked...
...Since Fat32 doesn't support the linux permissions system, Android mounts the pendrive with the FUSE fs wrapper, which cloaks a permission system hard-coded into some file in the Android system that I wasn't able to tell how could I modify it in order to set the pen permissions as 777 root root.
You can do so by plugging your pen on a Windows PC and right clicking -> Format. Remember to backup your data, otherwise you will lose everything. Your pen will still be able to be used on Windows pcs and Macs. You could also use other fileformats...
... like EXT4 or f2fs or exFAT or whatever, but do it at your own risk. I have no idea if those would work, despite them being able to use the linux permission system.
3rd step - Install the wonderful app Paragon HFS and NTFS mounter from appstore or whatever. They say it isn't compatible with marshmallow but it is, the only issue is that it can't mount a pendrive automatically but it's very easy to do it manually. In the settings menu, you can set SELinux as permissive. Since I'm not an android dev, only an ambicious amateur, I can't really explain what it does or what happens when you do that. So far, neither me or my phone died because of that, so.
Oh by the way, whenever you insert the pen , Android will say it's corrupted and ask you to format it. DO NOT DO IT! That happens because Android doesn't natively support NTFS (hence using an external app to solve that). Oh, and since we're talking about that, there is a way for Android to natively support NTFS...
..., just search it up on XDA. Beware that it's outdated and it won't work on Marshmallow either, unless you edit the copymodulecrc script, but that goes beyond my knowledge. For now, stick to the plan.
4th step - You need to choose the folder which you want to mount the pen to, which will be a folder in the root Android folder (I chose /pen so that I wouldn't forget)
You are now probably thinking, "That's insane! You need to edit init.rc in order to do that!" Well, you're kinda right, but there is a workaround for that. Why do I do this? Well...
... if you mount the pen in another random folder such as /storage/emulated/0/pen it won't work because all the folders underlying that one have certain permission issues that don't let other media apps be able to search for music files.
So here I'll show you two ways of accomplishing this.
4.1 Editing init.rc - This is very complex and NOT RECOMMENDED unless you're very comfortable with messing with boot files. PLEASE DO NOT DO THIS if you aren't sure of what you're doing, don't tell me I didn't warn you.
So in order to do this, well, I won't explain it to you. Search it up on the internet, it's very complex and too big for me to post here. But in the end what you want to do is edit the init.rc file, adding two lines:
"mkdir /pen" and "chmod 777 /pen".
4.2 Creating a script that runs on boot - This is the one method I recommend since it's harmless, but you have to install yet another app, that allows you to run scripts at boot. I used script manager. Then create a script that mounts the / folder as rw, creates the folder /pen, chmods it to 777. I used the following:
#!/system/bin/sh
su -c mount -o rw,remount /proc /
su -c mkdir /pen
su -c chmod 777 /pen
I tried other mount -o commands with rootfs instead of /proc but they didn't work. I don't know the difference but I hope it's harmless. Anyways, let's move on.
Run the script to see if it works, and to create the folder. Use a rooted file explorer to verify if the folder was created.
5th step - Reboot your phone if you had to set SELinux as permissive, and type on the Terminal "su -c getenforce" to confirm that your SELinux is permissive.
VERY IMPORTANT - On the Paragon app, open settings and disable FS access rights, otherwise it's the same as mounting a Fat32 pendrive - not what we want.
On the Paragon app, choose the folder we created before as the folder to mount the pen to, and mount the pendrive. If you followed all the previous steps correctly, the app won't have any issues mounting the pen.
6th step - Find a way to enforce Android building a media library with the new files in the USB OTG pendrive. There are many ways to do this and I recomment the one I used, but I will tell you other ways.
I used the app jetAudio which is a media player that can also forceably build a media library. On jetAudio settings menu, press "Rebuild media library" and point to the /pen folder. It will start reading all the files and Android now detects your pendrive as a media library.
Another way would be to use an app called FolderMount, and creat a symlink from the /pen to another folder in your emulated SD storage (you know, the only folder you have access to if you're not rooted), and wait for some time until hopefully Android detects your new music. If you don't want to use FolderMount, do a symlink with another method (like the ln command)
EDIT - Another cool way I found elsewhere on StackExchange is to run this command (through a script or whatever):
am broadcast -a android.intent.action.MEDIA_MOUNTED -n com.android.providers.media/.MediaScannerReceiver (-d file:///pen)
which forces Android to run a media scan. The part on parenthesis is optional, you can use it to choose the folder in which Android runs the media scan.
Hurray! Congrats for reaching this part of the post. If you did everything correctly, all media apps will finally be able to find the files. I posted some screenies to orientate you.
Feel free to ask anything and I will try to answer or explain. Remember that I'm no Android dev so my knowledge is limited. Feel free to thank me, if you want too.
reserved post
Why so compilcated? USB-OTG is supported on the fly by Android 6.0 / Marshmallow, but unfortunately most of the N7-kernels have a bug which lead to reboot on unmounting the OTG-Device. Nevertheless the next version of Android 6 AOSP on Grouper should have it fixed this issue ...
AndDiSa said:
Why so compilcated? USB-OTG is supported on the fly by Android 6.0 / Marshmallow, but unfortunately most of the N7-kernels have a bug which lead to reboot on unmounting the OTG-Device. Nevertheless the next version of Android 6 AOSP on Grouper should have it fixed this issue ...
Click to expand...
Click to collapse
It's not as straight-forward as you're saying.
Most media player apps that weren't updated to support Android 6's native USB OTG support will not be able to read a pen's contents. This topic that I made is aimed to circumvent the issue by mounting the pen in a different way. That bug you mentioned is not something I want to solve, and even if a new kernel solved the issue that I'm talking about, most manufacturers wouldn't update their devices...
Ok, you may be right with apps which are not yet updated to support Marshmallow, I didn't check that.
gaferreira13 said:
It's not as straight-forward as you're saying.
Most media player apps that weren't updated to support Android 6's native USB OTG support will not be able to read a pen's contents. This topic that I made is aimed to circumvent the issue by mounting the pen in a different way. That bug you mentioned is not something I want to solve, and even if a new kernel solved the issue that I'm talking about, most manufacturers wouldn't update their devices...
Click to expand...
Click to collapse
Oh, and maybe now that I think of it, this could solve the problem, since mounting/unmounting is done with the Paragon app instead of Android. Give it a shot
AndDiSa said:
Why so compilcated? USB-OTG is supported on the fly by Android 6.0 / Marshmallow, but unfortunately most of the N7-kernels have a bug which lead to reboot on unmounting the OTG-Device. Nevertheless the next version of Android 6 AOSP on Grouper should have it fixed this issue ...
Click to expand...
Click to collapse
Using native otg function, you can only copy files between phone and otg dive. To open a file e.g. To install apk from otg, you have to first copy it to phone's storage. On many media player, video can only be played sequentially (seek bar doesn't work).
Stuck at step 4.2, folder is not created
kashinath said:
View attachment 3746340Stuck at step 4.2, folder is not created
Click to expand...
Click to collapse
Hey, is there any way for you to determine the path of your root folder? Maybe using ES File Explorer. For some phones, the root folder isn't pointed to /.
EDIT - If you can't do that, try replacing the first of those commands with the following:
su -c mount -o rw,remount,rw /system
I'm also getting the same issue as kashinath, won't let me create pen. I've also tried pointing the mounter to a directory in /storage/emulated/0/pen but it seems to just crash and restart the app.
EDIT:
Okay so I've solved the problem completely differently. The otg storage is found in /mnt/media_rw, so I used the app "FolderMount [ROOT]" to point the folder "pen" (in the internal storage) to the /mnt/media_rw/*random string* folder. I then used the app "media.Re.Scan:" to force the media scanner to scan that folder as it didn't seem to want to do it. Now all apps seem to be working.
What tipped me off about this was this post: http://forum.xda-developers.com/nexus-6/help/marshmallow-usb-otg-mounting-media-t3230588
It seems you have to turn the folder mount on/off every time you plug/unplug the USB drive otherwise it won't play the files.
Thanks for the detailed instructions nonetheless.
Viridis said:
I'm also getting the same issue as kashinath, won't let me create pen. I've also tried pointing the mounter to a directory in /storage/emulated/0/pen but it seems to just crash and restart the app.
EDIT:
Okay so I've solved the problem completely differently. The otg storage is found in /mnt/media_rw, so I used the app "FolderMount [ROOT]" to point the folder "pen" (in the internal storage) to the /mnt/media_rw/*random string* folder. I then used the app "media.Re.Scan:" to force the media scanner to scan that folder as it didn't seem to want to do it. Now all apps seem to be working.
What tipped me off about this was this post: http://forum.xda-developers.com/nexus-6/help/marshmallow-usb-otg-mounting-media-t3230588
It seems you have to turn the folder mount on/off every time you plug/unplug the USB drive otherwise it won't play the files.
Thanks for the detailed instructions nonetheless.
Click to expand...
Click to collapse
Yeah forget mounting anything in the /storage/emulated/0...
According to the post you linked in your comment, "6.0 mounts to /mnt/media_rw/ but I can't seem to get any media players to see it. I tried creating a symbolic link in /storage/emulated, but I get an error with root explorer about symbolic links not being supported" which is exactly what happened to me
If you don't like the folder mount alternative you can always do a bind command (but i'm not sure how it works), search it up and see if you get any results.
Is your pen in Fat32 though?
There is a workaround for the pen thing... If you use Total Commander and want to edit any files in /, it asks you to run a command that mounts the / folder. Try to see what command it is and replicate it into the script, then the rest might work.
Thank you so much !! It worked on my XT1033 falcon dual sim - MM6.0 identity crisis 1.3a . I can finally restore all my nandroid backups.
Just to correct shouldn't the last command in the script be
su -c chmod 777 /pen
instead of
su -c chmod /pen 777
4k5blr said:
Just to correct shouldn't the last command in the script be
su -c chmod 777 /pen
instead of
su -c chmod /pen 777
Click to expand...
Click to collapse
No, thank you
And, damn you're right, lol I'll correct it ASAP, thanks a lot for pointing it out
I'm a complete newbie at this, in fact I rooted my device just to do this
Anyways I'm getting the same issue kashinath is getting and tried the other command you recommended (su -c mount -o rw,remount,rw /system ) wich also didn't work
In that reply you also said that the root folder is different between devices so, if I determine the path to my root folder, where exactly in the script do I have to put it? (Again I'm a newbie)
Arcane35 said:
I'm a complete newbie at this, in fact I rooted my device just to do this
Anyways I'm getting the same issue kashinath is getting and tried the other command you recommended (su -c mount -o rw,remount,rw /system ) wich also didn't work
In that reply you also said that the root folder is different between devices so, if I determine the path to my root folder, where exactly in the script do I have to put it? (Again I'm a newbie)
Click to expand...
Click to collapse
For my phone the Root folder's path is "/" so I'll put 2 arrows where the path to root is in the command:
" su -c mount -o rw,remount /proc --> / <-- "
So imagine your root path is /root
The command would look like this: " su -c mount -o rw,remount /proc /root " (without "" of course)
If you still can't find the path to your root folder, try searching on the internet "root folder for xxxxx phone"
Hope it helps
gaferreira13 said:
For my phone the Root folder's path is "/" so I'll put 2 arrows where the path to root is in the command:
" su -c mount -o rw,remount /proc --> / <-- "
So imagine your root path is /root
The command would look like this: " su -c mount -o rw,remount /proc /root " (without "" of course)
If you still can't find the path to your root folder, try searching on the internet "root folder for xxxxx phone"
Hope it helps
Click to expand...
Click to collapse
Turns out my phone's root folder is also / , and I'm still getting the same error (mount: '/' not in /proc/mounts)
Maybe its because I have Nougat :/
EDIT: So I think I managed to kinda work around that, I change the command to " su -c mount -o rw,remount / " and it ended up making the pen folder and no errors came out. So I then proceeded to open Paragon, disabled FS access rights, ensured that SELinux was permissive (it is) and change the mount point to the /pen folder, I finally proceeded to manually mount the thing BUT even tough that in my notifications says that I mounted it, on the app it still says that my Flash Drive is still not mounted (even tough it detects it and know that it is an NTFS file system). Basically whenever I try to mount my Flash Drive it wont work even tough the app detects it.
Arcane35 said:
Turns out my phone's root folder is also / , and I'm still getting the same error (mount: '/' not in /proc/mounts)
Maybe its because I have Nougat :/
Click to expand...
Click to collapse
Ooooh. Remember the topic is called "Full USB OTG on Media Players in Marshmallow"
I can't help you then, sorry. The only thing I can tell you is to open the /proc/mounts file as text on the top there should be a command that tells android to mount the root folder as rootfs I believe.
Maybe that could help.
Arcane35 said:
EDIT: So I think I managed to kinda work around that, I change the command to " su -c mount -o rw,remount / " and it ended up making the pen folder and no errors came out. So I then proceeded to open Paragon, disabled FS access rights, ensured that SELinux was permissive (it is) and change the mount point to the /pen folder, I finally proceeded to manually mount the thing BUT even tough that in my notifications says that I mounted it, on the app it still says that my Flash Drive is still not mounted (even tough it detects it and know that it is an NTFS file system). Basically whenever I try to mount my Flash Drive it wont work even tough the app detects it.
Click to expand...
Click to collapse
Try to open the /pen folder, try to see in the properties of /pen if the permissions are set to 777.
gaferreira13 said:
Try to open the /pen folder, try to see in the properties of /pen if the permissions are set to 777.
Click to expand...
Click to collapse
It is set as 0777, so yes (if the 0 is not supposed to be there)
Arcane35 said:
It is set as 0777, so yes (if the 0 is not supposed to be there)
Click to expand...
Click to collapse
Hmm... If you can open the folder fine and maybe create a file in there or something then I can't help you any further. The paragon app doesn't let you do much regarding troubleshooting.
Try using the methods that other people did like using Foldermount or something like that.