OpenWRT x86 Style Disks and Booting: Difference between revisions

mNo edit summary
mNo edit summary
 
Line 47: Line 47:


*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.
*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.
=== A Custom MBR (GRUB Stage 1, 1.5, and 2) ===
Start with a new Disk / SSD / Virtual Drive, connected to a bootable OS (Rocky Linux, other "Live" Linux Distribution, etc.) then (Examples are given, rather than stating WhatEverDrive, etc.);
* wipefs -a /dev/sda (not necessary if it is a new device, but this will wipe out partition information (and oddly, not formatting information if one recreates the same size partitions)
* Use CFDISK or FDISK to create Partitions
* mkfs.ext4 -L BOOT /dev/sda1 (where -L=Label and BOOT is the label name, also note that if this is going to be an LVM Disk, the /boot Partition should not be part of the LVM stuff)
* mkdir /mnt/sda1 (creates mount point), mount /dev/sda1 /mnt/sda1 (mounts the drive)
* grub-install --boot-directory=/mnt/sda1 /dev/sda (note, that last one is /dev/sda, not /dev/sda1 which can cause a funky error message, --boot-directory=where to create the /grub2/grub.cfg stuff, because if it isn't included then grub-install will think one is referring to /boot, which is probably where the OS that these commands are being issued from rather than the OpenWRT installation)
* grub-mkconfig -o /mnt/sda1/grub2/grub.cfg (not needed for OpenWRT as there are no grub tools available to install via OPKG)
* Use the /grub/grub.cfg (yes, /grub/grub.cfg, where as above it is /grub2/grub.cfg, because all of the above was done with Rocky Linux GRUB2 style) file included with OpenWRT's x86 version as a base for making a new config file.  There are no tools in OpenWRT to dynamically create a config file from settings in /etc/default, so just edit the config file by hand as the GRUB2 'understands' Legacy GRUB configuration style.
And from there, one OpenWRT system can be copied to another;
* cp -a /Source /Destination --verbose (where -a="Archive" and is equivalent to 'retain permissions', plus it does all of the symbolic link copying too as they're essentially "ShortCuts")
<br />