All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Mamedov <rm@romanrm.net>
To: d tbsky <tbskyd@gmail.com>
Cc: list Linux RAID <linux-raid@vger.kernel.org>
Subject: Re: add new disk with dd
Date: Thu, 29 Apr 2021 14:05:06 +0500	[thread overview]
Message-ID: <20210429140506.537c3c4a@natsu> (raw)
In-Reply-To: <CAC6SzHLDYhQDtfQMYozN6EBYB=nsKvB77hmyByZNr9uTpQH+KQ@mail.gmail.com>

On Thu, 29 Apr 2021 16:52:21 +0800
d tbsky <tbskyd@gmail.com> wrote:

> Hi:
>    I want to replace a fault disk for software raid5. there is
> something like grub/biosgrub at the beginning of the disk, so if I can
> use command below to copy them:
> 
> "dd if=/dev/sda of=/dev/sdb bs=1M count=10"
> 
> if it is a gpt disk I can use sgdisk to copy the partition table then
> radmonize guid.

Do you use whole disks or partitions as MD members? Better use partitions. And
if so, you can simply run "wipefs -a /dev/sdb1" after your dd, to wipe all the
MD metadata that got copied.

> however dd may also copy the mdadm superblock which include internal
> bitmap(since I don't caculate correct size). I don't know if there is
> risk that mdadm will be confused with the bitmap in new disk. although
> I have tried and it seems work fine.

Without wiping the metadata, don't plug in both disks at the same time, and
don't even plug in the new disk alone. With metadata at the beginning, mdadm
might pick up the new one as a normally operating array member, whereas it
only has 10 MB of the actual data copied to it.

-- 
With respect,
Roman

  reply	other threads:[~2021-04-29  9:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29  8:52 add new disk with dd d tbsky
2021-04-29  9:05 ` Roman Mamedov [this message]
2021-04-29  9:21 ` Mateusz
2021-04-29 15:32   ` d tbsky
2021-04-29 15:34     ` Reindl Harald
2021-05-01 10:07     ` Wols Lists

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=20210429140506.537c3c4a@natsu \
    --to=rm@romanrm.net \
    --cc=linux-raid@vger.kernel.org \
    --cc=tbskyd@gmail.com \
    /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.