Add linux md raid write journal to and existing arrayShould I use `mdadm --create` to recover my RAID?How to...

*p++->str : Understanding evaluation of ->

Wings for orbital transfer bioships?

Why am I getting an electric shock from the water in my hot tub?

Aligning arrays within arrays within another array

2019 2-letters 33-length list

Find the closest three-digit hex colour

usage of y" not just for locations?

Merging two data frames into a new one with unique items marked with 1 or 0

When does it become illegal to exchange bitcoin for cash?

Is it OK to say "The situation is pregnant with a crisis"?

Is it theoretically possible to hack printer using scanner tray?

What caused the flashes in the video footage of Chernobyl?

Old story where computer expert digitally animates The Lord of the Rings

What was the ASCII end of medium (EM) character intended to be used for?

What could a Medieval society do with excess animal blood?

What prevents a US state from colonizing a smaller state?

Cannot overlay, because ListPlot does not draw same X range despite the same PlotRange

Why did the Middle Kingdom stop building pyramid tombs?

How soon after takeoff can you recline your airplane seat?

My mom helped me cosign a car and now she wants to take it

Does the Grothendieck group of finitely generated modules form a commutative ring where the multiplication structure is induced from tensor product?

How can solar sailed ships be protected from space debris?

Why is quantum gravity non-renormalizable?

Russian equivalents of 能骗就骗 (if you can cheat, then cheat)



Add linux md raid write journal to and existing array


Should I use `mdadm --create` to recover my RAID?How to recover a crashed Linux md RAID5 array?Issue with degraded raid5 after power outagemdadm; previously working; after “failure”, cannot join array due to disk sizeReassemble mdadm-raid5RAID Array gone to read-onlymdadm root partition raid 1 fails intermittentlyRecover RAID5 array after partitions deleted'mdadm: RUN_ARRAY failed: Invalid argument' when creating RAID0need to rebuild mdadm raid5rebuilding mdadm raid5













1















I have a raid5 array with quite large disks, so reconstruction is really slow in case of a power outage. Thankfully, there is the --write-journal option for linux md raid. The man page lists the --write-journal option in the For create, build, or grow: section, so I supposed it should work in grow mode, and tried to add a write journal on the fly:



# mdadm --grow /dev/md1 --write-journal /dev/ssd/md1-journal
mdadm: :option --write-journal not valid in grow mode


Does anyone know whether I can add a write journal to an existing array? And if so, how?










share|improve this question



























    1















    I have a raid5 array with quite large disks, so reconstruction is really slow in case of a power outage. Thankfully, there is the --write-journal option for linux md raid. The man page lists the --write-journal option in the For create, build, or grow: section, so I supposed it should work in grow mode, and tried to add a write journal on the fly:



    # mdadm --grow /dev/md1 --write-journal /dev/ssd/md1-journal
    mdadm: :option --write-journal not valid in grow mode


    Does anyone know whether I can add a write journal to an existing array? And if so, how?










    share|improve this question

























      1












      1








      1








      I have a raid5 array with quite large disks, so reconstruction is really slow in case of a power outage. Thankfully, there is the --write-journal option for linux md raid. The man page lists the --write-journal option in the For create, build, or grow: section, so I supposed it should work in grow mode, and tried to add a write journal on the fly:



      # mdadm --grow /dev/md1 --write-journal /dev/ssd/md1-journal
      mdadm: :option --write-journal not valid in grow mode


      Does anyone know whether I can add a write journal to an existing array? And if so, how?










      share|improve this question














      I have a raid5 array with quite large disks, so reconstruction is really slow in case of a power outage. Thankfully, there is the --write-journal option for linux md raid. The man page lists the --write-journal option in the For create, build, or grow: section, so I supposed it should work in grow mode, and tried to add a write journal on the fly:



      # mdadm --grow /dev/md1 --write-journal /dev/ssd/md1-journal
      mdadm: :option --write-journal not valid in grow mode


      Does anyone know whether I can add a write journal to an existing array? And if so, how?







      linux mdadm software-raid raid5






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 17 '18 at 9:07









      P.PéterP.Péter

      2751 silver badge9 bronze badges




      2751 silver badge9 bronze badges






















          2 Answers
          2






          active

          oldest

          votes


















          3














          It kind of should work like this:



          # mdadm --manage /dev/md42 --readonly --add-journal /dev/loop3
          mdadm: Journal added successfully, making /dev/md42 read-write
          mdadm: added /dev/loop3


          However, currently (using kernel 4.18, mdadm 4.1-rc) that only seems to be possible for arrays that were created with journal in the first place. The above output was procuded after:



          # mdadm --create /dev/md42 --level=5 --raid-devices=3 /dev/loop[012] --write-journal /dev/loop3
          mdadm: Defaulting to version 1.2 metadata
          mdadm: array /dev/md42 started.
          # mdadm --manage /dev/md42 --fail /dev/loop3 --remove /dev/loop3
          mdadm: set /dev/loop3 faulty in /dev/md42
          mdadm: hot removed /dev/loop3 from /dev/md42


          Creating an array without journal, all attempts to add a journal fail:



          # mdadm --create /dev/md42 --level=5 --raid-devices=3 /dev/loop[012]
          mdadm: Defaulting to version 1.2 metadata
          mdadm: array /dev/md42 started.
          # mdadm --manage /dev/md42 --readonly --add-journal /dev/loop3
          mdadm: /dev/md42 does not support journal device.
          # mdadm --manage /dev/md42 --readwrite --add /dev/loop3
          # echo journal > /sys/block/md42/md/dev-loop3/state
          bash: echo: write error: Invalid argument


          So it just doesn't seem to be possible yet.



          I have found a discussion on the linux-raid mailing list that this is a planned feature. If it has been implemented since, I don't see how. Perhaps contact the mailing list yourself to remind mdadm devs there are people who want this to work!



          You might have to resort to mdadm --create to re-create the raid or edit metadata of the array. Either option is a bit dangerous.






          share|improve this answer































            0














            This PDF states it is possible: https://events.static.linuxfound.org/sites/events/files/slides/2016_vault_write_journal_cache_v2.pdf



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






            share|improve this answer


























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "106"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475987%2fadd-linux-md-raid-write-journal-to-and-existing-array%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              3














              It kind of should work like this:



              # mdadm --manage /dev/md42 --readonly --add-journal /dev/loop3
              mdadm: Journal added successfully, making /dev/md42 read-write
              mdadm: added /dev/loop3


              However, currently (using kernel 4.18, mdadm 4.1-rc) that only seems to be possible for arrays that were created with journal in the first place. The above output was procuded after:



              # mdadm --create /dev/md42 --level=5 --raid-devices=3 /dev/loop[012] --write-journal /dev/loop3
              mdadm: Defaulting to version 1.2 metadata
              mdadm: array /dev/md42 started.
              # mdadm --manage /dev/md42 --fail /dev/loop3 --remove /dev/loop3
              mdadm: set /dev/loop3 faulty in /dev/md42
              mdadm: hot removed /dev/loop3 from /dev/md42


              Creating an array without journal, all attempts to add a journal fail:



              # mdadm --create /dev/md42 --level=5 --raid-devices=3 /dev/loop[012]
              mdadm: Defaulting to version 1.2 metadata
              mdadm: array /dev/md42 started.
              # mdadm --manage /dev/md42 --readonly --add-journal /dev/loop3
              mdadm: /dev/md42 does not support journal device.
              # mdadm --manage /dev/md42 --readwrite --add /dev/loop3
              # echo journal > /sys/block/md42/md/dev-loop3/state
              bash: echo: write error: Invalid argument


              So it just doesn't seem to be possible yet.



              I have found a discussion on the linux-raid mailing list that this is a planned feature. If it has been implemented since, I don't see how. Perhaps contact the mailing list yourself to remind mdadm devs there are people who want this to work!



              You might have to resort to mdadm --create to re-create the raid or edit metadata of the array. Either option is a bit dangerous.






              share|improve this answer




























                3














                It kind of should work like this:



                # mdadm --manage /dev/md42 --readonly --add-journal /dev/loop3
                mdadm: Journal added successfully, making /dev/md42 read-write
                mdadm: added /dev/loop3


                However, currently (using kernel 4.18, mdadm 4.1-rc) that only seems to be possible for arrays that were created with journal in the first place. The above output was procuded after:



                # mdadm --create /dev/md42 --level=5 --raid-devices=3 /dev/loop[012] --write-journal /dev/loop3
                mdadm: Defaulting to version 1.2 metadata
                mdadm: array /dev/md42 started.
                # mdadm --manage /dev/md42 --fail /dev/loop3 --remove /dev/loop3
                mdadm: set /dev/loop3 faulty in /dev/md42
                mdadm: hot removed /dev/loop3 from /dev/md42


                Creating an array without journal, all attempts to add a journal fail:



                # mdadm --create /dev/md42 --level=5 --raid-devices=3 /dev/loop[012]
                mdadm: Defaulting to version 1.2 metadata
                mdadm: array /dev/md42 started.
                # mdadm --manage /dev/md42 --readonly --add-journal /dev/loop3
                mdadm: /dev/md42 does not support journal device.
                # mdadm --manage /dev/md42 --readwrite --add /dev/loop3
                # echo journal > /sys/block/md42/md/dev-loop3/state
                bash: echo: write error: Invalid argument


                So it just doesn't seem to be possible yet.



                I have found a discussion on the linux-raid mailing list that this is a planned feature. If it has been implemented since, I don't see how. Perhaps contact the mailing list yourself to remind mdadm devs there are people who want this to work!



                You might have to resort to mdadm --create to re-create the raid or edit metadata of the array. Either option is a bit dangerous.






                share|improve this answer


























                  3












                  3








                  3







                  It kind of should work like this:



                  # mdadm --manage /dev/md42 --readonly --add-journal /dev/loop3
                  mdadm: Journal added successfully, making /dev/md42 read-write
                  mdadm: added /dev/loop3


                  However, currently (using kernel 4.18, mdadm 4.1-rc) that only seems to be possible for arrays that were created with journal in the first place. The above output was procuded after:



                  # mdadm --create /dev/md42 --level=5 --raid-devices=3 /dev/loop[012] --write-journal /dev/loop3
                  mdadm: Defaulting to version 1.2 metadata
                  mdadm: array /dev/md42 started.
                  # mdadm --manage /dev/md42 --fail /dev/loop3 --remove /dev/loop3
                  mdadm: set /dev/loop3 faulty in /dev/md42
                  mdadm: hot removed /dev/loop3 from /dev/md42


                  Creating an array without journal, all attempts to add a journal fail:



                  # mdadm --create /dev/md42 --level=5 --raid-devices=3 /dev/loop[012]
                  mdadm: Defaulting to version 1.2 metadata
                  mdadm: array /dev/md42 started.
                  # mdadm --manage /dev/md42 --readonly --add-journal /dev/loop3
                  mdadm: /dev/md42 does not support journal device.
                  # mdadm --manage /dev/md42 --readwrite --add /dev/loop3
                  # echo journal > /sys/block/md42/md/dev-loop3/state
                  bash: echo: write error: Invalid argument


                  So it just doesn't seem to be possible yet.



                  I have found a discussion on the linux-raid mailing list that this is a planned feature. If it has been implemented since, I don't see how. Perhaps contact the mailing list yourself to remind mdadm devs there are people who want this to work!



                  You might have to resort to mdadm --create to re-create the raid or edit metadata of the array. Either option is a bit dangerous.






                  share|improve this answer













                  It kind of should work like this:



                  # mdadm --manage /dev/md42 --readonly --add-journal /dev/loop3
                  mdadm: Journal added successfully, making /dev/md42 read-write
                  mdadm: added /dev/loop3


                  However, currently (using kernel 4.18, mdadm 4.1-rc) that only seems to be possible for arrays that were created with journal in the first place. The above output was procuded after:



                  # mdadm --create /dev/md42 --level=5 --raid-devices=3 /dev/loop[012] --write-journal /dev/loop3
                  mdadm: Defaulting to version 1.2 metadata
                  mdadm: array /dev/md42 started.
                  # mdadm --manage /dev/md42 --fail /dev/loop3 --remove /dev/loop3
                  mdadm: set /dev/loop3 faulty in /dev/md42
                  mdadm: hot removed /dev/loop3 from /dev/md42


                  Creating an array without journal, all attempts to add a journal fail:



                  # mdadm --create /dev/md42 --level=5 --raid-devices=3 /dev/loop[012]
                  mdadm: Defaulting to version 1.2 metadata
                  mdadm: array /dev/md42 started.
                  # mdadm --manage /dev/md42 --readonly --add-journal /dev/loop3
                  mdadm: /dev/md42 does not support journal device.
                  # mdadm --manage /dev/md42 --readwrite --add /dev/loop3
                  # echo journal > /sys/block/md42/md/dev-loop3/state
                  bash: echo: write error: Invalid argument


                  So it just doesn't seem to be possible yet.



                  I have found a discussion on the linux-raid mailing list that this is a planned feature. If it has been implemented since, I don't see how. Perhaps contact the mailing list yourself to remind mdadm devs there are people who want this to work!



                  You might have to resort to mdadm --create to re-create the raid or edit metadata of the array. Either option is a bit dangerous.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 17 '18 at 10:35









                  frostschutzfrostschutz

                  28.7k2 gold badges62 silver badges96 bronze badges




                  28.7k2 gold badges62 silver badges96 bronze badges























                      0














                      This PDF states it is possible: https://events.static.linuxfound.org/sites/events/files/slides/2016_vault_write_journal_cache_v2.pdf



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






                      share|improve this answer




























                        0














                        This PDF states it is possible: https://events.static.linuxfound.org/sites/events/files/slides/2016_vault_write_journal_cache_v2.pdf



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






                        share|improve this answer


























                          0












                          0








                          0







                          This PDF states it is possible: https://events.static.linuxfound.org/sites/events/files/slides/2016_vault_write_journal_cache_v2.pdf



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






                          share|improve this answer













                          This PDF states it is possible: https://events.static.linuxfound.org/sites/events/files/slides/2016_vault_write_journal_cache_v2.pdf



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







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 26 mins ago









                          BrendonBrendon

                          12 bronze badges




                          12 bronze badges






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Unix & Linux Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475987%2fadd-linux-md-raid-write-journal-to-and-existing-array%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                              Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                              Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...