OpenWRT and Bare Metal BackUps: Difference between revisions
mNo edit summary |
|||
Line 73: | Line 73: | ||
Copy the Root Partition (second partition on a 'stock' / 'standard' OpenWRT x86 installation): | Copy the Root Partition (second partition on a 'stock' / 'standard' OpenWRT x86 installation): | ||
*...but first create the second Partition with CFDISK and format (mkfs.ext4 -L WhatEverLabel -v /dev/sdX ) it, if, that's ''if'' the second Partition doesn't already exist. | |||
*Using DD; | *Using DD; | ||
**Syntax: <code>dd if=/dev/sdX of=/WhatEverPath/WhatEverFileName.img of=/dev/sdX seek=WhatEverOffset conv=noerror bs=512 status=progress</code> | **Syntax: <code>dd if=/dev/sdX of=/WhatEverPath/WhatEverFileName.img of=/dev/sdX seek=WhatEverOffset conv=noerror bs=512 status=progress</code> | ||
Line 159: | Line 160: | ||
====Note on: LOSETUP -d WhatEverLoopDeviceName[edit | edit source]==== | ====Note on: LOSETUP -d WhatEverLoopDeviceName[edit | edit source]==== | ||
Bad news. The delete command doesn't always work. After issuing the command on a legitimate Loop Device, and with no errors, the Loop Device will persist. Checking it with LOSETUP -a shows it is still there. Accessing it with CFDISK or MOUNT still works. Oh, well. Windows solution time. Reboot. | Bad news. The delete command doesn't always work. After issuing the command on a legitimate Loop Device, and with no errors, the Loop Device will persist. Checking it with LOSETUP -a shows it is still there. Accessing it with CFDISK or MOUNT still works. Oh, well. Windows solution time. Reboot. | ||
==== Example Uses for LOSETUP ==== | |||
* Syntax: losetup -o OFFSET_IN_BYTES /dev/loopX /path/to/your/file | |||
* Example: losetup -o 3014656 -fP /mnt/sda1/OpenWRT_SDC2.img (this command allows for the LOSETUP command to select the next available LOOP Device in /dev) | |||
* Mount the resulting LOOP Device created by LOSETUP: mount -t f2fs /dev/loop1 /mnt/loop1 | |||
* Displays LOOP Devices: losetup -a | |||
* Delete LOOP Devices: losetup -d /dev/loopX | |||
===FAQs=== | ===FAQs=== | ||
Line 168: | Line 177: | ||
*Why did the OpenWRT developers that focus so much on refinement and minimization use a whopping 256K for the MBR Gap? | *Why did the OpenWRT developers that focus so much on refinement and minimization use a whopping 256K for the MBR Gap? | ||
**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. | ||
*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 183: | Line 190: | ||
====GRUB==== | ====GRUB==== | ||
OpenWRT specifically mentions GRUB 2 in their documentation. But the way it works on an x86_64 EXT4 installation of OpenWRT would convince anyone that it is Legacy GRUB (except for the GNU GRUB version 2.02 heading at the top of the screen). The way it is configured via /etc/grub/grub.cfg would also convince anyone that Legacy GRUB was being used. So, the conclusion is that GRUB 2.02 is indeed being used, but since it is backwards compatible, it is in 'Legacy Mode'. | OpenWRT specifically mentions GRUB 2 in their documentation. But the way it works on an x86_64 EXT4 installation of OpenWRT would convince anyone that it is Legacy GRUB (except for the GNU GRUB version 2.02 heading at the top of the screen). The way it is configured via /etc/grub/grub.cfg would also convince anyone that Legacy GRUB was being used. So, the conclusion is that GRUB 2.02 is indeed being used, but since it is backwards compatible, it is in 'Legacy Mode'. | ||
==== QEMU ( QEMU-NDB ) ==== | |||
[[wikipedia:QEMU|QEMU]], specifically QEMU-NDB and QEMU-IMG, were commands available to install on OpenWRT that seemed like it would be useful in terms of VHD and other Virtual Disk Files, but were ultimately not needed. | |||
Example Command: qemu-nbd -c /dev/nbd0 /usr/src/vmlinuz/vmlinuz | |||
===Rant on Backing Up OpenWRT (Not just the configuration files, but an entire 'Drive' (Flash, SSD, etc.))[edit | edit source]=== | ===Rant on Backing Up OpenWRT (Not just the configuration files, but an entire 'Drive' (Flash, SSD, etc.))[edit | edit source]=== |