[Q]How to mount directories across SD cards - Android Q&A, Help & Troubleshooting

Okay, this is what I want to do. Under Linux, it would be done via /etc/fstab, but Android has changed some things up.
Certain apps store files and other things on the internal SD card of the RAZR. For example, the Amazon MP3 Cloud player stores all downloaded music files to /sdcard/amazonmp3. There is no way to change this. However, I store all my music on my external SD card. So, what I want to do is create a mount point on the internal sdcard for the /sdcard/amazonmp3 directory that points to a directory on my external sd card (/sdcard-ext/amazonmp3).
That way, when I download music, it will still attempt to save it to /sdcard/amazonmp3 which really is a mount point that points to /sdcard-ext/amazonmp3.
Now, there is an app called FoldersPlug which does this. However, it's not doing it across reboots and it's a little buggy in how it works. I'd rather just fix the /etc/vold.fstab file (if that's possible) to mount my directories for me, but I don't completely understand all the needs to be set up in it.
If I have the following directories set up:
/sdcard/amazonmp3 (this will be empty)
/sdcard-ext/amazonmp3 (this will contain all the files and folder structures that would normally be in /sdcard/amazonmp3)
I want it so that the /sdcard-ext/amazonmp3 directory is mounted to the /sdcard/amazonmp3 directory.
Here is what I see when I run the "mount" command to look at the current mount points that are mounted:
Code:
/dev/block/vold/179:97 /mnt/sdcard/amazonmp3 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:97 /mnt/sdcard/DCIM vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:97 /mnt/sdcard/Pictures vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:97 /mnt/sdcard/Android/data/com.iconology.comics.app vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
These are the mount points that FoldersPlug set up and what I want to do instead is define them in the /etc/vold.fstab file but I don't know how they should be entered into the /etc/vold.fstab file.
Any help would be greatly appreciated!
Thanks!

I may be wrong, but I don't believe Android Vold can mount loopback (bind). You'll have to create a partition on the SD card instead, feeding it to Vold. Then try something similar to;
dev_mount /dev/block/mmcblk0p2 /mnt/sdcard/amazonmp3 /devices/platform/msm_sdcc.2/mmc_host/mmc1
Or if you forget about Vold, and use an ordinary mount;
# mount -o bind /sdcard-ext/amazonmp3 /sdcard/amazonmp3
In this case (bind loopback mount), you don't need it to be a partition.
Maybe the easies way is you just forget about the internal sdcard, replacing /mnt/cdcard with The real McCoy instead.

Cool. Thanks for the help. I see that this would have to be done using busybox, which is cool since I have that installed.
I tested what you stated and yup, that mounts them. So, I guess I'll fool around a little more with the scripts in /etc/init.d and see if I can't get it to work. I might have to do a sleep or something in the script to give the system time to mount the sdcards, but hopefully, this will work.
Thanks again for the tip!
UPDATE:
Well, here's my script but it doesn't seem to work. I have it first check to see if the number of lines returned from doing directory listing on the /sdcard and /sdcard-ext directories are 0. If so, it sleeps for 10 seconds and then tries it again, waiting for the sdcards to be mounted.
Once they are mounted, then I go and mount my directories. However, it doesn't seem to work. I have the script in the /etc/init.d directory and the permissions are set for execution (0777) like the other two scripts in there (98tweaks and S99SuperCharger).
If I go and run the script myself, it works and mounts the directories.
Here is the script. Any other ideas?
Code:
#!/system/xbin/sh
# Check if the SDCARDs are mounted yet.
result="`ls /sdcard/ | wc -l`"
while [ "$result" -eq 0 ]
do
sleep 10
result="`ls /sdcard/ | wc -l`"
done
result="`ls /sdcard-ext/ | wc -l`"
while [ "$result" -eq 0 ]
do
sleep 10
result="`ls /sdcard-ext/ | wc -l`"
done
# The cards are mounted. Now mount the directories
busybox mount --bind /sdcard-ext/DCIM /sdcard/DCIM
busybox mount --bind /sdcard-ext/amazonmp3 /sdcard/amazonmp3
busybox mount --bind /sdcard-ext/Pictures /sdcard/Pictures
busybox mount --bind /sdcard-ext/Android/data/com.iconology.comics.app /sdcard/Android/data/com.iconology.comics.app

Okay. Got it to work finally. I just decided to set it up using ScriptManager instead to run on boot.
Not sure why it wasn't working with the init.d process.

you rock!
iBolski said:
Cool. Thanks for the help. I see that this would have to be done using busybox, which is cool since I have that installed.
I tested what you stated and yup, that mounts them. So, I guess I'll fool around a little more with the scripts in /etc/init.d and see if I can't get it to work. I might have to do a sleep or something in the script to give the system time to mount the sdcards, but hopefully, this will work.
Thanks again for the tip!
UPDATE:
Well, here's my script but it doesn't seem to work. I have it first check to see if the number of lines returned from doing directory listing on the /sdcard and /sdcard-ext directories are 0. If so, it sleeps for 10 seconds and then tries it again, waiting for the sdcards to be mounted.
Once they are mounted, then I go and mount my directories. However, it doesn't seem to work. I have the script in the /etc/init.d directory and the permissions are set for execution (0777) like the other two scripts in there (98tweaks and S99SuperCharger).
If I go and run the script myself, it works and mounts the directories.
Here is the script. Any other ideas?
Code:
#!/system/xbin/sh
# Check if the SDCARDs are mounted yet.
result="`ls /sdcard/ | wc -l`"
while [ "$result" -eq 0 ]
do
sleep 10
result="`ls /sdcard/ | wc -l`"
done
result="`ls /sdcard-ext/ | wc -l`"
while [ "$result" -eq 0 ]
do
sleep 10
result="`ls /sdcard-ext/ | wc -l`"
done
# The cards are mounted. Now mount the directories
busybox mount --bind /sdcard-ext/DCIM /sdcard/DCIM
busybox mount --bind /sdcard-ext/amazonmp3 /sdcard/amazonmp3
busybox mount --bind /sdcard-ext/Pictures /sdcard/Pictures
busybox mount --bind /sdcard-ext/Android/data/com.iconology.comics.app /sdcard/Android/data/com.iconology.comics.app
Click to expand...
Click to collapse
Dude...a little renaming of dirs and i was running. thanx:good:

iBolski said:
Okay. Got it to work finally. I just decided to set it up using ScriptManager instead to run on boot.
Not sure why it wasn't working with the init.d process.
Click to expand...
Click to collapse
Works perfectly

Thanks for your work.
I have a question. Is it possible to create a folder in /mnt/sdcard (for example /mnt/sdcard/myfolder) with a script or automaticly after boot?
What i want is to mount the external SD to this folder (/mnt/sdcard/myfolder) but first you have to create the folder "mysdcard".
But i hope it works with a script only like:
Code:
#!/system/xbin/sh
# The cards are mounted. Now mount the directories
mkdir /mysdcard
busybox mount --bind /sdcard-ext /sdcard/mysdcard
sorry for my english

xoxys said:
Thanks for your work.
I have a question. Is it possible to create a folder in /mnt/sdcard (for example /mnt/sdcard/myfolder) with a script or automaticly after boot?
What i want is to mount the external SD to this folder (/mnt/sdcard/myfolder) but first you have to create the folder "mysdcard".
But i hope it works with a script only like:
Code:
#!/system/xbin/sh
# The cards are mounted. Now mount the directories
mkdir /mysdcard
busybox mount --bind /sdcard-ext /sdcard/mysdcard
sorry for my english
Click to expand...
Click to collapse
sorry my english bad...
if i don't have /etc/init.d directory... can i execute this command in another way?
thanks...
nb:
* modified with debuggerd is not work, my jelly-bean not execute debuggerd on boot
* add script install-recovery.sh on /system/etc is not work too....

Related

[Q] Partition becoming read only?

Hi,
A huge thanks to everyone on this forum for their incredible work. I got my G Tablet a couple of weeks ago and its been running flawlessly.
I ran into an issue a couple of days back with rapid FC's on most of my apps.
I am running VeganTab GE upgraded from the stock ROM, CWM 0.8 and Pershoot's 1.4 GHZ kernel. After facing all the rapid FC'S I decided to do a wipeall and start from scratch. I didn't realize the FC's are being caused due to the partition being read only for some reason.
I have tried everything under the sun to resolve this with no luck.
I tried using NVflash and have followed the instructions to the letter and dont it multiple times. Each time it says its successful yet when I boot in VeganTab takes over and all my settings and apps are still there.
Ive tried using NVflash to load CWM and then flash Cyanogen's ROM 7 as well the TapnTap's stock 3588 all to no avail. None of them will load. I cant delete files on the SD card nor write to it. I cant uninstall or install any apps. Everytime I try to do so, it says its uninstalled or installed and I can use the app, but the next time I reboot, things go back to exactly how they were when I started getting those FC's, almost like a restore point in Windows. Anytime I reboot it goes back to that point in time. I have also tried repartitioning the SD card to every possible combination (2048/0, 2048/256, 2048/128, 4096/256) and everytime it says its successful but nothing has changed. I have tried wipe data/factory resets, wipe Dalvik, format all (boot, cache, system, data). I have even tried the Format All zip floating around but it wont load it saying bad file. (Not a file size mismatch since I have downloaded it multiple times from different sources)
I came across this archived thread from a while back where someone had this issue but I haven't found a solution to it yet. I have followed everything in that thread but nothing seems to work. For the time being, the FC's have seemed to have slowed down but my tablet is stuck in some sorta time warp now since I cant seem to update it anymore.
Any help would be greatly appreciated!
It will be of no help, but in general Linux will knock a file system into read only mode when there are too many write errors to the volume. It could be a hardware defect in your unit doing it, or a corrupted file system. However, it seems you've been doing an NVFlash on it, so that should resolve the filesystem I would think.
Maybe in CW you can format /system and /data and see if that helps?
Edit: I see you did format, sorry. I don't know what to offer
Yup I have tried pretty much everything.
Wondering if anyone has any tips or tricks I might have missed. Surely there must be some way to convert this back into write mode.
What other options could I have?
Try this...it puts an empty file in each partition
http://forum.xda-developers.com/showthread.php?t=974422
Then use bekits nvflash files.
Nvflash is like a low level format. You either have a bad usb cable or your not in APX mode when you run nvflash or you have a bad tab. Make sure you are powering on using Power/Vol- not vol+. It will be a black screen and takes several minutes to run
Ive tried that.
Since the SD card is read only, i cant actually copy the file down to the drive to load.
Is there anyway to load this via microSD?
Can CWM view the microSD card?
Sandyjb, which partition is becoming read-only?--I'm not able to make this out after reading your post.
There are 2 distinct kinds of storage devices on the gTablet. You can see them if you type 'mount' in a Terminal Emulator window. For example, here's the output of mount on my tablet:
Code:
rootfs on / type rootfs (ro,relatime)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /mnt/asec type tmpfs (rw,relatime,mode=755,gid=1000)
tmpfs on /mnt/obb type tmpfs (rw,relatime,mode=755,gid=1000)
/dev/block/mtdblock3 on /system type yaffs2 (ro,relatime)
/dev/block/mtdblock4 on /cache type yaffs2 (rw,nosuid,nodev,relatime)
/dev/block/mmcblk3p2 on /data type ext3 (rw,nosuid,nodev,relatime,errors=continue,data=writeback)
/dev/block/vold/179:25 on /mnt/sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
The output of the mount command may vary slightly depending on whether you get the system mount command or the busybox mount command, but the basic information presented will remain the same. What's of interest to us are the lines beginning with /dev/block/ and the mount flags--the stuff within ().
There are, as you can see, 2 kinds of devices listed
/dev/block/mtdblockn and
/dev/block/mmcblkn
(The /dev/block/vold/n:n is also relevant to this discussion, but, more on this later.)
The /dev/block/mtdblockn device are directly addressable NAND flash devices. These are the only devices that the nvflash utility operates on.
The other type of device, the /dev/block/mmcblkn type, are SD card devices--either internal or external. On the gTablet, the internal SD cards are identified as /dev/block/mmcblk3x, and the external SD cards look like /dev/block/mmcblk2x. The SD card devices cannot be formatted or modified using nvflash. You have to use other tools. The /dev/block/vold/n:n device is also an SD card, but it is mounted (as needed) by the vold program which is why it is named differently.
If your external SD card partitions are read-only, try inserting them into a Windows machine and see if running the SD Formatter mentioned in this thread brings it back to its normal state:
http://micosd-doesnt-work.com/
If the program fixes the card, you can put it back in the gTablet and run ClockworkMod to re-partition it again.
If it is either the internal SD card partitions or the NAND flash partitions that are read-only, then the troubleshooting process is slightly more involved. In any case, send me the output of the mount command on your tablet.
Hi Rajeev.
I dont think I have any issues with my external card ie. microsd. Its the drive marked as sdcard card that I have issues with.
I am not as familiar with the results that came back via the terminal.
Perhaps you can elaborate.
Here is what I got
$mount
rootfs on / type rootfs (ro,relatime)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /mnt/asec type tmpfs (rw,relatime,mode=755,gid=1000)
tmpfs on /mnt/obb type tmpfs (rw,relatime,mode=755,gid=1000)
/dev/block/mtdblock3 on /system type yaffs2 (ro,relatime)
/dev/block/mtdblock4 on /cache type yaffs2 (rw,nosuid,nodev,relatime)
/dev/block/mmcblk3p2 on /data type ext3 (rw,nosuid,nodev,relatime,errors=continue,data=writeback)
/sys/kernel/debug on /sys/kernel/debug type debugfs (rw,relatime)
/dev/block/vold/179:25 on /mnt/sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/block/vold/179:25 on /mnt/secure/asec type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /mnt/sdcard/.android_secure type tmpfs (ro,relatime,size=0k,mode=000)
/dev/block/vold/179:17 on /mnt/sdcard2 type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/block/dm-0 on /mnt/asec/com.rovio.angrybirds-1 type vfat (ro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/block/dm-1 on /mnt/asec/com.tripit-1 type vfat (ro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
$
That mount output looks perfectly normal. You said you were running VEGAnTab-GE. That is a Gingerbread-based ROM, I think, and so should have the SD cards mounted at /mnt/sdcard and /mnt/emmc and not /mnt/sdcard and /mnt/sdcard2.
Whatever the case, I want to check that /mnt/sdcard is writable. So,
1. Can you tell me if there is an /emmc or a /mnt/emmc folder on the tablet. Typing ls -l /emmc /mnt/emmc will do.
2. Try these commands in a Terminal to check if it's an application problem or an OS/hardware problem:
Code:
mkdir /mnt/sdcard/tmp.dir
echo test > /mnt/sdcard/tmp.dir/file.txt
Both commands should succeed if /mnt/sdcard is writable. Next read back the file.txt file:
Code:
cat /mnt/sdcard/tmp.dir/file.txt
should say: test
3. Reboot the tablet and try the cat command again. It should again print: test
4. Remove the directory, and verify that it has gone both before and after a reboot:
Code:
rm -rf /mnt/sdcard/tmp.dir
We'll carry on from here.
Thanks a ton for your help Rajeev!
Here is what I got back after step 2. Seems like everything worked fine there.
$ export PATH=/data/local/bin:$PATH
$ls -l /emmc /mnt/emmc
ls: /emmc: No such file or directory
ls: /mnt/emmc: No such file or directory
$ mkdir /mnt/sdcard/tmp.dir/file.txt
mkdir failed for /mnt/sdcard/tmp.dir/file.txt, No such file or directory
$ mkdir /mnt/sdcard/tmp.dir
$ echo test > /mnt/sdcard/tmp.dir/file.txt
$ cat /mnt/sdcard/tmp.dir/file.txt
test
$
However, after the reboot, it hung up once during restart. After doing another restart, it loaded into Vegantab just fine. The I ran the same command again and this is what I got
export PATH=/data/local/bin:$PATH
$ export PATH=/data/local/bin:$PATH
$ cat /mnt/sdcard/tmp.dir/file.txt
/mnt/sdcard/tmp.dir/file.txt: No such file or directory
$
Didnt do step 4 after that.
Very interesting--it's just like you said: that partition seems to go back in time. If we can't fix this, you should send that SD card to the folks at NASA. They're sure to be interested in an entropy-negating device.
Alright, let's check to see if the other partition on that SD card--/data--exhibits the same problem. Do a reboot, so we can start from a clean slate--I want to see the kernel messages this time when we write to the SD card.
Code:
$ su
# mkdir /data/tmp.dir
# ls -ld /data/tmp.dir
# echo test > /data/tmp.dir/file.txt
# ls -l /data/tmp.dir/file.txt
# cat /data/tmp.dir/file.txt
test
#
Reboot the tablet, and check if the cat command outputs "test" again. But, before you reboot and check, run these commands so you can send me their output. We've written the output to /mnt/sdcard2, so we shouldn't have any disappearing files.
Code:
$ su
# dmesg > /mnt/sdcard2/dmesg.txt
# logcat -d > /mnt/sdcard2/logcat.txt
# ls -l /data > /mnt/sdcard2/ls-data.txt
# ls -l /mnt/sdcard /mnt/sdcard2 > /mnt/sdcard2/ls-sdcards.txt
# cat /system/etc/vold.fstab > /mnt/sdcard2/vold.fstab.txt
Zip up all those text files and attach it to your next post.
[email protected]
Ok here is what I got before the reboot.
$ export PATH=/data/local/bin:$PATH
$su
#mkdir /data/tmp.dir
# ls -ld /data/tmp.dir
drwxrwxrwx 2 root root 1024 May 9 13:15 /data/tmp.dir
# echo test > /data/tmp.dir/file.txt
# ls -l /data/tmp.dir/file.txt
-rw-rw-rw- 1 root root 5 May 9 13:17 /data/tmp.dir/file.txt
# cat /data/tmp.dir/file.txt
test
#
After the reboot:
# cat /data/tmp.dir/file.txt
/data/tmp.dir/file.txt: No such file or directory
And here are the Text files.
Hmm, the external SD card is referred to twice in /system/etc/vold.fstab. Can you try this:
Edit /system/etc/vold.fstab and comment out the last line in it. It looks like this:
Code:
dev_mount sdcard2 /mnt/sdcard/sdcard-ext auto /devices/platform/tegra-sdhci.2/mmc_host/mmc1
Just add a '#' character at the beginning of the line, like so:
Code:
# dev_mount sdcard2 /mnt/sdcard/sdcard-ext auto /devices/platform/tegra-sdhci.2/mmc_host/mmc1
You can edit it on your PC; then put it back on the tablet and reboot. After the reboot, go through the SD card test commands we did earlier.
To edit the vold.fstab file, you'll have to remount the /system partition read-write. If you know how to use adb, try these commands:
Code:
adb pull /system/etc/vold.fstab vold.fstab
[I]Edit the vold.fstab[/I]
adb remount
adb push vold.fstab /system/etc/vold.fstab
Also, after you've run the SD card test commands, run the "dmesg" and "logcat -d" as before and attach their outputs.
Another thing to try: Remove the external SD card (after you've changed vold.fstab) and see if file and directories persist on the internal SD card.
Ok, after editing vold.fstab, loading microSD back in and rebooting, I ran the test commands.
Code:
$ export PATH=/data/local/bin:$PATH
$su
#mkdir /data/tmp.dir
# ls -ld /data/tmp.dir
drwxrwxrwx 2 root root 1024 May 9 23:48 /data/tmp.dir
# echo test > /data/tmp.dir/file.txt
# ls -l /data/tmp.dir/file.txt
-rw-rw-rw- 1 root root 5 May 9 23:49 /data/tmp.dir/file.txt
# cat /data/tmp.dir/file.txt
test
#
After another reboot and running of the same test command
Code:
# cat /data/tmp.dir/file.txt
/data/tmp.dir/file.txt: No such file or directory
Then I ran the the "dmesg" and "logcat -d" as before
Here are the outputs again.
Thanks again....your time in looking at this is much appreciated!
PS - I didn't understand the last line. Internal directories exist on the main drive (SDcard) when the microSD is taken out? I only started using the microSD very recently and the directory structure on the main drive remains intact irrespective.
sandyjb said:
Ok, after editing vold.fstab, loading microSD back in and rebooting, I ran the test commands.
Click to expand...
Click to collapse
I see that you've placed the '#' on the line before the last line. This makes it a no-effect change. You have to comment out the last line--put the '#' at the start of that line. The last line should look like this:
Code:
# dev_mount sdcard2 /mnt/sdcard/sdcard-ext auto /devices/platform/tegra-sdhci.2/mmc_host/mmc1
Thanks again....your time in looking at this is much appreciated!
Click to expand...
Click to collapse
No probs. Actually, I may have good news and bad news for you... but, we'll get to that after you've fixed the vold.fstab file, rebooted, and repeated the tests in post #8, plus these additional commands via adb:
Code:
adb shell lsmod > lsmod.txt
adb shell ps > ps.txt
adb shell find / -name aufs.ko > find-aufs.txt
PS - I didn't understand the last line. Internal directories exist on the main drive (SDcard) when the microSD is taken out? I only started using the microSD very recently and the directory structure on the main drive remains intact irrespective.
Click to expand...
Click to collapse
If you look at that vold.fstab file you sent me, it has a line like this:
Code:
# todo: the secondary sdcard seems to confuse vold badly
After seeing that, I thought it would be best if you removed the external microSD card while you're running the tests. You can put it back in after we're done fixing this.
Ok after making the change to the vold.fstab file, I ran the test again and I got the same error.
$ cat /mnt/sdcard/tmp.dir/file.txt
/mnt/sdcard/tmp.dir/file.txt: No such file or directory
I dont have ADB setup so I cant run those commands. I made the changes to the text file via notepad. Any other way for me to run those commands?
I took out the microsd card and then ran the dmesg and logcat commands. Somehow I feel like I am doing this wrong....
$su
# dmesg > /mnt/sdcard2/dmesg.txt
cannot create /mnt/sdcard2/dmesg.txt: read-only file system
# logcat -d > /mnt/sdcard2/logcat.txt
cannot create /mnt/sdcard2/logcat.txt: read-only file system
#
This error looks right though since there is no microsd card anymore.
Thanks for your patience!
sandyjb said:
Ok after making the change to the vold.fstab file, I ran the test again and I got the same error.
$ cat /mnt/sdcard/tmp.dir/file.txt
/mnt/sdcard/tmp.dir/file.txt: No such file or directory
Click to expand...
Click to collapse
The vold.fstab looks OK now. Incidentally, I just downloaded VEGAn-GE-7.0.0-RC1-Harmony-signed.zip and checked the pristine vold.fstab inside it. Your original file is exactly the same as the official one. So, it looks like I've been barking up the wrong tree in this case. Oh, well...
I dont have ADB setup so I cant run those commands. I made the changes to the text file via notepad. Any other way for me to run those commands?
Click to expand...
Click to collapse
Since we're able to store files on /mnt/sdcard (the internal SD card), at least until the next reboot, just use /mnt/sdcard/ instead of /mnt/sdcard2 in the command lines. You can use the Terminal Emulator for now to run the commands if you don't have adb set up. But, we'll have need of adb soon, so you should get it set up if you can: http://forum.xda-developers.com/showthread.php?t=902860
Questions:
1. You are running VEGAn-TAB 7.0.0 RC1 (aka VEGAn-TAB Ginger Edition), correct?
2. Do you have ClockworkMod installed? And if so, which version? Ideally it should print this when you're in it: ClockworkMod Recovery v2.5.1.1-bekit-0.8. This seems to be the safest CWM for our gTablets according to the posts on the board.
3. You have tried the standard techniques to fix the SD card problem? Namely,
a) In CWM, formatted the internal SD card again (CWM > advanced > Partition Internal SD card).
b) Ran Fix Permissions (CWM > advanced > Fix Permissions)
4. Do you have anything of value on the internal SD card (/mnt/sdcard), because we might have to blow it away completely soon (or, atleast try to ). So, back up the stuff from /mnt/sdcard to /mnt/sdcard2.
You can insert the external SD card (/mnt/sdcard2) back into the tablet and move, not copy, the stuff from /mnt/sdcard into /mnt/sdcard2. We're doing a test along with backing up your sdcard data. After you move your files and folders, check that they are no longer present in /mnt/sdcard. Then shutdown, remove the external SD card, reboot back into VEGAn 7.0.0-RC1 and again check if the stuff you moved has indeed disappeared from /mnt/sdcard.
But, before you do all this, send me the output I requested in post #14.
5. Your gTablet is not a refurbished or second-hand piece, right? Because, I see a difference in the make of the internal SD card between your tablet and mine.
Here's the relevant portion of the difference in kernel messages (the dmesg output) between your tablet and mine:
Code:
- mmc1: new high speed SDHC card at address 1234
- mmcblk2: mmc1:1234 SA16G 14.8 GiB
- mmcblk2: p1
- mmc2: new high speed SDHC card at address aaaa
- mmcblk3: mmc2:aaaa SE16G 14.8 GiB
+ mmc1: new high speed SDHC card at address aaaa
+ mmcblk2: mmc1:aaaa SU16G 14.8 GiB
+ mmcblk2: p1 p2
+ mmc2: new high speed MMC card at address 0001
+ mmcblk3: mmc2:0001 MAG4EM 14.9 GiB
The lines prefixed with '-' are from your kernel; the ones prefixed with '+' are mine. We can skip the lines which mention "mmcblk2"--this is the external SD card. The lines containing "mmcblk3"--which is how the Linux kernel names these SD cards (MMC block devices as the name suggests)--are interesting because they refer to the internal SD card. I, and 2 other people I've talked to on the board, have the same internal SD card: MAG4EM 14.9 GiB, which is an MMC card. You, however, have a different internal SD card: SE16G 14.8 GiB, which is a SDHC card instead of a MMC card.
So, you have a slightly different kind of gTablet as far as the internal SD card goes. However, from what I've been able to find out, SDHC cards are (normally) freely inter-changeable with MMC cards, so I'm not sure if this is the cause of your problems. But, keep this in mind anyway.
1. You are running VEGAn-TAB 7.0.0 RC1 (aka VEGAn-TAB Ginger Edition), correct? YES.
2. Do you have ClockworkMod installed? And if so, which version? Ideally it should print this when you're in it: ClockworkMod Recovery v2.5.1.1-bekit-0.8. This seems to be the safest CWM for our gTablets according to the posts on the board. YES. Version 0.8.
3. You have tried the standard techniques to fix the SD card problem? Namely,
a) In CWM, formatted the internal SD card again (CWM > advanced > Partition Internal SD card). YES. Pretty much every trick there is on the forums, I have tried. Multiple times at that.
b) Ran Fix Permissions (CWM > advanced > Fix Permissions) YES
4. Do you have anything of value on the internal SD card (/mnt/sdcard), because we might have to blow it away completely soon (or, atleast try to ). So, back up the stuff from /mnt/sdcard to /mnt/sdcard2.
You can insert the external SD card (/mnt/sdcard2) back into the tablet and move, not copy, the stuff from /mnt/sdcard into /mnt/sdcard2. We're doing a test along with backing up your sdcard data. After you move your files and folders, check that they are no longer present in /mnt/sdcard. Then shutdown, remove the external SD card, reboot back into VEGAn 7.0.0-RC1 and again check if the stuff you moved has indeed disappeared from /mnt/sdcard. Nope, nothing I care about it on the SDcard. I have tried to manually format it using nvflash, accessing it via USB and just hitting delete on the PC. I even tried to do what you mentioned about, move the file over. It said it successfully did it and the file wasnt present when I checked, but open rebooting, as usual it went back in time.
But, before you do all this, send me the output I requested in post #14.
Here are the attachments from running it on the SD CARD. I will try and get ADB setup as well.
Also, no, I dont believe this is a refurb. I ordered it off Amazon and there it was specified as new.

[Q] SDCard Script

Can someone post the script that mount sdcard at boot?
I created a kernel but it doesn't mount sdcard at boot, it's possibile to create the script in system/etc/init.d that mount sdcard at boot?
Try busybox mount while booted to see if it's possible to mount SD Card with a script. SD card mounts automatically if it's FAT32 and it takes a little vold.fstab configuration for other file systems. You should check franco's or LG's kernel to see how to automount sd card from kernel.
This is taken from CM7, put it in init.d and see.
Turducken said:
This is taken from CM7, put it in init.d and see.
Click to expand...
Click to collapse
Thank you very much but what's that?
# set property with exit code in case an error occurs
setprop cm.e2fsck.errors $e2fsk_exitcode;
if [ "$e2fsk_exitcode" -lt 2 ];
then
# mount and set perms
$BB mount -o noatime,nodiratime,barrier=1 -t ext3 $SD_EXT_PART $SD_EXT_DIRECTORY;
if [ "$?" = 0 ];
then
$BB chown 1000:1000 $SD_EXT_DIRECTORY;
$BB chmod 771 $SD_EXT_DIRECTORY;
log -p i -t mountsd "$SD_EXT_DIRECTORY successfully mounted";
else
log -p e -t mountsd "Unable to mount filesystem for $SD_EXT_DIRECTORY!";
fi
else
log -p e -t mountsd "Unable to repair filesystem, disabling apps2sd";
fi
Click to expand...
Click to collapse
EDIT: Mount This script sdcard?
#!/system/bin/sh
mount -o remount,ro -t yaffs2 /dev/block/mmcblk0
Click to expand...
Click to collapse
RE-EDIT: The CM7 script doesn't works, in the second reboot the sd wasn't mount
The CM7 script mounts a2sd apps (apps2sd script). The second one should be like
Code:
mount -o remount,r[b]w[/b] -t [b]fat32[/b] /dev/block/mmcblk0
. As I already said, it's probably a kernel problem, vold mounts sdcards automatically.
Cricco said:
Thank you very much but what's that?
Click to expand...
Click to collapse
That part of the script mounts an ext partition if one exists.
RE-EDIT: The CM7 script doesn't works, in the second reboot the sd wasn't mount
Click to expand...
Click to collapse
As Ianis G. Vasilev said there are various ways to mount the SD card but I suspect the issue is with the kernel you've compiled. Flash francos, if it mounts then your kernel is bad. Run logcat to see what's going on.
**EDIT**
I didn't see Ianis post before I began mine...
so with
mount -o remount,rw -t fat32 /dev/block/mmcblk0
Click to expand...
Click to collapse
the sd will be mount?
EDIT: I need a script that mount sd without write or read permission, infact if i use root explorer and I go to sdcard sometimes the sdcard folder is blank, so the sd didn't mount
Read permissions are needed to see what's on the sd card. For a read-only mount replace rw with ro:
Code:
mount -o remount,r[b]o[/b] -t fat32 /dev/block/mmcblk0
I would advice you to use dmesg(should be enabled in kernel) to see if your phone detects the card and logcat to see if any errors are preventing your card from mounting.
Now i create script
#!/system/bin/sh
mount -o remount,rw -t fat32 /dev/block/mmcblk0
mount -t vfat -o /dev/block/mmcblk0
Click to expand...
Click to collapse
is it correct?

[Q] Unable to change permissions or delete a specific file WITH root

Hello Gentlemen. Sorry to disturb you with a noob question but I cannot solve it for the life of me and I have tried everything I could find on the forums. I have an Aluratek Cinepad AT107F. I have successfully rooted it. I have full super user permissions and I have no problems deleting any files or folders EXCEPT one directory. Let me explain the situation.
I recently did a firmware update and it included brand new APKs for Youtube, also added Google Play Support, and added Angry Birds.
I am unable to update Youtube to the latest version. It gives a "Package file was not signed correctly. Uninstall the previous copy of the app and try again.".
So I attempted to do just what it had asked. I rooted just to do this. I tried removing it with Titanium Backup, I tried Root Uninstaller, I tried Root Explorer, I tried deleting using the "adb shell rm" command. I still get a "Read-only file system".
Even though I have root and granted root access to Root Explorer, I am unable to change the permissions for this /oem/apps/ directory. It's on the top level of the internal memory. I have no external SD card.
I've spent 10+ hours trying to figure this out and I'm sure someone knows something that I don't and can fix this super easy. I'm asking for your help, you're my only hope!
Your issue is that the update gave you modded files that the OEM doesn't want deleted. Most likely do to them not have permission from Google to do so. You will be hard pressed to find help here as we mainly deal with official releases and apks.
Wayne Tech S-III
zelendel said:
Your issue is that the update gave you modded files that the OEM doesn't want deleted. Most likely do to them not have permission from Google to do so. You will be hard pressed to find help here as we mainly deal with official releases and apks.
Wayne Tech S-III
Click to expand...
Click to collapse
Am I in the wrong sub forum? Is there another forum at XDA-Developers that could help?
Vindicoth said:
Am I in the wrong sub forum? Is there another forum at XDA-Developers that could help?
Click to expand...
Click to collapse
No nowhere on the site really deals with unofficial android versions and knock of devices. Your best bet will be the OEM
Read the error message again. The file is on a read-only filesystem. That is why you cannot delete it. In other words, you lack permission to write to the partition.
System partitions get mounted readonly to prevent modification. To remount /system as read-write,
Adb shell mount -o remount,rw /system
If you get "not permitted" error, your ROM's ro.secure means you cannot execute mount operations passed with adb command. So instead you must first open the shell,
> AdB shell
# mount -o remount,rw /system
Now you can delete:
Adb shell rm /system/file
If it is a directory
Adb shell rm -rf /system/dir
If you accidentally mistype that last command with a space beyween that first forward-slash and "s" you will have a very unworkable device....and that's why it is mounted read-only.
If the file is on a different read only filesystem, identify the partition the file is on and
Adb shell mount -o remount,rw /dev/block/id /LocToMountTo
You may have to specify the type
-t fstype
Adb shell mount
will tell you this
Don't forget to remount it as read-only (ro) when you are done
anotherguy19 said:
Read the error message again. The file is on a read-only filesystem. That is why you cannot delete it. In other words, you lack permission to write to the partition.
System partitions get mounted readonly to prevent modification. To remount /system as read-write,
Adb shell mount -o remount,rw /system
Now you can delete:
Adb shell rm /system/file
If it is a dir
Adb shell rm -rf /system/file
If you accidentally mistype that last command with a space beyween that first forward-slash and "s" you will have a very unworkable device....and that's why it is mounted read-only.
If the file is on a different read only filesystem, identify the partition the file is on and
Adb shell mount -o remount,rw /partition/id /folder
You may have to specify the type
-t fstype
Adb shell mount
will tell you this
Don't forget to remount it as read-only (ro) when you are done
Click to expand...
Click to collapse
Well I can access /system just fine. The problem is the /oem/apps folder is not in the /system folder. It's in the top level folder.
/system and /oem/apps are in the root directory. I can change the permissions on /system just fine using Root Explorer, but when trying to change the permissions using any method possible, /oem wont change.
This happens alot on Devices out of China and other places that sell knock offs. They make it so you cant delete their apps and if you do then it bootloops which only a reflash will fix.
Vindicoth said:
Well I can access /system just fine. The problem is the /oem/apps folder is not in the /system folder. It's in the top level folder.
/system and /oem/apps are in the root directory. I can change the permissions on /system just fine using Root Explorer, but when trying to change the permissions using any method possible, /oem wont change.
Click to expand...
Click to collapse
/system and /oem are different partitions then
mount | grep oem
or
adb shell mount | grep oem
Will tell you what /dev/block/xxxx the /oem is on and if it is mounted as read-only (ro)
> adb shell
# mount -o rw,remount /oem
zelendel said:
This happens alot on Devices out of China and other places that sell knock offs. They make it so you cant delete their apps and if you do then it bootloops which only a reflash will fix.
Click to expand...
Click to collapse
Ever get the feeling that you're writing in invisible ink lol?.. Eventually he will listen! You have great patience!
zelendel said:
This happens alot on Devices out of China and other places that sell knock offs. They make it so you cant delete their apps and if you do then it bootloops which only a reflash will fix.
Click to expand...
Click to collapse
Referencing zelendel's post, the device could fail to boot because it is looking for the removed app in /oem
So you could try to remove it from being referenced by the startup scripts.
Try doing a search for files that could be referencing the apk you want to remove.
> adb shell
# grep -r AppName.apk /system/etc
CtrlAltDelIrl said:
Ever get the feeling that you're writing in invisible ink lol?.. Eventually he will listen! You have great patience!
Click to expand...
Click to collapse
If it bootloops then I'll just flash it again, but its worth a try isn't it? Thanks anyways.
anotherguy19 said:
Referencing zelendel's post, the device could fail to boot because it is looking for the removed app in /oem
So you could try to remove it from being referenced by the startup scripts.
Try doing a search for files that could be referencing the apk you want to remove.
> adb shell
# grep -r AppName.apk /system/etc
Click to expand...
Click to collapse
Thank you for your very helpful posts and willingness to help me possibly bootloop my device
when I type the grep command it says it is not found, so I will download busybox onto my tablet and try those commands.
Vindicoth said:
Thank you for your very helpful posts and willingness to help me possibly bootloop my device
when I type the grep command it says it is not found, so I will download busybox onto my tablet and try those commands.
Click to expand...
Click to collapse
So after running mount | grep oem it shows this
[email protected]:/ # mount | grep oem
/dev/block/nandi /oem cramfs ro,relatime 0 0
So is it possible to change this directory to rw? I tried the mount -o rw,remount oem but it doesnt show anything after i input the command
[EDIT]
So it seems that the cramfs file system is read-only.
Vindicoth said:
Thank you for your very helpful posts and willingness to help me possibly bootloop my device
when I type the grep command it says it is not found, so I will download busybox onto my tablet and try those commands.
Click to expand...
Click to collapse
I love breaking things. It's only then we can figure out how it works.
Busybox is exactly what you need.
grep will search for strings within all files and subdirs of /system/etc; matching whatever you type for "AppName.apk"
It is a case-sensitive search unless you add
-i
So
grep -ri ....
or
grep -r -i....
Both would work.
But you don't even know if you need to be searching for a file to modify.
You may want to go ahead and delete the file and reboot.
If it fails, note the file(s) you deleted and know the system is looking for them and then proceed with seeing if you can identify a file in /system/etc that is looking for it's presence.
---------- Post added at 11:59 PM ---------- Previous post was at 11:53 PM ----------
Vindicoth said:
So after running mount | grep oem it shows this
[email protected]:/ # mount | grep oem
/dev/block/nandi /oem cramfs ro,relatime 0 0
So is it possible to change this directory to rw? I tried the mount -o rw,remount oem but it doesnt show anything after i input the command
[EDIT]
So it seems that the cramfs file system is read-only.
Click to expand...
Click to collapse
Commands that complete "quietly" mean they were successful.
If you type
# mount | grep oem
After
# mount -o rw,remount /oem
/dev/block/nandi /oem cramfs ro,relatime 0 0
Should have changed to
/dev/block/nandi /oem cramfs rw,relatime 0 0
anotherguy19 said:
I love breaking things. It's only then we can figure out how it works.
Busybox is exactly what you need.
grep will search for strings within all files and subdirs of /system/etc; matching whatever you type for "AppName.apk"
It is a case-sensitive search unless you add
-i
So
grep -ri ....
or
grep -r -i....
Both would work.
But you don't even know if you need to be searching for a file to modify.
You may want to go ahead and delete the file and reboot.
If it fails, note the file(s) you deleted and know the system is looking for them and then proceed with seeing if you can identify a file in /system/etc that is looking for it's presence.
---------- Post added at 11:59 PM ---------- Previous post was at 11:53 PM ----------
Commands that complete "quietly" mean they were successful.
If you type
# mount | grep oem
After
# mount -o rw,remount /oem
/dev/block/nandi /oem cramfs ro,relatime 0 0
Should have changed to
/dev/block/nandi /oem cramfs rw,relatime 0 0
Click to expand...
Click to collapse
Followed those steps and its still
/dev/block/nandi /oem cramfs ro,relatime 0 0
Apparently the cramfs is a read only filesystem by design.
Vindicoth said:
Followed those steps and its still
/dev/block/nandi /oem cramfs ro,relatime 0 0
Apparently the cramfs is a read only filesystem by design.
Click to expand...
Click to collapse
You need to create an image of the partition, mount the partition on a system with tools to edit it, extract the contents, and re-create the cramfs.
You would need a linux box or linux virtual machine like Virtualbox, or maybe cygwin has the tools. I would just download and burn a Linux LiveISO and run it from VirtualBox, creating a shared folder to get access to the image file (oem partition).
With debian system, you would do
# apt-get install cramfsprogs fusecram
fusecram allow you to mount the cramfs partition on Linux PC via
# mount -t loop cramfsOEM.partition /mnt/workingdir
However since we cannot simply mount the filesystem on the device by plugging into the usb port of the linux machine and mounting from there, we must first create an image (file) of /dev/block/nandi.
> adb shell
# dd if=/dev/block/nandi of=/nandi.img bs=4k
And then copy it to our pc so we can work with the file.
# exit
> adb pull /nandi.orig.img .
Now we can transfer this file to a machine with the requisite cramfs tools to modify the file.
If you look back, I wrote
# mount -t loop cramfsOEM.partition /mnt/workingdir
replace cramfsOEM.partition for nandi.orig.img, or whatever you named it.
Workingdir needs to exist, so
# mkdir /mnt/workingdir
Now you will have to look up cramfsprogs which will allow you to extract the contents to modify. On the Debian or Ubuntu linux machine "/mnt/workingdir" would be the equivalent of "/oem" on your Android device.
However, all this is could very well be for naught, as it is likely the firmware has marked this partition as "signed" so if we try to write back our modified image, the system will fail to boot since the size will be different. On the other hand, the firmware may very well just check to see the partition size is correct. And since you are decreasing the size, the new cramfs image created with a linux box will (should) fit in the old partition.
Fyi, an image file is like a zip file without the compression.
After you modify the cramfs, you can write it back with something like
> adb push cramfs.mod.img /
> adb shell
Then write over the old partition. However, you shouldn't write over a mounted file system so
# umount /dev/block/nandi
Then write over it.
# dd if=/cramfs.mod.img of=/dev/block/nandi bs=4k
Then reboot
# shutdown -r now
And see what happens.
anotherguy19 said:
You need to create an image of the partition, mount the partition on a system with tools to edit it, extract the contents, and re-create the cramfs.
You would need a linux box or linux virtual machine like Virtualbox, or maybe cygwin has the tools. I would just download and burn a Linux LiveISO and run it from VirtualBox, creating a shared folder to get access to the image file (oem partition).
With debian system, you would do
# apt-get install cramfsprogs fusecram
fusecram allow you to mount the cramfs partition on Linux PC via
# mount -t loop cramfsOEM.partition /mnt/workingdir
However since we cannot simply mount the filesystem on the device by plugging into the usb port of the linux machine and mounting from there, we must first create an image (file) of /dev/block/nandi.
> adb shell
# dd if=/dev/block/nandi of=/nandi.img bs=4k
And then copy it to our pc so we can work with the file.
# exit
> adb pull /nandi.orig.img .
Now we can transfer this file to a machine with the requisite cramfs tools to modify the file.
If you look back, I wrote
# mount -t loop cramfsOEM.partition /mnt/workingdir
replace cramfsOEM.partition for nandi.orig.img, or whatever you named it.
Workingdir needs to exist, so
# mkdir /mnt/workingdir
Now you will have to look up cramfsprogs which will allow you to extract the contents to modify. On the Debian or Ubuntu linux machine "/mnt/workingdir" would be the equivalent of "/oem" on your Android device.
However, all this is could very well be for naught, as it is likely the firmware has marked this partition as "signed" so if we try to write back our modified image, the system will fail to boot since the size will be different. On the other hand, the firmware may very well just check to see the partition size is correct. And since you are decreasing the size, the new cramfs image created with a linux box will (should) fit in the old partition.
Fyi, an image file is like a zip file without the compression.
After you modify the cramfs, you can write it back with something like
> adb push cramfs.mod.img /
> adb shell
Then write over the old partition. However, you shouldn't write over a mounted file system so
# umount /dev/block/nandi
Then write over it.
# dd if=/cramfs.mod.img of=/dev/block/nandi bs=4k
Then reboot
# shutdown -r now
And see what happens.
Click to expand...
Click to collapse
Wow that was very detailed. I thought I might have to do something like that. Thanks so much again. I'll try this in the morning since it's getting very late here. I'll go ahead and download a linux livecd tonight.

[Q] Error in init.d script

Hi,
My today goal is to swap internal memory with SD card on HTC Desire 310, and I almost accomplished that, because at this moment I need to send command trough adb to get this working:
So ADB and
Code:
su
busybox mount -t vfat -o umask=0000 /dev/block/vold/179:97 /mnt/sdcard
so now I need to create init.d script to swap internal memory with SD card at boot, I've tried something like that:
Code:
#!/system/bin/sh
mount -t vfat -o umask=0000 /dev/block/vold/179:97
script location /system/etc/init.d/04swapsd, and this script does nothing even I tried to add 'busybox' before 'mount' - zero changes.
SManager app gives me 'Device or resource busy' error
Can anyone help me with my problem?
Thanks!
meciu99 said:
Hi,
My today goal is to swap internal memory with SD card on HTC Desire 310, and I almost accomplished that, because at this moment I need to send command trough adb to get this working:
So ADB and
Code:
su
busybox mount -t vfat -o umask=0000 /dev/block/vold/179:97 /mnt/sdcard
so now I need to create init.d script to swap internal memory with SD card at boot, I've tried something like that:
Code:
#!/system/bin/sh
mount -t vfat -o umask=0000 /dev/block/vold/179:97
script location /system/etc/init.d/04swapsd, and this script does nothing even I tried to add 'busybox' before 'mount' - zero changes.
SManager app gives me 'Device or resource busy' error
Can anyone help me with my problem?
Thanks!
Click to expand...
Click to collapse
Try this: https://www.youtube.com/watch?v=nWN0tOSPFv4
It should work fine!
in this tutorial I can expand RAM memory, but this is I dont want to do.
I have about 800MB left in internal storage - and I cant install big games like Asphalt 8, and because of that I want to create script to automatically swap internal with external memory.
I've tried already apps like Internal 2 External SD, Link2SD, DirectoryBind, FolderMount.

How to auto mount cleanly a partiton on boot

I have a second partition on my SDCARD at /dev/block/mmcblk1p2, all I want to do is ensure that it is always mounted as /storage/sdcard0/mount seems simple I can do it in 5 second on Linux, on Android, it seems impossible I can try to add a hack, but that is lost every-time I update the ROM. There has to be some simple way to do it, that I'm missing. The best I have is to load up a terminal emulated su to root and run: mount -t ext4 /dev/block/mmcblk1p2 /storage/sdcard0/mount
Now in theory, the following would work but for 2 things:
mkdir /storage/sdcard0/mount
su - root -c 'mount -t ext4 /dev/block/mmcblk1p2 /storage/sdcard0/mount'
But for the fact the Android's su does not understand -c so that is out. as well as the fact that non-root users (u0_a216 in my case) can not access /storage/sdcard0.
All I want is a simple way to ensure that this is always mounted where I want it when I need it, yet this simple task is nearly impossible it appears on Android, so why is that?
The issue here is that the fat32 partition does not support large files so I need a separate partition that does such as ext4, in reality if the external sdcard could just be ext4 there would be no issues, and it would be faster, but that is Android for you.
Any suggestions?
Thanks,
ERIC
Insert mount script to init.d folder...
via XDA Premium
Ok, I have this mostly working with juicessh and tasker now for now
I have 2 shell scripts:
mountDev.sh:
Code:
mkdir /storage/sdcard2
chmod 777 /storage/sdcard2
mount -t ext4 /dev/block/mmcblk1p2 /storage/sdcard2
umountDev.sh
Code:
umount /storage/sdcard2
rmdir /storage/sdcard2
In Tasker I have 2 tasks defined:
I'm using the JuiceSSH plugin to open a terminal to localhost I then execute:
To Mount:
Code:
su -l --shell=/system/bin/sh --command='cd /storage/sdcard0 ; sh ./mountDSev.sh ; exit' ; exit
To umount:
Code:
su -l --shell=/system/bin/sh --command='cd /storage/sdcard0 ; sh ./mountDSev.sh ; exit' ; exit
I then created 2 icons, 1 for each operation on the home screen. I also created a Device Boot event to automatically execute and mount the task.
This works, mostly, however even though it is root, sometimes I get errors such as /storage/ is readonly, which makes no sense since it could create the directory at boot, but can not remove the directory later on, since it is readonly. Its a minor thing currently, but annoying.
The benefit of this is it is easy to transfer between ROM images and devices without worrying about it being wiped out every-time I update. In theory it also works without init.d support being enabled. Down side is it you need Tasker and the JuiceSSH plug-in so it costs money.
Hope this helps others.
ERIC

Categories

Resources