mdadm 系统无法从 update-initramfs -u 启动警告

mdadm 系统无法从 update-initramfs -u 启动警告

当我运行 sudo update-initramfs -u 或 apt-get upgrade 时,我收到以下警告:

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.

我尝试使用 Google 来寻找解决方案。另外,我认为 mdadm.conf 中的 uuid 是正确的。

我认为唯一奇怪的是 /etc/mdadm/mdadm.conf 的内容与 /usr/share/mdadm/mkconf 的输出不同。

我该如何解决这个警告?

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

“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

“/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

“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

我已经看过了这个问题

答案1

在 Ubuntu 16.04 上,使用 mdadm 3.3,所有命令都以 'root' 身份执行 - 否则请在前面加上 sudo:

在同一个角落挣扎了 48 小时之后,我发现所有的问题都可以通过应用这个序列得到解决,必要时可以重复应用:

  • cat /proc/mdstat
  • 如果出现任何你不想要的 mdxxx,请使用以下命令将其删除

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

    最重要的是,使用以下命令清除相应的磁盘分片

    mdadm --zero-superblock /dev/sdxn
    
  • 如果缺少任何 mdyyy,请添加它。

  • 再次运行cat /proc/mdstat以确保一切符合要求。
  • 使用以下命令更新配置文件:

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

    然后使用简单的编辑(vi、nano 或任何你喜欢的)删除任何可能的重复条目/etc/mdadm/mdadm.conf

  • 如果配置文件正确,则使用它更新 initramfs:

    update-initramfs -u
    
  • 重新启动并验证,直到完美适口。

相关内容