get rid of software raid












2















We are running software raid1 using MDADM on ubuntu 11.04. What's the best way to get rid of it Keeping the current system ?



I want to use hardware raid instead.



What I tried to do:
-Copied the 1disk of software raid using HDClone. Configured degraded raid array without the second disk. Then copied everything from /dev/md0 onto a spare disk /dev/sdb using dd utility. However the copy wasn't accurate so I was not able to boot. I even tried to reinstall grub but it all didnt work. What's the best way to do this procedure? Thanks










share|improve this question



























    2















    We are running software raid1 using MDADM on ubuntu 11.04. What's the best way to get rid of it Keeping the current system ?



    I want to use hardware raid instead.



    What I tried to do:
    -Copied the 1disk of software raid using HDClone. Configured degraded raid array without the second disk. Then copied everything from /dev/md0 onto a spare disk /dev/sdb using dd utility. However the copy wasn't accurate so I was not able to boot. I even tried to reinstall grub but it all didnt work. What's the best way to do this procedure? Thanks










    share|improve this question

























      2












      2








      2








      We are running software raid1 using MDADM on ubuntu 11.04. What's the best way to get rid of it Keeping the current system ?



      I want to use hardware raid instead.



      What I tried to do:
      -Copied the 1disk of software raid using HDClone. Configured degraded raid array without the second disk. Then copied everything from /dev/md0 onto a spare disk /dev/sdb using dd utility. However the copy wasn't accurate so I was not able to boot. I even tried to reinstall grub but it all didnt work. What's the best way to do this procedure? Thanks










      share|improve this question














      We are running software raid1 using MDADM on ubuntu 11.04. What's the best way to get rid of it Keeping the current system ?



      I want to use hardware raid instead.



      What I tried to do:
      -Copied the 1disk of software raid using HDClone. Configured degraded raid array without the second disk. Then copied everything from /dev/md0 onto a spare disk /dev/sdb using dd utility. However the copy wasn't accurate so I was not able to boot. I even tried to reinstall grub but it all didnt work. What's the best way to do this procedure? Thanks







      11.04 raid mdadm






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 4 '12 at 1:41









      RomanGRomanG

      1112




      1112






















          3 Answers
          3






          active

          oldest

          votes


















          0














          I would move the installation to another drive. With the same DD utility, and do a grub install on it so that it boots normally. After that setup your hardware raid, and do DD from the drive you setup back to the new hardware raid drive and do a grub install on that drive, and you should be set.






          share|improve this answer
























          • for some reason dd from MD0 to dev sda fails...maybe should I use some parameters like a block size?

            – RomanG
            May 4 '12 at 3:34



















          0














          On creating your software RAID you have chosen to combine multiple drives into one logical unit. In your case a RAID1 is just mirroring data. On using mdadm you did that by partitioning and configuring your drives accordingly. Exactly this is why disk-clone utilities obviously fail to move your data to another drive.



          Of course you can still copy (e.g. by using cp -a or any other copy utility) your data from the RAID to any other spare disk.



          In case we need to resolve our software RAID we can do so by e.g.:



          sudo umount /dev/md0
          sudo mdadm --stop /dev/md0
          sudo mdadm --zero-superblock /dev/sda1 /dev/sdb1


          Adapt the setting shown here for RAID /md0 and drives /sda and /sdb to your settings.



          After that we need to change the partition type back from RAID to normal, install Grub, and update our fstab.



          See also this question






          share|improve this answer


























          • should I run this using LiveCD? or boot the system first using the raid?

            – RomanG
            May 8 '12 at 2:17











          • IIRC you can't stop an array used by the system you booted from. If it's not a mere data drive you need to do this from a live session.

            – Takkat
            May 8 '12 at 6:03











          • I was able to remove the second disk by running this mdadm -G /dev/md0 -n 1 --force However, the system still relies on /dev/md0...how to get rid of this completely? Thanks

            – RomanG
            May 9 '12 at 3:07





















          0














          This might come a little late..



          dd is the best tool to clone raw disks ( or partitions ), and that's exactly what it does.



          it copies raw data regardless ( and unaware ) of what filesystem / structure is on the source ( data + metadata )> so ponder on this for a while, as this actually means it will reconstruct the target exactly the same as the source.
          Or shorter > dd'ing a raid member will create a raid member .... which in your case will create a second degraded array....
          And that's definitely not what you intended to do...



          also while it's true that a raid1 mirrors data, it doesn't mean the raw data of the raid members is identical ( some metadata will differ )



          proper procedure for reusing a former raid member is to blank it by using




          dd if=/dev/zero of=/dev/sdb bs=4k ( don't copy pasta this > change output device to your needs. )




          this will properly zero any data / metadata > this is also a good idea on new disks...



          if the raid was used as a system disk > run a live cd ( don't copy from a running system )



          repartition / format / mount the cleaned disk
          mount the degraded raid array
          and copy the raids contents with




          sudo rsync -HAXavx /media/raid1/ /media/newdisk/




          following is only when raid was a system disk :



          alter the UUID's in fstab on the target volume ( find out what the new disk UUID is by running blkid )



          copy the boot sector by running dd if=/dev/sda of=/dev/sdb bs=446 count=1 ( and NOT bs=512 like most folks think > using 512 will overwrite your partition table !! )



          I'm now assuming the target disk is mounted as /media/newdisk




          sudo mount --bind /dev /media/newdisk/dev



          sudo mount --bind /sys /media/newdisk/sys



          sudo mount --bind /proc /media/newdisk/proc



          sudo chroot /media/newdisk/
          ( and after you altered the UUID's in fstab )



          grub-install /dev/sdb ( to make sure you've rewritten a fresh bootloader )



          update-grub



          exit ( this returns to your non chrooted environment )



          sudo reboot




          :-)






          share|improve this answer

























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            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: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            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%2faskubuntu.com%2fquestions%2f131157%2fget-rid-of-software-raid%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I would move the installation to another drive. With the same DD utility, and do a grub install on it so that it boots normally. After that setup your hardware raid, and do DD from the drive you setup back to the new hardware raid drive and do a grub install on that drive, and you should be set.






            share|improve this answer
























            • for some reason dd from MD0 to dev sda fails...maybe should I use some parameters like a block size?

              – RomanG
              May 4 '12 at 3:34
















            0














            I would move the installation to another drive. With the same DD utility, and do a grub install on it so that it boots normally. After that setup your hardware raid, and do DD from the drive you setup back to the new hardware raid drive and do a grub install on that drive, and you should be set.






            share|improve this answer
























            • for some reason dd from MD0 to dev sda fails...maybe should I use some parameters like a block size?

              – RomanG
              May 4 '12 at 3:34














            0












            0








            0







            I would move the installation to another drive. With the same DD utility, and do a grub install on it so that it boots normally. After that setup your hardware raid, and do DD from the drive you setup back to the new hardware raid drive and do a grub install on that drive, and you should be set.






            share|improve this answer













            I would move the installation to another drive. With the same DD utility, and do a grub install on it so that it boots normally. After that setup your hardware raid, and do DD from the drive you setup back to the new hardware raid drive and do a grub install on that drive, and you should be set.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered May 4 '12 at 2:53









            Frank BarcenasFrank Barcenas

            1,06231333




            1,06231333













            • for some reason dd from MD0 to dev sda fails...maybe should I use some parameters like a block size?

              – RomanG
              May 4 '12 at 3:34



















            • for some reason dd from MD0 to dev sda fails...maybe should I use some parameters like a block size?

              – RomanG
              May 4 '12 at 3:34

















            for some reason dd from MD0 to dev sda fails...maybe should I use some parameters like a block size?

            – RomanG
            May 4 '12 at 3:34





            for some reason dd from MD0 to dev sda fails...maybe should I use some parameters like a block size?

            – RomanG
            May 4 '12 at 3:34













            0














            On creating your software RAID you have chosen to combine multiple drives into one logical unit. In your case a RAID1 is just mirroring data. On using mdadm you did that by partitioning and configuring your drives accordingly. Exactly this is why disk-clone utilities obviously fail to move your data to another drive.



            Of course you can still copy (e.g. by using cp -a or any other copy utility) your data from the RAID to any other spare disk.



            In case we need to resolve our software RAID we can do so by e.g.:



            sudo umount /dev/md0
            sudo mdadm --stop /dev/md0
            sudo mdadm --zero-superblock /dev/sda1 /dev/sdb1


            Adapt the setting shown here for RAID /md0 and drives /sda and /sdb to your settings.



            After that we need to change the partition type back from RAID to normal, install Grub, and update our fstab.



            See also this question






            share|improve this answer


























            • should I run this using LiveCD? or boot the system first using the raid?

              – RomanG
              May 8 '12 at 2:17











            • IIRC you can't stop an array used by the system you booted from. If it's not a mere data drive you need to do this from a live session.

              – Takkat
              May 8 '12 at 6:03











            • I was able to remove the second disk by running this mdadm -G /dev/md0 -n 1 --force However, the system still relies on /dev/md0...how to get rid of this completely? Thanks

              – RomanG
              May 9 '12 at 3:07


















            0














            On creating your software RAID you have chosen to combine multiple drives into one logical unit. In your case a RAID1 is just mirroring data. On using mdadm you did that by partitioning and configuring your drives accordingly. Exactly this is why disk-clone utilities obviously fail to move your data to another drive.



            Of course you can still copy (e.g. by using cp -a or any other copy utility) your data from the RAID to any other spare disk.



            In case we need to resolve our software RAID we can do so by e.g.:



            sudo umount /dev/md0
            sudo mdadm --stop /dev/md0
            sudo mdadm --zero-superblock /dev/sda1 /dev/sdb1


            Adapt the setting shown here for RAID /md0 and drives /sda and /sdb to your settings.



            After that we need to change the partition type back from RAID to normal, install Grub, and update our fstab.



            See also this question






            share|improve this answer


























            • should I run this using LiveCD? or boot the system first using the raid?

              – RomanG
              May 8 '12 at 2:17











            • IIRC you can't stop an array used by the system you booted from. If it's not a mere data drive you need to do this from a live session.

              – Takkat
              May 8 '12 at 6:03











            • I was able to remove the second disk by running this mdadm -G /dev/md0 -n 1 --force However, the system still relies on /dev/md0...how to get rid of this completely? Thanks

              – RomanG
              May 9 '12 at 3:07
















            0












            0








            0







            On creating your software RAID you have chosen to combine multiple drives into one logical unit. In your case a RAID1 is just mirroring data. On using mdadm you did that by partitioning and configuring your drives accordingly. Exactly this is why disk-clone utilities obviously fail to move your data to another drive.



            Of course you can still copy (e.g. by using cp -a or any other copy utility) your data from the RAID to any other spare disk.



            In case we need to resolve our software RAID we can do so by e.g.:



            sudo umount /dev/md0
            sudo mdadm --stop /dev/md0
            sudo mdadm --zero-superblock /dev/sda1 /dev/sdb1


            Adapt the setting shown here for RAID /md0 and drives /sda and /sdb to your settings.



            After that we need to change the partition type back from RAID to normal, install Grub, and update our fstab.



            See also this question






            share|improve this answer















            On creating your software RAID you have chosen to combine multiple drives into one logical unit. In your case a RAID1 is just mirroring data. On using mdadm you did that by partitioning and configuring your drives accordingly. Exactly this is why disk-clone utilities obviously fail to move your data to another drive.



            Of course you can still copy (e.g. by using cp -a or any other copy utility) your data from the RAID to any other spare disk.



            In case we need to resolve our software RAID we can do so by e.g.:



            sudo umount /dev/md0
            sudo mdadm --stop /dev/md0
            sudo mdadm --zero-superblock /dev/sda1 /dev/sdb1


            Adapt the setting shown here for RAID /md0 and drives /sda and /sdb to your settings.



            After that we need to change the partition type back from RAID to normal, install Grub, and update our fstab.



            See also this question







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 13 '17 at 12:24









            Community

            1




            1










            answered May 4 '12 at 7:35









            TakkatTakkat

            108k37249377




            108k37249377













            • should I run this using LiveCD? or boot the system first using the raid?

              – RomanG
              May 8 '12 at 2:17











            • IIRC you can't stop an array used by the system you booted from. If it's not a mere data drive you need to do this from a live session.

              – Takkat
              May 8 '12 at 6:03











            • I was able to remove the second disk by running this mdadm -G /dev/md0 -n 1 --force However, the system still relies on /dev/md0...how to get rid of this completely? Thanks

              – RomanG
              May 9 '12 at 3:07





















            • should I run this using LiveCD? or boot the system first using the raid?

              – RomanG
              May 8 '12 at 2:17











            • IIRC you can't stop an array used by the system you booted from. If it's not a mere data drive you need to do this from a live session.

              – Takkat
              May 8 '12 at 6:03











            • I was able to remove the second disk by running this mdadm -G /dev/md0 -n 1 --force However, the system still relies on /dev/md0...how to get rid of this completely? Thanks

              – RomanG
              May 9 '12 at 3:07



















            should I run this using LiveCD? or boot the system first using the raid?

            – RomanG
            May 8 '12 at 2:17





            should I run this using LiveCD? or boot the system first using the raid?

            – RomanG
            May 8 '12 at 2:17













            IIRC you can't stop an array used by the system you booted from. If it's not a mere data drive you need to do this from a live session.

            – Takkat
            May 8 '12 at 6:03





            IIRC you can't stop an array used by the system you booted from. If it's not a mere data drive you need to do this from a live session.

            – Takkat
            May 8 '12 at 6:03













            I was able to remove the second disk by running this mdadm -G /dev/md0 -n 1 --force However, the system still relies on /dev/md0...how to get rid of this completely? Thanks

            – RomanG
            May 9 '12 at 3:07







            I was able to remove the second disk by running this mdadm -G /dev/md0 -n 1 --force However, the system still relies on /dev/md0...how to get rid of this completely? Thanks

            – RomanG
            May 9 '12 at 3:07













            0














            This might come a little late..



            dd is the best tool to clone raw disks ( or partitions ), and that's exactly what it does.



            it copies raw data regardless ( and unaware ) of what filesystem / structure is on the source ( data + metadata )> so ponder on this for a while, as this actually means it will reconstruct the target exactly the same as the source.
            Or shorter > dd'ing a raid member will create a raid member .... which in your case will create a second degraded array....
            And that's definitely not what you intended to do...



            also while it's true that a raid1 mirrors data, it doesn't mean the raw data of the raid members is identical ( some metadata will differ )



            proper procedure for reusing a former raid member is to blank it by using




            dd if=/dev/zero of=/dev/sdb bs=4k ( don't copy pasta this > change output device to your needs. )




            this will properly zero any data / metadata > this is also a good idea on new disks...



            if the raid was used as a system disk > run a live cd ( don't copy from a running system )



            repartition / format / mount the cleaned disk
            mount the degraded raid array
            and copy the raids contents with




            sudo rsync -HAXavx /media/raid1/ /media/newdisk/




            following is only when raid was a system disk :



            alter the UUID's in fstab on the target volume ( find out what the new disk UUID is by running blkid )



            copy the boot sector by running dd if=/dev/sda of=/dev/sdb bs=446 count=1 ( and NOT bs=512 like most folks think > using 512 will overwrite your partition table !! )



            I'm now assuming the target disk is mounted as /media/newdisk




            sudo mount --bind /dev /media/newdisk/dev



            sudo mount --bind /sys /media/newdisk/sys



            sudo mount --bind /proc /media/newdisk/proc



            sudo chroot /media/newdisk/
            ( and after you altered the UUID's in fstab )



            grub-install /dev/sdb ( to make sure you've rewritten a fresh bootloader )



            update-grub



            exit ( this returns to your non chrooted environment )



            sudo reboot




            :-)






            share|improve this answer






























              0














              This might come a little late..



              dd is the best tool to clone raw disks ( or partitions ), and that's exactly what it does.



              it copies raw data regardless ( and unaware ) of what filesystem / structure is on the source ( data + metadata )> so ponder on this for a while, as this actually means it will reconstruct the target exactly the same as the source.
              Or shorter > dd'ing a raid member will create a raid member .... which in your case will create a second degraded array....
              And that's definitely not what you intended to do...



              also while it's true that a raid1 mirrors data, it doesn't mean the raw data of the raid members is identical ( some metadata will differ )



              proper procedure for reusing a former raid member is to blank it by using




              dd if=/dev/zero of=/dev/sdb bs=4k ( don't copy pasta this > change output device to your needs. )




              this will properly zero any data / metadata > this is also a good idea on new disks...



              if the raid was used as a system disk > run a live cd ( don't copy from a running system )



              repartition / format / mount the cleaned disk
              mount the degraded raid array
              and copy the raids contents with




              sudo rsync -HAXavx /media/raid1/ /media/newdisk/




              following is only when raid was a system disk :



              alter the UUID's in fstab on the target volume ( find out what the new disk UUID is by running blkid )



              copy the boot sector by running dd if=/dev/sda of=/dev/sdb bs=446 count=1 ( and NOT bs=512 like most folks think > using 512 will overwrite your partition table !! )



              I'm now assuming the target disk is mounted as /media/newdisk




              sudo mount --bind /dev /media/newdisk/dev



              sudo mount --bind /sys /media/newdisk/sys



              sudo mount --bind /proc /media/newdisk/proc



              sudo chroot /media/newdisk/
              ( and after you altered the UUID's in fstab )



              grub-install /dev/sdb ( to make sure you've rewritten a fresh bootloader )



              update-grub



              exit ( this returns to your non chrooted environment )



              sudo reboot




              :-)






              share|improve this answer




























                0












                0








                0







                This might come a little late..



                dd is the best tool to clone raw disks ( or partitions ), and that's exactly what it does.



                it copies raw data regardless ( and unaware ) of what filesystem / structure is on the source ( data + metadata )> so ponder on this for a while, as this actually means it will reconstruct the target exactly the same as the source.
                Or shorter > dd'ing a raid member will create a raid member .... which in your case will create a second degraded array....
                And that's definitely not what you intended to do...



                also while it's true that a raid1 mirrors data, it doesn't mean the raw data of the raid members is identical ( some metadata will differ )



                proper procedure for reusing a former raid member is to blank it by using




                dd if=/dev/zero of=/dev/sdb bs=4k ( don't copy pasta this > change output device to your needs. )




                this will properly zero any data / metadata > this is also a good idea on new disks...



                if the raid was used as a system disk > run a live cd ( don't copy from a running system )



                repartition / format / mount the cleaned disk
                mount the degraded raid array
                and copy the raids contents with




                sudo rsync -HAXavx /media/raid1/ /media/newdisk/




                following is only when raid was a system disk :



                alter the UUID's in fstab on the target volume ( find out what the new disk UUID is by running blkid )



                copy the boot sector by running dd if=/dev/sda of=/dev/sdb bs=446 count=1 ( and NOT bs=512 like most folks think > using 512 will overwrite your partition table !! )



                I'm now assuming the target disk is mounted as /media/newdisk




                sudo mount --bind /dev /media/newdisk/dev



                sudo mount --bind /sys /media/newdisk/sys



                sudo mount --bind /proc /media/newdisk/proc



                sudo chroot /media/newdisk/
                ( and after you altered the UUID's in fstab )



                grub-install /dev/sdb ( to make sure you've rewritten a fresh bootloader )



                update-grub



                exit ( this returns to your non chrooted environment )



                sudo reboot




                :-)






                share|improve this answer















                This might come a little late..



                dd is the best tool to clone raw disks ( or partitions ), and that's exactly what it does.



                it copies raw data regardless ( and unaware ) of what filesystem / structure is on the source ( data + metadata )> so ponder on this for a while, as this actually means it will reconstruct the target exactly the same as the source.
                Or shorter > dd'ing a raid member will create a raid member .... which in your case will create a second degraded array....
                And that's definitely not what you intended to do...



                also while it's true that a raid1 mirrors data, it doesn't mean the raw data of the raid members is identical ( some metadata will differ )



                proper procedure for reusing a former raid member is to blank it by using




                dd if=/dev/zero of=/dev/sdb bs=4k ( don't copy pasta this > change output device to your needs. )




                this will properly zero any data / metadata > this is also a good idea on new disks...



                if the raid was used as a system disk > run a live cd ( don't copy from a running system )



                repartition / format / mount the cleaned disk
                mount the degraded raid array
                and copy the raids contents with




                sudo rsync -HAXavx /media/raid1/ /media/newdisk/




                following is only when raid was a system disk :



                alter the UUID's in fstab on the target volume ( find out what the new disk UUID is by running blkid )



                copy the boot sector by running dd if=/dev/sda of=/dev/sdb bs=446 count=1 ( and NOT bs=512 like most folks think > using 512 will overwrite your partition table !! )



                I'm now assuming the target disk is mounted as /media/newdisk




                sudo mount --bind /dev /media/newdisk/dev



                sudo mount --bind /sys /media/newdisk/sys



                sudo mount --bind /proc /media/newdisk/proc



                sudo chroot /media/newdisk/
                ( and after you altered the UUID's in fstab )



                grub-install /dev/sdb ( to make sure you've rewritten a fresh bootloader )



                update-grub



                exit ( this returns to your non chrooted environment )



                sudo reboot




                :-)







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited May 28 '12 at 16:26

























                answered May 28 '12 at 1:19









                DjamuDjamu

                11




                11






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • 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%2faskubuntu.com%2fquestions%2f131157%2fget-rid-of-software-raid%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

                    How did Captain America manage to do this?

                    迪纳利

                    南乌拉尔铁路局