Welcome to the Linux Foundation Forum!
Lab 17.1 Creating Software Raid - mdadm: RUN_ARRAY failed: Invalid argument
ultraninja
Posts: 20
I'm using the LFS Ubuntu 14.1 lab VM.
Basically, I added an additional 1GB virtual drive to the VM in Virtualbox. Partitioned it with fdisk.
pvcreate /dev/sdb1
vgcreate VG /dev/sdb1
lvcreate -L 200M -n MD1 VG
lvcreate -L 200M -n MD2 VG
root@ubuntu:/home/student# lvdisplay
--- Logical volume ---
LV Path /dev/VG/MD1
LV Name MD1
VG Name VG
LV UUID BVR2X8-jltC-MCSd-WulR-2IXQ-uc7c-6SEjvr
LV Write Access read/write
LV Creation host, time ubuntu, 2015-12-28 15:16:00 -0600
LV Status available
# open 0
LV Size 200.00 MiB
Current LE 50
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:0
--- Logical volume ---
LV Path /dev/VG/MD2
LV Name MD2
VG Name VG
LV UUID A8P9JO-RKwK-XlUB-Ifw7-mrtI-yfFO-zV3lQY
LV Write Access read/write
LV Creation host, time ubuntu, 2015-12-28 15:16:03 -0600
LV Status available
# open 0
LV Size 200.00 MiB
Current LE 50
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:1
root@ubuntu:/home/student# mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 /dev/VG/MD1 /dev/VG/MD2
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store '/boot' on this device please ensure that
your boot-loader understands md/v1.x metadata, or use
--metadata=0.90
mdadm: size set to 204608K
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: RUN_ARRAY failed: Invalid argument
root@ubuntu:/home/student# cat /proc/mdstat
Personalities :
unused devices: <none>
--- Logical volume ---
LV Path /dev/VG/MD1
LV Name MD1
VG Name VG
LV UUID BVR2X8-jltC-MCSd-WulR-2IXQ-uc7c-6SEjvr
LV Write Access read/write
LV Creation host, time ubuntu, 2015-12-28 15:16:00 -0600
LV Status available
# open 0
LV Size 200.00 MiB
Current LE 50
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:0
--- Logical volume ---
LV Path /dev/VG/MD2
LV Name MD2
VG Name VG
LV UUID A8P9JO-RKwK-XlUB-Ifw7-mrtI-yfFO-zV3lQY
LV Write Access read/write
LV Creation host, time ubuntu, 2015-12-28 15:16:03 -0600
LV Status available
# open 0
LV Size 200.00 MiB
Current LE 50
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:1
root@ubuntu:/home/student# mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 /dev/VG/MD1 /dev/VG/MD2
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store '/boot' on this device please ensure that
your boot-loader understands md/v1.x metadata, or use
--metadata=0.90
mdadm: size set to 204608K
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: RUN_ARRAY failed: Invalid argument
root@ubuntu:/home/student# cat /proc/mdstat
Personalities :
unused devices: <none>
I've also tried adding 2x 1GB virtual disks in Virtualbox, then trying to create a raid array with those 2 disks. Same error "mdadm: RUN_ARRAY failed: Invalid argument"
After battling with this for a few hours, reading man pages, and googling, I'm still getting the error.
0
Comments
-
What kernel are you running? If you are running the custom kernel on the LF VM,
it is likely not configured for RAID properly; it is intended for *this course* that you use the stock distro kernel. (the custom kernels are for use in kernel devel courses)
Check uname -r ; if it is reporting 4.3.0 or whatever, you are probably toast.
If you are using the Ubuntu stock kernel (choose at boot time) you should be ok.
Check if CONFIG_MD_RAID* is set (look at /boot/config*)
If this is not the problem, let us know/0 -
Thanks for the reply. Yup, it was the kernel. I just installed the generic kernel from the repositories. I have 2 remaining questions:
1) How can I check if RAID is supported in a booted kernel?root@ubuntu:/boot# grep RAID config-`uname -r` CONFIG_RAID_ATTRS=m CONFIG_BLK_DEV_3W_XXXX_RAID=m CONFIG_SCSI_AACRAID=m CONFIG_MEGARAID_NEWGEN=y CONFIG_MEGARAID_MM=m CONFIG_MEGARAID_MAILBOX=m CONFIG_MEGARAID_LEGACY=m CONFIG_MEGARAID_SAS=m CONFIG_SCSI_PMCRAID=m CONFIG_MD_RAID0=m CONFIG_MD_RAID1=m CONFIG_MD_RAID10=m CONFIG_MD_RAID456=m CONFIG_DM_RAID=m CONFIG_DMA_ENGINE_RAID=y CONFIG_ASYNC_RAID6_TEST=m CONFIG_ASYNC_RAID6_RECOV=m CONFIG_RAID6_PQ=m root@ubuntu:/boot# grep RAID config-4.2.0 # CONFIG_RAID_ATTRS is not set # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_AACRAID is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set # CONFIG_MEGARAID_SAS is not set # CONFIG_SCSI_PMCRAID is not set # CONFIG_MD_RAID0 is not set # CONFIG_MD_RAID1 is not set # CONFIG_MD_RAID10 is not set # CONFIG_MD_RAID456 is not set # CONFIG_DM_RAID is not set CONFIG_RAID6_PQ=m
I'm assuming the "is not set" values indicate the kernel wasn't compiled with RAID support on the 4.2 kernel. Oh, and the # commented out RAID lines.
2) I created the raid array with mdadm --create /dev/md0 --level=1 --raid-disks=2 /dev/sda3 /dev/sda4 yet when I check the array it's actually /dev/md127. I'm not sure why its md127 rather than md0. Maybe my mdadm.conf isn't correct.student@ubuntu:~$ sudo fdisk -l Disk /dev/sda: 42.9 GB, 42949672960 bytes 255 heads, 63 sectors/track, 5221 cylinders, total 83886080 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000045d1 Device Boot Start End Blocks Id System /dev/sda1 * 2048 37750783 18874368 83 Linux /dev/sda2 37752830 41940991 2094081 5 Extended /dev/sda3 41940992 42350591 204800 83 Linux /dev/sda4 42350592 42760191 204800 83 Linux /dev/sda5 37752832 41940991 2094080 82 Linux swap / Solaris Disk /dev/md127: 209 MB, 209518592 bytes 2 heads, 4 sectors/track, 51152 cylinders, total 409216 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/md127 doesn't contain a valid partition table root@ubuntu:/home/student# cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md127 : active (auto-read-only) raid1 sda3[0] sda4[1] 204608 blocks super 1.2 [2/2] [UU] unused devices: <none>
Thanks for the help0 -
Hi,
You can check if the md support is included in the kernel config file. So just do:
grep _MD_ /boot/config-`uname -r`
It uses to be included as modules.
Happy new year!
Luis.0 -
The reason I was getting /dev/md127 rather than /dev/md0:
Ubuntu Forums - RAID starting at md127 instead of md0
1: mdadm.conf needed to be edited to remove the --name directive.
For example:ARRAY /dev/md0 UUID=e4665ceb:15f8e4b6:b186d497:7d365254
2: You need to update initramfs so it contains your mdadm.conf settings during boot.sudo update-initramfs -u
Looks good now:root@LFS-VirtualBox:~# mdadm --detail /dev/md0 /dev/md0: Version : 1.2 Creation Time : Thu Jan 21 14:27:14 2016 Raid Level : raid1 Array Size : 204608 (199.85 MiB 209.52 MB) Used Dev Size : 204608 (199.85 MiB 209.52 MB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent Update Time : Thu Jan 21 15:32:57 2016 State : clean Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 Name : LFS-VirtualBox:0 (local to host LFS-VirtualBox) UUID : 8b25d1ce:4b396710:01d76fec:b0ba507d Events : 32 Number Major Minor RaidDevice State 0 8 17 0 active sync /dev/sdb1 1 8 18 1 active sync /dev/sdb2 root@LFS-VirtualBox:~# cat /proc/mdstat Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] md0 : active raid1 sdb2[1] sdb1[0] 204608 blocks super 1.2 [2/2] [UU] unused devices: <none>0 -
I'm glad to know that you solved it!
Regards,
Luis.0
Categories
- All Categories
- 164 LFX Mentorship
- 164 LFX Mentorship: Linux Kernel
- 726 Linux Foundation IT Professional Programs
- 368 Cloud Engineer IT Professional Program
- 162 Advanced Cloud Engineer IT Professional Program
- 69 DevOps IT Professional Program - Discontinued
- 2 DevOps & GitOps IT Professional Program
- 94 Cloud Native Developer IT Professional Program
- 33 Express Training Courses & Microlearning
- 31 Express Courses - Discussion Forum
- 2 Microlearning - Discussion Forum
- 7.4K Training Courses
- 25 LFC110 Class Forum - Discontinued
- 15 LFC131 Class Forum - DISCONTINUED
- 54 LFD102 Class Forum
- 254 LFD103 Class Forum
- 1 LFD103-JP クラス フォーラム
- 17 LFD110 Class Forum
- LFD114 Class Forum
- 54 LFD121 Class Forum
- 3 LFD123 Class Forum
- 2 LFD125 Class Forum
- 3 LFD133 Class Forum
- 4 LFD134 Class Forum
- 4 LFD137 Class Forum
- 1 LFD140 Class Forum
- 66 LFD201 Class Forum
- 7 LFD210 Class Forum
- 3 LFD210-CN Class Forum
- 1 LFD213 Class Forum - Discontinued
- 1 LFD221 Class Forum
- 127 LFD232 Class Forum - Discontinued
- 2 LFD233 Class Forum - Discontinued
- 4 LFD237 Class Forum
- 24 LFD254 Class Forum
- 759 LFD259 Class Forum
- 110 LFD272 Class Forum - Discontinued
- 2 LFD272-JP クラス フォーラム - Discontinued
- 22 LFD273 Class Forum
- 660 LFS101 Class Forum
- 4 LFS111 Class Forum - Discontinued
- 2 LFS112 Class Forum
- LFS114 Class Forum
- 4 LFS116 Class Forum
- 6 LFS118 Class Forum
- 2 LFS120 Class Forum
- 1 LFS140 Class Forum
- 11 LFS142 Class Forum
- 9 LFS144 Class Forum
- 5 LFS145 Class Forum
- 6 LFS146 Class Forum
- 7 LFS147 Class Forum
- 26 LFS148 Class Forum
- 22 LFS151 Class Forum - Discontinued
- 4 LFS157 Class Forum
- 167 LFS158 Class Forum
- 1 LFS158-JP クラス フォーラム
- 17 LFS162 Class Forum
- 1 LFS166 Class Forum - Discontinued
- 8 LFS167 Class Forum
- 4 LFS170 Class Forum
- 1 LFS171 Class Forum - Discontinued
- 3 LFS178 Class Forum - Discontinued
- 3 LFS180 Class Forum
- 2 LFS182 Class Forum
- 6 LFS183 Class Forum
- 2 LFS184 Class Forum
- 42 LFS200 Class Forum
- 736 LFS201 Class Forum - Discontinued
- 2 LFS201-JP クラス フォーラム - Discontinued
- 23 LFS203 Class Forum
- 151 LFS207 Class Forum
- 2 LFS207-DE-Klassenforum
- 3 LFS207-JP クラス フォーラム
- 301 LFS211 Class Forum - Discontinued
- 55 LFS216 Class Forum - Discontinued
- 60 LFS241 Class Forum
- 51 LFS242 Class Forum
- 41 LFS243 Class Forum
- 18 LFS244 Class Forum
- 8 LFS245 Class Forum
- 1 LFS246 Class Forum
- 1 LFS248 Class Forum
- 165 LFS250 Class Forum
- 3 LFS250-JP クラス フォーラム
- 2 LFS251 Class Forum - Discontinued
- 164 LFS253 Class Forum
- 1 LFS254 Class Forum - Discontinued
- 3 LFS255 Class Forum
- 18 LFS256 Class Forum
- 2 LFS257 Class Forum
- 1.4K LFS258 Class Forum
- 12 LFS258-JP クラス フォーラム
- 149 LFS260 Class Forum
- 164 LFS261 Class Forum
- 45 LFS262 Class Forum
- 82 LFS263 Class Forum - Discontinued
- 15 LFS264 Class Forum - Discontinued
- 11 LFS266 Class Forum - Discontinued
- 25 LFS267 Class Forum
- 27 LFS268 Class Forum
- 38 LFS269 Class Forum
- 10 LFS270 Class Forum
- 202 LFS272 Class Forum - Discontinued
- 2 LFS272-JP クラス フォーラム - Discontinued
- 1 LFS274 Class Forum - Discontinued
- 4 LFS281 Class Forum - Discontinued
- 32 LFW111 Class Forum
- 265 LFW211 Class Forum - Discontinued
- 190 LFW212 Class Forum - Discontinued
- 18 SKF100 Class Forum
- 2 SKF200 Class Forum
- 3 SKF201 Class Forum
- 789 Hardware
- 202 Drivers
- 68 I/O Devices
- 37 Monitors
- 95 Multimedia
- 173 Networking
- 89 Printers & Scanners
- 86 Storage
- 764 Linux Distributions
- 81 Debian
- 67 Fedora
- 20 Linux Mint
- 13 Mageia
- 23 openSUSE
- 150 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 355 Ubuntu
- 460 Linux System Administration
- 31 Cloud Computing
- 72 Command Line/Scripting
- Github systems admin projects
- 95 Linux Security
- 78 Network Management
- 100 System Management
- 46 Web Management
- 70 Mobile Computing
- 18 Android
- 39 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 381 Off Topic
- 117 Introductions
- 174 Small Talk
- 29 Study Material
- 735 Programming and Development
- 309 Kernel Development
- 408 Software Development
- 898 Software
- 291 Applications
- 182 Command Line
- 5 Compiling/Installing
- 68 Games
- 316 Installation
- 62 All In Program
- 62 All In Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)
