1

When I run sudo update-initramfs -u or apt-get upgrade I receive the following warning:

W: mdadm: the array /dev/md0 with UUID 5bb9de94:f4c6b44f:2c027820:a8368d69
W: mdadm: is currently active, but it is not listed in mdadm.conf. if
W: mdadm: it is needed for boot, then YOUR SYSTEM IS NOW UNBOOTABLE!
W: mdadm: please inspect the output of /usr/share/mdadm/mkconf, compare
W: mdadm: it to /etc/mdadm/mdadm.conf, and make the necessary changes.

I try to find out the solution with Google. Also, I think the uuid in mdadm.conf is correct.

The only thing I think it is so strange is that the content of /etc/mdadm/mdadm.conf is different from the output of /usr/share/mdadm/mkconf.

How can I fix this warning?

Information of md0:

dev/md0:
        Version : 1.2
  Creation Time : Sun Jul 17 02:15:47 2016
     Raid Level : raid5
     Array Size : 5860150272 (5588.67 GiB 6000.79 GB)
  Used Dev Size : 1953383424 (1862.89 GiB 2000.26 GB)
   Raid Devices : 4
  Total Devices : 4
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Wed Jan 25 12:48:51 2017
          State : clean
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 1024K

           Name : ubuntu-nas:0
           UUID : 5bb9de94:f4c6b44f:2c027820:a8368d69
         Events : 2811

    Number   Major   Minor   RaidDevice State
       0       8       16        0      active sync   /dev/sdb
       1       8       32        1      active sync   /dev/sdc
       2       8       48        2      active sync   /dev/sdd
       3       8       64        3      active sync   /dev/sde

Output of "cat /etc/mdadm/mdadm.conf"

# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR root

# definitions of existing MD arrays
ARRAY /dev/md/0  metadata=1.2 UUID=20ae8d0e:b8961a49:a5ae8fdb:77005216 name=ubuntu-nas:0

# This file was auto-generated on Sun, 17 Jul 2016 01:35:19 +0800
# by mkconf $Id$
#ARRAY /dev/md0 uuid=ace08019:818a2a70:f657877c:53ac421b
ARRAY /dev/md0 uuid=5bb9de94:f4c6b44f:2c027820:a8368d69

Output of "/usr/share/mdadm/mkconf":

# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR root

# definitions of existing MD arrays

Output of "cat /etc/fstab":

# /etc/fstab: static file system information.
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sdd1 during installation
UUID=5c71f0e0-4f8f-44c8-9ee1-4175a8c5d31d /               ext4            errors=remount-ro 0       1
# swap was on /dev/sdc5 during installation
#UUID=6c90b7ac-7849-4a61-ba41-076f767c36c4 none            swap    sw                  0       0
/dev/mapper/cryptswap1 none swap sw 0 0
/dev/vlm1/lv1   /mnt/vlm1/lv1   ext4    user    0       1

p.s. I have already seen this question

1 Answers1

1

On Ubuntu 16.04, with mdadm 3.3, and all commands executed as 'root' - preceed with sudo if otherwise:

After struggling for 48 hours in the same corner, I found all my problems solved by applying this sequence, repeatedly if necessary:

  • cat /proc/mdstat
  • if any mdxxx shows up that you do not want, remove it with

    mdadm --stop /dev/mdxxx
    mdadm --remove /dev/mdxxx
    

    and, most importantly, clear the corresponding disk slice(s) with

    mdadm --zero-superblock /dev/sdxn
    
  • If any mdyyy is missing, add it.

  • Run cat /proc/mdstat again to be very sure all is as desired.
  • Update the config file with:

    mdadm --detail --scan >>/etc/mdadm/mdadm.conf
    

    Then remove any possible double entries with a simple edit (vi, nano, or whatever you prefer) of the same /etc/mdadm/mdadm.conf

  • if the config file is OK, update initramfs with it:

    update-initramfs -u
    
  • Reboot and validate, until perfectly to taste.

karel
  • 110,292
  • 102
  • 269
  • 299
Karel Adams
  • 116
  • 10