[CWM UTIL] GS2PreloadBackup/Restore scripts for Samsung JB (02/03/2013)

Search This thread

hawkerpaul

Senior Member
Sep 25, 2011
3,305
6,242
UK
www.practicenet.co.uk
Awesome, thank you very much!!!
If it's ok I will add a how-to to my thread and link to yours?
To me, this is an enormous step forward :) great!!

Sent from my GT-I9100 using xda app-developers app

Feel free mate.
Bear in mind the new versions are not on the devhost site yet.
Waiting for ApriliaM3 to upload
 

ohwarumbloss

Senior Member
Oct 9, 2010
1,169
805
Kalletal
AW: [CWM UTIL] GS2PreloadBackup/Restore scripts for Samsung JB (22/02/2013)

Edit and much more important, thanks hawkerpaul for the updated Files, really appreciated!!!! Thank you thank you :)
Sent from my GT-I9100 using xda app-developers app
 
Last edited:
  • Like
Reactions: THE RED BLUR

seba84_2005

Senior Member
May 31, 2010
129
42
Warszawa
Thanks. I successful backup and restore full stock samsung rom jelly bean 4.1.2 xxms1 with philz-touch_3.00_i9100 temporary recovery, and GS2preload backup/restore sctipts.
 

king.com

Senior Member
Dec 14, 2010
146
57
I didn't noticed your work until today and it is a thing that I've been looking months.

Thanks a lot. It it awesome ;)
 

doctor_droid

Senior Member
Oct 29, 2012
4,472
1,938
Indore
hi hawkerpaul :)
i tried dual booting wid 2 jb roms using siyah(yes u can laugh here) :/
and then none booted..
i restored nandroid bt got a bootloop.. i flashed stock xwlsd via odin.. still bootloop after blue samsung logo..i can still run any rom flashed via recovery..
i posted my query in qna section and i came to knw abt ur script..
m pretty new to samsung... since i didnt made any backup of preload.. how m i suppose to restore it back..

ps - sorry for a question in dev thread ..:beer:
 

hawkerpaul

Senior Member
Sep 25, 2011
3,305
6,242
UK
www.practicenet.co.uk
hi hawkerpaul :)
i tried dual booting wid 2 jb roms using siyah(yes u can laugh here) :/
and then none booted..
i restored nandroid bt got a bootloop.. i flashed stock xwlsd via odin.. still bootloop after blue samsung logo..i can still run any rom flashed via recovery..
i posted my query in qna section and i came to knw abt ur script..
m pretty new to samsung... since i didnt made any backup of preload.. how m i suppose to restore it back..

ps - sorry for a question in dev thread ..:beer:

As you're probably aware, you cannot easily dual-boot on JB ROMs as they use the previously spare space for system files (/preload) and this was the area kernels such as Siyah used in order to dual boot on ICS.

Also be aware of the backup methodology of the kernel you are using. Some do not backup/restore /preload (eg. Siyah, Dorimanx).
Apolo and Jeboo both do.
PhilZ does too, as long as you have set the option in CWM in order to do so. (See OP for more details)
Online backup apps (Eg. orange backup) do backup /preload.
Be aware of this when restoring, as if the backup does not contain a /preload backup, then you will have a mis-match of /system and /preload files.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 48
    The JB XXLSJ leak and the latest XWLS8 official JB releases have introduced a new partition on /dev/block/mmcblk0p12 mounted to /preload.
    This was required due to the fact that the /system partition just isn't big enough to hold all the extra apps the JB leak requires.
    The problem with this is that with the exception of PhilZ Kernel and Jeboo, CWM backups in bith Siyah and DorimanX omit the backing up this /preload partition. If you regularly try out different ROMs and restore back, this can mean your ROM's getting a little out of step as it would have the /preload files from the ROM you last flashed, with all other files coming from the ROM you performed the backup on.

    Currently, if you are on Siyah/Dori, the only way to backup/restore everything via CWM backups is to:
    a) reboot into recovery
    b) flash PhilZ/Jeboo
    c) go to advanced>reboot recovery
    d) make your backup in PhilZ/Jeboo/Apolo recovery
    and if you want to revert back to Siyah/Dori:
    e) flash Siyah/Dori
    f) advanced>reboot recovery

    If you ever need to restore, and you are using Siyah/Dori then you will need to:
    a) reboot into recovery
    b) flash PhilZ/Jeboo
    c) go to advanced>reboot recovery
    d) restore your backup in PhilZ/Jeboo/Apolo recovery
    e) flash Siyah/Dori
    f) reboot

    NOTE: Later versions of PhilZ require you to specifically set the backup/restore of /preload. This is done in PhilZ CWM Recovery:
    1. boot into PhilZ recovery
    2. Philz settings
    3. Special backup and restore
    4. Misc nandroid settings
    5. Toggle /preload processing (make sure this says /preload will be processed)


    To get around this current omission in Siyah and Dori, I have written the following 2 CWM flashable zips:

    GS2PreloadBackup
    This will backup your current /preload partition.
    The backup is made on a per-ROM basis to /sdcard/MyBackups/preload/[ROM-Name]/preload.tar. Therefore, if you backup on several different ROMs, you will get several ROM folders in this preload backup location, one backup per ROM
    GS2PreloadRestore
    This will restore the /preload backup made by the above script for your current ROM.

    So if you are on Siyah/Dori and want to make a full backup without flashing between PhilZ, you can now do the following:
    1. Boot up into recovery
    2. Make your CWM backup
    3. Run GS2PreloadBackup.zip

    Further down the line, if you ever wanted to restore this, then
    1. Boot up into recovery
    2. Restore your CWM backup
    3. Flash GS2PreloadRestore.zip

    The restore is sensitive to the ROM you are currently on, so it will only restore the /preload for you current ROM, provided you have run the backup script previously for the ROM of course.


    Changing the backup location
    By default, backups are made to the internal SD card in /sdcard/MyBackups as described above. You can change the backup location to the external SD card if required. This can be done by editing /sdcard/MyBackups/HawkerOptions/MyWipeOptions.prop. Within this file there is a line that tells the script where the backups are to be stored. Edit the following line as required:
    BKP_LOCATION=int (backs up to INTERNAL SD Card, ie. /sdcard/MyBackups)
    BKP_LOCATION=ext (backs up to EXTERNAL SD Card, ie. /storage/extSdCard/MyBackups)

    Please note, that if you change the location between int/ext in MyWipeOptions.prop, your backups will not get automatically moved to the new location. You would have to manually move the current backup over to the new location if you do not want to potentially have two copies of the backups.


    Test Mode
    The script inside the zip file that does all the work is called GS2Hawker.sh. This can be called via adb shell/Script Manager etc. in order to perform a test dummy-run. The Test Mode goes through all the motions as per a standard CWM Recovery run, but it does not remove any files/folders in any way, and merely shows the commands it would have done.
    eg. extract GS2Hawker.sh from the zip using 7Zip or similar
    adb shell
    sh GS2Hawker.sh PreloadBackup
    sh GS2Hawker.sh PreloadRestore


    Summary of Files Created/Used
    1. /sdcard/MyBackups/HawkerLogs/GS2PreloadBackup.log.
    2. /sdcard/MyBackups/HawkerLogs/GS2PreloadRestore.log.
    These shows the activity log of what the script has done. This gets overwritten the next time you run the script.
    3. /sdcard/MyBackups/HawkerOptions/MyWipeOptions.prop. Options file for all my scripts. Currently this contains the option for backup location, internal or external SD card. (See Changing the backup location above)


    These scripts are of course only a temporary measure as I am in no doubt that both Siyah and Dori will both also include the /preload partition in their CWM Recovery scripts very shortly, but for now, I hope this might help one or two of you out.


    Known Issues
    Free space checking prior to performing the backup always returns free space on internal sdcard even when
    backing up to external sd card.

    For some reason, when I do a df (on Siyah, not sure about other kernels)
    I get the following:
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/block/mmcblk0p11
    12063840 231264 11832576 2% /mnt/.secondrom
    /dev/block/mmcblk1p1 12063840 231264 11832576 2% /sdcard
    /dev/block/mmcblk0p11
    12063840 231264 11832576 2% /sdcard
    /dev/block/mmcblk1p1 30648992 17592608 13056384 57% /emmc

    It appears /dev/block/mmcblk1p1 is mounted to /emmc AND /sdcard?????!!!!
    All file operations on /emmc gets performed on the extenral sd card as expected (ie your backups WILL go to external), BUT when the df command is issued to check for available space, it is performed on /sdcard! Therefore, if the script is trying to find the space left on /emmc, and the device returned from the df command is /sdcard, then an error is presumed, an no space check performed.


    Please Note
    I use these scripts myself between many flashes of different ROMS, and are provided here, as-is, out of my passion for development. Although every effort has been made to ensure everything works correctly on my handset I cannot be held responsible if things get messed up, or if you put something in your user-definable files that you shouldn't have included. As with everything else on here, you flash anything at your own risk. I always recommend performing a full CWM backup before attempting to flash anything onto your device. :)
    16
    Current Versions
    GS2PreloadBackup 1.05 (22/05/2013)
    GS2PreloadRestore 1.05 (02/03/2013)
    Note: If the latest versions quoted above do not appear in the download devhost site, then please be patient!
    ApriliaM3 should soon be uploading them. :)


    Downoad Here

    Download Here


    My HUGE thanks goes out to ApriliaM3 for hosting the scripts.
    Please give him the thanks he deserves. :)


    To Do
    ....​


    Work in Progress
    ....​

    Changelog
    GS2PreloadBackup v1.05 (22/05/2013)
    1. Extra free space checking. (See OP for known issues)

    GS2PreloadBackup v1.04 GS2PreloadRestore v1.05 (02/03/2013)
    1. Backups can now go to either internal or external SD Card. See Post #1 for details

    GS2PreloadRestore v1.04 (22/02/2013)
    1. Now restores /preload/symlink instead of whole of /preload for greater flexibility in dual-boot systems
    2. Current /preload/symlink contents removed before restore giving a better snapshot for the restore point

    GS2PreloadBackup v1.03 (22/02/2013)
    1. Now backs up /preload/symlink instead of whole of /preload

    GS2PreloadRestore v1.03 (22/02/2013)
    1. Current /preload contents removed before restore giving a better snapshot for the restore point
    2. Progress now given in Mb during the restore process

    v1.02 (13/02/2013)
    1. Numerous display updates
    2. Log file now goes to /sdcard/MyBackups/HawkerLogs so that they are grouped with logs from my other scripts

    v1.01 (31/01/2013)
    1. Progress now given during backup operation of the size of backup complete
    10
    Thanks buddy:thumbup::thumbup:. I just wanted to get in first. :D:thumbup::thumbup:

    Edit. I just ran a backup and it worked and so did the restore :):thumbup:

    In the meantime I'll leave this picture until I can post something constructive. ;)

    peneju4e.jpg


    SIGNATURE


    PHONE : SGSII
    Sent via: Tapatalk 2
    Main ROM: Alliance rom v5.2

    KERNEL : Dorimanx 7.39
    (DEFAULT PROFILE AND SETTINGS )
    MODEM : BVLP7
    BATTERY : Stock 1650mAh
    EXTERNAL Sdcard : Samsung Class 10 32gb
    LAUNCHER : Apex

    My Guides list to install NeatRom and other ROMS and kernels on LSJ + tools to have a bug free rom + how to back up and RESTORE FOM FULLY = http://xdaforums.com/showthread.php?p=35923600

    1.Rom Nuke script

    http://xdaforums.com/showthread.php?p=36268094

    2.Kernel Clean script

    http://xdaforums.com/showthread.php?p=34879811

    3.Fast Dormancy :

    http://xdaforums.com/showthread.php?p=36396636

    4. How to install full wipe with rom nuke on LSJ

    http://xdaforums.com/showthread.php?p=36655790

    7
    Updated GS2PreloadBackup to v1.04 and GS2PreloadRestore to v1.05

    See post #2 for details
    6
    Some more great work and another great guide there Paul... well done!
    I have now created a directory for your work on my Dev-Host mirror site HERE :)