Step 1: Booting from Live CD/DVD/USB
The first step is to boot your computer from a Live CD/DVD/USB containing the Linux distribution. Once the computer is booted, navigate to the terminal and gain root access by executing the commandsudo su
Step 2: Partition the drive
Once you have booted into the Live CD environment, you need to partition the drive to install the new operating system. Use a partitioning tool such as GParted to create new partitions or to resize the existing ones. Make sure that there is enough space for the root and swap partitions for the new OS. Also, ensure that the partition type is “Linux file system” and the boot flag is set for the root partition.Step 3: Mount the partition
After partitioning the drive, mount the root partition of the new OS. Execute the commandmount /dev/sda1 /mnt
where /dev/sda1 is the root partition of the new OS and /mnt is the mount point. Then, create a mount directory for the boot partition and mount the boot partition to that mount point. At this point, it’s essential to ensure that you have mounted all the necessary drives to their respective mount points.Step 4: Install GRUB
Once the necessary drives are mounted, install GRUB to the hard drive by executing the commandgrub-install --root-directory=/mnt /dev/sda
. The --root-directory option specifies the root directory of the new OS, and /dev/sda is the drive where the GRUB bootloader will be installed. Once completed, you can now reboot your computer to boot into the new operating system.