I just installed garuda linux - Perplexica

Transferring Garuda Linux Installation with Corrected GRUB and Initrd

Transferring a Linux installation from one machine to another, especially when dealing with boot issues like incorrect GRUB or initrd configurations, requires careful steps. Here's how you can achieve this without needing the original install disk.

Understanding the Problem

When you clone an existing Garuda Linux installation using dd, it copies everything exactly as is, including the bootloader (GRUB) and initial ramdisk (initrd). These components are configured for the hardware of the first machine. When moved to a different computer, they may not work correctly due to differences in disk layout or hardware configurations.

Steps to Correct GRUB and Initrd

1. Prepare the Target System

  • Boot into a live environment on the target system using any Linux distribution that can run from a USB drive.
  • Ensure you have root access, as modifying boot settings requires administrative privileges.

2. Identify Disk Partitions

  • Use lsblk or fdisk -l to identify the partitions on your target machine. Note down the device names (e.g., /dev/sda, /dev/nvme0n1) as you'll need them for mounting and configuring GRUB.

3. Mount the Filesystem

  • Mount the root partition of your Garuda Linux installation: bash sudo mount /dev/sdXn /mnt Replace /dev/sdXn with the appropriate device name and partition number.
  • If you have separate boot or EFI partitions, mount them as well: bash sudo mount /dev/sdYn /mnt/boot # For a separate boot partition sudo mount /dev/sdZn /mnt/boot/efi # For an EFI system partition

4. Chroot into the Installed System

  • Bind necessary directories and chroot: bash for dir in /dev /proc /run /sys; do sudo mount --bind $dir /mnt$dir; done sudo chroot /mnt

5. Update GRUB Configuration

  • Install grub if it's not already installed: bash pacman -Sy grub efibootmgr os-prober
  • Generate a new GRUB configuration file: bash grub-mkconfig -o /boot/grub/grub.cfg

6. Install GRUB to the Correct Disk

  • Install GRUB to the target disk (replace /dev/sdX with your actual device): bash grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Garuda --recheck /dev/sdX
  • For BIOS systems, use: bash grub-install --target=i386-pc /dev/sdX

7. Update Initrd

  • Regenerate the initramfs for all installed kernels: bash mkinitcpio -P

8. Exit Chroot and Unmount Partitions

  • Exit chroot environment: bash exit
  • Unmount all mounted directories: bash for dir in /sys /proc /run /dev; do sudo umount /mnt$dir; done sudo umount /mnt/boot/efi # If applicable sudo umount /mnt/boot # If applicable sudo umount /mnt

Final Steps

  • Reboot the System: Once everything is set up, reboot your system and remove any live USB drives.
  • Check Boot Configuration: Ensure that GRUB loads correctly and allows you to boot into Garuda Linux.

By following these steps, you should be able to transfer your Garuda Linux installation to a new machine with a properly configured bootloader. If issues persist, consider checking hardware compatibility or consulting the Arch Wiki for more detailed troubleshooting related to GRUB and initrd configurations.

How can I update GRUB configuration on a different computer after cloning a Linux installation?

What are the steps to chroot into an installed Linux system from a live environment?

How do I correctly install GRUB on a new machine when transferring a Linux installation?

What is the process for regenerating initramfs (initrd) on a cloned Linux system?

Can you explain how to mount and unmount partitions during a Linux system transfer?