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

Re: Problem with NON-STANDARD install



On Mon, 1 Aug 2016 13:06:16 -0500
Richard Owlett <rowlett@cloud85.net> wrote:


> 
> If I'm successful that will change.
> My goal is to learn enough about *nix too have the detail control 
> of Slackware or "Linux from Scratch" with the advantages of 
> Debian standard repositories.
> 
> If retirement is not for learning, what use is it?
> 

There are two chunks of storage for grub: the files, stored in a normal
filesystem and available under /boot, and the bootloader itself, which
generally lives in the drive MBR, but can also live in a partition. The
bootloader is machine code which is stored outside any filesystem.

During expert installation, there are two relevant options: if during
the partition allocation stage, you ask for a separate /boot partition,
you will get this and the grub files will be stored there. You will
later be asked whether you want to install the bootloader in the MBR, or
in the root partition, or not at all, and it will be pointed out that
you will need to make your own arrangements for booting if you choose
the last.

In the early days of grub, the developers didn't pay too much attention
to the idea of a separate /boot partition, and there were at least
three occasions when a grub upgrade lost the capability of dealing with
it. After the first time, I knew what to do... it's been several years
since that last happened.

A separate boot partition was useful if you were multi-booting Linux
installations, but while that is less common today, it is also advised
(and may be mandatory) if you use LVM. Grub does know about LVM, as it
must in order to mount an LVM-based /, but it's one more thing to go
wrong in a boot and to make life a little harder if you need to fix a
broken system.

Installing the bootloader somewhere other than the MBR is useful if you
dual-boot with Windows, as the Windows bootloader *must* be in the MBR
and it can execute another bootloader at the beginning of a partition.
Oh, yes, it's only Windows which requires the partition 'bootable' flag
to be set, Linux pays no attention to it and will boot from any
partition.

To rebuild the grub.cfg file, which controls most aspects of booting,
run update-grub from within the target system (boot by other means and
chroot into it if it's broken). Then run grub-install /dev/sdX, where X
is either the complete drive, or a partition of the drive, to install
the bootloader. If you need to fix grub with a separate /boot, make sure
this is actually mounted when you do it, and if you've arrived into a
chroot, you will need to do this manually, along with /dev, /sys
and /proc. There are various how-tos on the Net.

If you need to work from a rescue OS, you must use one of the same
architecture, and I would strongly advise using exactly the same grub
version as is installed on the broken system. I wasted a lot of time
before I learned that, I can remember trying every CD-based Linux I
could find around the house (at least half a dozen) until I found one
which would work to repair my (old) broken Debian stable. The same
kernel is probably also a good idea if you need to use chroot, which
will still be using the boot system's kernel and its modules.

Good luck, and try not to swear at grub as much as I have over the
years...

-- 
Joe


Reply to: