OpenWRT and Backing Up: Difference between revisions
mNo edit summary |
|||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
'''SEE THIS ARTICLE INSTEAD: [[OpenWRT and Bare Metal BackUps#Restoring%20a%20BackUp%20from%20an%20Image%20File(s)|OpenWRT and Bare Metal BackUps - Wiki.TerraBase.info]]''' | |||
This article is mostly about doing a bare metal backup of an x86 based OpenWRT system. There are some notes about the additional items that need to be done for a more typical installation on a Router with with Flash based storage (IE, using the | This article is mostly about doing a bare metal backup of an x86 based OpenWRT system. There are some notes about the additional items that need to be done for a more typical installation on a Router with with Flash based storage (IE, using the | ||
| Line 84: | Line 86: | ||
**Mount the LOOP Device (again for an x86 system) | **Mount the LOOP Device (again for an x86 system) | ||
***Example: mount -t f2fs /dev/loop1 /mnt/loop1 (mkdir /mnt/loop1 before this command of course) | ***Example: mount -t f2fs /dev/loop1 /mnt/loop1 (mkdir /mnt/loop1 before this command of course) | ||
**...and that's it for x86 devices. From there, just cp | **...and that's it for x86 devices. From there, just cp | ||
<nowiki>*</nowiki>If you haven't spotted it yet, but you've been asking, "Where is that file that OpenWRT mounts a Directory named /overlay as a LOOP Device?" Answer: There is no file. It is simply a sector on the Disk / SSD Drive to the end of it. And you might ask, "But won't it be overwritten?" Answer: Nope, because everything before it is considered ROM (as in no write), so it won't expand. And yes that means the entire disk drive (well, at least the OpenWRT partitions) is considered a File that breaks down into a ROM Section and an /overlay Section. | <nowiki>*</nowiki>If you haven't spotted it yet, but you've been asking, "Where is that file that OpenWRT mounts a Directory named /overlay as a LOOP Device?" Answer: There is no file. It is simply a sector on the Disk / SSD Drive to the end of it. And you might ask, "But won't it be overwritten?" Answer: Nope, because everything before it is considered ROM (as in no write), so it won't expand. And yes that means the entire disk drive (well, at least the OpenWRT partitions) is considered a File that breaks down into a ROM Section and an /overlay Section. | ||
3014656 | Why 3014656 Bytes as the offset? Well, it works out to 5888 Sectors (512 Bytes / Sector, $1700 (that's Commodore Hexadecimal Notation)), 1472 Sectors (if translated to 2048 Bytes / Sector, $5CO), so nothing really jumps out. If it was the 1980s, there might be some unique point in the CHS format where this makes sense. Some other alignment? Doesn't make any sense with SSDs, but maybe something with HDDs. PI ( π )? Nope, that's 3.141592. Maximum "ROM" size (with room left for expansion)? That seems so much like Bill Gate's comment on 640K should probably be about enough for anyone, when putting important stuff above the top of RAM, thus blocking easy expansion and requiring workarounds. | ||
mount -t f2fs /dev/loop1 /mnt/loop1 | mount -t f2fs /dev/loop1 /mnt/loop1 | ||
===MBR Gap=== | |||
And it seemed like all the backup stuff was done. Nope. There's also a 'hidden' (not on purpose) region in the [[wikipedia:BIOS_boot_partition#Overview|MBR Gap]] that contains [[wikipedia:GNU_GRUB#Version_0_(GRUB_Legacy)|stage 1.5 of the GRUB Boot Loader]]. See this: [[OpenWRT x86 Style Disks and Booting|OpenWRT x86 Style Disks and Booting - Wiki.TerraBase.info]] | |||
===Summary of Everything Backed Up=== | |||
*MBR | |||
*MBR Gap | |||
*Boot Partition | |||
*Root Partition | |||
*Overlay "Partition" | |||
===And More...=== | ===And More...=== | ||
What about taking that RAW Image created by DD and turning it into a VHD File (or just about any other virtual disk format) | What about taking that RAW Image created by DD and turning it into a VHD File (or just about any other virtual disk format) | ||