Grub issues

Ben Scott dragonhawk at gmail.com
Thu Mar 19 16:22:53 EDT 2009


2009/3/19  <jesse205 at gmail.com>:
> So I can get a GRUB command line at boot-up, but theres nothing to boot!
> Is there a way to install a kernel?

  I'm pretty sure you can boot the Live CD, mount your hard disk
filesystems and then chroot to them, then run "apt-get install
whatever" to install any package you want.  I just did this last night
to get the "lvm2" package installed into the system ('cause Ubuntu's
GUI installer *still* doesn't include it, grrr).

  In more detail:

Boot Ubuntu Live CD, get to GUI desktop.
Make sure Internet access is working.
Open a terminal.

We need to do everything here as root, so just get a root shell prompt:

	sudo -i

Create a directory to mount the hard disk system under:

	mkdir /mnt/target

Mount the hard disk system (This assumes you just have a single
partition for all things Linux, including the /boot directory.  If
you've got a more complicated partition layout, you'll need to mount
all your Ubuntu filesystems in similar fashion.):

	mount /dev/sda3 /mnt/target

Clone the needed pseduo filesystems:

	mount -o bind /proc /mnt/target/proc
	mount -o bind /dev /mnt/target/dev

Copy the DNS resolver config file, so networking will work in our chroot:

	cp /etc/resolv.conf /mnt/target/etc/

Get a shell running "inside" the hard disk system:

	chroot /mnt/target

Install the kernel package (I forget the package name; perhaps someone
else can chime in with it):

	apt-get install $KERNEL_PACKAGE_NAME

Update the GRUB menu.lst config file to include the new kernel:

	update-grub

Quit out of the chroot, dismount the filesystems, and reboot to the
hard disk system (The explict dismount and sync are prolly not needed,
but I'm paranoid about such things.):

	exit
	umount /mnt/target/proc
	umount /mnt/target/dev
	umount /mnt/target
	sync
	reboot

  The above is based mainly on the excellent LVM installation
instructions provided by "MAcks" at
<http://polishlinux.org/linux/ubuntu/install-ubuntu-804-on-lvm2/>.

-- Ben


More information about the gnhlug-discuss mailing list