[Q] How to wipe system from update-script? - Android Q&A, Help & Troubleshooting

Hi,
I've tried with
unmount("/system");
run_program("/sbin/erase_image","system");
Does not work. Would it be sufficient to run a shell script which mounts system and runs rm -rf /system through busybox?
Tanks for advice!

Related

Help with Samsung Replenish SPH-M580

I have root and installed busybox. I'm trying to use Terminal Emulator to remove
some unwanted .apk files.
I used this command
su
mount -o rw,remount /system
rm -f /system/app/Browser.apk
The response is rm failed Read-only file system
Is there a step I'm missing or wrong command?
I want to remove the browser. Any help would be great, thanks.

[Q] A script to clean Dalvik-Cache

Hi guys. I've tried to make a cleaning dalvik-cache script.
It contain only:
Code:
#!/bin/bash
rm -rf /data/dalvik-cache/*
Is it wrong?? Do i have to include something else??

Anyone whos going to wipe their atrix, please help...

Hi guys, I don't have an atrix so I can't test these, but I want to know if any of these commands does a factory reset from adb while in recovery...
So If anyone can please try them:
1.
adb shell
#wipe data
Click to expand...
Click to collapse
2.
adb shell
wipe all
Click to expand...
Click to collapse
3.
adb shell
su
wipe system
Click to expand...
Click to collapse
4.
su rm -rf *
Click to expand...
Click to collapse
And test if this clears dalvik:
su
cd /data/dalvik-cache
rm *
Click to expand...
Click to collapse
Please don't try this if you don't know what your doing... Thanks!
This is sure to work for wiping /data:
Code:
adb shell
dd if=/dev/zero of=/dev/block/mmcblk0p16
And this deletes all dalvik caches:
Code:
adb shell
rm -f /data/dalvik-cache/* /cache/dalvik-cache/*
ravilov said:
This is sure to work for wiping /data:
Code:
adb shell
dd if=/dev/zero of=/dev/block/mmcblk0p16
And this deletes all dalvik caches:
Code:
adb shell
rm -f /data/dalvik-cache/* /cache/dalvik-cache/*
Click to expand...
Click to collapse
Those can be done from recovery right?
What can I use to wipe cache?
Syl said:
Those can be done from recovery right?
Click to expand...
Click to collapse
Yes.
Syl said:
What can I use to wipe cache?
Click to expand...
Click to collapse
Code:
adb shell
dd if=/dev/zero of=/dev/block/mmcblk0p15
Are you familiar with the Atrix partition map? If so, you can wipe any partition this way, just substitute the appropriate mmcblk0pXX.
However, you must understand what exactly the dd command does and what are the consequences of it. It takes a raw partition and writes zeroes all over it. This not only removes the content but also the filesystem on it. This is what I understand as wiping, but that also means the filesystem must be recreated before the partition can be used again. It can also be dangerous to do this if the partition is currently mounted (especially if it's mounted r/w). A safer (but still not perfect) approach would be:
Code:
adb shell
mkdir -p /tmpmount
mount /dev/block/mmcblk0pXX /tmpmount || mount -o bind /dev/block/mmcblk0pXX /tmpmount
rm -rf /tmpmount/* /tmpmount/.[^.]*
umount /tmpmount
mmcblk0pXX is of course the partition you want to wipe.
ravilov said:
Yes.
Code:
adb shell
dd if=/dev/zero of=/dev/block/mmcblk0p15
Are you familiar with the Atrix partition map? If so, you can wipe any partition this way, just substitute the appropriate mmcblk0pXX.
However, you must understand what exactly the dd command does and what are the consequences of it. It takes a raw partition and writes zeroes all over it. This not only removes the content but also the filesystem on it. This is what I understand as wiping, but that also means the filesystem must be recreated before the partition can be used again. It can also be dangerous to do this if the partition is currently mounted (especially if it's mounted r/w). A safer (but still not perfect) approach would be:
Code:
adb shell
mkdir -p /tmpmount
mount /dev/block/mmcblk0pXX /tmpmount || mount -o bind /dev/block/mmcblk0pXX /tmpmount
rm -rf /tmpmount/* /tmpmount/.[^.]*
umount /tmpmount
mmcblk0pXX is of course the partition you want to wipe.
Click to expand...
Click to collapse
Yes I vaguely remember this, but I can manage. Thanks for all your help... I'm working on updating FFW...
Jeez, you'd think a Recognized Contributor would remember to click THANKS.

symlink /data/data to /mnt/sdcard

Hi... I have a rooted Sony Xperia J. It has phone memory of 764 mb, Internal SD card of 2.01gb and an ext SD card of 32gb.
What I want to do is move my app data which I think is in /data/data to my internal SD card which I think is mounted at /mnt/sdcard? I am going to create a folder on my sdcard called data.
I need some advice though as to whether this is possible and safe to do?
is it as simple as doing;
mkdir /mnt/sdcard/data
cp -r /data/data /mnt/sdcard/data
ln -s /data/data /mnt/sdcard/data
Then rebooting ?
in fact, thinking this might be a better option? Please can someone confirm this wont brick my phone?
mkdir /mnt/sdcard/data
mkdir /mnt/sdcard/app
cp -r /data/data /mnt/sdcard/data
cp -r /data/app /mnt/sdcard/app
ln -s /data/data /mnt/sdcard/data
ln -s /data/app /mnt/sdcard/app
Then rebooting ?
Sorry, I am doing lots of reading on this, but still haven't seen if anyone has done exactly this before. Would like some confirmation. I think I got the linking the wrong way around, so I now think it should be like this;
mkdir /mnt/sdcard/data
mkdir /mnt/sdcard/app
cp -pr /data/data /mnt/sdcard
cp -pr /data/app /mnt/sdcard
rm -r /data/data
rm -r /data/app
ln -s /mnt/sdcard/data /data/data
ln -s /mnt/sdcard/app /data/app
Then rebooting ?
yeah, that doesnt workd... soft bricked
ninjaprawn said:
yeah, that doesnt workd... soft bricked
Click to expand...
Click to collapse
Just in case someone needs this.
This wont work as you guys described because you need to format your card to EXT2 or EXT4, android is linux and needs perms wich FAT32 dont have. Also you need to make init script to mount the sdcard at boot and not at startup.
magix01 said:
Just in case someone needs this.
This wont work as you guys described because you need to format your card to EXT2 or EXT4, android is linux and needs perms wich FAT32 dont have. Also you need to make init script to mount the sdcard at boot and not at startup.
Click to expand...
Click to collapse
But is there any app that makes it easy?
i've a tablet vega with honeice android.
my problem is /data dimension, too.
i'm using link2sd app but /data is full, evenly.
why?

[Q] Safestrap

First off, yes i am a noob, I own that! I have safestrap install on my S4 (verizon). I am trying to sell the phone but i can't seem to get safestrap removed before I get rid of it. The buyer wants it off of the phone. I have uninstalled the recovery, but when the phone boots it still gives me the option to go into the recovery. How do i get rid of safestrap? I can't make sense of the manual removal process through the adb shell.
Please help!!
Thank you
Odin is your friend.
Download terminal emulator from Play.
Go here:
http://forum.xda-developers.com/showthread.php?t=2441441
Run this on Terminal Emulator:
su
mount -o remount,rw /system
mv /system/etc/init.qcom.modem_links.sh.bin /system/etc/init.qcom.modem_links.sh
rm -rf /system/etc/safestrap
rm /system/etc/firmware/q6.mdt
ln -s /firmware/image/q6.mdt /system/etc/firmware/q6.mdt
mount -o remount,ro /system
su granted but permission denied?
Tool Belt said:
su
mount -o remount,rw /system
mv /system/etc/init.qcom.modem_links.sh.bin /system/etc/init.qcom.modem_links.sh
rm -rf /system/etc/safestrap
rm /system/etc/firmware/q6.mdt
ln -s /firmware/image/q6.mdt /system/etc/firmware/q6.mdt
mount -o remount,ro /system
Click to expand...
Click to collapse
I'm a bit confused...just ran these commands on my ATT MF3 s4 running 4.2.2 after uninstalling the safestrap app, and when i start the terminal emulator it asks for SU access, which i grant...but after running this command:
rm -rf /system/etc/safestrap
i ALWAYS get "permission denied"
How is that possible? if i'm granting SU access..what more permissions do i need that i'm missing?
Anyone else get this when entering that specific command?
If so....any help would be appreciated....
Cheers!

Categories

Resources