Linux HD Install With Grub by eceppda
I’ve recently run into a problem with my dvd player. I think it’s an issue with the driver but I’m not sure and haven’t spent the time trying to figure it out yet. Meanwhile, I want to install Kubuntu in a new partition on my HD. So I was recently faced with a decision- dick with the DVD player, burn the downloaded ISO, and then install? Or some other way? I decided to figure out how to install from the ISO downloaded on my machine already. Here’s what I figured out:
First of all, you’ll need to create a new entry for grub. Grub has undergone some significant changes, but you wouldn’t know it by googling around trying to find quick answers to questions. As of this writing, all of the configuration for grub is located in /etc/grub.d/. Most of it you will not want to modify. When you’re done modifying the configuration, you’ll want to run:
sudo update-grubThis will generate a new configuration file: /boot/grub/grub.cfg
And this is what will be run when the OS is loaded.
*Prep work:
sudo mkdir /distro
cd /distro
mkdir /mnt/iso
mount -o loop ~/Downloads/my-linux.iso /mnt/iso
cp /mnt/iso/vmlinuz .
cp /mnt/iso/initrd.gz .
cp ~/Downloads/my-linux.iso .
*Grub work:
sudo emacs /etc/grub.d/40_custom
#!/bin/sh
exec tail -n +3 $0
- This file provides an easy way to add custom menu entries. Simply type the
- menu entries you want to add after this comment. Be careful not to change
- the ‘exec tail’ line above.
echo “Kubuntu Install”
menuentry “Kubuntu Install” {
set root=(hd0,1)
linux /distro/vmlinuz
initrd /distro/initrd.gz
}
sudo update-grub
The remaining question is- how do you know what value to place in the set root=???
sudo grub-mkdevicemap
more /boot/grub/device.mapwill show what you need to know.
Now, reboot and you should see your new option.
In many cases, a default value is set for grub already, and you may need to hit a special key to get to the grub boot menu. Alternatively, you can modify /etc/defaults/grub and change the GRUB_DEFAULT value to your new addition.