[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Does mdadm in the installer read its config file?



Hi,

By default mdadm will create md arrays with a bad blocks list
feature unless you tell it not to. I wish to tell the Debian
installer's mdadm to not do this.

The documented way to tell mdadm to not create arrays with a bad
blocks list is to put:

CREATE bbl=no

in /etc/mdadm/mdadm.conf

Once an array has been created with the bbl feature the only way to
remove that feature is to stop the array and manually assemble it
like:

# mdadm --assemble --update=no-bbl /dev/md0

Obviously that will require downtime and is a bit tricky if one of
the arrays is your root fs. So I'd really like to not even create
the arrays with a bbl.

My first thought was to do an expert mode install and after the
"Detect disks" step, go to "Execute a shell", create the
/etc/mdadm/mdadm.conf file, exit, and then proceed with "Partition
disks" where my partitions and md arrays will be created.

This did not work, in that it created arrays with a bbl:

~ # mdadm --examine /dev/sdb1
…
  Bad Block Log : 512 entries available at offset 72 sectors
…

I have confirmed that doing the assemble --update thing does remove
the bbl:

~ # umount /target/boot
~ # mdadm --stop /dev/md0
mdadm: stopped /dev/md0
~ # mdadm --assemble --update=no-bbl /dev/md0 /dev/sda1 /dev/sdb1
mdadm: /dev/md0 has been started with 1 drive (out of 2) and 1 rebuilding.
~ # mdadm --examine /dev/sda1
…
(no "Bad Block Log" line)
…

I have confirmed that creating a new array from the d-i shell using
mdadm commands manually does result in a new array without a bbl (so
this invocation of mdadm did read /etc/mdadm/mdadm.conf):

~ # swapoff /dev/md2
~ # mdadm --stop  /dev/md2
mdadm: stopped /dev/md2
~ # mdadm --zero-superblock /dev/sda3
~ # mdadm --zero-superblock /dev/sdb3
~ # mdadm -v --create /dev/md2 --assume-clean --level=1 --raid-devices=2 /dev/sd[ab]3
mdadm: Note: this array has metadata at the start and
    may not be suitable as a boot device.  If you plan to
    store '/boot' on this device please ensure that
    your boot-loader understands md/v1.x metadata, or use
    --metadata=0.90
mdadm: size set to 1951744K
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md2 started.
~ # mdadm --examine /dev/sda1
/dev/sda1:
…
(no "Bad Block Log" line)
…

So, from what I can see, d-i's own invocations of mdadm aren't
reading the /etc/mdadm/mdadm.conf file. Is that the case?

I can of course set up all the arrays from the d-i shell to get the
result I want, that's just rather tedious.

I wish that mdadm had a config option to remove bbl on assembly,
even incremental assembly. Then I could just set this using config
management once the machine was up and running and next reboot this
would be taken care of. But it does not, and I am maybe alone in
wanting this:

    https://www.spinics.net/lists/raid/msg65835.html

Cheers,
Andy


Reply to: