Mailinglist Archive: opensuse (714 mails)

< Previous Next >
Re: [opensuse] Double check: /boot on RAID 1
On Mon, Oct 03, Brian K. White wrote:

Yast won't install the 2nd mbr.

Yast will run grub, and grub will, assuming you want to have grub's own
stage1 in the mbr and not a generic mbr.

You just have to have lines like this in /etc/grub.conf, which you can
edit directly outside of yast, or in yast there is an advanced options
that includes an option to edit the same file from within yast.

setup (hd0) (hd0,0)
setup (hd1) (hd1,0)

Hmm. My /etc/grub.conf has (without my intervention)

setup --stage2=/boot/grub/stage2 --force-lba (hd0) (hd0,0)
setup --stage2=/boot/grub/stage2 --force-lba (hd1,0) (hd0,0)
quit


Re YaST, while you can within the Boot Loader module manually edit the
/etc/grub.conf file, depending upon your setup, when you go back to the
previous screens YaST will change the file. For example, if you edited the
second line to be (hd1) (hd1,0) or (hd1) (hd0,0) in order to install grub to
the MBR of the second disk, after you hit OK which returns you to Boot Loader
Installation, that line will be removed by YaST because the module does not
support installing to a second disk MBR. So this installation would need to be
done from the command line.

This raises the question I asked previously which I didn't see a reply for. In
your original msg, it appeared you wanted to have grub boot from the second
disk in the event the first *disk* failed, and still have a "working system".
This question can't be answered without knowing how the root is set up on the
disk(s) and what type of RAID you are using. Aside from the manual install,
it's usually trivial to get the bios to call grub from the second disk. But do
you also want to load the OS from the second disk, since the first disk has
failed? That's a different matter altogether.

The first line above puts grub stage1 and 1.5 into the mbr of drive 0 (hd0),
and gets the stage1 and 1.5 images from /grub or /boot/grub on partition
0 of drive 0 (hd0,0)

The second line is all the same but on drive 1.


That second line is not the same because (hd1,0) (hd0,0), installs grub stage1
to the boot sector of the first partition on the second disk, pointing it to
find stage2 on the first partition of the first disk; the first line is
installing stage1 to the MBR of the first disk. If you want grub on the second
disk to be called by the bios, install it to the MBR of the second disk, i.e.,
change (hd1,0) to (hd1). The above second line (hd1,0) syntax can be used if
generic MBR code has been installed and sdb1's active flag has been set. The
remainder of the line, (hd0,0), is correct only if you are calling stage2 from
the first disk. Calling stage2 and the kernel from the second disk would be
(hd1,1). But, again, see my question above.

Once you put that 2nd (or 3rd 4th etc...) lines in grub.conf, they get
executed every time yast or zypper or rpm does a kernel update or any
time you manually run grub-install or grub --batch </etc/grub.conf


A point of clarification re the above "grub-install". In openSUSE, that script
is not the same as the script of the same name which comes with the vanilla
grub package. In openSUSE, all this script does is run the batch command
above. In vanilla grub, the script attempts to do much more, essentially what
YaST is doing. The vanilla grub-install script is still in openSUSE, but under
the name "grub-install.unsupported".

While respecting your comments (and helpful url) regarding RTFM, is it
safe to run either of the above grub commands while running a system
normally, or should I do it from a rescue disk or try to drop into a grub
prompt at a reboot?

For a simple setup with only a couple of drives, you probably don't have
to worry about making sure "hd1" means what you think it means. Probably
yast automatically populated /boot/grub/device.map with every drive in
your system, but you might want to at least take a look at it and
satisfy yourself it looks right. Those lines in grub.conf don't _really_
mean anything by themselves. "hd0" and "hd1" are totally defined in
device.map

Yeah, its just two disks, and /boot/grub/device.map looks right.


Since your system only has 2 disks, the result will probably be the same
regardless of from where you install grub. That said, note that the grub shell
which does the install, only uses device.map when it is being run from a
mounted OS. If you run the shell outside the OS or from a rescue disk that
does not mount the root, it will attempt to determine the disk boot sequence by
making a query call to the bios. In that case it may or may not figure out the
sequence depending on the bios. So when outside the running OS it's always a
good idea to use the grub "find" command to be sure you are working with the
disk(s) you intend to be.


Really there are no simple answers to questions about how to set up
grub. You (not just you personally, anyone who wants to know how to make
it work) must simply read the grub manual. It explains how the parts
work together and has links to explanations about the unavoidable
problems of the OS not really being able to know what the BIOS will do
or how the BIOS "sees" the drives or what drives it even sees or what
order it sees them in or what drives may have been manually set to boot
first or last or totally ignored. All questions are already answered there.

http://www.gnu.org/software/grub/manual/legacy/grub.html#setup

Thanks again.



Michael

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >