Where does the original boot.img for magisk restore needs to be put

Search This thread

Benjamin_L

Senior Member
Nov 30, 2010
2,612
922
I put the boot.img to the MagiskManager folder but this does not work. What do I need to do? I read something about gzipping but I'd be grateful for instructions
 

ckpv5

Inactive Recognized Contributor
Feb 11, 2008
14,354
18,301
Kuala Lumpur
AFAIK you don't have to put stock boot.img anywhere as Magisk should have a backup of the stock boot at \root\data

You just need to select uninstall - restore images in Magisk Manager to restore stock boot.img
 

Attachments

  • Screenshot_20180922-132205.png
    Screenshot_20180922-132205.png
    175.1 KB · Views: 5,506

Benjamin_L

Senior Member
Nov 30, 2010
2,612
922
AFAIK you don't have to put stock boot.img anywhere as Magisk should have a backup of the stock boot at \root\data

You just need to select uninstall - restore images in Magisk Manager to restore stock boot.img

Oh I forgot to say I used your images and fastboot but fastboot doesn't work currently for me so i tried to use the normal method.

Edit: Now i tried complete removal and now I am stuck on recovery screen with "no command". Fastboot is always reporting requested size more than allowed...
 
Last edited:

ckpv5

Inactive Recognized Contributor
Feb 11, 2008
14,354
18,301
Kuala Lumpur
Don't you have the magisk backup stock boot at that location ?
Just check my current 9.6.13.0 (as example), both stock boot.img & magisk backup are same.

No idea how to fix your fastboot issue.

Edit: Now i tried complete removal and now I am stuck on recovery screen with "no command". Fastboot is always reporting requested size more than allowed...
Shouldn't try that before restore images is done.
Sorry.. no idea how to fix it without fastboot.
 

Attachments

  • 0_Screenshot_20180922-133600.jpg
    0_Screenshot_20180922-133600.jpg
    58.1 KB · Views: 2,968
  • 0_Screenshot_20180922-133626.jpg
    0_Screenshot_20180922-133626.jpg
    60.4 KB · Views: 2,947
Last edited:
  • Like
Reactions: Benjamin_L

Benjamin_L

Senior Member
Nov 30, 2010
2,612
922
Don't you have the magisk backup stock boot at that location ?
Just check my current 9.6.13.0 (as example), both stock boot.img & magisk backup are same.

No idea how to fix your fastboot issue.


Shouldn't try that before restore images is done.
Sorry.. no idea how to fix it without fastboot.
Fixed it with another laptop. Thank you for the time
 
  • Like
Reactions: ckpv5

JDKerados

New member
Mar 3, 2020
1
2
How did you fix it ?

FIX IT:
1 - Create a gzip archive named: stock_image_0.img.gz
2 - Put the file in your "/data" folder.
3 - GoTo "/root/sbin/.magisk" folder (is an hidden folder so you need to enable hidden files)
3 - Open file "config" and edit SHA1 string to "0". Usually that string is a SHA1 of the img file but i used "_0" so my SHA1 must be equal to "0".
4 - Now you are able to restore your stock boot image and you can do all other stuff to install your OTA Updates.
 

rophiroth

Senior Member
Dec 11, 2010
523
34
Is this info updated? im on android 12 magisk 24.7 and couldnt find those file and folders root and hidden acivated
 

b_fizzle

Senior Member
Feb 22, 2010
191
11
FIX IT:
1 - Create a gzip archive named: stock_image_0.img.gz
2 - Put the file in your "/data" folder.
3 - GoTo "/root/sbin/.magisk" folder (is an hidden folder so you need to enable hidden files)
3 - Open file "config" and edit SHA1 string to "0". Usually that string is a SHA1 of the img file but i used "_0" so my SHA1 must be equal to "0".
4 - Now you are able to restore your stock boot image and you can do all other stuff to install your OTA Updates.

I needed to change that to /data/stock_boot_${SHA1}.img.gz ("boot" instead of "image") as found in Magisk sources.

Other than that it worked like a charm, thanks!

Is this info updated? im on android 12 magisk 24.7 and couldnt find those file and folders root and hidden acivated


I'm in the same boat - I read that Magisk was supposed to autocreate a backup, if it did; it doesn't know where it went and I've tried a number of places (boot.img and gz zipped) and still nothing.

Android 12, Magisk 25.1

Thanks for any help!
 

b_fizzle

Senior Member
Feb 22, 2010
191
11
I found this website:

I will post the edits I had to make below, but for the original, see the website.

** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img

# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)

# repack boot.img.gz
gzip -9f /sdcard/boot.img

# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}

I was able to follow the guide to update from there, though to be fair, it's still "optimizing". Crossing my fingers.
 
  • Like
Reactions: Phantom Thief

ZerkerEOD

Senior Member
Aug 1, 2009
150
14
OnePlus 8 Pro
Nothing Phone 1
I found this website:

I will post the edits I had to make below, but for the original, see the website.

** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img

# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)

# repack boot.img.gz
gzip -9f /sdcard/boot.img

# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}

I was able to follow the guide to update from there, though to be fair, it's still "optimizing". Crossing my fingers.
This wanted me today on the Nothing Phone 1. Thanks so much!
 

v.konvict

Senior Member
Dec 1, 2012
1,672
929
Mwanza
1.Create a gzip archive named: stock_image_0.img.gz
Guys how are you making this gzip.what application are you using or is just renaming the boot.img file to that.
 

JustinChase

Senior Member
Jan 31, 2007
392
58
I found this website:

I will post the edits I had to make below, but for the original, see the website.

** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img

# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)

# repack boot.img.gz
gzip -9f /sdcard/boot.img

# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}

I was able to follow the guide to update from there, though to be fair, it's still "optimizing". Crossing my fingers.
Magisk is refusing to allow superuser rights when I type su. I believe I have allowed apps and adb in magisk, but it's denying the su request.

how to get past this?
 

b_fizzle

Senior Member
Feb 22, 2010
191
11
1.Create a gzip archive named: stock_image_0.img.gz
Guys how are you making this gzip.what application are you using or is just renaming the boot.img file to that.

That set of instructions didn't work for me - the one below that did (I'll quote it here):

I found this website:

I will post the edits I had to make below, but for the original, see the website.

** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img

# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)

# repack boot.img.gz
gzip -9f /sdcard/boot.img

# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}

I was able to follow the guide to update from there, though to be fair, it's still "optimizing". Crossing my fingers.
 

JustinChase

Senior Member
Jan 31, 2007
392
58
I dug a bit deeper and discovered that shell was disallowed from within Magisk for some reason. I have no recolleciton of it asking me, but once i enabled it in magisk, I was able to su in a prompt and get my problem solved.
 

simona70

Senior Member
Jun 11, 2013
266
43
Livorno
FIX IT:
1 - Create a gzip archive named: stock_image_0.img.gz
2 - Put the file in your "/data" folder.
3 - GoTo "/root/sbin/.magisk" folder (is an hidden folder so you need to enable hidden files)
3 - Open file "config" and edit SHA1 string to "0". Usually that string is a SHA1 of the img file but i used "_0" so my SHA1 must be equal to "0".
4 - Now you are able to restore your stock boot image and you can do all other stuff to install your OTA Updates.
I have backup boot.img in
/data/magisk_backup_60dcda9942c4926a9e1d4b2927840de892ab4f64/boot.img.gz
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    AFAIK you don't have to put stock boot.img anywhere as Magisk should have a backup of the stock boot at \root\data

    You just need to select uninstall - restore images in Magisk Manager to restore stock boot.img
    2
    How did you fix it ?

    FIX IT:
    1 - Create a gzip archive named: stock_image_0.img.gz
    2 - Put the file in your "/data" folder.
    3 - GoTo "/root/sbin/.magisk" folder (is an hidden folder so you need to enable hidden files)
    3 - Open file "config" and edit SHA1 string to "0". Usually that string is a SHA1 of the img file but i used "_0" so my SHA1 must be equal to "0".
    4 - Now you are able to restore your stock boot image and you can do all other stuff to install your OTA Updates.
    1
    Don't you have the magisk backup stock boot at that location ?
    Just check my current 9.6.13.0 (as example), both stock boot.img & magisk backup are same.

    No idea how to fix your fastboot issue.

    Edit: Now i tried complete removal and now I am stuck on recovery screen with "no command". Fastboot is always reporting requested size more than allowed...
    Shouldn't try that before restore images is done.
    Sorry.. no idea how to fix it without fastboot.
    1
    Don't you have the magisk backup stock boot at that location ?
    Just check my current 9.6.13.0 (as example), both stock boot.img & magisk backup are same.

    No idea how to fix your fastboot issue.


    Shouldn't try that before restore images is done.
    Sorry.. no idea how to fix it without fastboot.
    Fixed it with another laptop. Thank you for the time
    1
    FIX IT:
    1 - Create a gzip archive named: stock_image_0.img.gz

    I needed to change that to /data/stock_boot_${SHA1}.img.gz ("boot" instead of "image") as found in Magisk sources.

    Other than that it worked like a charm, thanks!