Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:installation:generic.backup [2021/12/05 11:20] – [Create full MTD backup] update vgaeteradocs:guide-user:installation:generic.backup [2022/07/11 15:06] – Add instructions for how to explore MTD backups spookyuser
Line 4: Line 4:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-NAND-based devices should use [[docs:techref:flash#nand-specific_tools_for_reading_and_writing_to_raw_nand|NAND-aware utilities]], as ''dd'' does not properly handle the error correction or bad-block marking of NAND flash. +NAND-based devices should use [[docs:techref:flash#nand-specific_tools_for_reading_and_writing_to_raw_nand|NAND-aware utilities]], as ''dd'' does not properly handle the error correction or bad-block marking of NAND flash.
 </WRAP> </WRAP>
  
Line 16: 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 ''[[docs:techref:mtd]]''.+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 ''[[docs:techref:mtd]]''. 
 <code bash> <code bash>
 dd if=/dev/$(sed -n -e '/:.*"art"/s///p' /proc/mtd) of=/tmp/art.backup dd if=/dev/$(sed -n -e '/:.*"art"/s///p' /proc/mtd) of=/tmp/art.backup
Line 35: Line 37:
 This script assumes a working Bash and SSH in native Unix-like or WSL environment. This script assumes a working Bash and SSH in native Unix-like or WSL environment.
 If you've changed your router's IP address, change the OPENWRT variable value to the hostname/IP of your OpenWrt router. If you've changed your router's IP address, change the OPENWRT variable value to the hostname/IP of your OpenWrt router.
-This will backup your mtd contents to a compressed tarball file "mtd_backup.tgzin the same folder as the script.+This will backup your mtd contents to a compressed tarball file ''mtd_backup.tgz'' in the same folder as the script.
  
 <code bash> <code bash>
Line 137: Line 139:
  
 ===== Create backup from bootloader ===== ===== Create backup from bootloader =====
-Sometimes it might be necessary to backup settings/partitions from original firmware. Depending on the bootloader, different strategies might be possible.+Sometimes it might be necessary to backup settings/partitions from original firmware. 
 +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 160: 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://github.com/sviehb/jefferson|jefferson]] with the command
 +
 +<code bash>
 +jefferson mtd4_rootfs_data.backup -d rootfs
 +</code>
 +
 +Where the mtd4_rootfs_data.backup file is the mtd block you want to explore. Likely this will be >rootfs_data as it contains most of the customizations you will have made to openwrt.
  • Last modified: 2023/03/19 10:23
  • by ryanc