OpenWRT x86 Style Disks and Booting: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 4: | Line 4: | ||
===For Cloning a Drive=== | ===For Cloning a Drive=== | ||
Copy the "MBR Gap" (GRUB Stage 1.5 | Copy the MBR and "MBR Gap" (GRUB Stage 1, GRUB Stage 1.5 (containing the CORE.IMG file)): <code>dd if=/dev/sdX of=/dev/sdY bs=512 count=511</code> | ||
Copy the MBR (GRUB Stage 1 and Partition Table): <code>dd if=/dev/sdX of=/dev/sdY bs=512 count=1</code> | * Breaking it down into two steps, see below (but watch out, because for some reason DD doesn't seem to do something right regardless of the order the below are done); | ||
* Copy the "MBR Gap" (GRUB Stage 1.5, containing the CORE.IMG file): <code>dd if=/dev/sdX of=/dev/sdY bs=512 skip=1 count=511</code> | |||
* Copy the MBR (GRUB Stage 1 and Partition Table): <code>dd if=/dev/sdX of=/dev/sdY bs=512 count=1</code> | |||
Copy the First Partition (/boot Directory): <code>dd if=/dev/sdX1 of=/dev/sdY1 bs=128M conv=noerror progress=status</code> | Copy the First Partition (/boot Directory): <code>dd if=/dev/sdX1 of=/dev/sdY1 bs=128M conv=noerror progress=status</code> | ||
| Line 29: | Line 31: | ||
*If conv=sync is used an out of space error will occur. | *If conv=sync is used an out of space error will occur. | ||
=== To Convert a SquashFS version of OpenWRT to an EXT4 version of OpenWRT === | ===To Convert a SquashFS version of OpenWRT to an EXT4 version of OpenWRT=== | ||
* Copy the MBR, "MBR Gap", and First Partition ( /boot Directory ) per the "Cloning a Drive" Section | *Copy the MBR, "MBR Gap", and First Partition ( /boot Directory ) per the "Cloning a Drive" Section | ||
* Edit the /boot/grub/grub.cfg file, changing portion of the ''menuentry'', from <code>rootfstype=squashfs</code> to <code>rootfstype=ext4</code> | *Edit the /boot/grub/grub.cfg file, changing portion of the ''menuentry'', from <code>rootfstype=squashfs</code> to <code>rootfstype=ext4</code> | ||
* Format the Second Partition: <code>mkfs.ext4 -L WhatEverName -v /dev/sda2 (-L = Label (can be named ROOT for clarity), -v = Verbose)</code> | *Format the Second Partition: <code>mkfs.ext4 -L WhatEverName -v /dev/sda2 (-L = Label (can be named ROOT for clarity), -v = Verbose)</code> | ||
* Resize the Second Partition (if cloned from a "Virgin OpenWRT" install) to a larger size using GParted or CFDISK (16 GB is more than enough) | *Resize the Second Partition (if cloned from a "Virgin OpenWRT" install) to a larger size using GParted or CFDISK (16 GB is more than enough) | ||
* | |||
Tips; | Tips; | ||
* Use GParted to Locate Mount Points and to resize Partitions (if using a Live Rocky Linux, CentOS, etc. USB Based , the mount points | *Use GParted to Locate Mount Points and to resize Partitions (if using a Live Rocky Linux, CentOS, etc. USB Based , the mount points for Rocky Linux, etc, end up in /run/media/root/WhatEverMountPoint by default. | ||