Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detailed recovery instructions #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

nr23730
Copy link

@nr23730 nr23730 commented Apr 4, 2024

Added detailed instructions to determine active system partition and restore partition using dd.

Added detailed instructions to determine active system partition and restore partition using dd.
* Make full backup of device `sudo dd if=/dev/sdc of=rm2.raw bs=4096 status=progress`
* Open the `uboot.env` file from the root of the `BOOT` partition in a text editor. You'll see something like `active_partition=3`. This indicates that your remarkable boots from sdc3, so we'll use sdc2 to restore the `sdc3` partition.
* Backup both system partitions using `sudo dd if=/dev/sdc2 of=rm2-sdc2.raw bs=4096 status=progress` and `sudo dd if=/dev/sdc3 of=rm2-sdc3.raw bs=4096 status=progress`
* Restore the `sdc3` partition with the backup of `sdc2` using `sudo dd if=rm2-sdc2.raw of=/dev/sdc3 bs=4096 status=progress` assuming your active partition is `3`. If your active partition is `2` restore it using `sudo dd if=rm2-sdc3.raw of=/dev/sdc2 bs=4096 status=progress`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably also outline how to restore from an update image. You can use codexctl to download the image, and then extract the image with https://github.com/ddvk/remarkable-update/tree/main/extractor or programatically with https://github.com/Eeems-Org/remarkable-update-fuse

Copy link

@joegoldin joegoldin Apr 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nr23730 and @Eeems -- this was really helpful in downgrading from the latest 3.11 beta!

I'd like to note that the only image extraction method that actually worked was using https://github.com/ddvk/remarkable-update/tree/main/extractor, https://github.com/ddvk/remarkable-update/blob/main/switch.sh, and this dd command:

dd if=rawimage.ext4 bs=4096 of=/dev/mmcblk2p3 && ./switch.sh && reboot

Any other method of extracting the image resulted in the tablet just rebooting back to the beta firmware partition.

To clarify, I was able to do this via SSH, didn't need the HW adapter 😄

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are doing this over SSH, it's not really relevant to what the instructions here are aimed at.

I'd like to note that the only image extraction method that actually worked was using https://github.com/ddvk/remarkable-update/tree/main/extractor, https://github.com/ddvk/remarkable-update/blob/main/switch.sh, and this dd command:

dd if=rawimage.ext4 bs=4096 of=/dev/mmcblk2p3 && ./switch.sh && reboot

Any other method of extracting the image resulted in the tablet just rebooting back to the beta firmware partition.

What other method did you attempt to use to extract the image? I only listed two options, one of which requires you to write your own python script to handle the extraction, which I know works, as it's part of the automated testing in the repo.


Side-note. 3.11+ has a new update mechanism, which changes the image format completely. New tools and instructions will need to be provided for how to get a raw image from the new update images.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are doing this over SSH, it's not really relevant to what the instructions here are aimed at.

Yeah, I just felt the need to jot this down somewhere in case others on 3.11+ ran into the same issues. Spent a while trying to understand what was going wrong...

What other method did you attempt to use to extract the image?

I originally tried codextl extract via https://github.com/Jayy001/codexctl, which uses your remarkable fuse package.

After failing a bunch with that image, my last thought after a few dozen tries the other day was that there must be a difference between versions/logic/etc in the three methods (codextl, extractor.py, diy py with fuse package) and tried directly using your package at the python prompt and also using the extractor.py script. The image from extractor.py was the only one that actually worked.

I did see one reddit post of a user on a much lower version (2.x) who was unable to get their downgrade to work, until it randomly did after a few tries -- it's possible this was just an intermittent failure (or that my images were damaged when scping to the RM2)?

It seemed like it really didn't want to downgrade from 3.11 and kept changing the firmware vals back...

Also, originally I hadn't been using the block size param with dd, but I went back and tried again after seeing this post (which was really helpful to confirm I was taking the right steps). I did try again with my original extracted image, but block size alone wasn't enough to fix it.

Side-note. 3.11+ has a new update mechanism

I did see that, but figured I could still flash the other partition and downgrade. I was worried something with the boot process had changed, but I think it was just really stubborn.


Very thankful for y'all in the community keeping these tools alive -- I've got toltec/KOReader/etc running now now problem😄

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What other method did you attempt to use to extract the image?

I originally tried codextl extract via https://github.com/Jayy001/codexctl, which uses your remarkable fuse package.

After failing a bunch with that image, my last thought after a few dozen tries the other day was that there must be a difference between versions/logic/etc in the three methods (codextl, extractor.py, diy py with fuse package) and tried directly using your package at the python prompt and also using the extractor.py script. The image from extractor.py was the only one that actually worked.

I don't see an open issue on either repository for the errors you were getting. So Jayy and I have no way of fixing whatever the issue you encountered was.

The logic extractor.py and my stuff uses is the same, my stuff just adds extra validation checks and performance optimizations for random access.

I did see one reddit post of a user on a much lower version (2.x) who was unable to get their downgrade to work, until it randomly did after a few tries -- it's possible this was just an intermittent failure (or that my images were damaged when scping to the RM2)?

It seemed like it really didn't want to downgrade from 3.11 and kept changing the firmware vals back...

The extracted images would need to be applied with dd, not the update mechansim, so I'm not sure how it would not work if you got an image to extract. Did you actually have errors with extracting the image, or were you still trying to use the old update mechansim to apply an update file, and used the extracted images instead?

Also, originally I hadn't been using the block size param with dd, but I went back and tried again after seeing this post (which was really helpful to confirm I was taking the right steps). I did try again with my original extracted image, but block size alone wasn't enough to fix it.

dd doesn't need to have a block size to work. It's just used for optimizing the speed, or calculating the size when doing a partial copy or from an infinite source like /dev/zero.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still appreciate an issue opened with more information, like the sha256sum of the update file, and of the produced image. We can't fix the issue if people don't report them with enough information to work with.

So far, I've used both mechanisms to produce non-corrupted images, and I have an automated test for rmufuse to make sure that it can extract images as expected.

I appreciate trying to avoid xkcd 979, but I do think that only giving partial information here and not reporting the issue to the broken upstream things you tried using that should work isn't really helping anything. Especially when you are just posting on a pull request comment, so this will be lost as time goes on as well.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spent a couple of hours and sorted out what the issue was: Eeems-Org/remarkable-update-fuse#7

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Eeems Went to start grabbing checksums and saw you had fixed this. Apologies for not providing those earlier, in hindsight that wasn't too helpful... Really appreciate you taking the time to dig in and thank you for fixing the issue!

Is there somewhere I can buy you a beer or a coffee (donate)? Thanks again!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://teamtrees.org/ or https://teamseas.org/ could always use more donations. I don't personally take any money for things I do as a hobby, it would change the relationship I have with it to be something that I'm obligated to do, instead of something that I do for fun.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L1ZY1LN2L

@Eeems
Copy link
Collaborator

Eeems commented May 23, 2024

@nr23730 poke? Would you be willing to make the changes to get a raw partition image from an update image?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants