You can find some thread for you to move data partition to sd-ext. But there is a easier way to do that: Modify the mount point of sd-ext and data in ramdisk.
The basic step is:
0. Make a nandroid backup
1. Make an ext4 partition on your sdcard (I used gparted in ubuntu, very fast and not lost data)
2. Download your kernel as boot.img
3. Unpack you boot.img (you can find many thread said how to do, and I think the most completly tool you can get from http://forum.xda-developers.com/showthread.php?t=1241005. You can find the example to unpack boot.img, extract ramdisk, repack ramdisk, repack boot.img from the README.txt file of this tool)
4. Extract ramdisk:
Code:
gzip -dc ../unpack/boot.img-ramdisk.gz | cpio -i
If you find ramdisk.cpio file, you need to extract it by
Code:
cpio -i -F ramdisk.cpio
5. Modify the mount point of data and sd-ext
- File fstab:
+ Find the line
Code:
/data yaffs2 userdata
, and change to
Code:
/data ext4 /dev/block/mmcblk0p2
- File init.semc.rc
+ Find the line
Code:
mount yaffs2 [email protected] /data nosuid nodev
and change to
Code:
mount ext4 /dev/block/mmcblk0p2 /data nosuid nodev
- File recovery.fstab:
+ Find the line
Code:
/data yaffs2 userdata
and change to
Code:
/data ext4 /dev/block/mmcblk0p2
6. Repack the ramdisk
If you extracted from ramdisk.cpio file, you need to pack to ramdisk.cpio first
Code:
find . | cpio -o -H newc -O <target path>/ramdisk.cpio
Then repack you ramdisk: At the ramdisk folder:
Code:
mkbootfs <ramdisk folder> | gzip > <target path>/boot.img-ramdisk-new.gz
7. Repack boot.img
Code:
mkbootimg --kernel <path to>/boot.img-zImage --ramdisk <path to>/boot.img-ramdisk-new.gz -o <path to>/boot_new.img --base `cat <path to>/boot.img-base`
8. Flash boot_new.img
9. Enter CWM, wipe phone and restore from your backup
--> Done
Thanks for the info. Or you can go on cmw and create sd-ext from there.
Will it Work with an ext3 partition too?
Gesendet von meinem LT15i
lol
i dont understand at all...
ARip Kenpachi said:
i dont understand at all...
Click to expand...
Click to collapse
It's because the title is wrong.. it's not the "easy way" .. it's a little bit more 'medium - adv user' way..
If it's so hard for you, I think it's better u to search 'script/app' for doing this.
There's a lot available like link2sd, cronmod script, etc
Excellent, it worked on Vengeance Kernel, actually that was the only kernel that I was able to extract the ramdisk.
Lupus kernel has is ramdisk in another format (not gzip), and KTG is in a elf file.
The boot took a little bit longer, but i think is more stable than using init.d scripts.
EDIT: Make the backup from an old CWM (like the one on the recoveryARC.img file), newer versions will check for the correct filesystem, and as we are changing it, It will not work. For restore, use any version of CWM (the one included on Vengeance works great).
Also, if you have an LT15i, backup your /system/vendor folder, otherwise, it will be not longer available (and a lot of apps will crash), I copied it into the data folder and made a symlink into /system/vendor (and as your data folder will be bigger, thats no issue).
I can't manage to do the trick on my Arc S with DoomKernel_v22. When I flash the modified .img the phone doesn't start and i can't go into CWM.
I have two partitions on SD, the second one is the ext4 i want to use.
These are the files extracted from Doomkernel:
fstab:
Code:
/data yaffs2 userdata
/cache yaffs2 cache
init.semc.rc:
Code:
on fs
# mount mtd partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /system rw remount
mount yaffs2 [email protected] /data nosuid nodev
mount yaffs2 [email protected] /cache nosuid nodev
recovery.fstab:
Code:
/cache yaffs2 cache
/data yaffs2 userdata
/system yaffs2 system
/sdcard vfat /dev/block/mmcblk0p1
/sd-ext auto /dev/block/mmcblk0p2
Can anyone help me please?
Related
hi
I have two 8GB class4 memory card but when I'm just a partition're doing very bad work
Android is reset
apps are broken
High and low speed is
And ...
But when a 2GB partition, I just work very well
Benchmarking partition is much better!
no more problem in android!
So I decided two partitions 2 and 6 GB and the second partition so I just do mount
Method:
1- Memory partitioning (first partition 2gb fat32)
2- copy android in first partition & run it
3- in android terminal type:
Code:
ls /dev/block/m*
or adb
Code:
adb shell ls /dev/block/m*
result like this:
Code:
/dev/block/mmcblk0
/dev/block/mmcblk0p1
/dev/block/mmcblk0p2
/dev/block/mmcblk0p3
Partition testing can be yours for the mount
1- make a folder (not in /sdcard & /mnt/sdcard)
Code:
mkdir /mnt/sd2
now test (for fat32): (just change mmcblk0p2)
Code:
mount -t vfat -o fmask=0000,dmask=0000,rw,flush,noatime,nodiratime /dev/block/mmcblk0p2 /mnt/sd2
(for ext2)
Code:
mount -t ext2 -o noatime,nodiratime /dev/block/mmcblk0p2 /mnt/sd2
Now the partition should be on the /mnt/sd2 mounted
and you can mount in boot
backup /init
open init and past mount cammand below this line :
Code:
PATH=/sbin:/system/sbin:/system/bin:/bin:/system/xbin:/system/xbin/bb:/data/local/bin
now we have auto mount partition
but we have one problem! we should link /mnt/sd2 > /mnt/sdcard
Who s the solution?
interesting idea. will try out.
If you are like me, and try out things alot that leave you with an unusable system and you want to recover as fast as possible, I made a small Listing, that shows what you have to enter on adb shell while booted in recovery.
Prequisites:
Tested on FuguMod >= 2.0 only
Be sure you have enough space free on internal SD
all these commands are issued in adb shell while booted into Recovery Mode
It restores to JFS on all partitions
One-liners for copy paste while root on adb shell in Recovery Mode:
Backup:
Code:
mount /dev/block/mmcblk0p1 /mnt/sdcard; mount /dev/block/mmcblk0p2 /data; mount /dev/block/stl10 /dbdata; rm /mnt/sdcard/system.tar /mnt/sdcard/data.tar /mnt/sdcard/dbdata.tar && cd / && tar cvf /mnt/sdcard/system.tar /system && tar cvf /mnt/sdcard/data.tar /data && tar cvf /mnt/sdcard/dbdata.tar /dbdata
Restore:
Code:
umount /system; umount /data; umount /mnt/sdcard; umount /dbdata; umount /cache; /sbin/jfs_mkfs -q /dev/block/stl9 && /sbin/jfs_mkfs -q /dev/block/mmcblk0p2 && /sbin/jfs_mkfs -q /dev/block/stl10 && /sbin/jfs_mkfs -q /dev/block/stl11 && mount /dev/block/mmcblk0p1 /mnt/sdcard; mount /dev/block/mmcblk0p2 /data; mount /dev/block/stl9 /system; mount /dev/block/stl10 /dbdata; mount /dev/block/stl11 /cache; cd / && tar xvf /mnt/sdcard/system.tar && tar xvf /mnt/sdcard/data.tar && tar xvf /mnt/sdcard/dbdata.tar
In detail:
Backup:
Code:
# backup - in adb shell (as root) do:
# --------------------------------------------------
# mount all filesystems
mount /dev/block/mmcblk0p1 /mnt/sdcard
mount /dev/block/mmcblk0p2 /data
mount /dev/block/stl9 /system
mount /dev/block/stl10 /dbdata
# remove older backups
rm /mnt/sdcard/data.tar /mnt/sdcard/system.tar /mnt/sdcard/dbdata.tar
# backup them all to the root of the internal sdcard (make sure enough space is free)
cd /
tar cvf /mnt/sdcard/system.tar /system
tar cvf /mnt/sdcard/data.tar /data
tar cvf /mnt/sdcard/dbdata.tar /dbdata
Restore:
Code:
# restore - process
# --------------------------------------------------
# flash stock ROM with Odin/heimdall
# flash fugumod with Odin/heimdall
# reboot recovery - claim root and open a shell
adb root
adb shell
# unmount all filesystems
umount /system
umount /data
umount /mnt/sdcard
umount /dbdata
umount /cache
# recreate filesystems (jfs)
/sbin/jfs_mkfs -q /dev/block/stl9
/sbin/jfs_mkfs -q /dev/block/mmcblk0p2
/sbin/jfs_mkfs -q /dev/block/stl10
/sbin/jfs_mkfs -q /dev/block/stl11
# mount all filesystems and internal sdcard
mount /dev/block/mmcblk0p1 /mnt/sdcard
mount /dev/block/mmcblk0p2 /data
mount /dev/block/stl9 /system
mount /dev/block/stl10 /dbdata
mount /dev/block/stl11 /cache
# restore the tar
cd /
tar xvf /mnt/sdcard/system.tar
tar xvf /mnt/sdcard/data.tar
tar xvf /mnt/sdcard/dbdata.tar
Listing: http://pastebin.com/rpZW1uWD
Good stuff.
really useful, thank you.
Danke^^
When I think about it, it should not be too difficult to write an application to create and pull the backups off the phone. And pushing and restoring would be the same thing in the other way. If I got some spare time I could do that, I think it would be really handy
Yeah... I also though about to supply an update.zip for backup and one for restore... but I was to lazy
I'm starting to form the project and layout for the program in my head, but on the other hand my laziness starts to fight all growing motivation. I'm wondering how this will turn out
Works perfect, thx.
How and in what regard is this faster than making the backup with CWM?
Not that I don't believe you that it is faster I just want to understand things
I pretty much understand what your script does, so probably what I would need to know to see the difference is how the CWM does the backup. I guess CWM is storing the whole file system with dd or something like that...
zsori said:
How and in what regard is this faster than making the backup with CWM?
Not that I don't believe you that it is faster I just want to understand things
I pretty much understand what your script does, so probably what I would need to know to see the difference is how the CWM does the backup. I guess CWM is storing the whole file system with dd or something like that...
Click to expand...
Click to collapse
It's faster since it does not create a new filesystem to back up the data... TBH. It is less safe than a nandroid backup (no md5 check). but faster in creation. and actually never failed on me
also everybody modding the hell out of their phones should get to know adb shell and the power that lies within it. You can take many shortcuts and debug errors easier.
do I understand correctly that this is able to restore a TAR file decrypted from a AB android backup file created before?
Can this make the backup on the computer the phone is connected to? Not enough free space on the phone to backup to.
Can it pull apps and their data from external SD?
Does it work without the user having to touch the screen? Broken screen, no touch possible and can't see anything so even if I had paired a bluetooth mouse before the damage it'd still be useless.
Can it restore to a different but identical in every way phone?
I installed 2.3 to my phone.
The cust.img contain a lot of unneeded apks. (The cust.img is a disk image file.)
How to extract cust.img and delete a file in that?
The cust.img mounted to /cust folder as "read only" by init.rc (init.rc automatically generated on boot)
ufukyayla said:
i installed 2.3 to my phone.
The cust.img contain a lot of unneeded apk.
How to extract cust.img and delete a file in that?
The cust.img mounted to /cust folder as as read only by init.rc (init.rc automatically generated on boot)
Click to expand...
Click to collapse
Is cust.img or cust_data.img? See on /cust_backup/image/cust...
This is cust.img in image folder. (When pink screen mode)
ufukyayla said:
This is cust.img in image folder. (When pink screen mode)
Click to expand...
Click to collapse
I never change or delete anything on that place (when pink screen mode). I make all on /cust_backup/image/recovery.img or /cust... don't remember all.
Is from here that at each restarting or rebooting is loaded the bootloader (pink screen).
I deleted in this place all Carrier data /cust_backup/image/cust... something.
But take care, that /image/ is backed also on ROM Backups. If you delete the /cust... like I made, and if one day you made a ROM Restore made before, the /cust... return to same place. You must delete this after each ROM Restore.
For all restores I have, I made: Rom Restore-> delete /cust... (carrier data) -> new Rom backup.
..................................
EDIT: I made all this because I'm rooted and whit Root Explorer.
I dont want to delete cust.img.
The cust.img is a disk image file.
I want to delete a file in disk image that contained in cust.img.
The cust.img mounted to /cust folder as read only on boot.
i delete all boot files.
I delete all of boot files in this folder.When i open phone i faced blue screen. can someone zip all files in this folder and upload for me. Otherwise i have to send my phone to technical service.
I fixed it.
I deleted all unneeded apks (stock apps) that stored in cust.img
My method;
1. On Slitaz Linux 3.0
2. Open terminal
3. Copy cust.img from phone to /home folder
4. mkdir tmp
5. mount cust.img /home/tmp
6. cd /home/tmp/hw/default/app
7. Delete apk files what you don't want
8. umount tmp
9. Copy cust.img from /home folder to phone
It is for who don't have linux;
http://www.multiupload.com/EKPGJ7EUGO
This is "cleared" cust.img. That contains only these apks;
BeyondTheSkyTheme.apk
Calendar.apk
CalendarProvider.apk
DeskClock.apk
ToolBox.apk
modify init.rc
Code:
mount vfat /dev/block/mmcblk0p1 /.cust_backup ro wait
mount ext3 [email protected]_backup/image/cust.img /cust ro
to
Code:
mount vfat /dev/block/mmcblk0p1 /.cust_backup rw wait
mount ext3 [email protected]_backup/image/cust.img /cust rw
then you could delete any files in cust.img..(/cust in phone)
genokolar said:
modify init.rc
Code:
mount vfat /dev/block/mmcblk0p1 /.cust_backup ro wait
mount ext3 [email protected]_backup/image/cust.img /cust ro
to
Code:
mount vfat /dev/block/mmcblk0p1 /.cust_backup rw wait
mount ext3 [email protected]_backup/image/cust.img /cust rw
then you could delete any files in cust.img..(/cust in phone)
Click to expand...
Click to collapse
The init.rc automatically generating on boot.
Changes lost when you reboot your phone.
The init.rc is in your boot.img, which you could edit with a tool like abootimg, but you'd need Linux to modify that, anyway.
qwerty12 said:
The init.rc is in your boot.img, which you could edit with a tool like abootimg, but you'd need Linux to modify that, anyway.
Click to expand...
Click to collapse
But, it is very hard to do.
abootimg -x boot.img
rename initrd.img to initrd.gz
gunzip initrd.gz
extract initrc using cpio
edit init.rc
recompess
regzip
update bootimg
...
...
etc. etc.
do you know easy way?
ufukyayla said:
But, it is very hard to do.
abootimg -x boot.img
rename initrd.img to initrd.gz
gunzip initrd.gz
extract initrc using cpio
edit init.rc
recompess
regzip
update bootimg
...
...
etc. etc.
do you know easy way?
Click to expand...
Click to collapse
Combine the commands together; create scripts or add aliases to your .bashrc
Do "abootimg -x boot.img && mkdir newramdisk && cd newramdisk && zcat ../initrd.img | cpio -i --no-absolute-filenames" and you're in the folder with the extracted initrd.
When you're done editing, run "find . -print | cpio -o -H newc | gzip -n -9 > ../initrd.img" followed by "cd .. ; abootimg -u boot.img -r initrd.img" and you're done
thanks a lot. i'll try this.
Is there any other way without Linux to remove a .apk from cust.img?
Yes, look at the page 1
I deleted app, but size boot.img has not changed. How to reduce size boot.img?
Moved To General
As the OP contains no development, as such this does not belong here
Hi,
Just to give a return about 2 tweaks I use on my phone running MrSteve555 v12.5 CM11 LBL ROM that gave me ~1500 more points on antutu (28340 reached). Antutu score is not important but my phone is significantly more responsive (and battery life probably improved too):
1- Qualcomm Optimized dalviq libs and executables from here : http://forum.xda-developers.com/showpost.php?p=53963337&postcount=1287
The right package is cwm-Qualcomm.Optimized.Dalvik-1+One-CAF.zip
Depending the cm11 you’ re runing you may have to modify this zip install because some libs can be located in an other place (ask your rom dev).
I added also these 2 lines in build.prop (Not sure it helps):
dalvik.vm.verify-bytecode=false
dalvik.vm.dexopt-flags=m=y,o=v,u=y
Then, wipe dalviq cache and restart
2- Now, an old tweak I used on my old motorola atrix runing cm7: disabling ext4 journal on the 3 partitions. On Atrix I never faced any corrupted datas in 2 years, I hope this will continue with my SP. But obviously it’s important to have a stable rom, any unexpected reboot may result in data corruption. It’s not a safe tweak in theory.
To do that I reboot recovery using TWRP. With it I can access the device with adb :
- umount /cache and /system and /data
- tune2fs -o journal_data_writeback /dev/block/mmcblk0p13
- tune2fs -O ^has_journal /dev/block/mmcblk0p13
- repeat this 2 commands with mmcblk0p14 (cache) and mmcblk0p15 (data)
- I also put this script in /system/etc/init.d but didn’t made any benchmark to see if it gives an improvment (it was on my atrix so I put it in my SP) :
#!/system/bin/sh
# Perfect Mounting
# Cut atime
for k in $(mount | grep relatime | cut -d " " -f3)
do
sync
busybox mount -o remount,noatime,nodiratime $k
done;
# Ext4 tweaks
busybox mount -o remount,rw,noatime,nodiratime,errors=continue,barrier=0,nobh,delalloc,noauto_da_alloc,discard /system
busybox mount -o remount,rw,nosuid,nodev,noatime,nodiratime,errors=continue,barrier=0,nobh,delalloc,noauto_da_alloc,discard /data
busybox mount -o remount,rw,nosuid,nodev,noatime,nodiratime,errors=continue,barrier=0,nobh,delalloc,noauto_da_alloc,discard /cache
That's it. Have fun, or not ...
Hello XDA, I was attempting to do some experimentation with what I could do on the device via modifying init.rc files and the like. Rather than building and flashing a custom ROM for each run which is time consuming I thought I could just mess with the existing system images.
What I was hoping would work:
1. Download the October 007 (patch) stock binaries from Google
2. Extract the flame_xxxxx.zip image file
3. Convert the sparse system image file to a raw image file
- $ simg2img system.img system.raw
4. Mount the ext2 filesystem to a loopback device
- $ mount -o loop -t ext2 system.raw temp_dir
5. Edit the init file (e.g. init.rc) and save it
6. Unmount the ext2 filesystem
7. Create sparse system image
- Still don't quite know how to do this
8. Flash the sparse image from fastboot
- $ fastboot flash system system.img
So my question to the community at large is, is this track of work even logically correct. If so, how does one do it?
I have been trying to run these steps against image-flame-qd1a.190821.007.zip
My machine is running Ubuntu 19.10
For example Step 4 (mounting the ext2 system is failing for me)
Code:
$ losetup --list
....
/dev/loop8 0 0 1 1 /path/system.raw 0 512
....
$ sudo mount /dev/loop8 sys_mount
mount: /pathsys_mount: wrong fs type, bad option, bad superblock on /dev/loop8, missing codepage or helper program, or other error.
Also not working for Step 4
Code:
$ file system.raw
system.raw: Linux rev 1.0 ext2 filesystem data, UUID=4729639d-b5f2-5cc1-a120-9ac5f788683c (extents) (large files) (huge files)
$ sudo mount -o loop -t ext2 system.raw sys_mount
mount: /pathsys_mount: wrong fs type, bad option, bad superblock on /dev/loop8, missing codepage or helper program, or other error.
Thanks for the help.
I have since built my own AOSP build and have the same issue in that I can't mount the resulting system.img file from the AOSP build either.
Not sure if that matters or not, but I found it odd.