Re: Rescue mode: cannot fix boot after raid1 repair
Don, thank you for a very comprehensive sequence. I wanted to skip
the part where the new disk was re-synced because that's going to take
some 8 hours or so and I rather need to have the basic server up,
albeit in degraded raid1 state, and then let it resync, so that the
(few) users can access their files. (This server's role is to provide
the file system for the network; it runs NFS and Samba, and timed
rdiff-backup jobs onto a physically separate filesystem.)
So I went to rebuild grub, after starting the raid array, but before
partitioning /dev/sda and resyncing the raid. Essentially, bringing
Lenny back up, then resyncing the raid, and finally making the boot
partition into a raid.
Failed though. Notes in-line, below.
On 06/11/2014 16:30, Don Armstrong wrote:
1) Boot off of rescue media (the Debian installer will work fine)
None of my Lenny install CD-1s would run - I think the CDs may be
damaged. Used a Squeeze (testing) XFCE CD, in rescue mode.
2) Start the raid for / in degraded mode from the rescue media shell
Not quite. The rescue mode installer gives the option to start the
array, and I started all 6 raid arrays. (Was that the right thing to
do?) Hadn't had a shell offered, at that point.
3) Mount the raid for / on /target or similar
Didn't do this, because I wanted just to load a version of grub that
would let me boot the degraded system.
4) Bind mount /dev, and mount /proc and /sys on /target/ as appropriate
Didn't do this, either, to get straight to grub.
5) Chroot into /target; start the other raid devices if necessary, and
mount them. You'll at least need /usr.
Took a shell offered by the installer, which was offered in /dev/md122
(was md1, previously).
# ls
showed all the directories that I expected to see, including
/userdata, so the shell was running in my Lenny '/'.
mounted /dev/md123 on /usr; was able to cd into it and see several
directories.
6) Copy the partition table from /dev/sdb to /dev/sda
Skipped this. Also, I don't think I can do this without gdisk (which
has a partition table clone command) and gdisk is not installed on my
Lenny system, neither is it available in the installer rescue.
Neither was parted. I tried fdisk, but it complained because /dev/sdb
is using GPT.
So I decided that I would create the dev/sda partitions by hand, using
Gparted (which is on my Lenny system) once I had managed to reboot
into Lenny. This is the other reason why I wanted to get booting
working, before resyncing the raid, because I can't partition /dev/sda
using fdisk.
(In the meantime, I've downloaded Gparted live ISO in case I do have
to revert to your specific ordering of the steps, and I will partition
/dev/sda first, before then starting with Debian-rescue.)
7) Add the new partitions from /dev/sda to the raid devices which you
have started
Haven't done this because /dev/sda isn't partitioned yet, and I wanted
the /userdata fairly urgently, for the users.
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.
I like that suggestion, and I will do that but I've skipped that for
now, as well, because I do need the Lenny system up.
9) If necessary, bring networking up, and install/reinstall grub.
I did enable networking. I don't think the installer used it -
except, maybe, for the time.
10) Run grub-install on /dev/sda and /dev/sdb
Tried the grub-install, but it failed complaining (loosely) that the
'image was too large for embedding, but the embedded image was needed
for raid or lvm systems'.
I'd mounted /boot2 to retain compatibility with the Lenny build. I
executed:
# mount /dev/sdb1 /boot2
# grub-install --root-directory=/boot2 /dev/sdb
which failed, complaining that the 'image' was too big. I tried
grub-setup as well but that complained, too.
Didn't get any further, because the grub-install failed.
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.
Perhaps I should try with a new-burn Lenny install CD. The Lenny ISOs
are on /userdata in the broken Lenny system (!), so I'll see if Debian
archives have one.
Don, thanks very much for the clear steps; these have been useful.
I'll continue with trying to restart the Lenny system first. If that
does continue to fail, then I'll revert to the sequence you suggest.
The grub failure is a bit odd, though.
Ron
Reply to: