Backing up of /system/sd as .img along with nandroid - G1 Android Development

When ever I do a nandroid backup i partially backup my system as my "apps" "apps-private" & dalvik-cache" folders are on my /system/sd partition ( /dev/block/mmcblk0p2 ).
To fully backup i need to somehow backup my "/system/sd" along with my nandroid backup.
Now If i copy all the stuff to "/sdcard" I loose all my file permissions, so its not an option.
One option is to use "dd" command which will say something like this
Code:
dd if=/dev/block/mmcblk0p2 of=/sdcard/nandroid/SDBACKUP.img
( the final-full script will generate today's date-time for name etc. etc. )
what will be achieved with this, is that it will create an exact binary copy of the EXT3 partition maintaining all the permissions etc. in that point of time. with same "dd" command you can re flash this img file back to your EXT3 partition.
It all sounds good, but there is a problem and I need someone to help me out here. currently the "dd" which is available in busybox is crippled as it can only handle File->File (byte wise) copy and No Partition -> File or vice-versa .
If anyone out there has a proper build environment ready for building binaries for android( I dont have it set up ) and can build full "dd", I'll be really thankful. you can find dd in GNU Fileutils(If you can build stuff for linux you know where i am pointing you).
If someone has any other ideas to achieve this please comment.

you can do that with adb.
Adb pull /system/sd/* c:\
Or use the ADB File explorer
Then just adb push it back when you need it

why don't you mount /system/sd and /sdcard from recovery and do 'cd /system/sd && tar czpf /sdcard/ext-backup/`date +%F-%I.%M`.tar.gz *'. This backup will be much smaller than your 'dd' backup.
eventually, its needs to be built into nandroid backup.

Seems lovely!
What are the commands to restore this backup (devsk)?

devsk said:
why don't you mount /system/sd and /sdcard from recovery and do 'cd /system/sd && tar czpf /sdcard/ext-backup/`date +%F-%I.%M`.tar.gz *'. This backup will be much smaller than your 'dd' backup.
eventually, its needs to be built into nandroid backup.
Click to expand...
Click to collapse
Any reason we couldn't do this with a command from BetterTerminal or a script from GScript? Looks like you could backup without remounting, but would need to remount r/w to do a similar script to restore from the backup.
Could someone with some programming chops (devsk??) type out the necessary commands for the doing backup and restore from terminal? I would do it, but my skill with linux is not up to it.

Backup for Root Users does this really well. If you choose to, it will back up both the apks and the data associated with the applications so you don't lose any save game progress or preferences and will save it on Fat32 partition of your sdcard so you can just transfer it to your computer for a more secure backup.

Zappza said:
Seems lovely!
What are the commands to restore this backup (devsk)?
Click to expand...
Click to collapse
Code:
cd /system/sd && tar xzpf /sdcard/ext-backup/<gzip_file_to_restore>
You need to change <gzip_file_to_restore> to the actual file name which you want to restore e.g. if you want to restore 2009-07-23-06.04.tar.gz to your ext partition, you would do:
Code:
cd /system/sd && tar xzpf /sdcard/ext-backup/2009-07-23-06.04.tar.gz
This will restore the ext partition backup I took at 6:04pm on 23rd Jul. This code assumes that you have your ext partition mounted on /system/sd and fat32 partition mounted on /sdcard already. If not, you need to say 'mount /sdcard' and 'mount /system/sd' before the above.
Remember that the safest way to backup and restore filesystems is through the recovery console. So, I do a nandroid backup followed by the above tar czpf ('c' is for create) command to backup. This puts my complete backup on the first fat32 partition. Then, I do the reverse (restore from nandroid backup, and fire the above xzpf ('x' is for extract) command to restore my ext partition) to restore a ROM to its working condition.

Thanks this does seem a far better approach . I'll try it and update

My_Name_Is_Neo said:
Thanks this does seem a far better approach . I'll try it and update
Click to expand...
Click to collapse
It is dog slow though! All because of the CPU not able to handle the compression from gzip. It compresses nicely and produces a smaller gzip file but takes a while.

I like where this thread is headed...
subscribed, can't wait to see where this goes.

devsk said:
It is dog slow though! All because of the CPU not able to handle the compression from gzip. It compresses nicely and produces a smaller gzip file but takes a while.
Click to expand...
Click to collapse
I noticed! At first I thought that it did not work at all. Is it possible to disable the compression?

I think removing the "z" from the command and naming the file .tar instead of .tar.gz will not compress it.

My_Name_Is_Neo said:
I think removing the "z" from the command and naming the file .tar instead of .tar.gz will not compress it.
Click to expand...
Click to collapse
that's right. Backup will be faster but bigger. I am looking at another command to see if we can pass a -fast option to gzip.

devsk said:
Code:
cd /system/sd && tar xzpf /sdcard/ext-backup/<gzip_file_to_restore>
You need to change <gzip_file_to_restore> to the actual file name which you want to restore e.g. if you want to restore 2009-07-23-06.04.tar.gz to your ext partition, you would do:
Code:
cd /system/sd && tar xzpf /sdcard/ext-backup/2009-07-23-06.04.tar.gz
This will restore the ext partition backup I took at 6:04pm on 23rd Jul. This code assumes that you have your ext partition mounted on /system/sd and fat32 partition mounted on /sdcard already. If not, you need to say 'mount /sdcard' and 'mount /system/sd' before the above.
Remember that the safest way to backup and restore filesystems is through the recovery console. So, I do a nandroid backup followed by the above tar czpf ('c' is for create) command to backup. This puts my complete backup on the first fat32 partition. Then, I do the reverse (restore from nandroid backup, and fire the above xzpf ('x' is for extract) command to restore my ext partition) to restore a ROM to its working condition.
Click to expand...
Click to collapse
Okay, so I saw this thread and decided to repartition my card to resize my ext3 partition to a smaller size and add a swap partition just in case I want to use it in the future. I've been wanting to do this for a while, but have been putting it off because I didn't want to lose all my data on my ext3. So I followed your instructions and I kept getting 'tar: empty archive' errors no matter what I tried (czpf .tar.gz, cpf .tar, cd /system/sd then tar cpf, creating the backup folder beforehand, etc.). So I did some googling and this is what worked for me. This is just an FYI for others who are having trouble with this as I was.
To backup:
mount /system/sd
mount /sdcard
tar cpf /sdcard/ext-backup/backup.tar system/sd
No compression, so it was really quick. It made a ~180mb file in a few seconds. So I opened up the resulting file in winrar and it kept the folder structure and everything e.g. system->sd->contents of sd folder. So I'm guessing to restore, the command would be like this:
mount /system/sd
mount /sdcard
tar xpf /sdcard/ext-backup/backup.tar
I say I'm guessing because I ended up not needing to restore it. I was able to preserve the data on my ext3 partition after the resize. I did however end up having to format my fat32 partition, but I did a backup on that too.
BTW, I'm on Cyanogen's modded recovery.

you got "empty tar" error because you 1. Either forgot to mount /system/sd OR 2. you forgot the '*' towards the end of the cpf command.
You 'tar xpf ..." command is correct for the 'tar cpf ...' command that you typed above.
Note that you need to be in the right directory while creating the backup and restoring it.

test this last commands and it work well, forgot to mention that was made it thru recovery console, hitting the commands with my PC in CMD.

Thanks for the ideas and discussion in this thread... been wanting to set up something like this for a long time but was being lazy.
Have you guys had any luck with the '--exclude' switch on the tar binary that we've got (busybox link, looks like... at least with the Cyan mod that I'm using)?
I haven't done enough testing but it seems like the '--exclude' switch doesn't do anything/is ignored... I was trying to do something like this to ignore the dalvik-cache directory from my backups but it still includes it in the .tar.gz file:
Code:
cd /system/sd && tar czpf /sdcard/backup/systemsd_$NOW.tar.gz --exclude='/system/sd/dalvik-cache' *
(I am setting $NOW to the datestamp string I want with "NOW=`date +"%Y%m%d-%H%M"`" in my shell script)
I haven't tried the '-X' switch with an exclusion file list yet so I might give that a shot but was just trying to see if others played around some more with any of this stuff, etc.

rub1k said:
Thanks for the ideas and discussion in this thread... been wanting to set up something like this for a long time but was being lazy.
Have you guys had any luck with the '--exclude' switch on the tar binary that we've got (busybox link, looks like... at least with the Cyan mod that I'm using)?
I haven't done enough testing but it seems like the '--exclude' switch doesn't do anything/is ignored... I was trying to do something like this to ignore the dalvik-cache directory from my backups but it still includes it in the .tar.gz file:
Code:
cd /system/sd && tar czpf /sdcard/backup/systemsd_$NOW.tar.gz --exclude='/system/sd/dalvik-cache' *
(I am setting $NOW to the datestamp string I want with "NOW=`date +"%Y%m%d-%H%M"`" in my shell script)
I haven't tried the '-X' switch with an exclusion file list yet so I might give that a shot but was just trying to see if others played around some more with any of this stuff, etc.
Click to expand...
Click to collapse
You might be interested in this thread:
http://forum.xda-developers.com/showpost.php?p=4209412

Thanks much for that... nice job with the script.
I guess I need to do a bit more reading though and figure out if backing up the dalvik-cache is actually necessary (doesn't it get (re-)built at first bootup with a new ROM?)... because if not, I'd like to not bother backing it up (and make the backup smaller and quicker in the process).

rub1k said:
Thanks much for that... nice job with the script.
I guess I need to do a bit more reading though and figure out if backing up the dalvik-cache is actually necessary (doesn't it get (re-)built at first bootup with a new ROM?)... because if not, I'd like to not bother backing it up (and make the backup smaller and quicker in the process).
Click to expand...
Click to collapse
I think you have a point. But we may be looking at a very small %age of disk space compared to the overall backup of the phone. Keep in mind that the nandroid backups are not gzip'ed (because it take them forever to do), so there are bigger savings to be had than just saving on the dalvik cache. For example, data.img in nandroid backup can gzipped to 4MB compare to 12MB.

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.

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.

Clone an SD card (including EXT3) to another?

Like ghosting a HDD to another, I wanted to know if there's an app that can do this?
I think my 8GB LG branded MicroSD is failing as Windows keeps reporting that the drive needs to be scanned when I mount it via USB from my Desire so I'd like to just get a new Sandisk 8GB card and clone the old to new one to avoid having to go through restoring backups and so on.
If anyone has any ideas that would be grand!
check winimage.
That app can make image and recover it to drives!
Doesnt matter if disk is bigger than previous ( NB! may need to resize to get total space if its bigger, cannot remember)
I've always used it for vmware ESXi embedded sticks, made a million of them and the app works!
also linux routers.
Hope this helps.
vmware ESXi runs linux so it supports EXT!
No need for a program, copy data from fat partitions vis pc and use this ( from cyanogen wiki page) Used it three times now and no problems
Upgrading SD / Moving data to new SD
If you are using RA recovery, this is all done for you by making a BART backup. The following is if you're wanting to do it from the command line.
1. First, backup your ext partition on to your fat32 partition. Note, you will need enough free space to hold all of your apps.
* In Terminal Emulator or recovery console:
mount -a [enter]
tar cvf /sdcard/ext.tar /system/sd [enter]
Note that you must have root access for Terminal Emulator. If you get "permission denied" after entering the above command, then try entering the command "su". "sudo" will not work. After entering "su" try the above command again.
* Or, Using ADB shell from your PC:
adb shell
mount -a [enter]
tar cvf /sdcard/ext.tar /system/sd [enter]
2. Next, mount your SD card and download/backup everything on your fat32 partition. Make sure to get the ext.tar file that you just created in the previous step.
3. Change cards/repartion, or do whatever it is you planned to do here. For instructions on creating new partitions see the installation instructions above.
4. If you're not already, reboot into your recovery. Restore your backup files to your fat32 partition. Don't boot into CM yet!
5. Either go to console or ADB shell and type:
*
mount -a [enter]
*
tar xvf /sdcard/ext.tar [enter]
6. Double check that your directories are moved with:
ls /system/sd [enter]
7. Now you can reboot into CM!
8. Run fix permissions to fix any corrupted permissions.
9. Enjoy your new card!
If you have Amon Ra's recovery on your android phone you can do a bart backup with your old sd card, partition the new sd card as required, copy the bart backup to new sd card and then do a bart restore. It is what i did when i upgraded from my 2gb to 8gb, worked a treat.
Since I created this thread a few great things have happened, EXT4 support in unrevoked permanent flashed AmonRA recovery being the main one so now I am sorted thanks!
I use Gparted just copy paste

[HOW TO] linux native in sbk2 devices, purelinux and pseudo-dualboot methods

This is a guide for installing and running natively any linux distribution on tf101 devices with sbk2 bootloader, but with some tweeks it would work also in tfp devices.
What is needed? you will need a rooted device with cwm recovery installed microsd for purelinux and a good microsd is recommended for one of the pseudo-dualboot options.
This guide is also prepared to execute all the commands in a computer running linux and with adb prepared to work, but you can also do it in windows, just google a bit for abootimg, blobpack and adb.
The binarys provided are precompiled for x86 system.
I am going to use as example ubuntu but you can install any linux distibution making some tweaks that i am not going to explain in this thread because i already opened another one explaining this.
DISCLAIMER: This is as safe as flashing custom roms (even a little bit less) you will always have a risk to brick your devices, I have a sbk1 device and in all my tests i haven't brick my device but i have the option of use nvflash so use it at your own risk
There are two basic options, running purelinux and pseudo-dualboot, and this last one has different variants.
Purelinux
YES: you will have the option to go to stock with cwm recovery
This will install ubuntu in the internal ssd in the data partition wich in tf101 is /dev/block/mmcblk0p7
With this method you will lose all the data in your android rom so make backups if necesary.
First of all we have to prepare the boot.img with the kernel and initrd, for that we will need abootimg, and a kernel already compiled, you either can compile your own kernel following lilsteive's, wiki instructions or use the one in OLIFE script. The initrd needed it's a bit diferent from OLIFE's one so i will attach the files needed at the end of this post.
We have kernel image: 2636-zImage
We have initd: initrd.img
and we need a boot.cfg file with this inside:
Code:
bootsize = 0x800000
pagesize = 0x800
kerneladdr = 0x10008000
ramdiskaddr = 0x11000000
secondaddr = 0x10f00000
tagsaddr = 0x10000100
name =
cmdline = [email protected] [email protected] vmalloc=128M gpt video=tegrafb console=tty0 usbcore.oldscheme_first=1 [email protected] root=/dev/mmcblk0p7 ro quiet splash
Now we can build boot.img with abootimg with this command.
Code:
./abootimg-i686 --create boot.img -f boot.cfg -k 2636-zImage -r initrd.img
Now we have created boot.img wich is ready to blobpack. It's VERY important to blobpack it to LNX partition to not overwrite cwm recovery.
Code:
./blobpack kernelblob LNX boot.img
Now we have kernelblob file and ubuntu.img. This is al we need to flash our device, but we can use a zip file suitable for cwm to flash the kernelblob. I will explain later in the pseudo-dualboot options.
So now we place those files in a microsdcard and we reboot into cwm.
Once in there we have to get a shell trough adb
In some version of cwm you cannot see microsd but you see the sdcard, in that case you will have to manually mount the microsd.
I don't remember right now if in cwm shell you are already root or not, but if not just su to gain permissions.
Now this is the most risky part we have to dd the kernel blob to the correct partition, in this case is /dev/block/mmcblk0p4. As i said before we can flash the kernel blob also through a zip file.
assuming we are in the folder where both files are:
Code:
dd if=kernelblob of=/dev/block/mmcblk0p4
and now we flash ubuntu.img over data partition, but we have to be sure is unmounted, depending wich version of cwm recovery you may need to do it manually
the command mount will show you if is mounted or not and if it is, umount it
Code:
umount /dev/block/mmcblkop7
and then dd
Code:
dd if=ubuntu.img of=/dev/block/mmcblk0p7
This will take some time, so be patient.
And that's it, just reboot and go through oem instalation procedure and you have it.
To go back to android you will only need to boot into cwm wipe everything to avoid problems reboot again into cwm and flash any rom wanted.
With the last cwm version i had some trouble accesing to sdcard or microsd so i needed to delete a symbolik link (/sdcard was a symbolik link to /media/data and i don't know why) and create /sdcard folder, mount /dev/block/mmcblk0p7 over sdcard create a microsd folder and mount microsd manually over that folder.
Pseudo-dualboot
We have two options here, we can install over a microsdcard or put the image file in the internal sdcard.
If you have a good 10 class microsd for me that's the best option if not, it will be much slower than the other option.
Pseudo-dualboot over microsd
The process here is almost the same than in pure linux, the diference is only that in the boot.cfg file rootfs parameter will be diferent partition:
Code:
bootsize = 0x800000
pagesize = 0x800
kerneladdr = 0x10008000
ramdiskaddr = 0x11000000
secondaddr = 0x10f00000
tagsaddr = 0x10000100
name =
cmdline = [email protected] [email protected] vmalloc=128M gpt video=tegrafb console=tty0 usbcore.oldscheme_first=1 [email protected] root=/dev/mmcblk1p1 ro quiet splash
instead of /dev/mmcblk0p7 (wich is data partition of the internal sdcard) it will be /dev/mmcblk1p1 wich is the microsdcard)
and instead of dd-ing ubuntu.img over internal sdcard we will dd to the microsd, we can do this also in cwm recovery or in a computer with sdcard reader.
As i think it's less risky to dd things in your computer instead in cwm and you will need an ubuntu.zip and android.zip to change your operating system flashing the kernel trough cwm i've attached Ubuntu.zip to do that. It's already prepared for microsd instalation.
If you compile the latest kernel (wich have some patches like the sound working) or you want to use it to purelinux instalation just do all the abootimg and blobpack proces and open ubuntu.zip and delete kernelblob and add your own one.
You will also need an android.zip file with the android kernel you prefer to choose again android system to boot.
I think it is aslo posible to do this with a pendrive is you have a dock, but i haven't tested it and i don't know if the kernel reads the usb devices soon enough to mount rootfs.
If you want to try, just boot linux, see wich device in /dev/ is asigned to the usb and place the correct device in root=/dev/XXXX in the boot.cfg
Pseudo-dualboot with loopmounted image placed in the internalsd
Just place ubuntu.img in the internal sdcard and flash ubuntu-mountloop.zip to boot into ubuntu and flash android.zip to boot into android.
There still are a couple of fixes to do, but i have no time right now and i am not using this configuration because i have sbk1 device so i won't be able to test and develop this but i will be glad to answer the questions i am able to.
I've also added the latest kernel and modules compiled from git but i haven't test them.
abootimg, blobpack and blobunpack files:
http://dl.dropbox.com/u/60048492/transformer/blobutils-abootimg.zip
ubuntu asus kernel (the OLIFE one, the git kernel has some fixes as sound enabling), initrd and boot.cfg
http://dl.dropbox.com/u/60048492/transformer/kernel-initrd-boot.cfg.zip
Unbutu-sdcard.zip (with kernelblob prepared for microsd installation)
http://dl.dropbox.com/u/60048492/transformer/Ubuntu-sdcard.zip
Android.zip (with revolver 3.1 default kernel)
http://dl.dropbox.com/u/60048492/transformer/Android.zip
Ubuntu-mountloop.zip for pseudo-dual boot with ubuntu.img placed in the internal sdcard
http://dl.dropbox.com/u/60048492/transformer/Ubuntu-mountloop.zip
Latest git kernel and modules precompiled
http://dl.dropbox.com/u/60048492/transformer/kernel-and-modules-from-git.zip
Thanks to rdnetto, Jhinta and of course lilstevie
Awesome! Waiting for the dualboot
How To - Step by step​
A few notes:
pseudo-dualboot over external microsd >> deletes all data on your external microsd card, but doesn't delete files on internal storage
pseudo-dualboot with loopmounted image placed in the internal storage >> doesn't delete files on internel storage (internal microsd)
how to resize img file (this you don't do in Ubuntu in TF):
Code:
dd if=/dev/zero bs=1G count=1 >> ubuntu.img
e2fsck -f ubuntu.img
resize2fs ubuntu.img
bs=1G >> how much large, new size is 3GB
mount data from Android in Ubuntu:
Code:
mkdir ~/Android/; mount /dev/block/mmcblk0p7 ~/Android/
after you find data in your home directory in folder Android
I recommend use the last CWM > http://forum.xda-developers.com/showthread.php?t=1213723 you need option flash package from internal storage
For work all components follow here: http://forum.xda-developers.com/showpost.php?p=25549030&postcount=1973 and http://forum.xda-developers.com/showpost.php?p=26149064&postcount=2048
You don't must nothing compile only apply change!
Dualboot with loopmounted image placed in the internal storage (I recommend, it is faster and smoother than sdcard version)
1. download http://lilstevie.geek.nz/ports/ubuntu.img.gz and extract ubuntu.img from .gz package to internal storage on /sdcard/
(second mirror > http://www.ulozto.net/xyFaPBA/ubuntu-img-gz)
2. download http://www.mediafire.com/?7f5fpatmgmg01ha and place to internal storage on /sdcard/
3. download from http://www.mediafire.com/?labcx60jowrdx one package for back to Android(by the ROM you use) and place to internal storage on /sdcard/ *
4. reboot into CWM recovery and flash the package Ubuntu.zip from 2. point
5. reboot and you booting to Ubuntu
6. you must add to /lib/modules/ this > http://www.2shared.com/file/843Sq6-J/3110tar.html
Code:
mkdir 3.1.10; tar -xzf 3.1.10.tar.gz -C 3.1.10; sudo cp -r 3.1.10 /lib/modules/
7. reboot and enjoy
When you want back to Android so reboot into recovery and flash your package from 3. point.
Dualboot over external mirco sd:
- your microsd card must have capacity more than 2GB (4GB is optimal)
1. download http://lilstevie.geek.nz/ports/ubuntu.img.gz and extract ubuntu.img from .gz package to internal storage on /sdcard/
2. open terminal emulator or run adb shell from your PC and enter the command:
Code:
dd if=/sdcard/ubuntu.img of=/dev/block/mmcblk1p1
(mmcblk1p1 is external microsd card)
- wait a few minutes
- after succesful finished you can delete ubuntu.img
- you don't see files in microsd card, but this is normal
3. download http://dl.dropbox.com/u/60048492/transformer/Ubuntu-sdcard.zip and place to internal storage on /sdcard/
4. download from http://www.mediafire.com/?labcx60jowrdx one package for back to Android(by the ROM you use) and place to internal storage on /sdcard/ *
5. reboot into CWM recovery and flash the package Ubuntu-sdcard.zip from 3. point
6. reboot and you booting to Ubuntu
7. you must add to /lib/modules/ this > http://www.2shared.com/file/843Sq6-J/3110tar.html
Code:
mkdir 3.1.10; tar -xzf 3.1.10.tar.gz -C 3.1.10; sudo cp -r 3.1.10 /lib/modules/
8. reboot and enjoy
When you want back to Android so reboot into recovery and flash your package from 4. point.
* when you can't find the package for your ROM or latest version so extract blob file from your ROM package .zip, rename to kernelblob and replace in Android-xxx.zip package
Original post:
Very thanks!
A few questions:
it deletes all data in my TF
ubuntu.img is from http://forum.xda-developers.com/showpost.php?p=16101612&postcount=3 (RootFS)
./abootimg-i686 --create boot.img -f boot.cfg -k 2636-zImage -r initrd-2.6.36.img << here should be initrd.img
jozka.1 said:
Very thanks!
A few questions:
ubuntu.img is from http://forum.xda-developers.com/showpost.php?p=16101612&postcount=3 (RootFS)
./abootimg-i686 --create boot.img -f boot.cfg -k 2636-zImage -r initrd-2.6.36.img << here should be initrd.img
Click to expand...
Click to collapse
Thanks, already corrected, and yes, that's an option, but the last version of ubuntu.img i think it's 2.0 GB and that one is 535MB or something like that, for all my tests i've used the 2GB one i think is inside OLIFE prime. But you can also build your own one with another distro. The question is wich type of instalation are you going to use, because in the native (internal or external) the image will be automatically resizes to fit the partition in the first boot so it doesn't matter, but in the loopmount one will keep the same size. So either of them would be a bad option.
I will explain this later and wich options we have to increase the space.
EDIT:
http://forum.xda-developers.com/showthread.php?t=1476835
i have to rewrite that to correct grammar but it will help you understanding a couple of things
And I can't this process without microsdcard (I can't have the ubuntu.img in internal memory), because dd if=ubuntu.img of=/dev/block/mmcblk0p7 deletes all files on /data/media. Is it right?
jozka.1 said:
And I can't this process without microsdcard (I can't have the ubuntu.img in internal memory), because dd if=ubuntu.img of=/dev/block/mmcblk0p7 deletes all files on /data/media. Is it right?
Click to expand...
Click to collapse
Yes, installing in the internal sdcard will erase all your data, and with the microsd even if you have a good one it will be a bit laggy sometimes.
The loopmount option it's another option, but i haven't try it yet and i will not write a guide for that until i do it, but basically is the same, we put the img file in the internal sd we modify the boot.cfg to mountloop and we'll need to tweak up the initrd to mount over loop device the image.
I don't know if that precompiled kernel support that, i think it does, but i am not sure if it's necesary recompile it.
In the other way, we would also need to resize the image to have a system with more than 2gb and that also would require editing the fstab.
I think i remember from time ago working with qemu there was two types of images qcow and raw. One of them had a good feature, you could create a 10gb image but it only weigth the space ocupied inside the image and not the all 10gb, but i don't know if we could use that feature in the mountloop option.
Do we have to compile again kernel with a new modules? Or how to mounts virtual disk?
jozka.1 said:
Do we have to compile again kernel with a new modules? Or how to mounts virtual disk?
Click to expand...
Click to collapse
I don't know yet, i don't think so but i have not compile the kernel myshelf. I have to take a look to init file in the initrd and figure where to put mount comands for the rootfs, i can't give you more information right now because i've never done that before, but here is "again" how the process i think it would be:
in boot.cfg root=/dev/loop0
and inside the initrd there is a file call init where whe have to mount /dev/mmcblk0p7 over somewhere, for example /media/data and then loopmount with losetup /media/data/ubuntu.img
That's what i think, but i am not sure
Just a point which is still not really clear for me, following those instructions, it will erase EVERYTHING on my ssd ? Or it's just a wipe like when we flash a new rom ?
outpox said:
Just a point which is still not really clear for me, following those instructions, it will erase EVERYTHING on my ssd ? Or it's just a wipe like when we flash a new rom ?
Click to expand...
Click to collapse
This process (the first one, purelinux option) will erase /data partition not the entire sdcard
it doesn't either erase android system wich is another partition. So (and this is a guess, when i test it i didn't have just a kernel blob to flash so i flashed the entire revolver rom) if you reboot into cwm recovery wipe data and install android.zip (wich i'll upload a bit later) . you would be able to boot into android like if it was a clean instalation.
So, yes, is like a full wipe. But only in the first option, the other two options don't touch your data.
But all this is yet to be confirmed, i am quite new in android systems i ony have experience in linux systems. I am pretty sure it is like a say but i would not bet my life on it
shaola said:
This process (the first one, purelinux option) will erase /data partition not the entire sdcard
it doesn't either erase android system wich is another partition. So (and this is a guess, when i test it i didn't have just a kernel blob to flash so i flashed the entire revolver rom) if you reboot into cwm recovery wipe data and install android.zip (wich i'll upload a bit later) . you would be able to boot into android like if it was a clean instalation.
So, yes, is like a full wipe. But only in the first option, the other two options don't touch your data.
But all this is yet to be confirmed, i am quite new in android systems i ony have experience in linux systems. I am pretty sure it is like a say but i would not bet my life on it
Click to expand...
Click to collapse
Okey that's nice
When I come home I will make a back up and I will try it !
I'll let you know if I experience any issues
I have the problem.
When I make dd if=ubuntu.img of=/dev/block/mmcblk0p7 so I get IO problem and now when I choose in CWM install zip from sdcard, so I get E: can't mount sdcard
E: mount: mounting /dev/block/mmcblk0p7 on /sdcard/ failed: Invalid argument
E2: solved, I made small .img file (2MB) and dd if=smal.img of=/dev/block/mmcblk0p7
E3: no, data is mount successful, but the size is small, any ideas how to resize back to default ?
I don't understand what exactly are you saying, anyway, the partition will not by resized in anyway, not when you dd not ever, is the filesystem what is resized. So wipe data trough cwm
Code:
/sdcard # cat /proc/partitions
major minor #blocks name
179 0 30203904 mmcblk0
179 1 524288 mmcblk0p1
179 2 542208 mmcblk0p2
179 3 2048 mmcblk0p3
179 4 542208 mmcblk0p4
179 5 5120 mmcblk0p5
179 6 512 mmcblk0p6
179 7 28563968 mmcblk0p7
179 8 1931264 mmcblk1
179 9 1930240 mmcblk1p1
but:
Code:
~ # df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 369644 32 369612 0% /dev
/dev/block/mmcblk0p2 533664 9072 524592 2% /cache
/dev/block/mmcblk0p7 39663 4587 33028 12% /data
I made dd if=smal.img of=/dev/block/mmcblk0p7, because it doesn't mount, but smail.img is 40MB.
Wipe data doesn't help to me.
ups, your data partition was mounted, it has to be unmounted before dd, that's the problem. Sorry i forget to put that in the guide. i will correct it now
just umount /data and try to dd again the ubuntu.img
Corrected. Sorry, i assumed that everyone should now that a partition has to be unmounted before attemp to dd. My fault
jozka.1 said:
[
I made dd if=smal.img of=/dev/block/mmcblk0p7, because it doesn't mount, but smail.img is 40MB.
Wipe data doesn't help to me.
Click to expand...
Click to collapse
It is mounted as you see in df command
No, I made mount.
jozka.1 said:
No, I made mount.
Click to expand...
Click to collapse
I am a bit lost, so
Did you check the md5sum of ubuntu.img before attemping this?
are you using a microsd card?
after wipe data did you reboot into cwm again?
wich version of cwm do you have?
I'm sorry, my fail.
I used dd with my smal image(40MB) for repair mount /data, then /data was so small. I used dd with ubuntu.img, kernelblob > reboot and all is it right.
I have one more question. When I want return to android, so I make factory reset (wipe data, cache) and flash a ROM ?
jozka.1 said:
I'm sorry, my fail.
I used dd with my smal image(40MB) for repair mount /data, then /data was so small. I used dd with ubuntu.img, kernelblob > reboot and all is it right.
Click to expand...
Click to collapse
So, you finally have running ubuntu natively with sbk2 device?

[Q] Move /data to SD card

I have a Galaxy GIO, which is a fairly old low-end phone. On factory reset, I have about 100MB memory free for apps, and the phone seems to start complaining as soon as I hit the 50MB mark; that's about one or 2 installed applications.
Because I would like to actually be able to, well, use my phone for anything else than calling, I want to move the /data partition to my SD card. I know this'll be slow, but slow still is better than not working at all.
I have done a bit of research, and came around plenty of scripts which claim to mount the second partition of the sd card as /data; none of these scripts work. I have tried 'INT2EXT', 'D2EXT', and I've heard about something called 'A2SD' but I have yet to find a copy of it . To install these scripts I've extracted them, and copied the scripts to '/system/etc/init.d/', after mounting '/system', using ADB.
I for an instant thought maybe my second partition isn't formatted properly, but using adb I am able to successfully mount the ext2 partition as /sd-ext, so I don't see why mounting them as /data should be a problem.
I have also tried to symbollicly link /data to /sd-ext/data and automatically mount my /sd-ext on boot. Obviously this didn't work, because the symbolic link isn't actually saved to disk.
How would I go about moving my data partition to my sd card? I am not affraid of doing some dirty work manually. I am running Cyanogenmod 11.
Binero said:
I have a Galaxy GIO, which is a fairly old low-end phone. On factory reset, I have about 100MB memory free for apps, and the phone seems to start complaining as soon as I hit the 50MB mark; that's about one or 2 installed applications.
Because I would like to actually be able to, well, use my phone for anything else than calling, I want to move the /data partition to my SD card. I know this'll be slow, but slow still is better than not working at all.
I have done a bit of research, and came around plenty of scripts which claim to mount the second partition of the sd card as /data; none of these scripts work. I have tried 'INT2EXT', 'D2EXT', and I've heard about something called 'A2SD' but I have yet to find a copy of it . To install these scripts I've extracted them, and copied the scripts to '/system/etc/init.d/', after mounting '/system', using ADB.
I for an instant thought maybe my second partition isn't formatted properly, but using adb I am able to successfully mount the ext2 partition as /sd-ext, so I don't see why mounting them as /data should be a problem.
I have also tried to symbollicly link /data to /sd-ext/data and automatically mount my /sd-ext on boot. Obviously this didn't work, because the symbolic link isn't actually saved to disk.
How would I go about moving my data partition to my sd card? I am not affraid of doing some dirty work manually. I am running Cyanogenmod 11.
Click to expand...
Click to collapse
I will introduce how to COPY(NOT MOVING) /data partition to /sdcard.
1. You should ROOT First.
2. Use Rootexplorer to Copy /data to /sdcard (WARNING:If your sdcard emulated with /data, Data WON'T copy to SDCARD --You need external Sdcard!)
2-1. if you don't want to use RootExplorer, you can use Android Debugging Bridge(adb)
(Youshould download Android sdks from developer.android.com)
--Command : adb shell su -C cp /data /sdcard/data
3. That's all.
Jason Hyunwoo said:
I will introduce how to COPY(NOT MOVING) /data partition to /sdcard.
1. You should ROOT First.
2. Use Rootexplorer to Copy /data to /sdcard (WARNING:If your sdcard emulated with /data, Data WON'T copy to SDCARD --You need external Sdcard!)
2-1. if you don't want to use RootExplorer, you can use Android Debugging Bridge(adb)
(Youshould download Android sdks from developer.android.com)
--Command : adb shell su -C cp /data /sdcard/data
3. That's all.
Click to expand...
Click to collapse
Thanks, but that's not entirely what I meant. I can manage to move my data to the SD card no problem, but I want my phone to actually use my second partition on my sd card, as the /data partition.
Binero said:
Thanks, but that's not entirely what I meant. I can manage to move my data to the SD card no problem, but I want my phone to actually use my second partition on my sd card, as the /data partition.
Click to expand...
Click to collapse
Oops.. Sorry about that!
First, I am not sure that will work or not, maybe you should try to edit init.*.rc. Which is from boot.mg. I think, maybe mounting sdcard as data is impossible, but you may try editing init.rc(or init.*.rc, * is manufacture). You could unpack your boot img, and you could edit mounting point which is from init.rc!
I hope this thing will help you..
Jason Hyunwoo said:
Oops.. Sorry about that!
First, I am not sure that will work or not, maybe you should try to edit init.*.rc. Which is from boot.mg. I think, maybe mounting sdcard as data is impossible, but you may try editing init.rc(or init.*.rc, * is manufacture). You could unpack your boot img, and you could edit mounting point which is from init.rc!
I hope this thing will help you..
Click to expand...
Click to collapse
I have looked into init.rc, but that only seemed to create the /data mountpoint, but not actually mount to it. I've no idea how to edit the boot image, or what that even is. Is that the filesystem that is built into the kernel?
Binero said:
I have looked into init.rc, but that only seemed to create the /data mountpoint, but not actually mount to it. I've no idea how to edit the boot image, or what that even is. Is that the filesystem that is built into the kernel?
Click to expand...
Click to collapse
Umm.. You should download unpackbootimg or dsixda's Android Kitchen to edit boot.mg. You cannot edit init.rc on Root explore. Use unpack boot.img menu which is from Android Kitchen!
Jason Hyunwoo said:
Umm.. You should download unpackbootimg or dsixda's Android Kitchen to edit boot.mg. You cannot edit init.rc on Root explore. Use unpack boot.img menu which is from Android Kitchen!
Click to expand...
Click to collapse
I'll try that out. Still not sure where to look though. As I said, init.rc does not contain any commands mounting /data.
Binero said:
I'll try that out. Still not sure where to look though. As I said, init.rc does not contain any commands mounting /data.
Click to expand...
Click to collapse
or you could edit look at other *.rc files!
Isn't this what you're looking for?
http://forum.xda-developers.com/galaxy-s2/themes-apps/tool-directorybind-data-to-externalsd-t1410262
sndsnd said:
Isn't this what you're looking for?
http://forum.xda-developers.com/galaxy-s2/themes-apps/tool-directorybind-data-to-externalsd-t1410262
Click to expand...
Click to collapse
I want to mount my sd card to my /data. That simply creates a symbolic link.
Jason Hyunwoo said:
or you could edit look at other *.rc files!
Click to expand...
Click to collapse
There is only 2 rc files, and one of them is specific to my recovery image.

Categories

Resources