[WTF][4.2.2] "mount -o remount ro /" doesn't work but "mount -o remount,ro /" does?? - Nexus 7 Q&A, Help & Troubleshooting

[WTF][4.2.2] "mount -o remount ro /" doesn't work but "mount -o remount,ro /" does??
Mod: You can delete this thread... Sorry, I was so nervous about that....
Hey Guys,
I was developing on my kernel in init.rc and I recognized that / doesn't get remounted read-only in my script.
I couldn't understand that. The command runs, but / don't get mounted ro. WTF???!
So I tested a bit and here is what I found out:
Code:
mount -o remount rw /
remounts / rw.
Code:
mount -o remount ro /
Doesn't remount / read-only.
Instead,
Code:
mount -o remount,ro /
works.
What the hell is going on here??!? I am using Android 4.2.2. Also happens with stock-kernel. Can someone confirm this?
I am pretty sure I used the old command on Android < 4.2.2 and it worked. Or?!
It doesn't matter if you use toolbox or busybox.
Thanks,
vorcers
Edit:
ahh,
Code:
mount -o remount /
remount's / rw. That solves the mystery. :silly:
This also happens on real systems. I think there is some bug in mount / the remount option. Because any word behind remount and prior / is ignored / no error. Instead, if you swap ro and remount, mount prints errors.

Related

WiFi - Ad Hoc somthings i did not understand

Hi every body !
I made my G1 connecting with Ad Hoc mode:
Code:
adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
adb push tiwlan.ini /data/misc/wifi/tiwlan.ini
adb push wpa_supplicant.conf /data/misc/wifi/wpa_supplicant.conf
adb shell mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system
And i have made a correct tiwlan.ini and wpa_supplicant.conf, this is why it works like a charm.
Now, i have two problems:
1- After every reboot, i can't start my Wifi(no Wifi at all, it is OFF), i have to redo all that script
2- Even i made a Shell Script, noway, it works only by using the ADB. Here is a very basic script that i tried:
Code:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cp -f ./tiwlan.ini /data/misc/wifi/tiwlan.ini
cp -f ./wpa_supplicant.conf /data/misc/wifi/wpa_supplicant.conf
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system
Any idea ?
Thank you.
G1 - Cyanogen 5.0.8-N1
(Sorry for my english writing)
Hi !
UP
I didn't resolve the problem yet
A+
I don't know how much of the script you understand, but your /system partition doesn't seem to be mounted until you run that script. That doesn't seem normal, /system sounds rather important :-/ If you don't know how to undo whatever modifications you have made, I would recommend resetting your phone to factory settings. It should fix it.

[Q] Writing to system?

I'v just rooted my Tab, I don't know if I'm losing the plot but I can't figure out how to write to the system partition? I can't find any apps that will work (for free) and "adb remount" doesn't work. "remount failed: Operation not permitted"
Am I missing something?
alias_neo said:
I'v just rooted my Tab, I don't know if I'm losing the plot but I can't figure out how to write to the system partition? I can't find any apps that will work (for free) and "adb remount" doesn't work. "remount failed: Operation not permitted"
Am I missing something?
Click to expand...
Click to collapse
adb remount doesn't work because /default.prop needs ro.secure set to 0 (not 1). This can't be changed easily without modifying the boot.img.
However, you can remount /system as a r/w filesystem using ADB by opening a shell and:
Code:
su
mount -o rw,remount -t ext3 /dev/block/mmcblk0p1 /system
or
Code:
su
mount -o rw,remount -t ext3 /dev/mtdblock3 /system
Regards,
Dave
foxmeister said:
adb remount doesn't work because /default.prop needs ro.secure set to 0 (not 1). This can't be changed easily without modifying the boot.img.
However, you can remount /system as a r/w filesystem using ADB by opening a shell and:
Code:
su
mount -o rw,remount -t ext3 /dev/block/mmcblk0p1 /system
or
Code:
su
mount -o rw,remount -t ext3 /dev/mtdblock3 /system
Regards,
Dave
Click to expand...
Click to collapse
Thanks, so which should I actually use, the former or the latter?
I've personally used the first command, but I saw the second one on another thread and it seems to work as well.
To be honest, I think it's ignoring the parameter anyway.
Regards,
Dave

mount /system with adb shell in recovery

hello, i need to restore my framework-res.apk from backup on my phone. i googled around and found some ways but they arent working. i can adb shell in while in recovery but i cant boot to android and /system isnt mounted.
i tried mount -o rw,remount /dev/block/mtdblock3 /system and mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system in adb shell and get "mount: mounting /dev/block/mtdblock3 on /system failed: Invalid argument"
also tried doing adb remount but get "remount failed: Unknown error: 0"
anyone know whats going on? i have 318 rom and streakmod recovery. sorry if this is considered android development. i dont think it is so its in streak general.
I believe /system shound be /dev/block/mtdblock6, so you should be able to use: mount -t yaffs2 /dev/block/mtdblock6 /system
yeah i just got the answer in freenode irc #dellstreak too and this did work. thank you.
[11:18pm] meralias: mount /dev/block/mtdblock6 /system
[11:21pm] meralias: actually: mount -t yaffs2 /dev/block/mtdblock6 /system
edit: [11:24pm] • meralias also goes as 'kantras'
sly.

with su access cannot modify /system

ok i have root access with busybox and su installed yet in terminal editor and adbshell i cannot remount my system as rw does anyone know why
ok update i got around my issue by using root explorer to get rw access on the system but still want to know why i cant do this
Sprint tab
How are you remounting it?
I always have good success with:
Code:
adb shell
su
remount rw /system
that is the exact code i have used and it gives me a not found error
Hmm. Check to see if /system/xbin/remount exists. If not, use Root Explorer to place this script at that location:
Code:
#!/system/bin/sh
#simplify mount rw and mount ro
#scripting wrote by forcystos - SDX - sdx-developers.com
#updated for samsunge epic by joeykrim - SDX - sdx-developers.com
case $1 in
rw)
echo "Remounting /system (/dev/stl9) in read/write mode"
/system/bin/mount -o remount,rw /dev/stl9 /system;;
ro)
echo "Remounting /system (/dev/stl9) in read-only mode"
/system/bin/mount -o remount,ro /dev/stl9 /system;;
*)
echo "usage: remount rw -or- remount ro";;
esac
Remember to change mode to 744 before executing.

Mounting error

Hi,
I am unable to edit build.prop (flashing B15 and B13-chinese bootstack enabled nav bar - I want to remove it) as I can not mount /system as RW. When doing so, either via Terminal, ADB Shell or simply a file explorer app, I generally get a "Device busy" error or some other random error.
I have tried those commands so far in Shell:
mount -o remount,rw /system
mount -o remount,rw -t ext4 /dev/block/bootdevice/by-name/system /system
All commands have been tried on the three available kernels.
Any help is much appreciated!

Categories

Resources