apps see the cifs mountpoints as either empty directory or read-only - General Topics

I have created a cifs mountpoint on the internal sdcard (sdcard0) as below:
Code:
su -c 'busybox mount -t cifs //192.168.x.x/sdcard /storage/sdcard0/Network-Shares/RouterSD -v -o user="admin",pass=xxxxx'
The problem is that apps see the mountpoint (RouterSD) as an empty folder; this is while the mountpoint has been created successfully; and I can browse its contents (even write to it) via X-plore or other file managers.
As a new try, instead of internal sdcard, I've used external sdcard (sdcard1), that is formatted as NTFS (I am on CyanogenMod 11 with built-in NTFS support), for creating that mountpoint, as below:
Code:
su -c 'busybox mount -t cifs //192.168.x.x/sdcard /storage/sdcard1/Network-Shares/RouterSD -v -o user="admin",pass=xxxxx'
This time, apps can browse the content of that mountpoint; but they cannot write to it. However, this not a problem with file managers as they can browse and write to it!
I've posted this problem in many forums to no avail; please help.

Related

using the internal memory as a virtual sdcard

I managed to break my micro sd card in half today and I wasn't able to pickup a class 10 or 6 replacement locally so I thought I could use some of the 6gb of internal memory as a virtual filesystem to get me out of trouble.
So, after quickly looking at the android docs and the supported busybox commands I created a 2gb sdcard.img in /data and mounted to /sdcard. I copied some files to it with astro filemanager and fired up raging thunder 2 and it went ahead and downloaded the game data to /sdcard/ and worked correctly.
But, a few apps won't recognise it as an sdcard (Motorola SD card and phone storage settings applet) as well as things like PlayPro (states I have no sdcard present). I thought perhaps I could modify the /etc/vold.fstab file to auto mount the sdcard.img I created using vi but I'm a bit clueless as to what I should change on the dev_mount /sdcard line to get it automounted at boot and hopefully fool the rest of the apps into thinking it is a physical sdcard.
Can anyone possibly point me in the right direction? Not sure how to invoke cmd mode in vi using the milestone qwerty either but I'll keep digging.
What I did (roughly), maybe I'm going about it wrong but any advice would be appreciated.
1. rooted device
2. installed the free terminal app from the market
3. fired up the terminal shell
4. su
5. dd if/dev/zero of=/data/sdcard.img bs=1024 count=1 seek=2000000
6. busybox mkfs.vfat /data/sdcard.img (didn't seem to support -F 32)
7. busybox mount -o loop /data/sdcard.img /sdcard/
+ 1 for this, it would be great to can use internal storage for user data
Why do you let this nice post die.. so "flibbulator" found anything more out?.. I'd like to know more.. like if you got it to work with Music Players and Video players??
Try to mount /data/sdcard.img to /mnt/sdcard (/sdcard is a link to /mnt/sdcard)
or try "export EXTERNAL_STORAGE /sdcard"
I made in a different way: created a 4GB storage.img in /data and mounted it in /sdcard/storage, so internal storage is finally usable for user data
the problem was to set mount point on boot, I can't find a way to execute a script on boot (you can't permanently modify init.rc)
flibbulator said:
What I did (roughly), maybe I'm going about it wrong but any advice would be appreciated.
1. rooted device
2. installed the free terminal app from the market
3. fired up the terminal shell
4. su
5. dd if/dev/zero of=/data/sdcard.img bs=1024 count=1 seek=2000000
6. busybox mkfs.vfat /data/sdcard.img (didn't seem to support -F 32)
7. busybox mount -o loop /data/sdcard.img /sdcard/
Click to expand...
Click to collapse
I have actually tried this on my Droid2Global, and I get the error "unknown operand if/dev/zero" I feel like I am missing the point or do not fully understanding how to use the "dd" command?
the correct syntax is:
dd if=/dev/zero of=/data/sdcard.img bs=1024 count=4194340
4194340 --> 4GB
patton82 said:
the correct syntax is:
dd if=/dev/zero of=/data/sdcard.img bs=1024 count=4194340
4194340 --> 4GB
Click to expand...
Click to collapse
Thank you bro.
Quick question I keep getting these errors. I do have a folder in "/" named "sdcard-int"
Better Terminal Emulator Pro
/ # busybox mount -o loop /data/sdcard.img /sdcard-int/
mount: can't setup loop device: No such file or directory
/ # busybox mount -o /data/sdcard.img /sdcard-int
mount: can't read /etc/fstab: No such file or directory
/ #
Sent from my DROID2 GLOBAL using Tapatalk
you can't place anything in root folder, /sdcard is a link to /mnt/sdcard and is created by init.rc (you can't edit init.rc, it's provided by boot.img, so need to extract from boot.img and repack)
I made in this way but I have to manually execute a script or a command from terminal after every boot to mount storage.img
mkdir /sdcard/storage
su
dd if=/dev/zero of=/data/storage.img bs=1024 count=4194340
busybox mkfs.vfat /data.storage.img
mount -o loop -t vfat /data/storage.img /sdcard/storage
Will be lost anything after reboot when use this storage?
Sent from my MotoA953 using XDA App
all the stuff in img file will not be lost, as long as you put it in /data/
on the contrary the mount point must be restored after reboot
patton82 said:
you can't place anything in root folder, /sdcard is a link to /mnt/sdcard and is created by init.rc (you can't edit init.rc, it's provided by boot.img, so need to extract from boot.img and repack)
I made in this way but I have to manually execute a script or a command from terminal after every boot to mount storage.img
mkdir /sdcard/storage
su
dd if=/dev/zero of=/data/storage.img bs=1024 count=4194340
busybox mkfs.vfat /data.storage.img
mount -o loop -t vfat /data/storage.img /sdcard/storage
Click to expand...
Click to collapse
Thank you, I will use the Thank you button when I login via PC.
I still get the same error, I know that I'm doing something incorrectly or maybe I don't understand "mount" comment correctly?
/ $ su
/ # mkdir /sdcard/storage
/ # dd if=/dev/zero of=/data/storage.img bs=1024 count=41943404194340+0 recordsn
4194340+0 records out
4295004160 bytes (4.0GB) copied, 339.823883 seconds, 12.1MB/s
/ # busybox mkfs.vfat /data/storage.img
/ # mount -o loop -t vfat /data/storage.img /sdcard/storage
mount: can't setup loop device: No such file or directory
/ #
I am using my sdcard also, I'm not too sure if that makes any difference?
Sent from my DROID2 GLOBAL using Tapatalk
Better terminal pro uses BASH shell, I presume
try to switch to android shell, in preferences
or to use terminal emulator (free) from market
Okay, I tried Android Terminal Emulator, and this is a new error.
export PATH=/data/local/bin:$PATH
$ $ su
# mount -o loop -t vfat /data/storage.img /sdcard/storage
ioctl LOOP_SET_FD failed: Device or resource busy
#
Not too sure where to go now. I thank you again for all your help, and time.
Sent from my DROID2 GLOBAL using Tapatalk
resource busy, you have to reboot the phone
I use Gscript lite, add a script with the string
mount -o loop -t vfat /data/storage.img /sdcard/storage
and create a shortcut to homescreen, so when I reboot, I can mount the img file in one click
Cool mod for my ROM. Could I take it??
sure, they are simple shell commands
the best would be to do what happen with Samsung Galaxy S: internal storage mounted as sdcard and physical sdcard mounted in a folder /sdcard/sd
storage.img is 3-4 times faster than my peak 8GB class 6
There is an application "Autostart" in the market, which can automatially execute a script with root after boot up.
I up because I'm now also interested in making profit of the huge internal storage. I'd like to put my wikipedia data from wikidroyd to the internal storage. Hopefully I'm skilled enough to follow the given steps...I doubt that though
fKngFtd said:
Okay, I tried Android Terminal Emulator, and this is a new error.
export PATH=/data/local/bin:$PATH
$ $ su
# mount -o loop -t vfat /data/storage.img /sdcard/storage
ioctl LOOP_SET_FD failed: Device or resource busy
#
Not too sure where to go now. I thank you again for all your help, and time.
Click to expand...
Click to collapse
Guys, I need your help! I have exactly. The same problem:
Every time I try to mount my storage.img I get
Ioctl LOOP_SET_FD failed: Device or resource busy.
I rebooted several times and also tried to mount smaller images (first I tried 3gb then I tried 1mb).
Any solution?
Edit: I solved it myself. I always forgot to punch in busybox before the command. Now it worked for me!!
I do have a question now. With help of Gscript I made a shortcut to mount the storage.img to my sdcard. But my pc wont recognise the sdcard as long as the image is mounted. What is the command to unmount the partition so I wouldnt have to reboot my phone before connecting it to the pc...?
Any help is much appreciated! Thx
(Something like busybox unmount -o loop -t vfat...?)
Sent from my MotoA953 using XDA App

[HOWTO] Copy/Move files TO/FROM internal memory/SD Card (Root & SU Needed)

Install Root Explorer and grant it Super User permissions. It appears Super User permissions is the key to writing to the SD card.
With SU permissions, Root Explorer can create/mv/delete/etc files/directories on the SD card. More importantly, Root Explorer also allows copying/moving files between the sd card and internal memory.
If you allow terminal emulator to have SU powers, you can delete (RM) files, move (MV) files (only within the SD card), create (MKDIR) and delete (RMDIR) directories from the command line within terminal.
I found that Astro couldn't create/delete/copy files because it didn't have SU powers on my Xoom. (How do you get Astro into the Super User app list?)
In terminal emulator on my Xoom
cat proc/mounts returns the following
/dev/block/vold/179:1 /mnt/external1 vfat rw,dirsync,relatime,uid=1000,gid=1023,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
Doesn't this mean that the SD card should be RW to all apps?
this is my problem as well ....
Why do u need root to write to SD card???
This is crazy
Interesting issue. I hadn't noticed until you pointed it out, and as you state, it doesn't make sense.
Thread moved to QA. Hopefully someone can figure out why.
Also, there's no way to give ASTRO root. The app has to be coded to request SU access.
Actually, the issue is with the fmask=0702, as that masks out write capability from the permissions. Use the following to remount as RW:
adb shell or any other terminal emulator to get to a shell on the xoom
su to get to the # prompt
umount /mnt/external1
mount -t vfat -o fmask=0000,dmask=0000,rw /dev/block/platform/sdhci-tegra.2/mmcblk0p1 /mnt/external1
That remounts the sdcard without using vold, which is enforcing a mask on the permissions.
I was thinking about writing a script/widget to remount it easily, but I don't know if it's a waste of time...
ekarelis said:
Actually, the issue is with the fmask=0702, as that masks out write capability from the permissions. Use the following to remount as RW:
adb shell or any other terminal emulator to get to a shell on the xoom
su to get to the # prompt
umount /mnt/external1
mount -t vfat -o fmask=0000,dmask=0000,rw /dev/block/platform/sdhci-tegra.2/mmcblk0p1 /mnt/external1
That remounts the sdcard without using vold, which is enforcing a mask on the permissions.
I was thinking about writing a script/widget to remount it easily, but I don't know if it's a waste of time...
Click to expand...
Click to collapse
Can you use vold with a different fmask/dmask?
shobirama said:
Can you use vold with a different fmask/dmask?
Click to expand...
Click to collapse
I didn't see a way to do it in the /etc/vold.fstab file, which is where I assume it goes. I just did this as a work around.

HTC Sensation, Cyanogenmod 9.1, /sd-ext Encryption with Cryptsetup

Having encrypted /data, I'd been interested in encrypting the SD card, either in full, or a full partition. As a new poster to xda, posting without citing reference links does prove a bit more challenging, but here goes:
Given an HTC Sensation, rooted, with Cyanogenmod 9.1 (ICS), and Clockwork Recovery, I partitioned (thru Clockwork) the SD card into FAT32, ext, and swap. Your milage may vary on the next step, but using Fedora, I accessed the SD card, deleted the ext partition, and recreated as an encrypted partition, type ext4. (read up on cryptsetup for alternative ways to create this) For the sake of this post, we'll use the password, "ChangeMe".
I installed LUKS Manager from Google Play, which provides lm.cryptsetup, a renamed binary of Guardian Project's cryptsetup. I didn't use LUKS Manager's implementation of creating encrypted folders, instead, the whole sd-ext partition has been encrypted.
To mount the device at startup, I have the script 99sd-extLUKinit, located at /system/etc/init.d/
#!/system/bin/sh
# Not quite sure what these do, but kept them in
sync;
setprop lk.filesystem.ready 1;
# Remount the root file system to allow changes
mount -o remount,rw rootfs /
# Create the mount point and create a symbolic link
mkdir /mnt/sd-ext
ln -s /mnt/sd-ext /sd-ext
# Decrypt the SD card via cryptsetup, device resides on /dev/block/sd-ext
# Hopefully prompt user for password, but for now, echoed in
echo ChangeMe | lm.cryptsetup luksOpen /dev/block/mmcblk1p2 sd-ext
# Clean errors
e2fsck -y /dev/mapper/sd-ext
# Mount the SD Card via cryptsetup block device
mount -t ext4 -o noatime,nodiratime,barrier=1 /dev/mapper/sd-ext /mnt/sd-ext/
# Remount the root file system to prevent changes
mount -o remount,ro rootfs /
Once verified that the system will automount the encrypted ext4 /mnt/sd-ext partition:
ls /sd-ext
should return with lost & found directory
I moved /data/app and /data/app-private to the encrypted partition:
cp -a /data/app /sd-ext/app
rm -r /data/app
ln -s /sd-ext/app /data/app
cp -a /data/app-private /sd-ext/app-private
rm -r /data/app-private
ln -s /sd-ext/app-private /sd-ext/app-private

Ascend G6 L11 -- use whole internal memory for apps+data

Note: This is probably only helpful for people with a computer science or linux hacking background!
We all know the single biggest issue with this phone is the lack of internal memory for apps and app data. The internal partitioning looks like this:
/system 1 GB
/data 2 GB
sdcard0 4 GB -- lots of space that competes with external SD! Let's use it!
other stuff (tmp, boot, etc.) 1 GB
persona78 provided an excellent mod of the (most recent) stock ROM that gives you root and a working init.d:
https://forum.xda-developers.com/ascend-g6/general/root-upadtekinguser-zip-modded-extras-t3349679
This mod also enables to move apps to a new ext4 partition on the external SD card. My experience however is:
dalvik cache and app data (e.g. some social media apps caching videos etc.) will still fill up the /data partition
access to external SD, even a fast one, is much slower
if you also move app data to external SD, the phone becomes unusable (slow)
So I propose the following solution, successfully tested on my phone, that will use just short of 6 GB on the internal SD card for dalvik cache, apps and their data!
This is how to do it:
backup everything important from the phone
unlock bootloader and install the ROM from persona78, linked above. Make sure root works, adb works.
connect to a Linux machine via USB that has adb installed
select mass storage mode on the phone in the USB settings
Now in mass storage mode do the following:
the phone exposes a block device without partitioning (e.g. /dev/sdb) and a block device with partitioning (e.g. /dev/sdc, /dev/sdc1). the former is the internal storage (sdcard0), the latter external storage (sdcard1).
mount /dev/sdb to /mnt/internal and /dev/sdc1 to /mnt/external
rsync -a /mnt/internal/ /mnt/external/
umount /dev/sdb
mkfs.vfat -C /var/tmp/vfat 256000
dd if=/var/tmp/vfat of=/dev/sdb bs=1M (you can delete /var/tmp/vfat after this)
losetup /dev/loop0 /dev/sdb -o 262144000
mkfs.ext4 /dev/loop0
On the phone you can now change back the USB mode to MTP (but not to charge only -- a data mode is needed for adb to work).
Now run adb shell and obtain root in the shell via 'su'. In the adb root shell:
mkdir -p /data/sdext4
losetup -o 262144000 /dev/block/loop7 /dev/block/mmcblk0p25
mount -t ext4 /dev/block/loop7 /data/sdext4
in /data/sdext4, create two directories called 'data-app' and 'data-data'. Give them the respective permissions and group,ownership as with the current /data/app and /data/data directories.
cp -a /data/app/* /data/sdext4/data-app
cp -a /data/data/* /data/sdext4/data-data
rm -r /data/app/* /data/data/*
mount -o remount,rw /system
edit /etc/init.d/01AOBoot as follows
Content of /etc/init.d/01AOBoot:
#!/system/bin/sh
CONCURRENCY=makefile
# mount sdext4
losetup -o 262144000 /dev/block/loop7 /dev/block/mmcblk0p25
mount -t ext4 /dev/block/loop7 /data/sdext4
mount -o bind /data/sdext4/data-app /data/app
mount -o bind /data/sdext4/data-data /data/data
# change dalvik permissions
chmod 773 /data/dalvik-cache
# change scaling_min_freq to 300000
echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
Click to expand...
Click to collapse
Now run adb reboot. It is done.
Explanation: Apps and their data need to reside on an ext4 partition. sdcard0 however has to be vfat, otherwise the phone will always complain and ask to format it. We can also not change the internal storage partitioning. Therefore we simply hide a large ext4 filesystem behind a small vfat filesystem on the same partition. Apps will startup fast and run fast, and all media files can be put on the external sd card.
I know this is very exotic to most, but maybe there are a few people like me with the necessary background who would like to follow my example. Happy hacking!
Are you kidding me?
This is a great work that you did. My phone keeps complaining about low disk space but I was gonna use parted to resize the data partition.

[Tutorial] How to emulate Second Partition on SD-Card without formatting

[TUTORIAL] SCROLL DOWN BELOW TO NEXT POST
Seems i have accidentially written the nearly same Init.d Enabler like term-init.sh by Ryuinferno @ XDA.
the small different, no busybox run-parts required, and install-recovery-2.sh is used (because SuperSU is running from install-recovery.sh)
However, main intent was to increase internal memory with Bulent Akpinar's Link2SD, but without using a 2. partition.
First have installed Androguide.fr's Universal Init.d, but the scripts were executed delayed. a quick view in SuperSU daemon install-recovery.sh proposed me to write my own script, so i decided to uninstall the App. besides this i highly recommend this app! always give it a try first (i just later realized that this is another version of term-init.sh - which i found on XDA after i was finished and decided to share...)
Once the init.d job was running, it turned out the delay wasn't Universal Init.d App's fault. instead the reason is the Android OS is mounting sdcard delayed. this means the provisional watchdog mount script 00_mount_sdext2.sh becames unusable for me. anyway i keep it attached for using with 2. partition. the final Link2sd mount script 4.3+ 00_mount_sdcardtmp.sh is pre-mounting the sdcard first, then mounting the ext4 image file. both files are just examples and will not work for you without modifying the paths.
Stock kernel does support init.d, but SuperSU is required for this. for better understanding please read Pandages' short description how it works.
For Link2SD i have installed a ext4 image file located on external microSD Card. Due the limitation of FAT32 file systems, the maximum file size is 4 GB. However, some busybox binaries are compiled without large file support and cannot create files bigger then 2 GB - thats why this download comes with busybox. if you don't have arm cpu, there is a copy of busybox /system/xbin/busybox.bak which you must manually rename.
initial create empty ext4 image file
Code:
busybox dd if=/dev/zero of=/sdcard/.data.sdext2.img bs=4k count=1048576
busybox mke2fs -T ext4 -F -q /sdcard/.data.sdext2.img
run the commands from adb shell or terminal emulator
the dd command creates a new file on sdcard. the file size is specified with count.
the mke2fs command is formatting the image file with ext4 file system.
the (.) dot in front makes a filename hidden.
helpful commands for initial gathering
Code:
busybox df
busybox cat /proc/partitions
busybox mount
all mount points with same size usually have identical partition (group by block size). query for matching major + minor in /proc/partitions and find the name (for example /dev/block/mmcblk1p1). make sure the mount point exists and is empty, or create a new folder (for example /storage/sdcardtmp). mount shows the file system type (for example vfat).
modify the paths in 00_mount_sdcardtmp. you have to define two different mounts. the mount point for Link2SD is /data/sdext2.
After this, Link2SD now detects 2. partition on boot. but instead of a 2. partition you just have a single image file on sdcard (which can easily copied for backup)
the download includes a small install shell script which just copy the files into /system. provision for making files executable is unpacking the downloaded zip file init_d.zip to /data/local/tmp. don't forget to set permissions after unpacking.
[TUTORIAL] PLEASE CLICK HERE TO EXPAND PICTURES
(rotate the page to landscape for best view)
1. UNPACK THE FILES2. SET PERMISSIONS
extract file init_d.zip tomake busybox and
/data/local/tmpinstall.sh executable
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
3. INSTALL init.d
execute the shell scriptmake sure script was
install.sh with su permissionsfinished successfully
(or terminal command: "su -c sh install.sh)"(or you already have init.d support?)
4. GATHER SDCARD PARTITION PARAMETERS
Read Driver and Device Numbers
open a root shell. make sure you have su permissions (type "su").
type "busybox df"
identify the external microSD Card folder. its usually "/storage/sdcard"
(or something, and symlinked to "/sdcard")
group all mount points with same size (group by block size)
find the related filesystem, starting with "/dev/block/vold/puplic:179,97"
(or something)
Find the Block Partition
open a shell
type "busybox cat /proc/partitions"
identify Driver and Device Numbers, for example major = 179, minor = 97
find the name. complete the path, starting with "/dev/block/mmcblk1p1" (or something)
Copy the Mount Options
open a shell
type "busybox mount"
identify the related filesystem, starting with "/dev/block/vold/puplic:179,97" (or something)
find the filesystem type, for example "vfat" (depends on microSD Card)
copy the mount options. usually from "rw" to "uid/gid"
5. CREATE THE MOUNT SCRIPT
use Mount-Button to make system partition read-write able
(or terminal command: "su -c busybox mount -o remount,rw /system")
navigate to folder "/system/etc/init.d"
delete the example file "00_mount_sdext2" (not required)
open the example file "00_mount_sdcardtmp" in text editor
MODIFYING THE init.d MOUNT SCRIPT EXAMPLE
Pre-mounting external microSD Card
edit the first mount line. usage: mount -t <type> -o <options> <source> <target>
Source: "/dev/block/mmcblk1p1" (Block Partition, see above 4.)
Target: "/storage/sdcardtmp"
Filesystem type: "vfat" (see above 4.)
Options: "rw, ..." (see above 4.)​example: "mount -t vfat -o rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015 /dev/block/mmcblk1p1 /storage/sdcardtmp"​Mounting the ext4 image file
the second mount line is like the first mount, except the source is a file. thus requires the additional mount option "loop". further use same mount options as used for "/data" (usually from "rw" to "uid/gid"). these might be different from above.
Source: "/storage/sdcardtmp/.data.sdext2.img" (Image File, see below 7.)
Target: "/data/sdext2" (see below 6.)
Filesystem type: "ext4" (see below 7.)
Options: "loop,rw, ..."​
6. PREPARING MOUNT POINTS
Make sure the target folders exists and folders are empty. consider that file names are case-sensitive.
You can create a new mount point asFor Link2SD a fixed mount point
well. the folder name for microSD Cardis defined, the folder name is
is an example, vary it as you like.detected from app.
use Mount-Button to make root directory read-write able
(or terminal command: "su -c busybox mount -o remount,rw /")
navigate to folder "/storage"
create new folder "/storage/sdcardtmp"
navigate to folder "/data"
make sure the identical path is specified
in mount script "00_mount_sdcardtmp"
(see above)
create new folder "/data/sdext2"
7. CREATE THE EXT4 IMAGE FILE
Finally, create the Image File "/storage/sdcardtmp/.data.sdext2.img". the file name is an example, vary it as you like. choose a location anywhere on external microSD Card. the (.) dot in front of filename makes a file hidden.
identify the external microSD Card folder.
its usually "/storage/sdcard" symlinked to "/sdcard"
calculate the number of blocks.
the maximum file size is 4096 bytes x 1048576 = 4294967296 bytes (4 GiB)
open a shell
create a new file with busybox "dd" command
Code:
busybox dd if=/dev/zero of=/sdcard/.data.sdext2.img bs=4k count=1048576
wait 10 minutes
format the file with busybox "mke2fs" command. the filesystem type is "ext4"
Code:
busybox mke2fs -T ext4 -F -q /sdcard/.data.sdext2.img
make sure the identical file name is specified in mount script "00_mount_sdcardtmp"
(see above)
8. MOUNT THE (EMULATED) SECOND PARTITION
Test the mount script
open a root shell. make sure you have su permissions (type "su")
type "sh /system/etc/init.d/00_mount_sdcardtmp"
type "busybox df"
if successful, there are two new mounts "/storage/sdcardtmp" and "/data/sdext2"​
Check the mount options
type "busybox mount"
identify the new mount points "/storage/sdcardtmp" and "/data/sdext2"
compare the mount options. they should be similar:
"/dev/block/vold/puplic:179,97" = "/storage/sdcardtmp"
"/data" = "/data/sdext2"
(or something)
FINISH. REBOOT THE PHONE. CHECK IF SUCCESSFUL
NOTE: IF YOU WON'T GO THROUGHT THIS MANUALLY CODING TORTURE
there is an app from google play called Mount2SD the solution as it has most of the mount scripts needed. It won't work with encryption. I personally prefer the loop file method descriped here (and never tested it), but looks like a good alternative for Link2SD
NOTE: The following apps are used:
For older versions (screenshots) please see Attached Files below
I found the tar.gz but its so difficult for me i dont understand
for unpacking, busybox or any unpacking app is needed. for example root explorer can browse tar.gz files and extract it.
for manually unpacking the tar.gz
Code:
busybox gunzip -c init_d.tar.gz | busybox tar -vxC /data/local/tmp
This is the screenshot command u ask me for
But i just download your file it is still in download folder .. should i unpack init.d.tar.gz first ? And then send u the command ?
Btw the screenshot is from last to first start with busybox df
Sorry i never seen newer android, knox is a new thing to me. seems like the /data partition is emulated, maybe it is not available during boot?
you can try to pre-mount sdcard. in your case it is /dev/block/vold/puplic:179,33 - (major = 179, minor = 33) - which is equal to /dev/block/mmcblk1p1. the mount point is /storage/31D1-1308 - but its not empty, so you have to create a new folder for example /storage/31D1-1308tmp (which must re-created from your init.d script on every boot). the file system type is sdfat. the mount options i am not sure. try rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime,uid=1023,gid=1023 (taken from your screenshots)
this is for the first mount. check if it works, you should see files in /storage/31D1-1308tmp (and new mount is listed in busybox df). you can check the mount command on adb shell or terminal emulator, it works during runtime.
for the second mount then create a ext4 image file first. then mount /storage/31D1-1308tmp/.data.sdext2.img to /data/sdext2 type ext4 with options loop,rw,nosuid,nodev,noexec,relatime,low_uid=1023,low_gid=1023,gid=9997 if success /data/sdext2 is listed in busybox df.
if mount works on adb shell, but not in mount script, increase the timer busybox sleep 4

Categories

Resources