TWRP wipe rm -fr sufficient? - General Questions and Answers

Is the rm -fr wipe option in TWRP sufficient for cleaning out /data /system /boot /cache etc?
Does it also perform a rm -fr .* to delete hidden files and directories?

NECRO REPLY INBOUND!!!!
Yes it is. You probably know this by now, but yes, it is. I use it on my Nexus 10 as formatting using make_ext4fs is horribly slow, often taking a few minutes compared to a few seconds. Either way it removes all the files in the selected partition.

Related

modified: Installing & Run application on sdcard

WARNING: Proceed at your own risk, this may damage your phone and/or make it unstable. This is for advanced users only and should only be attempted by those who understand the risks of the following changes
Original post: http://www.androidin.net/thread-1099-1-1.html
AS usual, this is for those WITH ROOT ONLY
Preparation:
1. Installed JF RC30 V1.2 (only if you are using JF RC30 1.2 , this is not compatible with RC8)
2. Make a NANDROID backup (you may get everything back to normal if the phone screw up)
3. A MICRO-SD card with 2 partitions divided : (1) a fat-32 partition, (2) a ext2, you need a linux/mac to format the sdcard with ext2 partition
* the fat 32 will be mounted as sdcard and the ext2 will be mounted as /sd for application data, make your own decision for the size*
4. insert the sdcard with 2 partition on the phone
5. set the phone to aeroplane mode for safe
Procedure:
1. adb pull /system/etc/mountd.conf /*somewhere you may want to back it up*
2. rm -f /system/etc/mountd.conf
3. using the modified mountd.conf, adb push /*the path of modified mount.conf */mount.conf /system/etc/mountd.conf
4. adb pull /system/init.rc /*somewhere you may want to back it up*
5. rm -f /system/init.rc
6. using the modified init.rc, adb push /*the path of modified init.rc*/init.rc /system/init.rc
7. reboot
8. busybox cp -a /data/app /sd/
9. rm -r /data/app
10. ln -s /sd/app /data/app
11. reboot
Now, the phone will install and run everyone on /sd, still mounting /sdcard as usual. It is possible that to mount or unmount /sdcard by usb without everything screwed up. Beware that your sdcard will be used as part of system, removing the sdcard may freeze the phone. If the phone get freeze because of removing the sdcard, plug the sdcard again and soft reset.
It is also possible that copy the application data to another card. If you want to change the sdcard, switch the phone off, mounting the sdcard to computer directory, copy the /sd partition to another sdcard with ext2 partition
Back to normal:
1. rm -f /system/etc/mountd.conf
2. adb push /*the backup of mountd.conf* /system/etc/mountd.conf
3. rm -f /system/init.rc
4. adb push /*the backup of init.rc* /system/init.rc
5. busybox cp -a /sd/ /data/app
6. rm -r /sd/
Change of mountd.conf:
changing /dev/block/mmcblk0 to /dev/block/mmcblk0p1
change of init.rc:
adding
insmod /system/modules/2.6.25-01843-gfea26b0/kernel/fs/ext2/ext2.ko
mknod /dev/mmcblk0p2 b 179 2 1000
mount ext2 /dev/mmcblk0p2 /sd noatime nodiratime
Any chance of this being simplified into the actual commands necessary for this!?
I'm a semi-noob at *nix stuff... I can format my SD card into 2 partitions, but I'm lost at step 4... What do we need to edit??
Changed step 4...just adb pull the mount.conf for editing..open the file in text editor..find "mmcblk0" and change it "mmcblk0p1" ..save the .conf...del the original one..push the new one to the original directory..
Yay. Now hopefully we can get this in an update.zip to flash
Yeah, I'm putting off doing this until someone makes an update.zip which I definitely know how to apply and get rid of if I screw anything up
REPLACES the internal memory...?
So the internal memory isnt used?
kinda the same trick as the browser cache and market cache, just a bit more complex as its an entire filesystem your moving, which wouldnt let the sys see the internal, mem, please correct me if im reading it wrong, Im not a total noob at linux but no guru dev either...
bhang
The internal memory is still used, just not for /data/app
19.rm -r /data/app
20.ln -s /sd/app /data/app
Click to expand...
Click to collapse
It should probably be /sdcard/app. In any case, this is a fairly complex mod that is not suited for Linux newbies. I would advise against folks considering this mod unless they understand and can test each step before attempting.
I agree and added a warning to the first post
Ummm yea, so what happens when you mount your sdcard for storage? I expect the phone goes crazy?
This tutorial, if you could call it that,(no offense) is really badly written and this process seems too risky for what you gain considering that if we are patient google will come out with this themselves.
Stericson
Stericson said:
Ummm yea, so what happens when you mount your sdcard for storage? I expect the phone goes crazy?
This tutorial, if you could call it that,(no offense) is really badly written and this process seems too risky for what you gain considering that if we are patient google will come out with this themselves.
Stericson
Click to expand...
Click to collapse
The procedure calls for two partitions on the microsd, one FAT32, other EXT. Theoretically it should work with mounting for mass storage. However, I agree that it's a rather sloppy hack.
There is talk about a similar strategy being officially implemented by the Android team. Instead of two partitions, it would be loopback mounted to a file in the FAT32. That would also provide some encryption security. See here. It's just talk though. Won't be a reality for at least a few months.
Well talk is certainly better than nothing...thanks for the info....
Stericson
I post a method withtout compiling the ramdisk.img but that do not force mounting the sd ext2 drive under rootfs but still workable...probably when i back to work I can compile 1 to flash
Am I the only one that thinks there are a few things that are getting 'lost in translation' here?
I'm not getting /sd mounted properly upon reboot...there's no way I'm going to continue attempting this till I see a better (no offense) tutorial or do a little more research on the command lines.
I would really shy away from this if you're an average user or don't know what mountd and init.rc files are used for....this could flat out wreck your phone.
TheDudeOfLife said:
Am I the only one that thinks there are a few things that are getting 'lost in translation' here?
I'm not getting /sd mounted properly upon reboot...there's no way I'm going to continue attempting this till I see a better (no offense) tutorial or do a little more research on the command lines.
I would really shy away from this if you're an average user or don't know what mountd and init.rc files are used for....this could flat out wreck your phone.
Click to expand...
Click to collapse
/sd is /sdcard (mount point for the micro sd card's partition)
I'm getting stuck right here:
8. busybox cp -a /data/app /sd/
9. rm -r /data/app
10. ln -s /sd/app /data/app
11. reboot
It's saying read only system blah blah, even though I have indeed mounted it is rw
pershoot said:
/sd is /sdcard (mount point for the micro sd card's partition)
Click to expand...
Click to collapse
No....no it is not.
/sd is a mount of the ext2 partition used for the 'copy' of /data/app (one of the things i disagreed with is picking /sd as a mount point for the second partition.)
/sdcard is the fat32 mount point...used as usual for mounting files.
IzzeLing said:
I'm getting stuck right here:
8. busybox cp -a /data/app /sd/
9. rm -r /data/app
10. ln -s /sd/app /data/app
11. reboot
It's saying read only system blah blah, even though I have indeed mounted it is rw
Click to expand...
Click to collapse
Type mount in adb shell and see if /sd is even mounted. I wasn't seeing it in my list. I don't think his mount command in the init.rc is correct, but I'm too busy with holiday stuff.
Don't rm -r /data/app if you have not 100% verified the copy works.
This line looks mangled (need flags in the args):
Edit: nevermind, looks like it should work in the init.rc
TheDudeOfLife said:
No....no it is not.
/sd is a mount of the ext2 partition used for the 'copy' of /data/app (one of the things i disagreed with is picking /sd as a mount point for the second partition.)
/sdcard is the fat32 mount point...used as usual for mounting files.
Click to expand...
Click to collapse
ahh yea. i just re-glanced over the instructions.
cool.
TheDudeOfLife said:
Type mount in adb shell and see if /sd is even mounted. I wasn't seeing it in my list. I don't think his mount command in the init.rc is correct, but I'm too busy with holiday stuff.
Don't rm -r /data/app if you have not 100% verified the copy works.
Click to expand...
Click to collapse
Yeah, don't see it. Hm.

Dalvik cache gone wrong

I was reading that you could save some space by moving your dalvik cache to your sd card, so i was trying to move it, and somehow i botched the code up.
Now when i reboot i lost my open home, and currently, have the default one, what is worse is that, all my apps are gone everything. I am still on JF 1.42 RC but i can't install nor uninstall anything, and the phone doesn't show any other programs then the default one. Terminal is not there, and i can't gain any method to it. I check my sd card and the dalvik cahce is there, i am hoping that maybe i didn't sim link it correctly? The phone still shows more or less the same space as though i have apps install however it doesn't show the app for me to access.
What can i do?
you can try:
rm /data/dalvik-cache
mkdir /data/dalvik-cache
chmod 0771 /data/dalvik-cache
from adb shell. (btw, stop if the first line returns an error)
without the dalvik-cache folder you won't be able to do anything that involves unpaking apk packages (that's basically everything you do on an android).
I strongly advice you not to put the folder on sd.
This also demonstrates the importance of a bakup before doing anything to the phone, or anything for that matter.
Can i insert the command in the terminal during home+power and alt X because i can't get my adb to work correctly?
yes, but you'll have to mount the data partition first:
mount -t yaffs2 /dev/block/mtdblock5 /data
and then:
rm /data/dalvik-cache
(you don't have to type the other 2 commands, because the system will create the directory automatically during boot)
and in this case you'll have to reboot properly: either use the reboot command or home+back
naTTan said:
Can i insert the command in the terminal during home+power and alt X because i can't get my adb to work correctly?
Click to expand...
Click to collapse
OK ignore that i have just gotten adb to work, not in fastboot thought, i think the driver is a bit messed up in that state, but it works fine if the phone is on.
Thank you bill.cn i was able to regain some function with your help however now open home is giving me repeated stop messages, how can i uninstall it using adb?
Do i just remove it from data/app?
Help again ?
naTTan said:
OK ignore that i have just gotten adb to work, not in fastboot thought, i think the driver is a bit messed up in that state, but it works fine if the phone is on.
Thank you bill.cn i was able to regain some function with your help however now open home is giving me repeated stop messages, how can i uninstall it using adb?
Do i just remove it from data/app?
Help again ?
Click to expand...
Click to collapse
Safest way would be to go to settings->applications->OpenHome and then uninstall it. Remember, android isn't expecting users to add and remove apps using the terminal so doing it the normal way is best when possible.
billc.cn said:
you can try:
rm /data/dalvik-cache
mkdir /data/dalvik-cache
chmod 0771 /data/dalvik-cache
from adb shell. (btw, stop if the first line returns an error)
without the dalvik-cache folder you won't be able to do anything that involves unpaking apk packages (that's basically everything you do on an android).
I strongly advice you not to put the folder on sd.
Click to expand...
Click to collapse
There is nothing wrong with moving dalvik to sdcard, I did it with absolutely no problems. I can do everything i could do before with dalvik to sdcard.
nattan - make sure you do a nandroid backup before doing something like this
I had the same problem... thank god for Nandroid!
Anyways, what happened is you deleted the dalvik-cache. The thing is, its not the same type of cache as your browser, where if there is no data, the browser will pull new data.
Not the case here.
To prevent that, you NEED to copy the contents, THEN symlink.
Similar to the way you did apps move. You don't rm -R them unless you have copied it first.
naTTan said:
OK ignore that i have just gotten adb to work, not in fastboot thought, i think the driver is a bit messed up in that state, but it works fine if the phone is on.
Thank you bill.cn i was able to regain some function with your help however now open home is giving me repeated stop messages, how can i uninstall it using adb?
Do i just remove it from data/app?
Help again ?
Click to expand...
Click to collapse
The safest way is to try Settings first. If it doesn't work, you can remove the apk from /data/app and the data folder in /data/data (needs root)
Ryanmo5 said:
There is nothing wrong with moving dalvik to sdcard, I did it with absolutely no problems. I can do everything i could do before with dalvik to sdcard.
nattan - make sure you do a nandroid backup before doing something like this
Click to expand...
Click to collapse
I am just worried about performance and stability problem. I think normal sdcard isn't really designed to hold a program cache.
Thanks for all your help, i couldn't at all access settings because open home was constantly giving errors. I had to ultimately remove it from /data/app and reinstall it.
I might consider moving the cache again, however not in the near future =P
Here you go:
kingblind said:
I figured out how to move the Dalvik Cache..
busybox cp -a /data/dalvik-cache /system/sd/dalvik-cache
rm -rf /data/dalvik-cache
ln -s /system/sd/dalvik-cache /data/dalvik-cache
reboot
Click to expand...
Click to collapse
Ok something is not going right here, i tried it again and sure enough the same error happens, i am sure i put the code correctly so what is wrong here?
I followed this code :
Dalvik Cache
busybox cp -a /data/dalvik-cache /sdcard/dalvik-cache
rm -rf /data/dalvik-cache
ln -s /sdcard/dalvik-cache /data/dalvik-cache
reboot
twice and the same error happens, at first i thought i botch the code up but since it happened again, i think not.
When i put in the first command, the busybox one, it gives multiple warning, can't preserve ownership or permission, is that what is wrong? If so why?
naTTan said:
Ok something is not going right here, i tried it again and sure enough the same error happens, i am sure i put the code correctly so what is wrong here?
I followed this code :
Dalvik Cache
busybox cp -a /data/dalvik-cache /sdcard/dalvik-cache
rm -rf /data/dalvik-cache
ln -s /sdcard/dalvik-cache /data/dalvik-cache
reboot
twice and the same error happens, at first i thought i botch the code up but since it happened again, i think not.
When i put in the first command, the busybox one, it gives multiple warning, can't preserve ownership or permission, is that what is wrong? If so why?
Click to expand...
Click to collapse
Try this:
su
busybox cp -a /data/dalvik-cache /sdcard/dalvik-cache
rm -rf /data/dalvik-cache
ln -s /sdcard/dalvik-cache /data/dalvik-cache
reboot
If you're doing anything that involves the root of the program, type in "su" first.
I did put su and waited for it to turn to # however the problem still persist.
For example is says
cp : cannot preserve ownership of ' /sdcard/dalvik-cache/dalvik-cache/[email protected]@[email protected] : operation not permitted.
This happens to all apps so i can't usually proceed with moving the dalvik cache.
Any idea guys?
usually that means that it requires the ext2 filesystem and you should be copying to the /system/sd directory. But if this can be done to the /sdcard fat32 filesystem then try the cp without -a
I am just guessing since I haven't tried to use the /sdcard (fat32) for anything but storage.
I thought dalvik cache can be put on the sdcard and doesn't need a ext2 partition, can someone verify this? Anyone here running it of the SDcard on a fat32 partition?
i tried cp without -a but it says, /data/dalvik-cache was ommited. can i use cp -r?
I'm no guru, just a noob that takes notes...lol. I don't know if this will help but in the 2nd line what does the f (rm -rF) do? I ask because the line I used doesn't have it and I had/have no issues with the dalvik.
busybox cp -a /data/dalvik-cache /system/sd/dalvik-cache
rm -r /data/dalvik-cache
ln -s /system/sd/dalvik-cache /data/dalvik-cache
reboot
hope this helps.
I would wager to bet that the Dalvik-Cache requires the permission model that is absent in Fat32, meaning it must be moved to the EXT2 partition, so the advice to put it onto your /sdcard/ and not /system/sd, is very bad.
my dalvik cache copies over ok- i can see it there with ls, but when i try to remove the dalvik cache it gives me a read only error- i am using 5.02Hr3? not possible to move dalvik for this version?
***edit**** apparently when if used the -rf instructions it gave me this error- just used -r and it worked great. internal storage gone from 29MB to 65!!!

Cache On Sd Card

After following this guide,
http://android-dls.com/wiki/index.php?title=Haykuro_Apps_to_SD#Preparing_SD_card
A friend said do this to move all your phones cace to sd card
Code:
rm -rf /data/dalvik-cache
ln -s /system/sd/dalvik-cache /data/dalvik-cache
But my question is what are the cons and pros about it?
One thing I heard is it shortens its life, but how much of it is shorten?
Code:
cp -a /data/dalvik-cache /system/sd
rm -rf /data/dalvik-cache
ln -s /system/sd/dalvik-cache /data/dalvik-cache
this is the right code I don't have any issues atm. I'm using 16gb class6 may ext2 is 500mb but my I didn't move my /data/data to sd because I noticed a little lag if I move my /data/data to sd
the new sd cards are tested for millions of write cycles. you would have to write constantly for years to reach that. you will be ok. the worst is you would have to replace your card after a few years. by then they will have 100gb micro sd cards(maybe an exageration) .
jrherras said:
Code:
cp -a /data/dalvik-cach /system/sd
rm -rf /data/dalvik-cache
ln -s /system/sd/dalvik-cache /data/dalvik-cache
this is the right code I don't have any issues atm. I'm using 16gb class6 may ext2 is 500mb but my I didn't move my /data/data to sd because I noticed a little lag if I move my /data/data to sd
Click to expand...
Click to collapse
someone said the first part is
Code:
/system/sd/
not
/system/sd
Which one is it?
tanner2007 said:
someone said the first part is
Code:
/system/sd/
not
/system/sd
Which one is it?
Click to expand...
Click to collapse
doesn't matter
system/sd
system/sd/
/system/sd
/system/sd/
they're all the same
jrherras said:
doesn't matter
system/sd
system/sd/
/system/sd
/system/sd/
they're all the same
Click to expand...
Click to collapse
Thank you, after looking at your siggy i see you have
" Cache, Dalvik-cache on SD"
there are two different caches? if so, should I move both?
I have apps on sd right now my class 6 chip, now I wanna move cache, all caches
Sorry to bump, just now I learn theres a few different caches, which are the phone ones that could help speed up the phone
jrherras said:
doesn't matter
system/sd
system/sd/
/system/sd
/system/sd/
they're all the same
Click to expand...
Click to collapse
Oh, don't agree.
For the first two be the same as last two you need to be in the '/' directory.
I don't really think a normal card can last that long. Flash devices are divided to many "pages" and you have to write one whole page each time, so we have to use file systems that take this into account (e.g. yaffs and jffs). if you don't use such file system, a page could be re-written hundreds of times just to save one file. this is made even worse, in case of inode tables, journals, and frequently used files. (this is why they use ext2 with noatime.) your card could easily die in months!!!
also, android doesn't have file system check on boot and the linux design assumes all file system are intact (that's why you're forced to do fsck on normal linux boot), so if the fs on your card is corrupted, the os will not complain and will keep messing it up!!
don't cry when you have to wipe because the phone can't access dalvik-cache and hang on boot.

How to swap SD cards w/ Apps2SD

All props go to Jonnythan who gave the steps in another post. Mods may want to sticky this....
1. As always: Nandroid backup
2. reboot phone
3. adb shell into the phone
4. mkdir /sdcard/backup/
mkdir /sdcard/backup/app
mkdir /sdcard/backup/app-private
cp -r /data/app/* /sdcard/backup/app/
cp -r /data/app-private/* /sdcard/backup/app-private/
5. copy sd card to pc
6. Shut off phone and remove old sdcard and insert new sdcard
7. Start in recovery mode and partition new sdcard (fat32, ext2, swap)
8. Enable usb mode, copy data from old sdcard to newly partitioned sdcard
9. reboot and ignore force closings
10. Plug in USB and enable USB mode
From PC ADB shell into phone and type the following (enter after each line):
rm -r /data/app/*
rm -r /data/app-private/*
[chances are those directories are empty already, but you never know]
cp -r /sdcard/backup/app/* /data/app/
cp -r /sdcard/backup/app-private/* /data/app-private
reboot recovery
11. Restore most recent nandroid
12. reboot and enjoy
All thanks again to Jonnythan
Tweaks:
Between 5 and 6, shut off phone. Then start step 7 by specifying to start into recovery mode to partition the card. Then specify that you need to plug in the usb and adb shell for step 10. End step 10 by typing in "reboot recovery" which will reboot you right into the recovery partition.
Thanks for writing it up! Now I don't have to
Ok, I must be doing something wrong here... Does this require a custom ROM or anything? Im on the sprint Hero, stock ROM and I do have root. Everytime I get to step 4, at the cp -r /data/app/* /sdcard/backup/app/ command i get an error. It cant find the directory. Also, if i check the folder properties through Astro or linda file manager, it says 0 files, 0 folders, and also shows that it is not taking up any space. Just as a test to see if I was somehow blocked, I made a nandroid backup and deleted the /data folder, and upon reboot nothing had changed. Still have all of my apps on the phone...
I think the stock ROM doesn't include the cp command.
jonnythan said:
I think the stock ROM doesn't include the cp command.
Click to expand...
Click to collapse
Wait, when i get my sd card I have to do all this? I can't just reformat using the utility and drag and drop everything back into the sd card?
runsoverfrogs said:
Wait, when i get my sd card I have to do all this? I can't just reformat using the utility and drag and drop everything back into the sd card?
Click to expand...
Click to collapse
Not if you're using AppsToSD.
If you're not using A2SD then just make a backup of the old card, unmount it, put the new one in, and copy everything back. If you are using A2SD, the process is more complex.
Cp = Copy. Works on any rom. Like he said since you're on the stock rom, I doubt you're using Apps2SD so no you don't have to do all this.
If only people would actually read the thread title....
"How to swap SD cards w/ Apps2SD."
Don't have Apps2SD? Then this isn't the thread for you.
Exactly what I was thinking.
jonnythan said:
If only people would actually read the thread title....
"How to swap SD cards w/ Apps2SD."
Don't have Apps2SD? Then this isn't the thread for you.
Click to expand...
Click to collapse
I'm using the modaco 1.1, i should've mentioned that. Doesnt that come with Apps2SD built in?
Only if you partitioned your sd card before you flashed.
After step 6, how do you boot into recovery mode to partition the new card if you dont have the recovery image on the new card? Did I miss a step where I added the recovery image to the new card?
chalan30 said:
After step 6, how do you boot into recovery mode to partition the new card if you dont have the recovery image on the new card? Did I miss a step where I added the recovery image to the new card?
Click to expand...
Click to collapse
The recovery partition is installed on the phone itself, not the card.
thanks I dont know why the first time I tried i didn't get back into the recovery screen but the second time I booted into it just fine... oh well thanks for all your hard work!!!
Partitioning links
To partition the new card, you might want to include links to sdparted and this page for people who want to do it manually.
I have a question about how to make the swap. I have moved /data/dalvik-cache/ to my sd card and freed up about 25 meg of space on internal memory. Is there anything I need to do in addition to your instructions or would it be better to just do a wipe and start from scratch. I am using MoCaDo 1.2 Rom using apps2sd and ext3 partition. I have a 16 gig card coming. By moving the cache I now have 143 meg of internal memory with about 65 apps installed counting some of the stock apps. I have removed several of those as well. 34 apps from the market or handmark.
esoteric1311 said:
All props go to Jonnythan who gave the steps in another post. Mods may want to sticky this....
1. As always: Nandroid backup
2. reboot phone
3. adb shell into the phone
4. mkdir /sdcard/backup/
mkdir /sdcard/backup/app
mkdir /sdcard/backup/app-private
cp -r /data/app/* /sdcard/backup/app/
cp -r /data/app-private/* /sdcard/backup/app-private/
5. copy sd card to pc
6. Shut off phone and remove old sdcard and insert new sdcard
7. Start in recovery mode and partition new sdcard (fat32, ext2, swap)
8. Enable usb mode, copy data from old sdcard to newly partitioned sdcard
9. reboot and ignore force closings
10. Plug in USB and enable USB mode
From PC ADB shell into phone and type the following (enter after each line):
rm -r /data/app/*
rm -r /data/app-private/*
[chances are those directories are empty already, but you never know]
cp -r /sdcard/backup/app/* /data/app/
cp -r /sdcard/backup/app-private/* /data/app-private
reboot recovery
11. Restore most recent nandroid
12. reboot and enjoy
All thanks again to Jonnythan
Click to expand...
Click to collapse
I see some possible problems with this method... what happens if you're copying the sdcard onto a windows machine to backup? You'll lose symlinks, uid, and the like.
Also, what if /app and /app-private don't get put back onto the new sdcard? You'll end up with symlinks that point to nothing.
How 'bout this method? (just a little tweak).
Boot into recover (adb shell reboot recovery)
when recovery comes up, go to the shell (adb shell)
Then, issue these commands (this assumes your ext partition is ext3, and that you're using Amon-Ra's recovery so you have BusyBox 1.13.2 or later):
mkdir /sdcard/extback
mount -o ro -t ext3 /dev/block/mmcblk0p2 /system/sd
cp -a /system/sd/. /sdcard/extback/
Now, back up the sdcard to a linux machine... keeping uid's and everything the same.
Turn the phone off, swap the cards, reboot into recovery (manually), format, partition, and convert ext2->ext3 the sdcard, put all the stuff back onto the card... and in the shell (within recovery
mount -o rw -t ext3 /dev/block/mmcblk0p2 /system/sd
cp -a /sdcard/extback/. /system/sd/
reboot
Now, it should all come up with the same attributes, no force close, and everything...
Basically, this method would swap sd cards outside of the normal OS (in recovery), but would keep all the attributes, symlinks, and uids the same for the main OS.
I think if you're using a windows box to backup the card, then we may want to look into making a tarball of the ext partition. I'm not sure if Amon-Ra's recovery supports this or not.
jmanley69 said:
I see some possible problems with this method... what happens if you're copying the sdcard onto a windows machine to backup? You'll lose symlinks, uid, and the like.
Also, what if /app and /app-private don't get put back onto the new sdcard? You'll end up with symlinks that point to nothing.
How 'bout this method? (just a little tweak).
Boot into recover (adb shell reboot recovery)
when recovery comes up, go to the shell (adb shell)
Then, issue these commands (this assumes your ext partition is ext3, and that you're using Amon-Ra's recovery so you have BusyBox 1.13.2 or later):
mkdir /sdcard/extback
mount -o ro -t ext3 /dev/block/mmcblk0p2 /system/sd
cp -a /system/sd/. /sdcard/extback/
Now, back up the sdcard to a linux machine... keeping uid's and everything the same.
Turn the phone off, swap the cards, reboot into recovery (manually), format, partition, and convert ext2->ext3 the sdcard, put all the stuff back onto the card... and in the shell (within recovery
mount -o rw -t ext3 /dev/block/mmcblk0p2 /system/sd
cp -a /sdcard/extback/. /system/sd/
reboot
Now, it should all come up with the same attributes, no force close, and everything...
Basically, this method would swap sd cards outside of the normal OS (in recovery), but would keep all the attributes, symlinks, and uids the same for the main OS.
I think if you're using a windows box to backup the card, then we may want to look into making a tarball of the ext partition. I'm not sure if Amon-Ra's recovery supports this or not.
Click to expand...
Click to collapse
Now I'm confused don't take much.
I tried reading the ext2 partition using ubuntu and loading it temp on my windows 7 PC. It would not let me open that partition so I could not copy anything to it.
I guess the easiest way is to just wipe the phone back to factory, booting to recovery with the new card in and create the fat32-ext2-swap partition, re-flash the MoDaCo or any Rom that uses Apps2Sd and install all my apps again. I am assuming this would work as well.
jmanley69 said:
I see some possible problems with this method... what happens if you're copying the sdcard onto a windows machine to backup? You'll lose symlinks, uid, and the like.
Also, what if /app and /app-private don't get put back onto the new sdcard? You'll end up with symlinks that point to nothing.
How 'bout this method? (just a little tweak).
Boot into recover (adb shell reboot recovery)
when recovery comes up, go to the shell (adb shell)
Then, issue these commands (this assumes your ext partition is ext3, and that you're using Amon-Ra's recovery so you have BusyBox 1.13.2 or later):
mkdir /sdcard/extback
mount -o ro -t ext3 /dev/block/mmcblk0p2 /system/sd
cp -a /system/sd/. /sdcard/extback/
Now, back up the sdcard to a linux machine... keeping uid's and everything the same.
Turn the phone off, swap the cards, reboot into recovery (manually), format, partition, and convert ext2->ext3 the sdcard, put all the stuff back onto the card... and in the shell (within recovery
mount -o rw -t ext3 /dev/block/mmcblk0p2 /system/sd
cp -a /sdcard/extback/. /system/sd/
reboot
Now, it should all come up with the same attributes, no force close, and everything...
Basically, this method would swap sd cards outside of the normal OS (in recovery), but would keep all the attributes, symlinks, and uids the same for the main OS.
I think if you're using a windows box to backup the card, then we may want to look into making a tarball of the ext partition. I'm not sure if Amon-Ra's recovery supports this or not.
Click to expand...
Click to collapse
Well, for one thing your method requires a linux machine
But what would you even have symlinks on the SD card for? Symlinks, uids, and attributes on SD card files simply aren't an issue at all for most people.
And truthfully if you are already doing that kind of stuff, you don't need this guide.
jonnythan said:
Well, for one thing your method requires a linux machine
But what would you even have symlinks on the SD card for? Symlinks, uids, and attributes on SD card files simply aren't an issue at all for most people.
And truthfully if you are already doing that kind of stuff, you don't need this guide.
Click to expand...
Click to collapse
As far as Linux... get VMWare player for free and download ubuntu and you're set real fast. Also if you notice what I said about doing a tar instead id using Linux.
As far as symlinks. You're right there "shouldn't" be any... but if you're backing up something why not do it right just in case? We have no idea what future versions of apps2ad sill do. It may happen that a file MUST reside on internal memory and therefore you'd need a symlink.
As far as the rest...
Actualy... each app gets its own user id and mismatches in those can cause problems with some apps. And each file in Linux gets attributes to tell the OS who is allowed ti read/write/execute it. If those get messed up it can cause problems.
So... we have a responsibility aa educators to give the best instructions possible. And not give instructions that ultimately would result in a backup that is missing vital information and would lead to a complete reload to fix the problems.
There are many reasons why Google decided to restrict apps to internal memory and we will never know all of them... this may very well be one of the problems they saw happening.

Fastboot's Wipe Cache Partition very slow on 6.0?

Like the title says, it takes about 5 - 10 minutes to perform a wipe from Recovery, where in Lollipop and before, it was a few seconds. A couple of websites have corroborated this.
Does anyone know what's changed in 6.0 that a cache wipe takes so long? I'm on an unrooted N5 and performed a clean factory flash (and re-locked the bootloader).
Did we go from
Code:
mkfs -t ext4 /dev/[device]
to
Code:
rm -rf /cache/*
or something? I mean, even formatting a heavily encrypted partition shouldn't take that long (especially one as small as /cache).
Anyone?
Sicily1918 said:
Like the title says, it takes about 5 - 10 minutes to perform a wipe from Recovery, where in Lollipop and before, it was a few seconds. A couple of websites have corroborated this.
Does anyone know what's changed in 6.0 that a cache wipe takes so long? I'm on an unrooted N5 and performed a clean factory flash (and re-locked the bootloader).
Did we go from
Code:
mkfs -t ext4 /dev/[device]
to
Code:
rm -rf /cache/*
or something? I mean, even formatting a heavily encrypted partition shouldn't take that long (especially one as small as /cache).
Anyone?
Click to expand...
Click to collapse
Likely it was the other way around: in 5.x.x, a simple rm -rf was used; in 6.x, mkfs.ext4 is used.
beekay201 said:
Likely it was the other way around: in 5.x.x, a simple rm -rf was used; in 6.x, mkfs.ext4 is used.
Click to expand...
Click to collapse
Hmmm... typically an rm is far slower than mkfs, especially on such a small filesystem with lots of files.
Interestingly enough, I tried it on the wife's N5. The first time took about 20 - 30 seconds, but after everything installed, it took more like 8 minutes, much like on my N5, so it must be a Marshmallow thing.
I don't agree. rm is much faster than formatting.
Sent from my Nexus 5 using Tapatalk

Categories

Resources