OpenWRT and Bare Metal BackUps: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 4: | Line 4: | ||
===Backing Up=== | ===Backing Up=== | ||
The "Backing Up" or BackUp Process is the first part of the cloning a system too. | The "Backing Up" or BackUp Process is the first part of the cloning a system too. In syntax examples, devices are assumed to be in /dev. | ||
====Relevant "Partitions" of an OpenWRT x86==== | ====Relevant "Partitions" of an OpenWRT x86==== | ||
| Line 16: | Line 16: | ||
====What to do / How to do it / Examples of...==== | ====What to do / How to do it / Examples of...==== | ||
Copy the MBR and "MBR Gap" in one | Copy the MBR and "MBR Gap" (Choice of doing it in one or two steps); | ||
* <code>dd if=/dev/sdX of=/dev/sdY bs=512 count=511</code> | * Syntax in one step; | ||
** <code>dd if=/dev/sdX of=/dev/sdY bs=512 count=511</code> | |||
* Syntax in two steps (optional); | |||
** MBR: <code>dd if=/dev/sdX of=/dev/sdY bs=512 count=1</code> | |||
** "MBR Gap": <code>dd if=/dev/sdX of=/dev/sdY bs=512 skip=1 count=511</code> | |||
*Working Example (in one step): <code>dd if=/dev/sdb of=/mnt/sda1/MBR_and_MBR-Gap.img conv=noerror bs=512 count=511 status=progress</code> | |||
Copy the Boot Partition (first partition on a 'stock' / 'standard' OpenWRT x86 installation): | |||
* | * Syntax: <code>dd if=/WhatEverPath/WhatEverFileName.img of=/dev/sdX skip=511 conv=noerror bs=512 status=progress</code> | ||
==== Questions About Stuff ==== | * Working Example: <code>dd if=/run/media/root/NTFS/Boot.img of=/dev/sda skip=511 conv=noerror bs=512 status=progress</code> | ||
Copy the Root Partition (second partition on a 'stock' / 'standard' OpenWRT x86 installation): | |||
* Syntax: <code>dd if=/WhatEverPath/WhatEverFileName.img of=/dev/sdX skip=511 conv=noerror bs=512 status=progress</code> | |||
* Working Example: <code>dd if=/run/media/root/NTFS/Boot.img of=/dev/sda skip=511 conv=noerror bs=512 status=progress</code> | |||
==== Syntax Notes for DD ==== | |||
*if: Input File (or Device) | |||
*of: Output File (or Device) | |||
*bs: "How much to copy from one device to another at a time" | |||
*conv=noerror: "Don't stop, just do what I told you to do, and don't give an excuse" | |||
*progress = status: Show the progress of the copy process (only for a certain version of DD and up) | |||
*sync: Write all buffered blocks to disk (just to be safe) | |||
====Questions About Stuff==== | |||
*Why 511 sectors? | *Why 511 sectors? | ||
| Line 36: | Line 56: | ||
**The answer appears to be known only to them as there is no direct way to ask them. ChatGPT was asked and the answer was so bad, it was way worse than not knowing. | **The answer appears to be known only to them as there is no direct way to ask them. ChatGPT was asked and the answer was so bad, it was way worse than not knowing. | ||
<br /> | |||
*Example of saving to a Disk / SSD from an Image File: <code>dd if=/dev/sdb of=/mnt/sda1/MBR_and_MBR-Gap.img conv=noerror bs=512 count=511 status=progress</code> | *Example of saving to a Disk / SSD from an Image File: <code>dd if=/dev/sdb of=/mnt/sda1/MBR_and_MBR-Gap.img conv=noerror bs=512 count=511 status=progress</code> | ||
| Line 44: | Line 64: | ||
Flush any buffered information to disk: <code>sync</code> | Flush any buffered information to disk: <code>sync</code> | ||
* | |||
* | |||
===Other Notes=== | ===Other Notes=== | ||