[HOWTO]Do a backup of your current kernel and use it for recovery - Galaxy Y GT-S5360 General

This is a new device and the development is starting quickly. Many user that haven't the device is starting to develop some stuff for it also if they don't have the phone ( like me ).
Kernel testing can cause softbrick that can be easy fixed flashing again the stock kernel. The following steps explain how to do a backup of your current kernel so you can use it to restore your device.
It's a very simple guide.....
IMPORTANT You need to use adb ( also terminal emulator is good) and you need to be root!
Code:
su
dd if=/dev/block/bml7 of=/sdcard/boot.img
tar cvf /sdcard/kernel-backup.tar /sdcard/boot.img
IMPORTANT: Write the commands exactly like i wrote and put attention that in the second command. I wrote "BML7" not "BM17" but you have to write without capital letter so "bml7" OK?
After this you'll have a file called kernel-backup.tar in your SDcard. Save it and, in case of softbrick testing a new kernel, put your phone in download mode and flash it with odin (PDA field).
Wish this can help you...
Bye

I got
Code:
su
# dd if=/dev/block/bml7 of=/sdcard/boot.img
dd if=/dev/block/bml7 of=/sdcard/boot.img
# tar cvf /sdcard/kernel-backup.tar /sdcard/boot.img
tar cvf /sdcard/kernel-backup.tar /sdcard/boot.img
tar: removing leading '/' from member names
sdcard/boot.img
#
Nvm.. my bad

noobwithgalaxyy said:
I got
Code:
su
# dd if=/dev/block/bml7 of=/sdcard/boot.img
dd if=/dev/block/bml7 of=/sdcard/boot.img
# tar cvf /sdcard/kernel-backup.tar /sdcard/boot.img
tar cvf /sdcard/kernel-backup.tar /sdcard/boot.img
tar: removing leading '/' from member names
sdcard/boot.img
#
Click to expand...
Click to collapse
check your sd card root. the files are there.

it creates two files..."boot.img" and "karnel-backup.tar"...
which one should I flash with Odin??

amlanpaira said:
it creates two files..."boot.img" and "karnel-backup.tar"...
which one should I flash with Odin??
Click to expand...
Click to collapse
The tar file

The problem is that odin wont flash it i guess !
Sent from my GT-S5360 using XDA App

It doesn't.. I checked..
Sent from my GT-S5360 using XDA App

noobwithgalaxyy said:
It doesn't.. I checked..
Sent from my GT-S5360 using XDA App
Click to expand...
Click to collapse
As i expected !!!we have big problem with odin ...
Sent from my GT-S5360 using XDA App

Yeah we do have a problem.. but Skin did make it work(flashing CWM was successful, even though it didn't work)
If he can let us know how and why other single file flashes do not work..

@ skin1980 can we convert somehow this tar file to update.zip so we can flash it from CWM recovery?

get back up ...
Thank you ..
now and discover how to use it if you need
I wonder if it has the backing of the baseband
Here in Brazil is put another baseband .... we are unsigned operators: /

Code:
C:\Users\hubert>adb shell
$ su
su
# dd if=/dev/block/bml7 of=/sdcard/boot.img
dd if=/dev/block/bml7 of=/sdcard/boot.img
# tar cvf /sdcard/kernel-backup.tar /sdcard/boot.img
tar cvf /sdcard/kernel-backup.tar /sdcard/boot.img
tar: not found
#
what am I doing wrong?

Preterer said:
Code:
C:\Users\hubert>adb shell
$ su
su
# dd if=/dev/block/bml7 of=/sdcard/boot.img
dd if=/dev/block/bml7 of=/sdcard/boot.img
# tar cvf /sdcard/kernel-backup.tar /sdcard/boot.img
tar cvf /sdcard/kernel-backup.tar /sdcard/boot.img
tar: not found
#
what am I doing wrong?
Click to expand...
Click to collapse
both the files are now on your sd card check them...........

rohit589769 said:
both the files are now on your sd card check them...........
Click to expand...
Click to collapse
You are wrong, there is only boot.img .

Preterer said:
Code:
C:\Users\hubert>adb shell
$ su
su
# dd if=/dev/block/bml7 of=/sdcard/boot.img
dd if=/dev/block/bml7 of=/sdcard/boot.img
# tar cvf /sdcard/kernel-backup.tar /sdcard/boot.img
tar cvf /sdcard/kernel-backup.tar /sdcard/boot.img
tar: not found
#
what am I doing wrong?
Click to expand...
Click to collapse
You have to install busybox!
look for busybox installers on Market!

I've created a tar and flashed it with odin. It works fine.
I'm currently working on a replacement for heimdall that will support this phone and some others. So if you make a backup you will be able to restore it later.

s0unds said:
I've created a tar and flashed it with odin. It works fine.
I'm currently working on a replacement for heimdall that will support this phone and some others. So if you make a backup you will be able to restore it later.
Click to expand...
Click to collapse
Keep us updated please for anything new!
Sent from my GT-S5360 using XDA App

Is the boot.img and kernel-backup.tar only sized 5MB?
Sent from my GT-S5360 using XDA App

qtu said:
Is the boot.img and kernel-backup.tar only sized 5MB?
Sent from my GT-S5360 using XDA App
Click to expand...
Click to collapse
It's a really small file, cause it's only Kernel, not whole sys.

Preterer said:
It's a really small file, cause it's only Kernel, not whole sys.
Click to expand...
Click to collapse
I see! Thanks a lot! Now, my kernel is backed-up.

Related

[GUIDE] How to make an Odin ROM

How to make an Odin flashable ROM
This is just a small guide I want to share with anyone who's interested in the commands I personally use. Feel free to correct me or give better commands / instructions.
@Moderators:
If this thread is in the wrong section or already present at XDA, PM me.
This needs a UNIX compatible OS - like Linux or Mac OS X.
On Windows, you can use "Cygwin".
Click to expand...
Click to collapse
Use the dd (datadump) command to make the .rfs files
Of course you need to connect your phone via USB and have ADB prepared on your computer.
# Get Root access first
Code:
su
# Do this first to mount the /system R/W
(thanks to scheichuwe for the simplified command)
Code:
mount -o remount,rw /dev/block/stl9 /system
# Dump the needed data / partitions to your /sdcard
Code:
dd if=/dev/block/stl9 of=/sdcard/factoryfs.rfs bs=4096
dd if=/dev/block/stl11 of=/sdcard/cache.rfs bs=4096
dd if=/dev/block/bml7 of=/sdcard/zImage bs=4096
dd if=/dev/block/bml12 of=/sdcard/modem.bin bs=4096
# Make the tar ball
Code:
tar -H ustar -c factoryfs.rfs cache.rfs modem.bin zImage > darky.tar
# MD5 it for a security check
Code:
md5sum –t darky.tar >> darky.tar
# Rename the tar file
Code:
mv darky.tar darky.tar.md5
Optional:
Make your own pit file
The pit file is used to set the partition layout (Partition Information Table).
# Dump the pit
Code:
dd if=/dev/block/bml2 of=/sdcard/darky.pit bs=4096
I hope I could help you with that
- darkyy.
Nice
Yeah first
Oh and one more thing:
If someone is gonna rate this thread 1 star, please explain here why.
So this means I can make an Odin rom of my current installed config? Or am I missing something?
If you then flash your tar + pit, you have your kernel and rom restored? This would be an awesome way to backup a good config, no?
VenQWish said:
So this means I can make an Odin rom of my current installed config? Or am I missing something?
If you then flash your tar + pit, you have your kernel and rom restored? This would be an awesome way to backup a good config, no?
Click to expand...
Click to collapse
Exactly - these commands will dump the data directly from your current phone.
And yes, you'll have a 1 to 1 Backup.
That is actually VERY useful! I'm constantly switching between a modded Insanity and CM7, and constantly reverting to stock, flashing custom kernels and flashing nandroids is getting quite annoying now.
Don't have access to a linux machine now, I'll try this asap, thanks!
Wow, dasch mal nützlich ville dank^^
Neat. Thank you!
Quipeace said:
That is actually VERY useful! I'm constantly switching between a modded Insanity and CM7, and constantly reverting to stock, flashing custom kernels and flashing nandroids is getting quite annoying now.
Don't have access to a linux machine now, I'll try this asap, thanks!
Click to expand...
Click to collapse
Well you can install cygwin, just remember to install bash terminal when cygwin setup is running.
Sent from my GT-P1000 using Tapatalk
Code:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
Click to expand...
Click to collapse
Galaxy S is running on yaffs2? Interesting
Code:
mount -o rw,remount /system
That should work too...
Is this the same as this?
http://forum.xda-developers.com/showthread.php?t=943588
Mackzen said:
Is this the same as this?
http://forum.xda-developers.com/showthread.php?t=943588
Click to expand...
Click to collapse
No:
The instructions from drakyy create a flashable ROM from the phone.
The Application from bohdans creates a flashable ROM from files on your computer
scheichuwe said:
Galaxy S is running on yaffs2? Interesting
Code:
mount -o rw,remount /system
That should work too...
Click to expand...
Click to collapse
Thanks - gonna change it in the first post
Verified?
Cool stuff Darkyy,
is this working without any issues, any testers?
mr_at_sgs said:
Cool stuff Darkyy,
is this working without any issues, any testers?
Click to expand...
Click to collapse
It's what we used for the Darky's Resurrection Edition
Damn. Left my laptop charger at work. Just when I need battery also.
Great thread. Thank you.
Tricky103 UltraSlim Essential Rom on DamianGTO Ultimate kernel
I have a problem. When tryign to create the tar-file i get:
cannot create jesper.tar: read-only file system.
What to do?
Does this also work when the partitions are NOT RFS.
Like all in ext4?
Will Odin be able to flash that image?
I somehow doubt it...
zurchpet said:
Does this also work when the partitions are NOT RFS.
Like all in ext4?
Will Odin be able to flash that image?
I somehow doubt it...
Click to expand...
Click to collapse
Good question..... I'd like to know this too..
Although even if having to disable lag fix to create it the apply again after flashing is still a quicker way to toggle between your current rom and cm7..
Neat Darky
but can i do these dumps on the phone without a pc or adb
Sent from my GT-I9000 using XDA App
Perhaps some could write a script to do this at the phone
Sent from my GT-I9000 using XDA App

[Request] How to flash system.img through ADB in CWM

I would like to try flashing the stock bell rom back on my phone but I never backed it up initially.
I've been having Bluetooth music issues with both kernelpanics and ho!no!s roms so I have to get stock to test if its the phone or just the roms while its still in warranty.
Thanks guys!!
Sent from my LG-P930 using XDA
EDIT:
Found stock system.img
What are the ADB commands to flash the file to my phone?
Bump for new topic. Found System.img of stock bell canada rom
adb shell
su
dd if=/sdcard/boot.img of=/dev/block/mmcblk0p8
dd if=/sdcard/recovery.img of=/dev/block/mmcblk0p13
dd if=/sdcard/firmware.img of=/dev/block/mmcblk0p1
dd if=/sdcard/system.img of=/dev/block/mmcblk0p27
dd if=/sdcard/baseband.img of=/dev/block/mmcblk0p14
Epyoch said:
adb shell
su
dd if=/sdcard/boot.img of=/dev/block/mmcblk0p8
dd if=/sdcard/recovery.img of=/dev/block/mmcblk0p13
dd if=/sdcard/firmware.img of=/dev/block/mmcblk0p1
dd if=/sdcard/system.img of=/dev/block/mmcblk0p27
dd if=/sdcard/baseband.img of=/dev/block/mmcblk0p14
Click to expand...
Click to collapse
when I type SU in, it says /sbin/sh: su: not found
and if i try dd if=/sdcard/system.img of=/dev/block/mmcblk0p27
it gives me dd: can't open '/sdcard/system.img': No such file or directory
Okay, first, in CWM, you don't need to su for root permissions, your ADB shell has them. Second, if you haven't copied your file to the root level of your sdcard and if your file isn't named "system.img" exactly, that command will fail. I'll leave it to you to figure out how to move/rename your system.img file accordingly lol
Edit, it just occurred to me you might be having the garbled sdcard problem where it will spit out garbage if you type in the "ls" command in ADB. The solution has been posted by kernelpan1c, but first let us know what the output of ls is if you're sure your system.img is in the root level of your sdcard.
Malnilion said:
Okay, first, in CWM, you don't need to su for root permissions, your ADB shell has them. Second, if you haven't copied your file to the root level of your sdcard and if your file isn't named "system.img" exactly, that command will fail. I'll leave it to you to figure out how to move/rename your system.img file accordingly lol
Edit, it just occurred to me you might be having the garbled sdcard problem where it will spit out garbage if you type in the "ls" command in ADB. The solution has been posted by kernelpan1c, but first let us know what the output of ls is if you're sure your system.img is in the root level of your sdcard.
Click to expand...
Click to collapse
I already used ADB to push system.img to my phone's SDCard root directory.
Are you suggesting that I reformat my SDCard through windows?
I just realized that I am lacking the boot.img of the stock bell ROM. system and boot are the two that are absolutely necessary to get the phone working correct?
Which rom are you coming from? If it's a Nitro rom/kernelpan1c's rom, you shouldn't have to flash boot.img.
Yeah, according to kernelpan1c, there is something weird going on with the way our sdcard is formatted. After formatting it in Windows he says it should work just fine in the CWM flashed by Rom Manager (I haven't tested it myself, but I'm sure he's correct). I really want to know what is making the Rom Manager CWM unable to read it where bytecode64's CWM can read it just fine...
Malnilion said:
Which rom are you coming from? If it's a Nitro rom/kernelpan1c's rom, you shouldn't have to flash boot.img.
Yeah, according to kernelpan1c, there is something weird going on with the way our sdcard is formatted. After formatting it in Windows he says it should work just fine in the CWM flashed by Rom Manager (I haven't tested it myself, but I'm sure he's correct). I really want to know what is making the Rom Manager CWM unable to read it where bytecode64's CWM can read it just fine...
Click to expand...
Click to collapse
I think I'll be using HO!NO!'s rom as a base for the boot.img, since he has a bell optimus LTE, not the AT&T phone. I'm assuming that he hasn't made any changes to the boot partition, since no custom kernel development has occurred for this phone yet.
I found a so called legit CWM backup of the BELL rom, in one of the lu6200 threads, http://forum.xda-developers.com/showthread.php?t=1472501
but recovering the backup only hangs on the LG logo. I did a "advanced restore" and restored only the system and boot files but that didn't get past the logo either...
It booted after an advanced restore with the "stock" system(from that thread) and the boot (from HONO's), but the WIFI wouldn't start, it said error.
Where did you get your stock bell system.img? and can you provide it?
hereric said:
when I type SU in, it says /sbin/sh: su: not found
and if i try dd if=/sdcard/system.img of=/dev/block/mmcblk0p27
it gives me dd: can't open '/sdcard/system.img': No such file or directory
Click to expand...
Click to collapse
Mount sdcard in recovery.
After you enter adb shell
"mount /sdcard" (without quotations)
Then use the command "dd if=/sdcard/system.img of=/dev/block/mmcblk0p27"

[Download] system.img was extracted to a 7z file (Prerooted)

It's a 7z file. It was extracted from system.img
link: http://minus.com/lJ9OQT5ktY7Vr
I used the below command to get the system.img. Root is required. Image size is 1Gb.
Code:
dd if=/dev/block/mmcblk0p15 of=/sdcard/system.img
adb pull /sdcard/system.img
To mount:
Code:
mkdir sys
sudo mount -o loop system.img sys
Is this Gingerbread or ICS? What version?
popfan said:
Is this Gingerbread or ICS? What version?
Click to expand...
Click to collapse
LT28H 4.0.4
ganeshbiyer said:
I used the below command to get the system.img. Root is required. Image size is 1Gb.
Code:
dd if=/dev/block/mmcblk0p15 of=/sdcard/system.img
adb pull /sdcard/system.img
To mount:
Code:
mkdir sys
sudo mount -o loop system.img sys
Click to expand...
Click to collapse
Now we need a usable cwm

[GUIDE] If your EFS is corrupt

When I first got SGS3 I made efs backup as suggested by xda. I didn't backup it as a folder, only as a dd block copy.
So if you are good today - make block copy of EFS and tar copy using adb:
adb shell
su
dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn
cd /sdcard
tar cvf efs.tar /efs
Also there is a way of saving NVRam into recovery. Do it now if you haven't yet:
adb reboot nvbackup
Then if you still don't feel safe download QPST tools from IMEI thread and backup your NVRam to PC.
My earpiece died and I got a replacement SGS3.
Something (CWM6?) caused IMEI corruption. I didn't know that, so I tried reflashing modems and ROMs. I was trying everything to restore my connectivity. It somehow didn't help that there are seversal guides on how to do IMEI restore.
While I was waiting for another tool download I decided to restore efs from my previous SGS3 on to current SGS3 (I was at my wits end). And I didn't backup current EFS - my huge mistake! But I already almost give up on the phone at that point.
QPST+Peoplearmy tool was able to restore my IMEI. But EFS is now corrupt (why? I cannot even mount it!). And I can only use one modem - the one I used when backing up EFS (UCALG1 modem).
On the good side - after formatting EFS and making it clean, I can run CM10.1 without any issues. My serial number is 000000, but who cares.
Here's how to format EFS:
1. Reboot into recovery (CWM 5.8.0.5 touch is my preferred)
2. You should be able to see phone connected to PC in adb (recovery mode)
3. Issue following commands:
adb shell
mke2fs -T ext4 /dev/block/mmcblk0p11
mkdir /efs
mount -w -t ext4 /dev/block/mmcblk0p11 /efs
Lesson learned - try not to mess with EFS at all. Do IMEI restore using QPST and Peoplearmy. I'll keep you posted on EFS restore efforts.
Assuming I made a block copy of my EFS partition using "dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn".
How would I restore it should I corrupt my EFS?
Like this?
dd if=/sdcard/efs.sbn of=/dev/block/mmcblk0p11
HiKsFiles said:
Assuming I made a block copy of my EFS partition using "dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn".
How would I restore it should I corrupt my EFS?
Like this?
dd if=/sdcard/efs.sbn of=/dev/block/mmcblk0p11
Click to expand...
Click to collapse
Correct.
Sent from my SAMSUNG-SGH-I747 using xda premium
---------- Post added at 03:19 PM ---------- Previous post was at 03:15 PM ----------
Or you can do the backup in one nice command:
dd if=/dev/block/mmcblk0p11 | gzip -9 > /sdcard/efs.gz
And to restore:
gunzip /sdcard/efs.gz - | dd of=/dev/block/mmcblk0p11
Oh, and you don't need to reformat the partition before restoring, that happens during the restore, because every bit gets overwritten.
Sent from my SAMSUNG-SGH-I747 using xda premium
bravomail said:
...make block copy of EFS and tar copy using adb:
adb shell
su
dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn
cd /sdcard
tar cvf efs.tar /efs
Click to expand...
Click to collapse
The TAR command failed for me on my i747, TAR not found.
d3athsd00r said:
Or you can do the backup in one nice command:
dd if=/dev/block/mmcblk0p11 | gzip -9 > /sdcard/efs.gz
Click to expand...
Click to collapse
This worked like a charm for me, thanks.

Backup files

Hi people! I need backups from your phone F180L. Those who have F180L phone please make a backup. Go to the terminal emulator and type:
su
cd /sdcard
mkdir 123
cd /123
dd if=/dev/block/mmcblk0p1 of=modem.img
dd if=/dev/block/mmcblk0p15 of=drm.img
dd if=/dev/block/mmcblk0p12 of=m9kefs1.img
dd if=/dev/block/mmcblk0p13 of=m9kefs2.img
dd if=/dev/block/mmcblk0p26 of=persist.img
Please Share a link to files that are in the /123
mazahaka1997 said:
Hi people! I need backups from your phone F180L. Those who have F180L phone please make a backup. Go to the terminal emulator and type:
su
cd /sdcard
mkdir 123
cd /123
dd if=/dev/block/mmcblk0p1 of=modem.img
dd if=/dev/block/mmcblk0p15 of=drm.img
dd if=/dev/block/mmcblk0p12 of=m9kefs1.img
dd if=/dev/block/mmcblk0p13 of=m9kefs2.img
dd if=/dev/block/mmcblk0p26 of=persist.img
Please Share a link to files that are in the /123
Click to expand...
Click to collapse
Those who know what this is about, need no explanations. Those who are not so sure, be aware that by doing this (specifically the line in red), you will be sharing your phone's identity. Nothing's wrong with that, as long as you know it.
What's in drm and persist images?
Sent from my LG-E975 using Tapatalk
davevinci said:
What's in drm and persist images?
Click to expand...
Click to collapse
For these two, I don't know... Since I am not familiar with nuts and bolts of the DRM implementation on Android, I don't know what exactly is stored on that partition. As for persist, I was trying to get some info on it quite a while ago, for a different phone that is long gone, but couldn't find much.

Categories

Resources