[Top][All Lists]

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

Re: What does grub-install do?

From: lee
Subject: Re: What does grub-install do?
Date: Sat, 2 Oct 2010 22:30:30 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Sun, Oct 03, 2010 at 01:46:41AM +0800, Goh Lip wrote:
> On Saturday 02,October,2010 09:36 PM, lee wrote:
> >but grub-install doesn't
> >create a grub.cfg and leaves me screwed.
> >So you can ask what's grub-install for? It doesn't install grub.
> "grub-install /dev/sda" creates a grub.cfg
> "grub-install --root-directory=xxxxx../dev/sda" does not.
> Both installs grub.

Whatever it does, it's useless without a working grub.cfg.

My old root partition is /dev/sde1, the new one is going to be
/dev/md0p2: That's a partition on /dev/md0, and /dev/md0 is a RAID1
created with mdadm from /dev/sdd1 and /dev/sdf1. I've copied
everything over from the old root partition to the new one, now I need
to install grub so that I can boot from the new root partition. Then
the disk that contains /dev/sde1 is going to be removed from the
computer. --- The other partitions like /usr, /var, /tmp have already
been moved to partitions on the RAID1.

Here's the simple question: how do I install grub so that I can boot
from /dev/md0p2?

> "grub-mkconfig" prints out output, does nothing else.
> "grub-mkconfig -o /boot/grub/grub.cfg" creates grub.cfg

It's useless because it needs to create a grub.cfg for booting from
/dev/md0p2, but it doesn't: When /boot is on /dev/md0p2 it gives lots
of warnings about nested partitions and aborts with "unknown file
system". The same is with grub-install, it doesn't create a grub.cfg.

I've tried it with chrooting to the new root partition, with the same
results. When I use /dev/sde6 to hold /boot, mounted under /mnt/tst,
and tell grub-install to use --root-directory=/mnt/tst, I don't get
the error about the unknown file system, but no grub.cfg is
created. However, it creates a /boot directory under /mnt/tst.

When I mount /dev/sde6 under /boot after chrooting to the new root
partition and run "grub-install --no-floppy --recheck --modules="raid
mdraid" /dev/sdd", I get warnings about nested partitions but no error
about unknown file systems, but still no grub.cfg is created.

Hm, now when I run grub-mkconfig, I still get the warnings, but a
grub.cfg is created which looks like it might even work. But even if
it works (I'll have to try later), since /dev/sde6 is on the disk I
want to remove, that doesn't really solve the problem.

> But use "update-grub" instead of "grub-mkconfig"

What exactly does this do, and how do I use it so that it does what I

reply via email to

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