Remove apps from /system via SSH - Hero, G2 Touch Q&A, Help & Troubleshooting

Since I've got DropBear and SSH on my Hero (MCR 3.2) I thought I'd try to remove APK-files via SSH, instead of using the USB-connection. I've successfully managed to connect to my phone, both via PuTTY and ConnectBot, but whenever I try to remove something from /system I get a message saying it's a read-only file system. What am I doing wrong? I should be able to perform what I've described above, right?

jeans2 said:
Since I've got DropBear and SSH on my Hero (MCR 3.2) I thought I'd try to remove APK-files via SSH, instead of using the USB-connection. I've successfully managed to connect to my phone, both via PuTTY and ConnectBot, but whenever I try to remove something from /system I get a message saying it's a read-only file system. What am I doing wrong? I should be able to perform what I've described above, right?
Click to expand...
Click to collapse
remount /system as rw

jeans2 said:
Since I've got DropBear and SSH on my Hero (MCR 3.2) I thought I'd try to remove APK-files via SSH, instead of using the USB-connection. I've successfully managed to connect to my phone, both via PuTTY and ConnectBot, but whenever I try to remove something from /system I get a message saying it's a read-only file system. What am I doing wrong? I should be able to perform what I've described above, right?
Click to expand...
Click to collapse
/system is by default read only, even for root.
Execute this in shell to remount it as read/write
mount -o remount,rw /dev/block/mtdblock3 /system

Eddie1506 said:
/system is by default read only, even for root.
Execute this in shell to remount it as read/write
mount -o remount,rw /dev/block/mtdblock3 /system
Click to expand...
Click to collapse
I'm guessing that line is similar to "adb remount"?
Is it something I have to execute each time I wan't to make changes in the /system-folder?

Yes, you can execute it through adb with "adb shell ...". I guess you have to execute it after reboot, I'm not really sure.

/system will stay mounted read/write until you reboot or remount to read only, however I'd always either reboot or remount it read only as soon as I was finished making changes, to be safe & avoid any accidental modifications/deletions. Also, yes, adb remount is just a quicker way to execute the same (or very similar) command.

cauli said:
/system will stay mounted read/write until you reboot or remount to read only, however I'd always either reboot or remount it read only as soon as I was finished making changes, to be safe & avoid any accidental modifications/deletions. Also, yes, adb remount is just a quicker way to execute the same (or very similar) command.
Click to expand...
Click to collapse
Okay, so mount -o rw /dev/block/mtdblock3 /system for mount and remount -o rw /dev/block/mtdblock3 /system for remount, right?
Btw, what does mtdblock3 contain?

jeans2 said:
Okay, so mount -o rw /dev/block/mtdblock3 /system for mount and remount -o rw /dev/block/mtdblock3 /system for remount, right?
Btw, what does mtdblock3 contain?
Click to expand...
Click to collapse
Last question first: /system System contains most of the operating system.
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
&
mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
to mount system read/write & read-only respectively. You might not need the '-t yaffs2' option which tells it what format the partition is, as it should auto detect the type, however the above should be most reliable.

cauli said:
Last question first: /system System contains most of the operating system.
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
&
mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
to mount system read/write & read-only respectively. You might not need the '-t yaffs2' option which tells it what format the partition is, as it should auto detect the type, however the above should be most reliable.
Click to expand...
Click to collapse
Okay, but what are the differences between the above and executing mount -o remount,rw (-t yaffs2) /system and mount -o remount,ro (-t yaffs2) /system, leaving the /dev/block/mtdblock3-part out?

remount isn't a command of itself (if you're using adb, adb remount is, so perhaps this is the source of that misapprehension) so that line above simply wouldn't do anything.
As to missing out the /dev/block/mtdblock3, aiui, in this case the mount command will attempt to infer the block device associated with the given mount point (ie with /system). Usually I think it relies on a config file /etc/fstab to do this, but that is often not present in Android ROMs (it seems to be absent from MCR 3.2 for one). In this particular case it works because the remount option implies it must use the device currently mounted at that mount point.
Essentially, you can often keep the command simple by missing out various parts, but if you have any kind of problem with it executing it's worthwhile specifying everything in case that is the cause of your problem. HTH

fyi:
Code:
$ adb shell cat /proc/mtd
dev: size erasesize name
mtd0: 00040000 00020000 "misc"
mtd1: 00500000 00020000 "recovery"
mtd2: 00280000 00020000 "boot"
mtd3: 0aa00000 00020000 "system"
mtd4: 08200000 00020000 "cache"
mtd5: 0a5c0000 00020000 "userdata"

cauli said:
remount isn't a command of itself (if you're using adb, adb remount is, so perhaps this is the source of that misapprehension) so that line above simply wouldn't do anything.
As to missing out the /dev/block/mtdblock3, aiui, in this case the mount command will attempt to infer the block device associated with the given mount point (ie with /system). Usually I think it relies on a config file /etc/fstab to do this, but that is often not present in Android ROMs (it seems to be absent from MCR 3.2 for one). In this particular case it works because the remount option implies it must use the device currently mounted at that mount point.
Essentially, you can often keep the command simple by missing out various parts, but if you have any kind of problem with it executing it's worthwhile specifying everything in case that is the cause of your problem. HTH
Click to expand...
Click to collapse
Ah, it was a typo. Should've been "mount" and not "remount", just as you pointed out.
Thank you for the explanation! And to you too, kendong2.

Related

Cannot mount as read/write, Please help

Trying to push files from adb to my phone but it wont let me because its a read only system.
I've done adb shell mount -o rw,remount /dev/block/mtdblock3 /system but it does not work, I'm running windows 7 could this be a problem?
Make sure that USB Debugging is enabled on the phone.
Settings...Applications...Development
C:\Users\Jake\Desktop\android-sdk-windows\tools>adb shell mount -o rw,remount /d
ev/block/mtdblock3 /system
mount: mounting /dev/block/mtdblock3 on /system failed: Invalid argument
C:\Users\Jake\Desktop\android-sdk-windows\tools>
It is enabled.
Are you in recovery mode when you're trying this? Or booted regularly?
If you're in recovery mode you'd mount it like this:
mount -o rw /dev/block/mtdblock3 /system
Jboxen said:
C:\Users\Jake\Desktop\android-sdk-windows\tools>adb shell mount -o rw,remount /d
ev/block/mtdblock3 /system
mount: mounting /dev/block/mtdblock3 on /system failed: Invalid argument
C:\Users\Jake\Desktop\android-sdk-windows\tools>
Click to expand...
Click to collapse
follow my tutorial for ADB set-up. http://forum.xda-developers.com/showthread.php?p=6054534#post6054534
I noticed you dont have SDK in C:/ root....
or a simple command like this should mount it as read/write:
adb remount
its what i have been doing and seems to do the same thing with less commands, unless someone can point out the difference for me.
Otherwise, try
mount -o rw,remount /dev/block/mtd3 /system
That should do it. The /dev/block/mtdblock3 is only required in recovery.
ECLIPS3 said:
or a simple command like this should mount it as read/write:
adb remount
its what i have been doing and seems to do the same thing with less commands, unless someone can point out the difference for me.
Click to expand...
Click to collapse
I would also like to know the difference between the two commands:
adb remount
and
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
DeezNotes said:
I would also like to know the difference between the two commands:
adb remount
and
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Click to expand...
Click to collapse
i believe they both do the same thing. just one uses the same characters
Android22 said:
follow my tutorial for ADB set-up. http://forum.xda-developers.com/showthread.php?p=6054534#post6054534
I noticed you dont have SDK in C:/ root....
Click to expand...
Click to collapse
having the SDK in C:\ root is not a necessity. People do it because it is easy to do it that way.

Cannot mount with ADB

Hello all,
I am trying to push a file to my system, however I do not seem to be able to mount my system partition.
When I try to execute the following command, I always get the error "Operation not permitted" :
Code:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
My phone is rooted and my USB debugging is on !!
Anyone no what could cause this. It has always worked when I was still on 1.6 (rooted) and now it doesn't allow me access.
When I use Rootexplorer, I have R/W access, so root works.
Anyone has any tips or advise ?
Try...
adb shell
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
Tried that, and get permission denied
Should have added, make sure your screens on on the phone and allow SuperUser access when you type su.
never mind, one sec

[Q] Can't mount /system with ADB

So I'm totally unable to do anything to my /system in CWM via ADB.
Code:
> adb remount
remount failed: Operation not permitted
> adb push item.apk /system/app/item.apk
Failed: Permission denied
adb shell
$: su
Segmentation fault
$: rootsh
~# mount /system
mount: mounting /dev/block/mmcblk0p9 on /system failed: Device or resource busy
~# su
# mount /system
mount: mounting /dev/block/mmcblk0p9 on /system failed: Device or resource busy
# mount /system/app
can't find /system/app in /etc/fstab/
Pressing "unmount /system" in CWM results in "Error unmounting /system!" message. I tried pressing "Fix Permissions" but it didn't help. The only thing it did was that "su" results in "Segmentation fault" instead of "Permission denied". I just flashed my Lite'nin ROM again but it didn't fix anything.
I do have root access in normal OS so I can probably do some stuff in terminal emulator. But why is /system busy all the time?
try this:
adb shell
$ su
# mount -o rw,remount -t yaffs2 /dev/block/mmcblk0p9
kaukassus said:
try this:
adb shell
$ su
# mount -o rw,remount -t yaffs2 /dev/block/mmcblk0p9
Click to expand...
Click to collapse
Thanks. That apparently mounted the /system but adb was still unable to push the files there. Maybe that is because "su" is still not working, only "rootsh". So I moved the file to my sdcard and then moved it to /system in shell.
Jiia said:
Thanks. That apparently mounted the /system but adb was still unable to push the files there. Maybe that is because "su" is still not working, only "rootsh". So I moved the file to my sdcard and then moved it to /system in shell.
Click to expand...
Click to collapse
since you are using a Secured Kernel(probably the CF-Root with CWM), you have to push the files to /sdcard
and then copy the files from the sdcard to the /system directory.
you can only push files with adb directly to the /system directory, when you are using an insecured kernel.
kaukassus said:
since you are using a Secured Kernel(probably the CF-Root with CWM), you have to push the files to /sdcard
and then copy the files from the sdcard to the /system directory.
you can only push files with adb directly to the /system directory, when you are using an insecured kernel.
Click to expand...
Click to collapse
Oh. Thanks for the info, that cleared things up! I thought you only need to have a custom recovery in order to push with adb but apparently it's about the kernel.
kaukassus said:
try this:
adb shell
$ su
# mount -o rw,remount -t yaffs2 /dev/block/mmcblk0p9
Click to expand...
Click to collapse
this not working for me ,still can't mount the system i can't rm9 at ADB at all please help me !

[Q] How can I mount /system as writeable in adb shell?

I thought I'd bricked my NT but it would appear that it is actually alive because it turns up with adb and I can get shell and then issue command su, but what I can't do is replace the old build.prop because file system is not writable. How do I remount it to be writeable from a shell please?
Thanks!
CelticWebSolutions said:
I thought I'd bricked my NT but it would appear that it is actually alive because it turns up with adb and I can get shell and then issue command su, but what I can't do is replace the old build.prop because file system is not writable. How do I remount it to be writeable from a shell please?
Thanks!
Click to expand...
Click to collapse
mount -o rw,remount -t ext4 /dev/block/mmcblk0p8 /system
Type mount to verify rw, make your changes
mount -o ro,remount -t ext4 /dev/block/mmcblk0p8 /system
Type mount to verify ro
Thank you!
hwong96 said:
mount -o rw,remount -t ext4 /dev/block/mmcblk0p8 /system
Type mount to verify rw, make your changes .....
Click to expand...
Click to collapse
I don't have this tablet but a phone with similar problem.
this does not work for me, although I have ROOTED phone MTK6572, android 4.2.2 ;
"/ root" gets RW, but "/system" stays RO.
I get this message:
error
"the item "system" is read only"
I have tried many apps in phone (remount system RW, FX file expl. ....), and mtkdroid-tools and ADB shell in PC.
I have tried many similar version of that command, too, inc. busybox remount. non of those work.
any ideas, what to try next?
what file or thing or item and where I need to change to get this remounting system to RW done?
it is ext4, and remountable.
I have SuperSU in phone but can't update its binaries: /system stays RO, what ever I try...
I can't change audios, anything in /system.
very annoying...
Jack_Rover said:
I don't have this tablet but a phone with similar problem.
this does not work for me, although I have ROOTED phone MTK6572, android 4.2.2 ;
"/ root" gets RW, but "/system" stays RO.
I get this message:
error
"the item "system" is read only"
I have tried many apps in phone (remount system RW, FX file expl. ....), and mtkdroid-tools and ADB shell in PC.
I have tried many similar version of that command, too, inc. busybox remount. non of those work.
any ideas, what to try next?
what file or thing or item and where I need to change to get this remounting system to RW done?
it is ext4, and remountable.
I have SuperSU in phone but can't update its binaries: /system stays RO, what ever I try...
I can't change audios, anything in /system.
very annoying...
Click to expand...
Click to collapse
I understand your frustration, however, you should try to post your question to the MTK6572 or Samsung S4 thread. Anyway, since you have asked I'll answer. The mount point for /system is different on each phone model. There is no one standard /system mount point. On the Nook Tablet and Nook Color it is mmcblk0p8. On your device it is different, so the command you tried will not work.
You need to find out what the /system mount point is for your phone.
Open terminal from phone and type su.
Press enter.
At the # prompt type cat /proc/mtd
Press enter.
Look at the output on the screen and see what the mount point is for /system.
A the the # prompt type mount -o rw,remount -t ext4 /dev/block/enteryoursystemmountpointhere /system
Note: replace enteryourmountpointhere with your mount point from the previous step.
Change /system to ro when done. Hope this works for you.
Also download root checker app to ensure you rooted properly.
hwong96 said:
I understand your frustration, however, you should try to post your question to the MTK6572 or Samsung S4 thread. ......
Click to expand...
Click to collapse
thanks for your responce.
with that "cat ..." I got : "no such file or dir"...
I know already that my mnt point is (did try already these earlier):
mount -o rw,remount /dev/block/mmcblk0p4 system
mount -o remount,rw -t ext4 /[email protected] /system
but no success, " system read only" stays, and no change.
Jack_Rover said:
thanks for your responce.
with that "cat ..." I got : "no such file or dir"...
I know already that my mnt point is (did try already these earlier):
mount -o rw,remount /dev/block/mmcblk0p4 system
mount -o remount,rw -t ext4 /[email protected] /system
but no success, " system read only" stays, and no change.
Click to expand...
Click to collapse
Did you use the root checker app to verify for proper root?
hwong96 said:
Did you use the root checker app to verify for proper root?
Click to expand...
Click to collapse
yes.
I have many apps (e.g. FX, ATools, TitaniumBup, busybox, ES, mount /system rw, SD maid, root expl., adbd insec., rootAppDel, a.s.o.) that use root rights, and phone's superSU gives the rights to them.
AT:s terminal has # prompt, so it must be root. (?)
adbd insecure's current status = binary: insecure; usb debugging: enabled.
I have earlier version SU's binaries working ok, but updating SU made this binary-update-issue: " binary update failure" and so SU-app won't open (it closes after failing binary update), though otherwise it works ok (and worked earlier until I did let G-play to update it, silly me!).
somehow my /system has been "open" i.e. RW earlier, since busybox and superSU has been installed, but now it is "stuck" to that RO-status. "/" opens, but "/system" not.
MTK Droid Root & Tools v2.5.3 (from here xdadevs) gets root shell ok, but fails when trying to install SU, busybox a.s.o. ("read-only system") - and it "crashes".
maybe kernel related? or boot loader, or .... what?
-----
btw, my apologises, that I wrote this issue to this thread, but I found my "problem" here with the search, and after posting I realized that this is "tablet area..."
so this part can be moved to better place by those who know best where to - though not to trash, anyway....
Jack_Rover said:
yes.
I have many apps (e.g. FX, ATools, TitaniumBup, busybox, ES, mount /system rw, SD maid, root expl., adbd insec., rootAppDel, a.s.o.) that use root rights, and phone's superSU gives the rights to them.
AT:s terminal has # prompt, so it must be root. (?)
adbd insecure's current status = binary: insecure; usb debugging: enabled.
I have earlier version SU's binaries working ok, but updating SU made this binary-update-issue: " binary update failure" and so SU-app won't open (it closes after failing binary update), though otherwise it works ok (and worked earlier until I did let G-play to update it, silly me!).
somehow my /system has been "open" i.e. RW earlier, since busybox and superSU has been installed, but now it is "stuck" to that RO-status. "/" opens, but "/system" not.
MTK Droid Root & Tools v2.5.3 (from here xdadevs) gets root shell ok, but fails when trying to install SU, busybox a.s.o. ("read-only system") - and it "crashes".
maybe kernel related? or boot loader, or .... what?
-----
btw, my apologises, that I wrote this issue to this thread, but I found my "problem" here with the search, and after posting I realized that this is "tablet area..."
so this part can be moved to better place by those who know best where to - though not to trash, anyway....
Click to expand...
Click to collapse
Don't know what else to suggest, except maybe contact Chainfire on G+.
.

[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.

Categories

Resources