remove disk after pvs output












0















psv command has show below output after I removed physical disk. That disk has xfs filesystem and belog to lvm partition. Before I was removing disk, I did unmount filesystem and I ran below command.



echo 1 > /sys/block/sd#/device/delete



how to I delete a disk to no see the warnning below? and How can I get rid of the warning without rebooting



pvs output:
/dev/vg_u02/lv_u02: read failed after 0 of 4096 at 0: Input/output error
/dev/vg_u02/lv_u02: read failed after 0 of 4096 at 53682831360: Input/output error
/dev/vg_u02/lv_u02: read failed after 0 of 4096 at 53682888704: Input/output error
/dev/vg_u02/lv_u02: read failed after 0 of 4096 at 4096: Input/output error









share|improve this question



























    0















    psv command has show below output after I removed physical disk. That disk has xfs filesystem and belog to lvm partition. Before I was removing disk, I did unmount filesystem and I ran below command.



    echo 1 > /sys/block/sd#/device/delete



    how to I delete a disk to no see the warnning below? and How can I get rid of the warning without rebooting



    pvs output:
    /dev/vg_u02/lv_u02: read failed after 0 of 4096 at 0: Input/output error
    /dev/vg_u02/lv_u02: read failed after 0 of 4096 at 53682831360: Input/output error
    /dev/vg_u02/lv_u02: read failed after 0 of 4096 at 53682888704: Input/output error
    /dev/vg_u02/lv_u02: read failed after 0 of 4096 at 4096: Input/output error









    share|improve this question

























      0












      0








      0








      psv command has show below output after I removed physical disk. That disk has xfs filesystem and belog to lvm partition. Before I was removing disk, I did unmount filesystem and I ran below command.



      echo 1 > /sys/block/sd#/device/delete



      how to I delete a disk to no see the warnning below? and How can I get rid of the warning without rebooting



      pvs output:
      /dev/vg_u02/lv_u02: read failed after 0 of 4096 at 0: Input/output error
      /dev/vg_u02/lv_u02: read failed after 0 of 4096 at 53682831360: Input/output error
      /dev/vg_u02/lv_u02: read failed after 0 of 4096 at 53682888704: Input/output error
      /dev/vg_u02/lv_u02: read failed after 0 of 4096 at 4096: Input/output error









      share|improve this question














      psv command has show below output after I removed physical disk. That disk has xfs filesystem and belog to lvm partition. Before I was removing disk, I did unmount filesystem and I ran below command.



      echo 1 > /sys/block/sd#/device/delete



      how to I delete a disk to no see the warnning below? and How can I get rid of the warning without rebooting



      pvs output:
      /dev/vg_u02/lv_u02: read failed after 0 of 4096 at 0: Input/output error
      /dev/vg_u02/lv_u02: read failed after 0 of 4096 at 53682831360: Input/output error
      /dev/vg_u02/lv_u02: read failed after 0 of 4096 at 53682888704: Input/output error
      /dev/vg_u02/lv_u02: read failed after 0 of 4096 at 4096: Input/output error






      linux hard-drive partitioning lvm






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 8 '18 at 5:52









      arifisikarifisik

      876




      876






















          1 Answer
          1






          active

          oldest

          votes


















          0














          how to I delete a disk to no see the warnning below?





          • In order to delete a disk that is part of LVM you need to first make sure that no space is being used. To find out how much space is actually being occupied issue the following command:




            root@bbb01:~# pvs -o +pv_used





          • You should get an output like this:




            PV VG Fmt Attr PSize PFree Used

            /dev/sda2 vgbbb lvm2 a-- 39.52g 0 39.52g

            /dev/sdb1 vgbbb lvm2 a-- 1020.00m 508.00m 512.00m





          • As you can see sdb1 has 512.00m (512MB) occupied, so I need to reallocate this space with the following command (assuming you have 512MB free in another PV):




            root@bbb01:~# pvmove /dev/sdb1





          • LVM will move the 512MB to another PV that has enough room to allocate that space. Now you shoud see the Used column should look like this:




            PV VG Fmt Attr PSize PFree Used

            /dev/sda2 vgbbb lvm2 a-- 39.52g 0 39.52g

            /dev/sdb1 vgbbb lvm2 a-- 1020.00m 1020.00m 0





          • Here you can see it shows 0 and the PSize and PFree columns are now equal 1020.00m (1GB/1024MB). Now we need to reduce de VG like this:




            root@bbb01:~# vgreduce vgbbb /dev/sdb1





          • Finally, you can remove the PV like this:




            root@bbb01:~# pvremove /dev/sdb1





          • To confirm just run the pvs command which output should be similar to this:




            PV VG Fmt Attr PSize PFree

            /dev/sda2 vgbbb lvm2 a-- 39.52g 0





          How can I get rid of the warning without rebooting?





          • I did exactly what you did and I just delete de LV involved. In your case would be:




            lvremove /dev/vg_u02/lv_u02





          • Now you should see the removed disk as unknown device in the output of the pvs command:




            PV VG Fmt Attr PSize PFree

            /dev/sda2 vgbbb lvm2 a-- 39.52g 0

            unknown device vgbbb lvm2 a-m 1020.00m 1020.00m





          • Finally tell LVM to remove missing PVs, in your case like this:




            vgreduce vg_u02 --removemissing




          • Now run the pvs command and confirm you have no errors.



          Hope this helps.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            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%2fsuperuser.com%2fquestions%2f1347059%2fremove-disk-after-pvs-output%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            how to I delete a disk to no see the warnning below?





            • In order to delete a disk that is part of LVM you need to first make sure that no space is being used. To find out how much space is actually being occupied issue the following command:




              root@bbb01:~# pvs -o +pv_used





            • You should get an output like this:




              PV VG Fmt Attr PSize PFree Used

              /dev/sda2 vgbbb lvm2 a-- 39.52g 0 39.52g

              /dev/sdb1 vgbbb lvm2 a-- 1020.00m 508.00m 512.00m





            • As you can see sdb1 has 512.00m (512MB) occupied, so I need to reallocate this space with the following command (assuming you have 512MB free in another PV):




              root@bbb01:~# pvmove /dev/sdb1





            • LVM will move the 512MB to another PV that has enough room to allocate that space. Now you shoud see the Used column should look like this:




              PV VG Fmt Attr PSize PFree Used

              /dev/sda2 vgbbb lvm2 a-- 39.52g 0 39.52g

              /dev/sdb1 vgbbb lvm2 a-- 1020.00m 1020.00m 0





            • Here you can see it shows 0 and the PSize and PFree columns are now equal 1020.00m (1GB/1024MB). Now we need to reduce de VG like this:




              root@bbb01:~# vgreduce vgbbb /dev/sdb1





            • Finally, you can remove the PV like this:




              root@bbb01:~# pvremove /dev/sdb1





            • To confirm just run the pvs command which output should be similar to this:




              PV VG Fmt Attr PSize PFree

              /dev/sda2 vgbbb lvm2 a-- 39.52g 0





            How can I get rid of the warning without rebooting?





            • I did exactly what you did and I just delete de LV involved. In your case would be:




              lvremove /dev/vg_u02/lv_u02





            • Now you should see the removed disk as unknown device in the output of the pvs command:




              PV VG Fmt Attr PSize PFree

              /dev/sda2 vgbbb lvm2 a-- 39.52g 0

              unknown device vgbbb lvm2 a-m 1020.00m 1020.00m





            • Finally tell LVM to remove missing PVs, in your case like this:




              vgreduce vg_u02 --removemissing




            • Now run the pvs command and confirm you have no errors.



            Hope this helps.






            share|improve this answer




























              0














              how to I delete a disk to no see the warnning below?





              • In order to delete a disk that is part of LVM you need to first make sure that no space is being used. To find out how much space is actually being occupied issue the following command:




                root@bbb01:~# pvs -o +pv_used





              • You should get an output like this:




                PV VG Fmt Attr PSize PFree Used

                /dev/sda2 vgbbb lvm2 a-- 39.52g 0 39.52g

                /dev/sdb1 vgbbb lvm2 a-- 1020.00m 508.00m 512.00m





              • As you can see sdb1 has 512.00m (512MB) occupied, so I need to reallocate this space with the following command (assuming you have 512MB free in another PV):




                root@bbb01:~# pvmove /dev/sdb1





              • LVM will move the 512MB to another PV that has enough room to allocate that space. Now you shoud see the Used column should look like this:




                PV VG Fmt Attr PSize PFree Used

                /dev/sda2 vgbbb lvm2 a-- 39.52g 0 39.52g

                /dev/sdb1 vgbbb lvm2 a-- 1020.00m 1020.00m 0





              • Here you can see it shows 0 and the PSize and PFree columns are now equal 1020.00m (1GB/1024MB). Now we need to reduce de VG like this:




                root@bbb01:~# vgreduce vgbbb /dev/sdb1





              • Finally, you can remove the PV like this:




                root@bbb01:~# pvremove /dev/sdb1





              • To confirm just run the pvs command which output should be similar to this:




                PV VG Fmt Attr PSize PFree

                /dev/sda2 vgbbb lvm2 a-- 39.52g 0





              How can I get rid of the warning without rebooting?





              • I did exactly what you did and I just delete de LV involved. In your case would be:




                lvremove /dev/vg_u02/lv_u02





              • Now you should see the removed disk as unknown device in the output of the pvs command:




                PV VG Fmt Attr PSize PFree

                /dev/sda2 vgbbb lvm2 a-- 39.52g 0

                unknown device vgbbb lvm2 a-m 1020.00m 1020.00m





              • Finally tell LVM to remove missing PVs, in your case like this:




                vgreduce vg_u02 --removemissing




              • Now run the pvs command and confirm you have no errors.



              Hope this helps.






              share|improve this answer


























                0












                0








                0







                how to I delete a disk to no see the warnning below?





                • In order to delete a disk that is part of LVM you need to first make sure that no space is being used. To find out how much space is actually being occupied issue the following command:




                  root@bbb01:~# pvs -o +pv_used





                • You should get an output like this:




                  PV VG Fmt Attr PSize PFree Used

                  /dev/sda2 vgbbb lvm2 a-- 39.52g 0 39.52g

                  /dev/sdb1 vgbbb lvm2 a-- 1020.00m 508.00m 512.00m





                • As you can see sdb1 has 512.00m (512MB) occupied, so I need to reallocate this space with the following command (assuming you have 512MB free in another PV):




                  root@bbb01:~# pvmove /dev/sdb1





                • LVM will move the 512MB to another PV that has enough room to allocate that space. Now you shoud see the Used column should look like this:




                  PV VG Fmt Attr PSize PFree Used

                  /dev/sda2 vgbbb lvm2 a-- 39.52g 0 39.52g

                  /dev/sdb1 vgbbb lvm2 a-- 1020.00m 1020.00m 0





                • Here you can see it shows 0 and the PSize and PFree columns are now equal 1020.00m (1GB/1024MB). Now we need to reduce de VG like this:




                  root@bbb01:~# vgreduce vgbbb /dev/sdb1





                • Finally, you can remove the PV like this:




                  root@bbb01:~# pvremove /dev/sdb1





                • To confirm just run the pvs command which output should be similar to this:




                  PV VG Fmt Attr PSize PFree

                  /dev/sda2 vgbbb lvm2 a-- 39.52g 0





                How can I get rid of the warning without rebooting?





                • I did exactly what you did and I just delete de LV involved. In your case would be:




                  lvremove /dev/vg_u02/lv_u02





                • Now you should see the removed disk as unknown device in the output of the pvs command:




                  PV VG Fmt Attr PSize PFree

                  /dev/sda2 vgbbb lvm2 a-- 39.52g 0

                  unknown device vgbbb lvm2 a-m 1020.00m 1020.00m





                • Finally tell LVM to remove missing PVs, in your case like this:




                  vgreduce vg_u02 --removemissing




                • Now run the pvs command and confirm you have no errors.



                Hope this helps.






                share|improve this answer













                how to I delete a disk to no see the warnning below?





                • In order to delete a disk that is part of LVM you need to first make sure that no space is being used. To find out how much space is actually being occupied issue the following command:




                  root@bbb01:~# pvs -o +pv_used





                • You should get an output like this:




                  PV VG Fmt Attr PSize PFree Used

                  /dev/sda2 vgbbb lvm2 a-- 39.52g 0 39.52g

                  /dev/sdb1 vgbbb lvm2 a-- 1020.00m 508.00m 512.00m





                • As you can see sdb1 has 512.00m (512MB) occupied, so I need to reallocate this space with the following command (assuming you have 512MB free in another PV):




                  root@bbb01:~# pvmove /dev/sdb1





                • LVM will move the 512MB to another PV that has enough room to allocate that space. Now you shoud see the Used column should look like this:




                  PV VG Fmt Attr PSize PFree Used

                  /dev/sda2 vgbbb lvm2 a-- 39.52g 0 39.52g

                  /dev/sdb1 vgbbb lvm2 a-- 1020.00m 1020.00m 0





                • Here you can see it shows 0 and the PSize and PFree columns are now equal 1020.00m (1GB/1024MB). Now we need to reduce de VG like this:




                  root@bbb01:~# vgreduce vgbbb /dev/sdb1





                • Finally, you can remove the PV like this:




                  root@bbb01:~# pvremove /dev/sdb1





                • To confirm just run the pvs command which output should be similar to this:




                  PV VG Fmt Attr PSize PFree

                  /dev/sda2 vgbbb lvm2 a-- 39.52g 0





                How can I get rid of the warning without rebooting?





                • I did exactly what you did and I just delete de LV involved. In your case would be:




                  lvremove /dev/vg_u02/lv_u02





                • Now you should see the removed disk as unknown device in the output of the pvs command:




                  PV VG Fmt Attr PSize PFree

                  /dev/sda2 vgbbb lvm2 a-- 39.52g 0

                  unknown device vgbbb lvm2 a-m 1020.00m 1020.00m





                • Finally tell LVM to remove missing PVs, in your case like this:




                  vgreduce vg_u02 --removemissing




                • Now run the pvs command and confirm you have no errors.



                Hope this helps.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 29 '18 at 3:20









                Manuel FlorianManuel Florian

                1595




                1595






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • 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%2fsuperuser.com%2fquestions%2f1347059%2fremove-disk-after-pvs-output%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

                    Plaza Victoria

                    In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

                    How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...