why do we need to create physical volume and volume group?












1















I have some doubts while studying about LVM. what is requirement to create physical volume and volume group separately. Means is it not possible to make LV on directly physical volume.










share|improve this question





























    1















    I have some doubts while studying about LVM. what is requirement to create physical volume and volume group separately. Means is it not possible to make LV on directly physical volume.










    share|improve this question



























      1












      1








      1








      I have some doubts while studying about LVM. what is requirement to create physical volume and volume group separately. Means is it not possible to make LV on directly physical volume.










      share|improve this question
















      I have some doubts while studying about LVM. what is requirement to create physical volume and volume group separately. Means is it not possible to make LV on directly physical volume.







      lvm






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 23 at 21:17









      Rui F Ribeiro

      39.8k1479133




      39.8k1479133










      asked Jul 7 '17 at 13:31









      yogs_2019yogs_2019

      62




      62






















          2 Answers
          2






          active

          oldest

          votes


















          2














          Creating a Logical Volume directly over a Physical Volume would not give much avantage over a simple partitioning of a disk and would negate one of the most useful features of LVM, that is grouping together several PVs into a single VGs.



          For instance, you can group three physical disks of 100 Gb each into a single VG, then create a 300 Gb volume (as a LV) out of it. Or two 150 Gb volumes.






          share|improve this answer































            0














            This is how it was done before : you just "slice" a disk into partition, each partition holding a filesystem (aka files and directories).



            /dev/sda1 => / from 0 to 12
            /dev/sda2 => swap from 13 to 53
            /dev/sda3 => /usr from 54 to 114
            /dev/sda4 => /var from 115 to 156
            free from 157 to end of disk


            (number are pseudo block)



            Now the problem is when you want to increase, say /usr, you will overlap /var. Having free space after, but still needing a cumbersome move to extend /usr.



            Now the whole LVM paradigm have been set up as to allow use of multiple disk, and dynamic growing of logical volume (and filesystem that support it).



            Also keep in mind that logical volume are seldom use alone, most of the time a filesystem (ext4, xfs, and many other) is put in top of it.



            LVM stack (from physical to logical) looks like




            • disk (PV: Physical Volume)

            • Volume Group (VG) : one or more PV

            • Logical Volume (LV) : a part on a LV, can be mirrored if need be, can be dynamically moved from a PV to another (in same VG).


            Not part of LVM:




            • Below LVM are SAN device, local disk or Virtual disk

            • Above LVM are filesystem or swap.

            • Some program may use direct access to LV (I don't have example in mind tho).






            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%2f375990%2fwhy-do-we-need-to-create-physical-volume-and-volume-group%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









              2














              Creating a Logical Volume directly over a Physical Volume would not give much avantage over a simple partitioning of a disk and would negate one of the most useful features of LVM, that is grouping together several PVs into a single VGs.



              For instance, you can group three physical disks of 100 Gb each into a single VG, then create a 300 Gb volume (as a LV) out of it. Or two 150 Gb volumes.






              share|improve this answer




























                2














                Creating a Logical Volume directly over a Physical Volume would not give much avantage over a simple partitioning of a disk and would negate one of the most useful features of LVM, that is grouping together several PVs into a single VGs.



                For instance, you can group three physical disks of 100 Gb each into a single VG, then create a 300 Gb volume (as a LV) out of it. Or two 150 Gb volumes.






                share|improve this answer


























                  2












                  2








                  2







                  Creating a Logical Volume directly over a Physical Volume would not give much avantage over a simple partitioning of a disk and would negate one of the most useful features of LVM, that is grouping together several PVs into a single VGs.



                  For instance, you can group three physical disks of 100 Gb each into a single VG, then create a 300 Gb volume (as a LV) out of it. Or two 150 Gb volumes.






                  share|improve this answer













                  Creating a Logical Volume directly over a Physical Volume would not give much avantage over a simple partitioning of a disk and would negate one of the most useful features of LVM, that is grouping together several PVs into a single VGs.



                  For instance, you can group three physical disks of 100 Gb each into a single VG, then create a 300 Gb volume (as a LV) out of it. Or two 150 Gb volumes.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jul 7 '17 at 13:37









                  dr01dr01

                  16.1k114973




                  16.1k114973

























                      0














                      This is how it was done before : you just "slice" a disk into partition, each partition holding a filesystem (aka files and directories).



                      /dev/sda1 => / from 0 to 12
                      /dev/sda2 => swap from 13 to 53
                      /dev/sda3 => /usr from 54 to 114
                      /dev/sda4 => /var from 115 to 156
                      free from 157 to end of disk


                      (number are pseudo block)



                      Now the problem is when you want to increase, say /usr, you will overlap /var. Having free space after, but still needing a cumbersome move to extend /usr.



                      Now the whole LVM paradigm have been set up as to allow use of multiple disk, and dynamic growing of logical volume (and filesystem that support it).



                      Also keep in mind that logical volume are seldom use alone, most of the time a filesystem (ext4, xfs, and many other) is put in top of it.



                      LVM stack (from physical to logical) looks like




                      • disk (PV: Physical Volume)

                      • Volume Group (VG) : one or more PV

                      • Logical Volume (LV) : a part on a LV, can be mirrored if need be, can be dynamically moved from a PV to another (in same VG).


                      Not part of LVM:




                      • Below LVM are SAN device, local disk or Virtual disk

                      • Above LVM are filesystem or swap.

                      • Some program may use direct access to LV (I don't have example in mind tho).






                      share|improve this answer




























                        0














                        This is how it was done before : you just "slice" a disk into partition, each partition holding a filesystem (aka files and directories).



                        /dev/sda1 => / from 0 to 12
                        /dev/sda2 => swap from 13 to 53
                        /dev/sda3 => /usr from 54 to 114
                        /dev/sda4 => /var from 115 to 156
                        free from 157 to end of disk


                        (number are pseudo block)



                        Now the problem is when you want to increase, say /usr, you will overlap /var. Having free space after, but still needing a cumbersome move to extend /usr.



                        Now the whole LVM paradigm have been set up as to allow use of multiple disk, and dynamic growing of logical volume (and filesystem that support it).



                        Also keep in mind that logical volume are seldom use alone, most of the time a filesystem (ext4, xfs, and many other) is put in top of it.



                        LVM stack (from physical to logical) looks like




                        • disk (PV: Physical Volume)

                        • Volume Group (VG) : one or more PV

                        • Logical Volume (LV) : a part on a LV, can be mirrored if need be, can be dynamically moved from a PV to another (in same VG).


                        Not part of LVM:




                        • Below LVM are SAN device, local disk or Virtual disk

                        • Above LVM are filesystem or swap.

                        • Some program may use direct access to LV (I don't have example in mind tho).






                        share|improve this answer


























                          0












                          0








                          0







                          This is how it was done before : you just "slice" a disk into partition, each partition holding a filesystem (aka files and directories).



                          /dev/sda1 => / from 0 to 12
                          /dev/sda2 => swap from 13 to 53
                          /dev/sda3 => /usr from 54 to 114
                          /dev/sda4 => /var from 115 to 156
                          free from 157 to end of disk


                          (number are pseudo block)



                          Now the problem is when you want to increase, say /usr, you will overlap /var. Having free space after, but still needing a cumbersome move to extend /usr.



                          Now the whole LVM paradigm have been set up as to allow use of multiple disk, and dynamic growing of logical volume (and filesystem that support it).



                          Also keep in mind that logical volume are seldom use alone, most of the time a filesystem (ext4, xfs, and many other) is put in top of it.



                          LVM stack (from physical to logical) looks like




                          • disk (PV: Physical Volume)

                          • Volume Group (VG) : one or more PV

                          • Logical Volume (LV) : a part on a LV, can be mirrored if need be, can be dynamically moved from a PV to another (in same VG).


                          Not part of LVM:




                          • Below LVM are SAN device, local disk or Virtual disk

                          • Above LVM are filesystem or swap.

                          • Some program may use direct access to LV (I don't have example in mind tho).






                          share|improve this answer













                          This is how it was done before : you just "slice" a disk into partition, each partition holding a filesystem (aka files and directories).



                          /dev/sda1 => / from 0 to 12
                          /dev/sda2 => swap from 13 to 53
                          /dev/sda3 => /usr from 54 to 114
                          /dev/sda4 => /var from 115 to 156
                          free from 157 to end of disk


                          (number are pseudo block)



                          Now the problem is when you want to increase, say /usr, you will overlap /var. Having free space after, but still needing a cumbersome move to extend /usr.



                          Now the whole LVM paradigm have been set up as to allow use of multiple disk, and dynamic growing of logical volume (and filesystem that support it).



                          Also keep in mind that logical volume are seldom use alone, most of the time a filesystem (ext4, xfs, and many other) is put in top of it.



                          LVM stack (from physical to logical) looks like




                          • disk (PV: Physical Volume)

                          • Volume Group (VG) : one or more PV

                          • Logical Volume (LV) : a part on a LV, can be mirrored if need be, can be dynamically moved from a PV to another (in same VG).


                          Not part of LVM:




                          • Below LVM are SAN device, local disk or Virtual disk

                          • Above LVM are filesystem or swap.

                          • Some program may use direct access to LV (I don't have example in mind tho).







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Jul 7 '17 at 14:06









                          ArchemarArchemar

                          20k93772




                          20k93772






























                              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%2f375990%2fwhy-do-we-need-to-create-physical-volume-and-volume-group%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 to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

                              is 'sed' thread safe

                              How to make a Squid Proxy server?