help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help installing grub


From: Jordan Uggla
Subject: Re: Help installing grub
Date: Thu, 31 May 2012 12:35:01 -0700

On Wed, May 30, 2012 at 6:16 PM, Yan Seiner <address@hidden> wrote:
>
> The relevant parts of the system setup on the disk that I want to boot from:
>
> /etc/fstab:
> /dev/md0    /        ext4    errors=remount-ro 0    0
> /dev/md1    /boot        ext4    defaults    0    1

If /dev/md1 is already mounted to /boot/ then you can just run
"grub-install /dev/sda && grub-install /dev/sdb". For testing grub via
qemu/kvm over ssh you'll need to configure grub to output via serial.
To do that add this to your /etc/default/grub:

GRUB_TERMINAL_INPUT="console serial"
GRUB_TERMINAL_OUTPUT="gfxterm serial"

Then run "grub-mkconfig -o /boot/grub/grub.cfg".

Then to test that grub will work properly at boot run the following
commands (and don't continue if one of the earlier commands fail):

# Create read only copies of /dev/sda and /dev/sdb
# This is essential to making this a safe procedure
losetup -r /dev/loop0 /dev/sda
losetup -r /dev/loop1 /dev/sdb

# Make sure that changes made to devices are actually committed
# and thus visible to the VM.
sync
echo 3 > /proc/sys/vm/drop_caches

# Run kvm passing both loop devices as hard drives and using stdio
# for (serial) input/output rather than an X window.
kvm -nographic -hda /dev/loop0 -hdb /dev/loop1

This will *not* let you test a complete GNU/Linux boot as 1: You'd
need to configure GNU/Linux for serial also and 2: GNU/Linux doesn't
tend to like its devices suddenly being read only when it's expecting
them to be writable. But it should let you test your grub
installation. Also make sure that you're using screen or can start
another ssh session so that you can kill qemu/kvm if something hangs
(ctrl+c won't work with -nographic as it'll just be interpreted as
input for serial).

-- 
Jordan Uggla (Jordan_U on irc.freenode.net)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]