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

Re: install-mbr on amd64?



On Sat, May 20, 2006 at 09:38:16PM +0200, Goswin von Brederlow wrote:
> Alexander Sieck <alexander.sieck@web.de> writes:
> 
> > After running 'grub-install' on /dev/sdb, both MBRs, on /dev/sda
> > and /dev/sdb, contain the right data.
> 
> Some data but the right data? The two MBRs should be identical or not?
> Have you tried removing sda and boot or swap sda and sdb around and
> boot? (below I see you haven't fully tested that)
> 
Hello,

maybe you got me wrong, since my wording was misleading.

I think we agree on this:
Without additional actions after configuring RAID1 and installing
grub, the MBR on the 2nd disk contains mainly zeros.
>From this it looks like the 2nd drive is not bootable directly.

How to make the 2nd disk bootable is still not fully clarified
and a proof of the approach is still missing.

Goswin wrote further up in this thread, that the 2nd disk can be
made bootable by switching sda to sdb in /boot/grub/device.map
and running grub-install. He could not remember, if additional
changes to fstab or mtab were required.

I tried to not change device.map, but just run
# BEGIN-CLI
deb64a:~# grub-install --no-floppy /dev/sdb
# END-CLI

The option --root-directory=/boot was wrong, since this creates
/boot/boot/grub.

After running grub-install on /dev/sdb the MBR of the 2nd drive
/dev/sdb contains _some_ data. By just looking at the octal numbers
I cannot tell, if it is really bootable.

> > # BEGIN-CLI
> > deb64a:~# grub-install --root-directory=/boot --no-floppy /dev/sdb
> > Probing devices to guess BIOS drives. This may take a long time.
> > Installation finished. No error reported.
> > This is the contents of the device map /boot/boot/grub/device.map.
> > Check if this is correct or not. If any of the lines is incorrect,
> > fix it and re-run the script `grub-install'.
> >
> > (hd0)   /dev/sda
> > (hd1)   /dev/sdb
> >
> 
> Lets interleave the data for comparision:
> > deb64a:~# dd if=/dev/sda bs=512 count=1 | od -v | head -n 12
> > deb64a:~# dd if=/dev/sdb bs=512 count=1 | od -v | head -n 12
> 
> > 0000000 044353 150220 000274 175574 003520 017520 137374 076033
> > 0000000 044353 010220 150216 000274 134260 000000 154216 140216
> 
> > 0000020 015677 050006 134527 000745 122363 136713 003676 002261
> > 0000020 137373 076000 000277 134406 001000 122363 020752 000006
> ... 
> > # END-CLI

I as well had expected that the MBRs of both disks should be
identical and do not know in the moment, if they need to be
byte by byte identical.

Now I have tested Goswins approach:
# BEGIN-CLI
deb64a:/boot/grub# cat device.map 
(hd0)   /dev/sdb
(hd1)   /dev/sda
deb64a:/boot/grub# grub-install --no-floppy /dev/sdb
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0)   /dev/sdb
(hd1)   /dev/sda
deb64a:/boot/grub# dd if=/dev/sda bs=512 count=1 | od -v | head -n 8
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.016311 seconds, 31.4 kB/s
0000000 044353 150220 000274 175574 003520 017520 137374 076033
0000020 015677 050006 134527 000745 122363 136713 003676 002261
0000040 067070 076000 072411 101423 010305 172342 014315 172613
0000060 143203 044420 014564 026070 173164 132640 132007 001003
0000100 000377 020000 000001 000000 001000 100372 100312 051752
0000120 000174 030400 107300 107330 136320 020000 120373 076100
0000140 177474 001164 141210 137122 076571 032350 173001 100302
0000160 052164 040664 125273 146525 055023 071122 100511 052773
deb64a:/boot/grub# dd if=/dev/sdb bs=512 count=1 | od -v | head -n 8
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.006904 seconds, 74.2 kB/s
0000000 044353 010220 150216 000274 134260 000000 154216 140216
0000020 137373 076000 000277 134406 001000 122363 020752 000006
0000040 137000 003676 002070 005565 143203 100420 177376 072407
0000060 165763 132026 130002 135401 076000 100262 072212 001003
0000100 000377 020000 000001 000000 001000 110372 173220 100302
0000120 001165 100262 054752 000174 030400 107300 107330 136320
0000140 020000 120373 076100 177474 001164 141210 137122 076577
0000160 032350 173001 100302 052164 040664 125273 146525 055023
# END-CLI

That is, also after changing sda to sdb in device.map, the
two MBRs are not identical.

Maybe Goswin, or somebody else who enabled booting from both
disks with RAID1 and grub, can give the output of
'dd if=xxx[ab] bs=512 count=1 | od' on their system.

> > I did not unplug or replugged the HDs, but I changed the
> > HD boot order in the BIOS, from IDE-channel2, -channel3 to
> > IDE-channel3, -channel2, and can boot in both cases.
> 
> Is that the same as removing a disk or does that preserve sda as hd0
> and sdb as hd1 and just boot from hd1?
> 
I also think, that unplugging the 1st disk, is the only hard test
(and even that may not be sufficient to simulate a real crash).

Since the time I installed my system a couple of months ago, I would
like to test, how much work it will be to recover from a disk-crash.
So I am willing to test it the hard way by unplugging the 1st
disk. But this might take some time. Before doing that, I will
do a backup and figure out how to synchronize the RAID afterwards.

This sub-thread fits better to debian-user or debian-boot, since it is
absolutely not related to amd64. Maybe there the chance is higher
to get people involved which already tested booting from the 2nd disk.
Maybe Goswin can report, if he unplugged it.

I will inform you after the unplug test, if I do not shoot in my own
toe and mess up my system:-). It is my private machine and not a
production server, therefore it is not really critical, but I do
not want to spent too much time.

Alexander



Reply to: