You are not logged in.

#1 2022-09-16 15:17:06

domdit
Member
Registered: 2022-09-16
Posts: 5

[SOLVED] unable to assemble raid1, Module md_mod not in kernel

Hello,

I have a fresh install of Arch. I followed the install guide on the wiki and set up RAID1 on two drives during the install. While I was booting from the live-usb, I was able to see my raid array mounted to /dev/md0. Now that I am booting from ssd, raid is not mounted anymore.

$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 894.3G  0 disk
├─sda1   8:1    0   200M  0 part /boot
├─sda2   8:2    0    50G  0 part /
└─sda3   8:3    0 844.1G  0 part /home
sdb      8:16   0   3.6T  0 disk
sdc      8:32   0   3.6T  0 disk
sdd      8:48   1  28.8G  0 disk
├─sdd1   8:49   1   779M  0 part
└─sdd2   8:50   1    15M  0 part
$ sudo mdadm --examine /dev/sdb
/dev/sdb:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 6b1f8336:162657f5:f45067b9:9b19ade7
           Name : archiso:0
  Creation Time : Fri Sep  9 23:17:11 2022
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 7813772976 sectors (3.64 TiB 4.00 TB)
     Array Size : 3906886464 KiB (3.64 TiB 4.00 TB)
  Used Dev Size : 7813772928 sectors (3.64 TiB 4.00 TB)
    Data Offset : 264192 sectors
   Super Offset : 8 sectors
   Unused Space : before=264112 sectors, after=48 sectors
          State : clean
    Device UUID : 954f1528:dce0ce07:0510ba2a:1e4c169e

Internal Bitmap : 8 sectors from superblock
    Update Time : Sat Sep 10 08:12:52 2022
  Bad Block Log : 512 entries available at offset 24 sectors
       Checksum : 7b6081e9 - correct
         Events : 6510


   Device Role : Active device 0
   Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
$ sudo mdadm --examine /dev/sdc
/dev/sdc:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 6b1f8336:162657f5:f45067b9:9b19ade7
           Name : archiso:0
  Creation Time : Fri Sep  9 23:17:11 2022
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 7813772976 sectors (3.64 TiB 4.00 TB)
     Array Size : 3906886464 KiB (3.64 TiB 4.00 TB)
  Used Dev Size : 7813772928 sectors (3.64 TiB 4.00 TB)
    Data Offset : 264192 sectors
   Super Offset : 8 sectors
   Unused Space : before=264112 sectors, after=48 sectors
          State : clean
    Device UUID : 818cd097:4fd08948:d459a1a3:40660a03

Internal Bitmap : 8 sectors from superblock
    Update Time : Sat Sep 10 08:12:52 2022
  Bad Block Log : 512 entries available at offset 24 sectors
       Checksum : 9b2123b - correct
         Events : 6510


   Device Role : Active device 1
   Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
$ cat /etc/mdadm.conf
# mdadm configuration file
#
# mdadm will function properly without the use of a configuration file,
# but this file is useful for keeping track of arrays and member disks.
# In general, a mdadm.conf file is created, and updated, after arrays
# are created. This is the opposite behavior of /etc/raidtab which is
# created prior to array construction.
#
#
# the config file takes two types of lines:
#
#       DEVICE lines specify a list of devices of where to look for
#         potential member disks
#
#       ARRAY lines specify information about how to identify arrays so
#         so that they can be activated
#


# You can have more than one device line and use wild cards. The first
# example includes SCSI the first partition of SCSI disks /dev/sdb,
# /dev/sdc, /dev/sdd, /dev/sdj, /dev/sdk, and /dev/sdl. The second
# line looks for array slices on IDE disks.
#
#DEVICE /dev/sd[bcdjkl]1
#DEVICE /dev/hda1 /dev/hdb1
#
# The designation "partitions" will scan all partitions found in
# /proc/partitions
DEVICE partitions


# ARRAY lines specify an array to assemble and a method of identification.
# Arrays can currently be identified by using a UUID, superblock minor
number,
# or a listing of devices.
#
#       super-minor is usually the minor number of the metadevice
#       UUID is the Universally Unique Identifier for the array
# Each can be obtained using
#
#       mdadm -D <md>
#
# To capture the UUIDs for all your RAID arrays to this file, run these
:
#    to get a list of running arrays:
#    # mdadm -D --scan >>/etc/mdadm.conf
#    to get a list from superblocks:
#    # mdadm -E --scan >>/etc/mdadm.conf
#
#ARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371
#ARRAY /dev/md1 super-minor=1
#ARRAY /dev/md2 devices=/dev/hda1,/dev/hdb1
#
# ARRAY lines can also specify a "spare-group" for each array.  mdadm --monitor
# will then move a spare between arrays in a spare-group if one array has a
# failed drive but no spare
#ARRAY /dev/md4 uuid=b23f3c6d:aec43a9f:fd65db85:369432df spare-group=group1
#ARRAY /dev/md5 uuid=19464854:03f71b1b:e0df2edd:246cc977 spare-group=group1
#


# When used in --follow (aka --monitor) mode, mdadm needs a
# mail address and/or a program.  To start mdadm's monitor mode, enable
# mdadm.service in systemd.
#
# If the lines are not found, mdadm will exit quietly
#MAILADDR root@mydomain.tld
#PROGRAM /usr/sbin/handle-mdadm-events

When I try to assemble:

$ sudo mdadm --assemble /dev/md0 /dev/sdb /dev/sdc
modprobe: FATAL: Module md_mod not found in directory /lib/modules/5.19.7-arch1-1
mdadm: Fail to create md0 when using /sys/module/md_mod/parameters/new_array, fallback to creation via node
mdadm: unexpected failure opening /dev/md0

From some cursory research, it seems modprobe is not compiled into my current kernel. Is this actually the problem? If it is the problem, can I fix this without doing a new re-install of arch. If it is not the problem, then what is?

I hope I was able to provide sufficient background, but please let me know if I can provide something else

Thank you!!

Last edited by domdit (2022-09-16 17:22:10)

Offline

#2 2022-09-16 15:24:58

Zod
Member
From: Hoosiertucky
Registered: 2019-03-10
Posts: 636

Re: [SOLVED] unable to assemble raid1, Module md_mod not in kernel

https://wiki.archlinux.org/title/RAID#C … mkinitcpio

Don't know nothing about no raid but it sounds like this might be your problem.

Offline

#3 2022-09-16 15:26:06

domdit
Member
Registered: 2022-09-16
Posts: 5

Re: [SOLVED] unable to assemble raid1, Module md_mod not in kernel

Zod wrote:

https://wiki.archlinux.org/title/RAID#C … mkinitcpio

Don't know nothing about no raid but it sounds like this might be your problem.

I also don't know nothing about no raid but thank you for the link. I am going to try this right now.

Offline

#4 2022-09-16 16:40:19

frostschutz
Member
Registered: 2013-11-15
Posts: 1,647

Re: [SOLVED] unable to assemble raid1, Module md_mod not in kernel

Is there a /lib/modules/5.19.7-arch1-1 at all?

If you just updated to linux-5.19.8 but have not rebooted yet, pacman probably removed the modules of the current running kernel, and any module not loaded yet... too bad. It would be nice if pacman cleaned out modules only after rebooting, but it is what it is.

Or something else went wrong with the kernel update and you're booting the wrong kernel.

Unrelated to the module loading issue:

Your mdadm.conf does not define any arrays, add one like so (just the UUID is sufficient)

ARRAY /dev/md0 UUID=d8b8b4e5:e47b2e45:2093cd36:f654020d

You are using whole unpartitioned drives for your array. In that case you have to make sure that nothing (like Windows, gparted, some installer, etc.) ever creates a partition table on these, as doing so would overwrite your mdadm metadata and you lose access to your data until you restore it with the correct data offset...

Last edited by frostschutz (2022-09-16 16:45:55)

Offline

#5 2022-09-16 16:44:30

domdit
Member
Registered: 2022-09-16
Posts: 5

Re: [SOLVED] unable to assemble raid1, Module md_mod not in kernel

frostschutz wrote:

Is there a /lib/modules/5.19.7-arch1-1 at all?

If you just updated to linux-5.19.8 but have not rebooted yet, pacman probably removed the modules of the current running kernel, and any module not loaded yet... too bad. It would be nice if pacman cleaned out modules only after rebooting, but it is what it is.

Or something else went wrong with the kernel update and you're booting the wrong kernel.

I am just figuring this out realtime as I got your message haha. So I did update mkinitcpio.conf as suggested above, I created a new initrams-custom.img after rebooting (because I did run pacman -Syu) and now I am here:

[dominic@quailnest ~]$ sudo mdadm --assemble /dev/md0 /dev/sdb /dev/sdc
mdadm: /dev/sdb is busy - skipping
mdadm: /dev/sdc is busy - skipping
[dominic@quailnest ~]$ lsblk
NAME    MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda       8:0    0 894.3G  0 disk
ââsda1    8:1    0   200M  0 part  /boot
ââsda2    8:2    0    50G  0 part  /
ââsda3    8:3    0 844.1G  0 part  /home
sdb       8:16   0   3.6T  0 disk
ââmd127   9:127  0   3.6T  0 raid1
sdc       8:32   0   3.6T  0 disk
ââmd127   9:127  0   3.6T  0 raid1
sdd       8:48   1  28.8G  0 disk
ââsdd1    8:49   1   779M  0 part
ââsdd2    8:50   1    15M  0 part

not sure why I am getting weird ââ all of a sudden (would appreciate if someone could help me fix that haha). also do not know why my drives are busy, but have not actually done any research on it.

My big question now is: Will everything that I just did remain in affect? Do I need to update something with systemd to make sure steps are taken on every boot

Offline

#6 2022-09-16 16:47:14

frostschutz
Member
Registered: 2013-11-15
Posts: 1,647

Re: [SOLVED] unable to assemble raid1, Module md_mod not in kernel

Your array got auto assembled as md127 there, that's why you can't assemble it again as md0 (busy)

If you want auto assemble as md0, you have to define it as such in your mdadm.conf - or disable auto assembly altogether and do it manually every time

Offline

#7 2022-09-16 16:49:22

domdit
Member
Registered: 2022-09-16
Posts: 5

Re: [SOLVED] unable to assemble raid1, Module md_mod not in kernel

frostschutz wrote:

Your array got auto assembled as md127 there, that's why you can't assemble it again as md0 (busy)

If you want auto assemble as md0, you have to define it as such in your mdadm.conf - or disable auto assembly altogether and do it manually every time

You are clearly the best because you already answered this here: https://bbs.archlinux.org/viewtopic.php?id=193302

I just found the thread. Thank you, I am going to see if I can get it working then mark this solved.

Offline

#8 2022-09-16 17:21:08

domdit
Member
Registered: 2022-09-16
Posts: 5

Re: [SOLVED] unable to assemble raid1, Module md_mod not in kernel

documenting my steps:

1. reboot

2. follow docs here: https://wiki.archlinux.org/title/RAID#C … mkinitcpio

3. lsblk, check if drives are assembled at /dev/md0, if assembled somewhere else, mdadm --stop /dev/md###

3. mdadm --assemble <target> <drives>

4. mkfs on md0

5. mount md0

6. I followed this: https://superuser.com/questions/287462/ … -each-boot

7. then add md0 to fstab

rebooted and it works!!! thanks all

Offline

Board footer

Powered by FluxBB