You are not logged in.

#1 2020-01-10 20:13:10

Iriomote
Member
Registered: 2013-11-10
Posts: 29

[SOLVED] Cannot convert from RAID 5 to RAID 6

I have a NAS in which I set up a RAID 5 with a Journal.

Today I tried adding an extra drive so I could convert to RAID 6 like described here.

I was able to add the extra drive and it was recognized as a spare.
So the RAID is as follows:

root@archnas ~# mdadm --detail /dev/md0
/dev/md0:
           Version : 1.2
     Creation Time : Thu May 23 17:36:39 2019
        Raid Level : raid5
        Array Size : 7813871616 (7451.89 GiB 8001.40 GB)
     Used Dev Size : 3906935808 (3725.94 GiB 4000.70 GB)
      Raid Devices : 3
     Total Devices : 5
       Persistence : Superblock is persistent

       Update Time : Fri Jan 10 20:13:12 2020
             State : clean 
    Active Devices : 3
   Working Devices : 5
    Failed Devices : 0
     Spare Devices : 1

            Layout : left-symmetric                                  )
        Chunk Size : 256K

Consistency Policy : journal

              Name : any:dataraid
              UUID : 96fe77fb:b761a770:ad6c1452:2129f2b5
            Events : 10981

    Number   Major   Minor   RaidDevice State
       1       8       17        0      active sync   /dev/sdb1
       4       8       49        1      active sync   /dev/sdd1
       3       8       65        2      active sync   /dev/sde1

       0       8        4        -      journal   /dev/sda4
       5       8       33        -      spare   /dev/sdc1

But when I try to convert it to RAID 6 it just gives me this:

root@arschinas ~# mdadm --grow /dev/md0 --level=6 --raid-devices=4 --backup-file=/root/raid5backup --verbose
mdadm: level of /dev/md0 changed to raid6
mdadm: Cannot set device shape for /dev/md0
mdadm: aborting level change

dmesg says this:

[ 4505.812321] md/raid:md0: device sdd1 operational as raid disk 1
[ 4505.812325] md/raid:md0: device sde1 operational as raid disk 2
[ 4505.812327] md/raid:md0: device sdb1 operational as raid disk 0
[ 4505.848930] ------------[ cut here ]------------
[ 4505.848943] WARNING: CPU: 3 PID: 2531 at kernel/kthread.c:510 kthread_park+0x77/0x90
[ 4505.848945] Modules linked in: iptable_mangle iptable_raw xt_connmark nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 xt_mark ip6table_mangle xt_comment xt_addrtype ip6table_raw ip6_tables wireguard(OE) ip6_udp_tunnel udp_tunnel nct6775 hwmon_vid nls_iso8859_1 nls_cp437 vfat fat snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx intel_telemetry_pltdrv intel_punit_ipc intel_telemetry_core intel_pmc_ipc snd_sof_pci xor snd_sof_intel_byt snd_sof_intel_ipc snd_sof_xtensa_dsp snd_sof_intel_hda_common snd_soc_hdac_hda snd_sof_intel_hda snd_sof snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi x86_pkg_temp_thermal i915 intel_powerclamp snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel coretemp snd_intel_nhlt kvm_intel snd_hda_codec snd_hda_core i2c_algo_bit drm_kms_helper kvm input_leds raid6_pq snd_hwdep mei_hdcp libcrc32c intel_rapl_msr snd_pcm irqbypass drm md_mod intel_cstate
[ 4505.849020]  snd_timer intel_rapl_perf snd r8169 wdat_wdt intel_gtt pcspkr agpgart hid_generic i2c_i801 mei_me realtek syscopyarea libphy sysfillrect soundcore processor_thermal_device sysimgblt fb_sys_fops mei intel_rapl_common intel_soc_dts_iosf evdev mac_hid int3400_thermal int3403_thermal acpi_thermal_rel int340x_thermal_zone dptf_power int3406_thermal ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 dm_crypt dm_mod uas usb_storage sd_mod usbhid hid crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel ahci crypto_simd libahci cryptd xhci_pci glue_helper xhci_hcd libata scsi_mod
[ 4505.849076] CPU: 3 PID: 2531 Comm: mdadm Tainted: G           OE     5.4.10-arch1-1 #1
[ 4505.849079] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4105-ITX, BIOS P1.40 08/06/2018
[ 4505.849083] RIP: 0010:kthread_park+0x77/0x90
[ 4505.849087] Code: 00 48 89 ef e8 9a f4 00 00 48 85 c0 74 25 31 c0 5b 5d c3 0f 0b 48 8b 9d e0 05 00 00 a8 04 74 b2 0f 0b b8 da ff ff ff 5b 5d c3 <0f> 0b b8 f0 ff ff ff eb dd 0f 0b eb d9 66 66 2e 0f 1f 84 00 00 00
[ 4505.849089] RSP: 0018:ffffaaf6c5febd30 EFLAGS: 00010202
[ 4505.849092] RAX: 0000000000000004 RBX: ffff9325322c6360 RCX: 0000000000000000
[ 4505.849094] RDX: 0000000000000001 RSI: 0000000000000246 RDI: ffff932531c70000
[ 4505.849096] RBP: ffff932531c70000 R08: 0000000000000000 R09: ffffaaf6c5febce0
[ 4505.849099] R10: ffff932537ba97e0 R11: ffffffffffd08a68 R12: ffff932532cbf000
[ 4505.849101] R13: ffff932532cbf31c R14: ffff932532cbf028 R15: ffff93253317c280
[ 4505.849104] FS:  00007f7a1a89b740(0000) GS:ffff932537b80000(0000) knlGS:0000000000000000
[ 4505.849106] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 4505.849109] CR2: 0000560117173bc8 CR3: 000000026fd20000 CR4: 0000000000340ee0
[ 4505.849111] Call Trace:
[ 4505.849134]  r5l_quiesce+0x3c/0x70 [raid456]
[ 4505.849145]  raid5_quiesce+0x228/0x2e0 [raid456]
[ 4505.849165]  mddev_detach+0x30/0x70 [md_mod]
[ 4505.849180]  level_store+0x202/0x670 [md_mod]
[ 4505.849189]  ? security_capable+0x40/0x60
[ 4505.849203]  md_attr_store+0x7b/0xc0 [md_mod]
[ 4505.849210]  kernfs_fop_write+0xce/0x1b0
[ 4505.849218]  vfs_write+0xb6/0x1a0
[ 4505.849224]  ksys_write+0x67/0xe0
[ 4505.849232]  do_syscall_64+0x4e/0x140
[ 4505.849240]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 4505.849245] RIP: 0033:0x7f7a1a98e497
[ 4505.849249] Code: 64 89 02 48 c7 c0 ff ff ff ff eb bb 0f 1f 80 00 00 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24
[ 4505.849251] RSP: 002b:00007ffe4c96b398 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[ 4505.849255] RAX: ffffffffffffffda RBX: 00005636e158f735 RCX: 00007f7a1a98e497
[ 4505.849257] RDX: 0000000000000005 RSI: 00005636e158f735 RDI: 0000000000000004
[ 4505.849259] RBP: 0000000000000004 R08: 00000000ffffffff R09: 00007ffe4c96b220
[ 4505.849260] R10: 0000000000000000 R11: 0000000000000246 R12: 00005636e158f735
[ 4505.849262] R13: 00007ffe4c96bef0 R14: 00007ffe4c96b480 R15: 0000000000000003
[ 4505.849270] ---[ end trace 54890de769bec9d9 ]---
[ 4505.942283] md/raid:md0: raid level 6 active with 3 out of 4 devices, algorithm 18
[ 4506.381164] md/raid:md0: device sdd1 operational as raid disk 1
[ 4506.381168] md/raid:md0: device sde1 operational as raid disk 2
[ 4506.381169] md/raid:md0: device sdb1 operational as raid disk 0
[ 4506.502364] md/raid:md0: raid level 5 active with 3 out of 3 devices, algorithm 2

The new drive is definitely good. I was able to put a filesystem on it, mount it and read/write to it.

The documentation for changing the RAID level says you should remove the write-intend-bitmap. But I have a journal which is different. I could not find any documentation on how to temporally remove a journal. The documentation on journals in RAID seems to be sparse.

Last edited by Iriomote (2020-01-13 20:01:02)

Offline

#2 2020-01-13 19:59:33

Iriomote
Member
Registered: 2013-11-10
Posts: 29

Re: [SOLVED] Cannot convert from RAID 5 to RAID 6

I was able to find a workaround for my problem.

First I failed the journaling device:

mdadm --manage /dev/md0 --fail /dev/sda4 --remove /dev/sda4

Then I could grow my RAID 5 into a RAID 6 with

mdadm --grow /dev/md0 --level 6 --raid-devices 4

Then I added the journaling device back in:

mdadm --manage /dev/md0 --add-journal /dev/sda4

After that, the degraded RAID 6 started to recover. It took over 10 hours but it worked.

Offline

Board footer

Powered by FluxBB