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

Re: Rescue mode: cannot fix boot after raid1 repair



On Thu, 06 Nov 2014, Ron Leach wrote:
> /dev/sdb is partitioned:
> sdb1: /boot2 (this was a simple copy of /boot on /dev/sda1; sda1 and sdb1
> were not raid)
> sdb2: (raid1) /
> sdb3: (raid1) /usr
> sdb4: (raid1) /var
> sdb5: swap
> sdb6: (raid1) /tmp
> sdb7: (raid1) /home
> sdb8: (raid1) /userdata
> 
> Could I ask 3 questions?  Is there a way I can check whether there is a
> correct MBR on /dev/sdb?
> 
> Secondly, /boot on /dev/sda1 had been flagged as bootable, so to boot from
> /dev/sdb1 should I now flag /dev/sdb1 as bootable and, if so, how should I
> do that from the rescue mode?
> 
> Lastly, do I need to run a grub installer and, if so, where ought I be able
> to find that?  I tried running grub-install from both a shell in the root
> filesystem, and from a shell in the rescue system, but grub-install seemed
> not to be there.  Perhaps the shell needs a 'path' to find it or, even, some
> other partitions mounted.

1) Boot off of rescue media (the Debian installer will work fine)
2) Start the raid for / in degraded mode from the rescue media shell
3) Mount the raid for / on /target or similar
4) Bind mount /dev, and mount /proc and /sys on /target/ as appropriate
5) Chroot into /target; start the other raid devices if necessary, and
mount them. You'll at least need /usr.
6) Copy the partition table from /dev/sdb to /dev/sda
7) Add the new partitions from /dev/sda to the raid devices which you
have started
8) At this point, I would suggest imaging /dev/sdb1, and turning
/dev/sdb1 into a real raid device, and using that as /boot and mounting
it on /boot. Copy the files back by mounting the old /dev/sdb1 on a
loopback device, not by dd'ing (or similar) /dev/sdb1 to the new raid
device.
9) If necessary, bring networking up, and install/reinstall grub.
10) Run grub-install on /dev/sda and /dev/sdb
11) Make sure that /boot now has the correct kernel. (You'll probably
want to re-install it anyway, because it's highly likely that you
haven't kept /boot2 in sync.)
12) unmount things, exit the chroot, and unmount more.
13) Reboot. You should *at least* get a grub prompt.
 

-- 
Don Armstrong                      http://www.donarmstrong.com

We cast this message into the cosmos. [...] We are trying to survive
our time so we may live into yours. We hope some day, having solved
the problems we face, to join a community of Galactic Civilizations.
This record represents our hope and our determination and our goodwill
in a vast and awesome universe.
 -- Jimmy Carter on the Voyager Golden Record


Reply to: