Can't mount SD card as write permissions in android - android

I'm using the below command to mount sd card in adb shell window, which returns an error:
# mount -rw -t vfat /tmp/udev/dev/mmcblk0p1 /tmp/new
mount: Device or resource busy
what might be the issue?
But when I'm mounting it as read only using the below command I could able to read the contents of SD card.
# mount -r -t vfat /tmp/udev/dev/mmcblk0p1 /tmp/new

Related

Cannot remount system (read only) as read/write on my Android TV Box using the adb shell

I am trying to change the access rights of the file system at root
level (/) (or /system level) from read only to read/write on my Android TV Box
using adb and the shell. My Android TV Box runs as Android 7.1.2
A mount command returns :
1|q201:/ $ mount
rootfs on / type rootfs (ro,seclabel)
...
The following command :
1|q201:/ $ mount -o rw,remount mtd:rootfs /
returns :
mount : '/' not in /proc/mounts
A cat /proc/mounts command returns :
q201:/ $ cat /proc/mounts
rootfs / rootfs ro,seclabel 0 0
...
The following command :
1|q201:/ $ mount -o rw,remount /
returns :
mount: 'rootfs' not user mountable in fstab
Starting adb at root level adb root does not change anything.
Could someone kindly help?
you cannot remount the rootfs in rw mode, but only the system partition.
to see what is mounted:
cat /proc/mounts
or the available partitions:
cat /proc/partitions
Device must be rooted!
su
mount -o rw,remount /

Android Emulator Won't Let Me Mount And Copy A File To It

I am trying to follow the tutorial :
http://borkweb.com/story/setting-etchosts-on-an-android-emulator-using-a-mac
But when I type:
adb -s emulator-5554 remount
All I get is remount of /system failed: Read-only file system
So then I try this..
MAC-M-N20B:~ user$ adb shell
root#generic_x86:/ # su
root#generic_x86:/ # mount -o rw,remount,rw /system
And then I get this...
mount: Read-only file system
Any ideas how I can make the system folder writeable?

Change android emulator sdcard permission

I want to change my android emulator sdcard read only permission, for that I typed
mount -o remount,rw /mnt/sdcard
in adb shell. But it shows
Usage: mount [-r] [-w] [-o options] [-t type] device directory
Whats the problem in the command I have written in the adb shell.
I think you must write something like this:
mount -o remount rw /sdcard

Mount ext2 sd card with BusyBox

I am trying to mount an sd card that I put into my tablet. The sd card is in ext2 format. I tried using BusyBox with the following command in my terminal app on the tablet:
busybox mkfs.ext2
But it seems I need to add some arguments to the command. What commands would I need to add to it? Or is there an easier way to mount the sd card?
I would like to not format the sd card as there is data on it; but whatever it takes to read it as ext2 format is ok.
you need to mount the ext2 filesystem not create the filesystem.
Depending on your tablet, the device in /dev could be different from my example. but in general you want to run a similar command :
busybox mount -t ext2 /dev/block/vold/179:2 /data/sd-ext
where /dev/block/vold/179:2 is the device that you are trying to mount.
and /data/sd-ext is the path where you want to mount your sd card to.
here's the help page for the mount command
1|shell#android:/ $ busybox mount -t
option requires an argument -- t
BusyBox v1.20.0.git (2012-03-21 01:44:00 GMT) multi-call binary.
Usage: mount [OPTIONS] [-o OPTS] DEVICE NODE
Mount a filesystem. Filesystem autodetection requires /proc.
-a Mount all filesystems in fstab
-f Dry run
-i Don't run mount helper
-r Read-only mount
-w Read-write mount (default)
-t FSTYPE[,...] Filesystem type(s)
-O OPT Mount only filesystems with option OPT (-a only)
-o OPT:
loop Ignored (loop devices are autodetected)
[a]sync Writes are [a]synchronous
[no]atime Disable/enable updates to inode access times
[no]diratime Disable/enable atime updates to directories
[no]relatime Disable/enable atime updates relative to modification time
[no]dev (Dis)allow use of special device files
[no]exec (Dis)allow use of executable files
[no]suid (Dis)allow set-user-id-root programs
[r]shared Convert [recursively] to a shared subtree
[r]slave Convert [recursively] to a slave subtree
[r]private Convert [recursively] to a private subtree
[un]bindable Make mount point [un]able to be bind mounted
[r]bind Bind a file or directory [recursively] to another location
move Relocate an existing mount point
remount Remount a mounted filesystem, changing flags
ro/rw Same as -r/-w
There are filesystem-specific -o flags.
Should be busybox mount /dev/block/something /mountpoint. mkfs creates a filesystem like format in Windows
http://www.busybox.net/downloads/BusyBox.html#mount
Or is there an easier way to mount the sd card?
It usually happens automatically, check busybox mount without arguments if it is already mounted somewhere.

Make Android sdcard read-only

I need to test a scenario where the sdcard (or atleast a particular directory) is read-only. Does anyone know how I can do this on the emulator?
Basically I want to mount the sdcard as read-only. I tried the following command in adb shell, but it doesn't work.
mount -o remount r /sdcar
Here is how I managed to remount sdcard in read-only mode:
Step 1.
Execute mount and see the list of mounted directories. Note the one with /sdcard or /mnt/sdcard in it.
On my Android 1.6 emulator:
/dev/block//vold/179:0 /sdcard vfat rw,dirsync,nosuid,nodev,...
Step 2.
Execute next command:
mount -o remount,ro <block> <sdcard>
Where <block> and <sdcard> are first two items taken from mount output line with sdcard.
In my case the command would be:
mount -o remount,ro /dev/block//vold/179:0 /sdcard
make sure you have set permissions in your manifest file
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Categories

Resources