All of lore.kernel.org
 help / color / mirror / Atom feed
From: Reindl Harald <h.reindl@thelounge.net>
To: David T-G <davidtg-robot@justpickone.org>, linux-raid@vger.kernel.org
Subject: Re: ???root account locked??? after removing one RAID1 hard disc
Date: Mon, 30 Nov 2020 22:57:00 +0100	[thread overview]
Message-ID: <e580e980-1842-b505-8159-e921ccd412a8@thelounge.net> (raw)
In-Reply-To: <20201130200620.GW1415@justpickone.org>



Am 30.11.20 um 21:06 schrieb David T-G:
> Reindl, et al --
> 
> ...and then Reindl Harald said...
> %
> ...
> %
> % typically fire up my "raid-repair.sh" telling the script source and
> % target disk for cloning partition table, mbr and finally add the new
> % partitions to start the rebuild
> [snip]
> 
> Oooh!  How handy :-)  Share, please!

just make sure GOOD_DISK is one of the remaining and BAD_DISK is the 
repalcement drive before uncomment the "exit"

and yeah, adjust how many raid-partitions are there

the first is my homeserver with 3 filesystems (boot, system, data), the 
second one is a RAID10 on a HP microserver with the OS on a sd-card

---------------------------------------------------------------------

DOS:

[root@srv-rhsoft:~]$ cat /scripts/raid-recovery.sh
#!/usr/bin/bash

GOOD_DISK="/dev/sda"
BAD_DISK="/dev/sdd"

echo "NOT NOW"
exit 1

# clone MBR
dd if=$GOOD_DISK of=$BAD_DISK bs=512 count=1

# force OS to read partition tables
partprobe $BAD_DISK

# start RAID recovery
mdadm /dev/md0 --add ${BAD_DISK}1
mdadm /dev/md1 --add ${BAD_DISK}2
mdadm /dev/md2 --add ${BAD_DISK}3

# print RAID status on screen
sleep 5
cat /proc/mdstat

# install bootloader on replacement disk
grub2-install "$BAD_DISK"

---------------------------------------------------------------------

GPT:

[root@nfs:~]$ cat /scripts/raid-recovery.sh
#!/usr/bin/bash

GOOD_DISK="/dev/sda"
BAD_DISK="/dev/sde"

echo "NOT NOW"
exit 1

echo "sgdisk $GOOD_DISK -R $BAD_DISK"
sgdisk $GOOD_DISK -R $BAD_DISK

echo "sgdisk -G $BAD_DISK"
sgdisk -G $BAD_DISK

echo "sleep 5"
sleep 5

echo "partprobe $BAD_DISK"
partprobe $BAD_DISK

echo "sleep 5"
sleep 5

echo "mdadm /dev/md0 --add ${BAD_DISK}1"
mdadm /dev/md0 --add ${BAD_DISK}1

echo "sleep 5"
sleep 5

echo "cat /proc/mdstat"
cat /proc/mdstat

---------------------------------------------------------------------

  reply	other threads:[~2020-11-30 21:57 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-30  8:44 “root account locked” after removing one RAID1 hard disc c.buhtz
2020-11-30  9:27 ` antlists
2020-11-30 10:29   ` c.buhtz
2020-11-30 11:40     ` Wols Lists
2020-11-30 10:31   ` Reindl Harald
2020-11-30 11:10     ` Rudy Zijlstra
2020-11-30 11:18       ` Reindl Harald
2020-11-30 20:06         ` ???root account locked??? " David T-G
2020-11-30 21:57           ` Reindl Harald [this message]
2020-11-30 22:06             ` RAID repair script (was "Re: ???root account locked??? after removing one RAID1 hard disc" David T-G
2020-11-30 12:00     ` “root account locked” after removing one RAID1 hard disc Wols Lists
2020-11-30 12:13       ` Reindl Harald
2020-11-30 13:11         ` antlists
2020-11-30 13:16           ` Reindl Harald
2020-11-30 13:47             ` antlists
2020-11-30 13:53               ` Reindl Harald
2020-11-30 14:46                 ` Rudy Zijlstra
2020-11-30 20:05 ` partitions & filesystems (was "Re: ???root account locked??? after removing one RAID1 hard disc") David T-G
2020-11-30 20:51   ` antlists
2020-11-30 21:03     ` Rudy Zijlstra
2020-11-30 21:49     ` Reindl Harald
2020-11-30 22:31       ` antlists
2020-11-30 23:21         ` Reindl Harald
2020-11-30 23:59           ` antlists
2020-11-30 22:04     ` partitions & filesystems David T-G
2020-12-01  8:45     ` partitions & filesystems (was "Re: ???root account locked??? after removing one RAID1 hard disc") c.buhtz
2020-12-01  9:18       ` Rudy Zijlstra
2020-12-01 10:00       ` Wols Lists
2020-12-01  8:41   ` buhtz
2020-12-01  9:13     ` Reindl Harald
2020-12-01  8:42   ` c.buhtz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e580e980-1842-b505-8159-e921ccd412a8@thelounge.net \
    --to=h.reindl@thelounge.net \
    --cc=davidtg-robot@justpickone.org \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.