Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:installation:generic.backup [2019/04/06 03:35] – links updated vgaetera | docs:guide-user:installation:generic.backup [2022/07/11 15:06] – Add instructions for how to explore MTD backups spookyuser | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Generic backup ====== | + | ====== Generic |
| * This guide describes how to perform block-level backup/ | * This guide describes how to perform block-level backup/ | ||
| - | * Follow [[docs: | + | * Follow [[docs: |
| + | |||
| + | <WRAP center round important 60%> | ||
| + | NAND-based devices should use [[docs: | ||
| + | </ | ||
| Please have a look at [[docs: | Please have a look at [[docs: | ||
| Line 12: | Line 16: | ||
| ===== Create ART backup ===== | ===== Create ART backup ===== | ||
| - | If your ART-partition got corrupted, you would still be able to boot OpenWrt and only your wireless would not function correctly any longer. Easy fix with '' | + | If your ART-partition got corrupted, you would still be able to boot OpenWrt and only your wireless would not function correctly any longer. |
| + | Easy fix with '' | ||
| <code bash> | <code bash> | ||
| - | dd if=/dev/$(grep -i '" | + | dd if=/dev/$(sed -n -e '/:.*" |
| </ | </ | ||
| Line 29: | Line 35: | ||
| ===== Create full MTD backup ===== | ===== Create full MTD backup ===== | ||
| - | This script assumes a working | + | This script assumes a working |
| - | If you've changed your router' | + | If you've changed your router' |
| - | + | This will backup your mtd contents to a compressed tarball file '' | |
| - | On your local PC (not on the router), using a bash terminal (not Windows Command Prompt, Windows 10 Linux subsystem bash terminal is fine) create a new file (eg. ~/mtdbk.sh) containing the below script. | + | |
| - | If running on windows, make sure to save the text file as UNIX (LF) encoded, otherwise you'll get syntax errors, and then execute it (./ | + | |
| - | If running on unix-like system, give this file execution privileges (chmod u+x mtdbk.sh) and then execute it (./ | + | |
| - | This will backup your mtd contents to a compressed tarball file "mtd_backup.tgz" | + | |
| - | Make sure to use bash. (Don't do sh ./mtdbk.sh) | + | |
| <code bash> | <code bash> | ||
| + | cat << " | ||
| #!/bin/bash | #!/bin/bash | ||
| Line 96: | Line 98: | ||
| echo -e "\nMTD backup complete. Extract the files using:\ntar xzf \" | echo -e "\nMTD backup complete. Extract the files using:\ntar xzf \" | ||
| + | EOF | ||
| + | chmod +x mtdbk.sh | ||
| + | ./mtdbk.sh | ||
| </ | </ | ||
| Line 134: | Line 139: | ||
| ===== Create backup from bootloader ===== | ===== Create backup from bootloader ===== | ||
| - | Sometimes it might be necessary to backup settings/ | + | Sometimes it might be necessary to backup settings/ |
| + | Depending on the bootloader, different strategies might be possible. | ||
| + | |||
| + | The flash-chip is mapped to a start address. | ||
| + | With uboot it should be in the following settings: | ||
| - | The flash-chip is mapped to a start address. With uboot it should be in the following settings: | ||
| <code bash> | <code bash> | ||
| printenv | printenv | ||
| Line 157: | Line 165: | ||
| Then you must flash this to you device, boot it, and now the partition should be writable. | Then you must flash this to you device, boot it, and now the partition should be writable. | ||
| + | ===== Exploring MTD Backups ===== | ||
| + | If you want to explore the contents of an MTD backup on your computer, without restoring it to openwrt, you can use [[https:// | ||
| + | |||
| + | <code bash> | ||
| + | jefferson mtd4_rootfs_data.backup -d rootfs | ||
| + | </ | ||
| + | |||
| + | Where the mtd4_rootfs_data.backup file is the mtd block you want to explore. Likely this will be > | ||