#860458 mdadm: please make it possible to create an initramfs without mdadm support

Package:
mdadm
Source:
mdadm
Description:
Tool to administer Linux MD arrays (software RAID)
Submitter:
Russell Coker
Date:
2023-02-25 15:03:05 UTC
Severity:
normal
#860458#5
Date:
2017-04-17 08:35:15 UTC
From:
To:
It seems that if you want to have mdadm installed but not present in the
initramfs then the only option is to remove the mdadm files from under
/usr/share/initramfs-tools.  Otherwise you get a larger initramfs and some
delay while it tries to assemble a mdadm that may not be possible.

Here are some situations where you want mdadm installed but not in the
initramfs:

Making a recovery disk that needs to be able to access raid etc but not for
booting.

Running a system that has /boot on software RAID and / on some other form of
RAID (such as BTRFS or ZFS).  Especially if that system has VMs that use
the same initramfs and have no software RAID because they have virtual devices
from BTRFS or ZFS filesystems.

Running a system with limited disk that needs to connect to arrays
occasionally, such as using a laptop with a single internal disk to connect to
RAID arrays and test them.
--- /etc/default/mdadm
AUTOCHECK=true
START_DAEMON=true
DAEMON_OPTIONS="--syslog"
VERBOSE=false

      487104 blocks super 1.2 [2/2] [UU]
      bitmap: 0/1 pages [0KB], 65536KB chunk

unused devices: <none>
--- /proc/partitions:
major minor  #blocks  name

   8       16  117220824 sdb
   8       17     487424 sdb1
   8       18  116732376 sdb2
   8       32  234431064 sdc
   8       33     487424 sdc1
   8       34  233942616 sdc2
   8        0  468851544 sda
   8        1     487424 sda1
   8        2  468363096 sda2
   9        0     487104 md0
   7        0    2097152 loop0
   7        2     253952 loop2
--- LVM physical volumes: LVM does not seem to be used. --- mount output sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) udev on /dev type devtmpfs (rw,nosuid,relatime,seclabel,size=8186296k,nr_inodes=2046574,mode=755) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000) tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,seclabel,size=1639584k,mode=755) /dev/sdc2 on / type btrfs (rw,relatime,seclabel,ssd,space_cache,skip_balance,subvolid=5,subvol=/) securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel) tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,seclabel,size=5120k) tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,seclabel,mode=755) cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd) pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime,seclabel) cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids) cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio) cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct) cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory) cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event) cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices) cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer) cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset) cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio) systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=37,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=14789) hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,seclabel) debugfs on /sys/kernel/debug type debugfs (rw,relatime,seclabel) mqueue on /dev/mqueue type mqueue (rw,relatime,seclabel) sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime) nfsd on /proc/fs/nfsd type nfsd (rw,relatime) /dev/md0 on /boot type ext4 (rw,nodev,noexec,noatime,seclabel,data=ordered) tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=1639580k,mode=700) /xenstore/isos/debian-8.7.1-amd64-netinst.iso on /mnt/tmp2 type iso9660 (ro,relatime) fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
--- initrd.img-4.9.0-2-amd64: 28318 blocks d3be82c0f275d6c25b04d388baf9e836 ./etc/modprobe.d/mdadm.conf 74e5bb9fd80508594e8a702375fcc243 ./lib/modules/4.9.0-2-amd64/kernel/drivers/md/dm-mod.ko
--- initrd's /conf/conf.d/md: no conf/md file.
--- /proc/modules: dm_mod 118784 0 - Live 0xffffffffc0a1a000 raid10 49152 0 - Live 0xffffffffc0344000 raid456 106496 0 - Live 0xffffffffc041e000 async_raid6_recov 20480 1 raid456, Live 0xffffffffc02e0000 async_memcpy 16384 2 raid456,async_raid6_recov, Live 0xffffffffc02db000 async_pq 16384 2 raid456,async_raid6_recov, Live 0xffffffffc0293000 async_xor 16384 3 raid456,async_raid6_recov,async_pq, Live 0xffffffffc028e000 async_tx 16384 5 raid456,async_raid6_recov,async_memcpy,async_pq,async_xor, Live 0xffffffffc0289000 raid6_pq 110592 4 btrfs,raid456,async_raid6_recov,async_pq, Live 0xffffffffc03e0000 libcrc32c 16384 2 xfs,raid456, Live 0xffffffffc0271000 raid0 20480 0 - Live 0xffffffffc022e000 multipath 16384 0 - Live 0xffffffffc0229000 linear 16384 0 - Live 0xffffffffc01df000 raid1 36864 1 - Live 0xffffffffc0216000 md_mod 131072 7 raid10,raid456,raid0,multipath,linear,raid1, Live 0xffffffffc03bf000
--- /var/log/syslog:
--- volume detail: /dev/sda: MBR Magic : aa55 Partition[0] : 974848 sectors at 2048 (type fd) Partition[1] : 936726192 sectors at 976896 (type 83) -- /dev/sda1: Magic : a92b4efc Version : 1.2 Feature Map : 0x1 Array UUID : 5d63e73c:6c6845cf:9ed639c1:ba2f50af Name : othello2:0 Creation Time : Wed Apr 16 19:34:29 2014 Raid Level : raid1 Raid Devices : 2 Avail Dev Size : 974336 (475.75 MiB 498.86 MB) Array Size : 487104 (475.69 MiB 498.79 MB) Used Dev Size : 974208 (475.69 MiB 498.79 MB) Data Offset : 512 sectors Super Offset : 8 sectors Unused Space : before=424 sectors, after=128 sectors State : clean Device UUID : 33022856:08f926d4:e69e2826:cf26d3dd Internal Bitmap : 8 sectors from superblock Update Time : Mon Apr 17 18:28:25 2017 Bad Block Log : 512 entries available at offset 72 sectors Checksum : 982e7e37 - correct Events : 415 Device Role : Active device 0 Array State : AA ('A' == active, '.' == missing, 'R' == replacing) -- /dev/sda2 is not recognised by mdadm. /dev/sdb: MBR Magic : aa55 Partition[0] : 974848 sectors at 2048 (type fd) Partition[1] : 233464752 sectors at 976896 (type 83) -- /dev/sdb1: Magic : a92b4efc Version : 1.2 Feature Map : 0x1 Array UUID : 5d63e73c:6c6845cf:9ed639c1:ba2f50af Name : othello2:0 Creation Time : Wed Apr 16 19:34:29 2014 Raid Level : raid1 Raid Devices : 2 Avail Dev Size : 974336 (475.75 MiB 498.86 MB) Array Size : 487104 (475.69 MiB 498.79 MB) Used Dev Size : 974208 (475.69 MiB 498.79 MB) Data Offset : 512 sectors Super Offset : 8 sectors Unused Space : before=424 sectors, after=128 sectors State : clean Device UUID : 492a9016:28c29246:fa48424b:2b133f0b Internal Bitmap : 8 sectors from superblock Update Time : Tue Mar 7 15:00:04 2017 Bad Block Log : 512 entries available at offset 72 sectors Checksum : 1d51b95a - correct Events : 387 Device Role : Active device 1 Array State : AA ('A' == active, '.' == missing, 'R' == replacing) -- /dev/sdb2 is not recognised by mdadm. /dev/sdc: MBR Magic : aa55 Partition[0] : 974848 sectors at 2048 (type fd) Partition[1] : 467885232 sectors at 976896 (type 83) -- /dev/sdc1: Magic : a92b4efc Version : 1.2 Feature Map : 0x1 Array UUID : 5d63e73c:6c6845cf:9ed639c1:ba2f50af Name : othello2:0 Creation Time : Wed Apr 16 19:34:29 2014 Raid Level : raid1 Raid Devices : 2 Avail Dev Size : 974336 (475.75 MiB 498.86 MB) Array Size : 487104 (475.69 MiB 498.79 MB) Used Dev Size : 974208 (475.69 MiB 498.79 MB) Data Offset : 512 sectors Super Offset : 8 sectors Unused Space : before=424 sectors, after=128 sectors State : clean Device UUID : daf71a6f:892080f9:0421ca74:086e2786 Internal Bitmap : 8 sectors from superblock Update Time : Mon Apr 17 18:28:25 2017 Bad Block Log : 512 entries available at offset 72 sectors Checksum : cd7064b5 - correct Events : 415 Device Role : Active device 1 Array State : AA ('A' == active, '.' == missing, 'R' == replacing) -- /dev/sdc2 is not recognised by mdadm.
--- /proc/cmdline BOOT_IMAGE=/vmlinuz-4.9.0-2-amd64 root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro init=/bin/systemd consoleblank=0 rootflags=skip_balance selinux=1 security=selinux
--- grub2: set root='hd2,msdos2' set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' linux /vmlinuz-4.9.0-2-amd64 root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' linux /vmlinuz-4.9.0-2-amd64 root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' linux /vmlinuz-4.9.0-2-amd64 root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux init=/lib/sysvinit/init set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' linux /vmlinuz-4.9.0-2-amd64 root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro single init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' linux /vmlinuz-4.9.0-1-amd64 root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' linux /vmlinuz-4.9.0-1-amd64 root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux init=/lib/sysvinit/init set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' linux /vmlinuz-4.9.0-1-amd64 root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro single init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' linux /vmlinuz-4.9.0-2-amd64 root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' linux /vmlinuz-4.9.0-2-amd64 root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' linux /vmlinuz-4.9.0-2-amd64 root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' linux /vmlinuz-4.9.0-2-amd64 root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux init=/lib/sysvinit/init menuentry 'Debian GNU/Linux, with Linux 4.9.0-2-amd64 (recovery mode) (on /dev/sda2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-4.9.0-2-amd64-root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro single init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux-caf5f13b-c48f-4d01-aa30-93d29be10c03' { set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' linux /vmlinuz-4.9.0-2-amd64 root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro single init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' linux /vmlinuz-4.9.0-1-amd64 root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' linux /vmlinuz-4.9.0-1-amd64 root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux init=/lib/sysvinit/init menuentry 'Debian GNU/Linux, with Linux 4.9.0-1-amd64 (recovery mode) (on /dev/sda2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-4.9.0-1-amd64-root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro single init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux-caf5f13b-c48f-4d01-aa30-93d29be10c03' { set root='mduuid/5d63e73c6c6845cf9ed639c1ba2f50af' linux /vmlinuz-4.9.0-1-amd64 root=UUID=caf5f13b-c48f-4d01-aa30-93d29be10c03 ro single init=/bin/systemd consoleblank=0 rootflags=skip_balance security=selinux
--- udev: ii udev 232-22 amd64 /dev/ and hotplug management daem aa83f41de49462d05e446cfc5e14e74b /lib/udev/rules.d/63-md-raid-arrays.rules 5de7d0b70cd948d00bb38ca75ad5f288 /lib/udev/rules.d/64-md-raid-assembly.rules 8e28181624da2ed60739cae470ca6415 /lib/udev/rules.d/99-systemd.rules
--- /dev: brw-rw----. 1 root disk 9, 0 Mar 27 03:15 /dev/md0 /dev/disk/by-id: total 0 lrwxrwxrwx. 1 root root 9 Mar 27 03:15 ata-INTEL_SSDSC2CT120A3_CVMP219105MT120BGN -> ../../sdb lrwxrwxrwx. 1 root root 10 Mar 27 03:15 ata-INTEL_SSDSC2CT120A3_CVMP219105MT120BGN-part1 -> ../../sdb1 lrwxrwxrwx. 1 root root 10 Mar 27 03:15 ata-INTEL_SSDSC2CT120A3_CVMP219105MT120BGN-part2 -> ../../sdb2 lrwxrwxrwx. 1 root root 9 Mar 27 03:15 ata-INTEL_SSDSCKKW480H6_CVLY619500AV480F -> ../../sda lrwxrwxrwx. 1 root root 10 Mar 27 03:15 ata-INTEL_SSDSCKKW480H6_CVLY619500AV480F-part1 -> ../../sda1 lrwxrwxrwx. 1 root root 10 Mar 27 03:15 ata-INTEL_SSDSCKKW480H6_CVLY619500AV480F-part2 -> ../../sda2 lrwxrwxrwx. 1 root root 9 Mar 27 03:15 ata-SanDisk_SDSSDA240G_164056457915 -> ../../sdc lrwxrwxrwx. 1 root root 10 Mar 27 03:15 ata-SanDisk_SDSSDA240G_164056457915-part1 -> ../../sdc1 lrwxrwxrwx. 1 root root 10 Mar 27 03:15 ata-SanDisk_SDSSDA240G_164056457915-part2 -> ../../sdc2 lrwxrwxrwx. 1 root root 9 Mar 27 03:15 md-name-othello2:0 -> ../../md0 lrwxrwxrwx. 1 root root 9 Mar 27 03:15 md-uuid-5d63e73c:6c6845cf:9ed639c1:ba2f50af -> ../../md0 lrwxrwxrwx. 1 root root 9 Mar 27 03:15 wwn-0x5001517bb291304b -> ../../sdb lrwxrwxrwx. 1 root root 10 Mar 27 03:15 wwn-0x5001517bb291304b-part1 -> ../../sdb1 lrwxrwxrwx. 1 root root 10 Mar 27 03:15 wwn-0x5001517bb291304b-part2 -> ../../sdb2 lrwxrwxrwx. 1 root root 9 Mar 27 03:15 wwn-0x5001b444a66e657a -> ../../sdc lrwxrwxrwx. 1 root root 10 Mar 27 03:15 wwn-0x5001b444a66e657a-part1 -> ../../sdc1 lrwxrwxrwx. 1 root root 10 Mar 27 03:15 wwn-0x5001b444a66e657a-part2 -> ../../sdc2 lrwxrwxrwx. 1 root root 9 Mar 27 03:15 wwn-0x55cd2e414cbf9788 -> ../../sda lrwxrwxrwx. 1 root root 10 Mar 27 03:15 wwn-0x55cd2e414cbf9788-part1 -> ../../sda1 lrwxrwxrwx. 1 root root 10 Mar 27 03:15 wwn-0x55cd2e414cbf9788-part2 -> ../../sda2 /dev/disk/by-label: total 0 lrwxrwxrwx. 1 root root 11 Apr 17 14:23 Debian\x208.7.1\x20amd64\x201 -> ../../loop2 /dev/disk/by-partuuid: total 0 lrwxrwxrwx. 1 root root 10 Mar 27 03:15 00095041-01 -> ../../sda1 lrwxrwxrwx. 1 root root 10 Mar 27 03:15 00095041-02 -> ../../sda2 /dev/disk/by-path: total 0 lrwxrwxrwx. 1 root root 9 Mar 27 03:15 pci-0000:00:1f.2-ata-1 -> ../../sdb lrwxrwxrwx. 1 root root 10 Mar 27 03:15 pci-0000:00:1f.2-ata-1-part1 -> ../../sda1 lrwxrwxrwx. 1 root root 10 Mar 27 03:15 pci-0000:00:1f.2-ata-1-part2 -> ../../sda2 lrwxrwxrwx. 1 root root 9 Mar 27 03:15 pci-0000:00:1f.2-ata-2 -> ../../sdc lrwxrwxrwx. 1 root root 10 Mar 27 03:15 pci-0000:00:1f.2-ata-2-part1 -> ../../sdc1 lrwxrwxrwx. 1 root root 10 Mar 27 03:15 pci-0000:00:1f.2-ata-2-part2 -> ../../sdc2 /dev/disk/by-uuid: total 0 lrwxrwxrwx. 1 root root 9 Mar 27 03:15 1fc41a68-3a3b-4e02-ba0d-a26d80478336 -> ../../md0 lrwxrwxrwx. 1 root root 11 Apr 17 14:23 2017-01-16-11-01-01-00 -> ../../loop2 lrwxrwxrwx. 1 root root 11 Mar 27 03:15 3692132f-0122-46d5-ac32-d5cf0cfa28a8 -> ../../loop0 lrwxrwxrwx. 1 root root 10 Mar 27 03:15 caf5f13b-c48f-4d01-aa30-93d29be10c03 -> ../../sda2 /dev/md: total 0 lrwxrwxrwx. 1 root root 6 Mar 27 03:15 0 -> ../md0 Auto-generated on Mon, 17 Apr 2017 18:30:37 +1000 by mdadm bugscript
#860458#10
Date:
2023-02-25 14:58:46 UTC
From:
To:
retitle 860458 debconf question to disable initramfs integration
severity 860458 wishlist
thanks

Hi Russell,

thank you for reporting things - this has also bother me in "rescue
system" situations/use-cases. I'll add a debconf question to address
this in one of the next uploads.

Regards,
Daniel