Am 02.03.2017 um 00:36 schrieb Peter Sangas:
Hi Reindl,
My comments are interleaved. thanks:
___________________________________________________
#!/bin/bash
GOOD_DISK="/dev/sda"
BAD_DISK="/dev/sdc"
# clone MBR
dd if=$GOOD_DISK of=$BAD_DISK bs=512 count=1
Here I run the command sfdisk -d /dev/$GOOD_DISK | sfdisk -f /dev/$BAD_DISK.
I think dd and sfdisk are doing the same thing which is cloning the
partitions and copy the MBR ?
yes
# force OS to read partition tables
partprobe $BAD_DISK
Why run partprobe if the partitions have not changed?
because they *have* changed when you replace a disk with a complete
empty one and clone the MBR and partition table with 3 partitions and
have bootet with a empty partition table - not every hardware supports
hotswap proper and even if it don't harm
# install bootloader on replacement disk grub2-install "$BAD_DISK"
Here don't you mean grub-install not grub2-install?
no, i mean what i say since that script replaced multiple disks on
multiple machines - but how does it matter which name a binary has on
whatever distribution?
[harry@srv-rhsoft:~]$ rpm -q --filesbypkg grub2 | grep install
[harry@srv-rhsoft:~]$ rpm -q --filesbypkg grub2-tools | grep install
grub2-tools /usr/sbin/grub2-install
grub2-tools /usr/share/man/man8/grub2-install.8.gz
[harry@srv-rhsoft:~]$ cat /etc/redhat-release
Generic release 24 (Generic)
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html