linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roy Sigurd Karlsbakk <roy@karlsbakk.net>
To: Andy Smith <andy@strugglers.net>
Cc: Linux Raid <linux-raid@vger.kernel.org>
Subject: Re: "--re-add for /dev/sdb1 to /dev/md0 is not possible"
Date: Tue, 22 Sep 2020 12:27:40 +0200 (CEST)	[thread overview]
Message-ID: <913919976.4679345.1600770460519.JavaMail.zimbra@karlsbakk.net> (raw)
In-Reply-To: <20200915102736.GE13298@bitfolk.com>

> In my continuing goal to remove the bad blocks log from any of my
> arrays and not have one on any new arrays I create, I wrote this
> article:
> 
>    https://strugglers.net/~andy/blog/2020/09/13/debian-installer-mdadm-configuration-and-the-bad-blocks-controversy
> 
> Shortly afterwards someone on Hacker News¹ said that it is possible
> to remove the BBL by failing and re-adding devices, like so:
> 
> # mdadm /dev/md127 --fail /dev/sda --remove /dev/sda --re-add /dev/sda
> --update=no-bbl
> 
> I tried that on Ubuntu 18.04:
> 
> $ mdadm --version
> mdadm - v4.1-rc1 - 2018-03-22
> $ sudo mdadm --fail /dev/md0 /dev/sdb1 --remove /dev/sdb1 --re-add /dev/sdb1
> --update=no-bbl
> mdadm: set /dev/sdb1 faulty in /dev/md0
> mdadm: hot removed /dev/sdb1 from /dev/md0
> mdadm: --re-add for /dev/sdb1 to /dev/md0 is not possible
> $ sudo mdadm --add /dev/md0 /dev/sdb1 --update=no-bbl
> mdadm: --update in Manage mode only allowed with --re-add.
> $ sudo mdadm --add /dev/md0 /dev/sdb1
> mdadm: added /dev/sdb1
> $ sudo mdadm --examine-badblocks /dev/sdb1
> Bad-blocks list is empty in /dev/sdb1
> 
> I tried it on Debian buster:
> 
> $ mdadm --version
> mdadm - v4.1 - 2018-10-01
> $ sudo mdadm --fail /dev/md6 /dev/sdb1 --remove /dev/sdb1 --re-add /dev/sdb1
> --update=no-bbl
> mdadm: set /dev/sdb1 faulty in /dev/md6
> mdadm: hot removed /dev/sdb1 from /dev/md6
> mdadm: --re-add for /dev/sdb1 to /dev/md6 is not possible
> 
> So, is that supposed to work and if so, why doesn't it work for me?
> 
> In both cases these are simple two device RAID-1 metadata version
> 1.2 arrays. Neither has bitmaps.

I've tried this as well, and ran

mddev=/dev/md0
diskdev=/dev/sdm

mdadm --fail $mddev $diskdev
mdadm --remove $mddev $diskdev
mdadm --re-add $mddev $diskdev

All returned ok, but sdm was listed as a slave, thus not active anymore. After this, a new --remove and --re-add didn't work, so it'll take some hours to --add it again (yet another time).

It would be very nice if someone at linux-raid could prioritise this rather obvious bug in the bbl code, where the bbl keeps replicating itself over and over, regardless of any actual failures on the disks. IMHO the whole BBL should be scrapped, as mentioned earlier, since it really has no function. Mapping out bad sectors is for the drive to decide and if it can't handle it, it should be kicked out of the array.

Vennlig hilsen

roy
-- 
Roy Sigurd Karlsbakk
(+47) 98013356
http://blogg.karlsbakk.net/
GPG Public key: http://karlsbakk.net/roysigurdkarlsbakk.pubkey.txt
--
Hið góða skaltu í stein höggva, hið illa í snjó rita.

  parent reply	other threads:[~2020-09-22 10:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15 10:27 "--re-add for /dev/sdb1 to /dev/md0 is not possible" Andy Smith
2020-09-17  8:29 ` Andy Smith
2020-09-22 10:27 ` Roy Sigurd Karlsbakk [this message]
2020-09-22 23:18   ` antlists
2020-11-28 17:59     ` Roy Sigurd Karlsbakk
2020-11-28 19:51       ` Andy Smith

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=913919976.4679345.1600770460519.JavaMail.zimbra@karlsbakk.net \
    --to=roy@karlsbakk.net \
    --cc=andy@strugglers.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).