Answer the question
In order to leave comments, you need to log in
Tell me the sequence of actions when replacing a disk in raid1
One disk from a software raid fell off on a remote server
Answer the question
In order to leave comments, you need to log in
> Yes, it seems that when you replaced the disk, you incorrectly registered rude on it.
Yes, so first, even before replacing the disk, I did
grub-install /dev/sdb
Check /etc/initramfs-tools/conf.d/mdadm, you need it to be BOOT_DEGRADED=true
Then replace the disk
1. Check for the disk
cat /proc/ scsi/scsi
2. Look at fdisk -l and get something like "Disk /dev/sda doesn't contain a valid partition table"
3. Transfer the partition structure between disks
sfdisk -d /dev/sda | sfdisk --force /dev/sdb
--force is needed otherwise it will swear that the new disk is not marked
4. Check fdisk -l /dev/sda /dev/sdb disks must be the same
5. Add a new disk to the raid
mdadm --manage /dev/md0 --add /dev/sda1
mdadm --manage /dev/md1 --add /dev/sda6
mdadm --manage /dev/md2 --add /dev/
sda5 drives cat /proc/mdstat
md2: active raid1 sdb5[2] sda5[3]
11716536 blocks super 1.2 [2/2] [UU]
md1: active raid1 sdb6[2] sda6[3]
[>...... ..............] recovery = 0.1% (97408/71585536) finish=73.3min speed=76234K/sec
md0: active raid1 sda1[3] sdb1[2]
9763840 blocks super 1.2 [ 2/2] [UU]
unused devices: 7. After doing grub-install /dev/sda and update-grub
Yes, it looks like when you replaced the disk, you incorrectly registered rough on it.
It is strange that it does not see file systems on any partition. And judging by the names, do you have grub2?
As an option, try to connect the second (working) disk in place of the first one. When installing grub, it is useful to indicate for each disk that it is the first and only one (I won’t tell you right off the bat how to do this for grub2, for grub there are three commands in the shell - device (hd0) /dev/sdX, root (hd0,x), setup(hd0))
After replacing the disk, you need to run grub-update so that it writes the stage1.5 code to 1 track.
That was done? If not, then you need to start from the rescue system,
do mdadm --assemble, mount, chroot and grub-update.
Second question - was grub installed on (md0) or on (hd0)?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question