apt-get install linux-image-extra getting "W: mdadm: /etc/mdadm/mdadm.conf defines no arrays."

When installing:

sudo apt-get install \
    linux-image-extra-$(uname -r) \
    linux-image-extra-virtual

I am getting:

W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.

I found that someone else has had a similar issue: apt-get update mdadm scary warnings

So I followed the instructions:

/usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf

Then:

update-initramfs -u

But the output is:

update-initramfs: Generating /boot/initrd.img-4.10.0-30-generic
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.

lsb_release -a

LSB Version:    core-9.20160110ubuntu5-amd64:core-9.20160110ubuntu5-noarch:security-9.20160110ubuntu5-amd64:security-9.20160110ubuntu5-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 17.04
Release:    17.04
Codename:   zesty

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

# 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

# This configuration was auto-generated on Thu, 10 Aug 2017 15:23:15 +0000 by mkconf

/etc/fstab

LABEL=cloudimg-rootfs   /        ext4   defaults        0 0
/var/swap.1 swap swap defaults 0 0

I think this started happening after I added:

/var/swap.1 swap swap defaults 0 0

Is there something else I need to do?

I am running a VM with the help of Vagrant.

UPDATE 1

I found another similar question to mine": https://askubuntu.com/questions/834903/i-dont-have-a-raid-but-get-the-warning-mdadm-conf-defines-no-arrays

I added:

ARRAY <ignore> devices=/dev/sda1

I added 1 at the end because I don't have /dev/sda stand alone.

Filesystem      Size  Used Avail Use% Mounted on
udev            473M     0  473M   0% /dev
tmpfs            97M  3.1M   94M   4% /run
/dev/sda1        19G  4.8G   15G  26% /
tmpfs           483M     0  483M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           483M     0  483M   0% /sys/fs/cgroup
vagrant_        384G   48G  337G  13% /vagrant
vagrant_www_    384G   48G  337G  13% /vagrant/www
tmpfs            97M     0   97M   0% /run/user/1000

I am doing this right? What does this do?

The warnings to have gone away.


This warning is normal. Ignore it.

update-initramfs needs to figure out what kernel modules will be needed to boot your system. In this case, it's checking whether the RAID modules will be needed, by running mdadm to check whether your root filesystem is on a RAID array. Since you don't have any RAID arrays at all, mdadm prints a warning -- but this is OK, because update-initramfs has found what it needed to know.


Regarding your update, you should be using /dev/sda. /dev/sda1 refers to a disk partition, while /dev/sda refers to the physical disk itself. Try running the lsblk tool and judging by the output you posted from df -h, you should get something along the lines of:

NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0   19G  0 disk
└─sda1   8:1    0   19G  0 disk /

RAID arrays can be split into separate partitions so they are treated as functionally identical to physical devices.