Does `resize2fs` by default do nothing?












0















For resize2fs,




If ``size parameter is not specified, it will default to the
size of the partition




The size of a filesystem is by default the size of its underlying partition.



So by default, resize2fs doesn't change the size of a filesystem. Does it do nothing?



Thanks.










share|improve this question



























    0















    For resize2fs,




    If ``size parameter is not specified, it will default to the
    size of the partition




    The size of a filesystem is by default the size of its underlying partition.



    So by default, resize2fs doesn't change the size of a filesystem. Does it do nothing?



    Thanks.










    share|improve this question

























      0












      0








      0








      For resize2fs,




      If ``size parameter is not specified, it will default to the
      size of the partition




      The size of a filesystem is by default the size of its underlying partition.



      So by default, resize2fs doesn't change the size of a filesystem. Does it do nothing?



      Thanks.










      share|improve this question














      For resize2fs,




      If ``size parameter is not specified, it will default to the
      size of the partition




      The size of a filesystem is by default the size of its underlying partition.



      So by default, resize2fs doesn't change the size of a filesystem. Does it do nothing?



      Thanks.







      filesystems resize2fs






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 21 at 17:29









      TimTim

      27.6k78264480




      27.6k78264480






















          3 Answers
          3






          active

          oldest

          votes


















          2














          If the underlying partition is larger than the filesystem within it, resize2fs will, by default, attempt to expand the filesystem to fill the partition.



          For example, if /dev/sdd3 is a 1TB partition, and we were to run:



          # mke2fs /dev/sdd3 500G


          We will have a 500GB partition within a 1TB partition. If we then resize2fs /dev/sdd3, it will be expanded to the full 1TB.






          share|improve this answer































            1















            The size of a filesystem is by default the size of its underlying partition.




            Usually, yes. There's little point in creating a filesystem smaller than the available space on the partition.



            But if you're trying to enlarge the filesystem, you'll first have to enlarge the device it's on. For the usual fixed partitions, that's not often possible (you'd need to have available space after the partition itself), but with something like LVM it's trivial, since you can just resize the logical volume at will.



            After resizing the partition/volume, the filesystem only makes use of the originally available space, and at that point resize2fs is necessary. Again, you'll usually want to resize the partition to the fill all the now available space, so the default action is what you want.






            share|improve this answer































              1














              I also often (ab)use resize2fs in some smallish/skeletal VMs for not to have to setup LVM.



              For extending a drive/partition, I can provisioning/extend a virtual physical hard disk, and then delete and create a new bigger partition. Once I do that, I can extend the partition to the new "physical" space. (for instance, in vmware, I just edit an existing virtual disk, and edit it to be 10GB instead of 5GB...)



              Or even in a physical disk, you can delete a second partition, delete the 1st one and recreate it using the former space of the two partitions, and then use resizefs for having a single partition where once you had two partitions.



              So, resize2fs does something even without using LVM.






              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%2f502136%2fdoes-resize2fs-by-default-do-nothing%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









                2














                If the underlying partition is larger than the filesystem within it, resize2fs will, by default, attempt to expand the filesystem to fill the partition.



                For example, if /dev/sdd3 is a 1TB partition, and we were to run:



                # mke2fs /dev/sdd3 500G


                We will have a 500GB partition within a 1TB partition. If we then resize2fs /dev/sdd3, it will be expanded to the full 1TB.






                share|improve this answer




























                  2














                  If the underlying partition is larger than the filesystem within it, resize2fs will, by default, attempt to expand the filesystem to fill the partition.



                  For example, if /dev/sdd3 is a 1TB partition, and we were to run:



                  # mke2fs /dev/sdd3 500G


                  We will have a 500GB partition within a 1TB partition. If we then resize2fs /dev/sdd3, it will be expanded to the full 1TB.






                  share|improve this answer


























                    2












                    2








                    2







                    If the underlying partition is larger than the filesystem within it, resize2fs will, by default, attempt to expand the filesystem to fill the partition.



                    For example, if /dev/sdd3 is a 1TB partition, and we were to run:



                    # mke2fs /dev/sdd3 500G


                    We will have a 500GB partition within a 1TB partition. If we then resize2fs /dev/sdd3, it will be expanded to the full 1TB.






                    share|improve this answer













                    If the underlying partition is larger than the filesystem within it, resize2fs will, by default, attempt to expand the filesystem to fill the partition.



                    For example, if /dev/sdd3 is a 1TB partition, and we were to run:



                    # mke2fs /dev/sdd3 500G


                    We will have a 500GB partition within a 1TB partition. If we then resize2fs /dev/sdd3, it will be expanded to the full 1TB.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Feb 21 at 17:41









                    DopeGhotiDopeGhoti

                    46.1k56089




                    46.1k56089

























                        1















                        The size of a filesystem is by default the size of its underlying partition.




                        Usually, yes. There's little point in creating a filesystem smaller than the available space on the partition.



                        But if you're trying to enlarge the filesystem, you'll first have to enlarge the device it's on. For the usual fixed partitions, that's not often possible (you'd need to have available space after the partition itself), but with something like LVM it's trivial, since you can just resize the logical volume at will.



                        After resizing the partition/volume, the filesystem only makes use of the originally available space, and at that point resize2fs is necessary. Again, you'll usually want to resize the partition to the fill all the now available space, so the default action is what you want.






                        share|improve this answer




























                          1















                          The size of a filesystem is by default the size of its underlying partition.




                          Usually, yes. There's little point in creating a filesystem smaller than the available space on the partition.



                          But if you're trying to enlarge the filesystem, you'll first have to enlarge the device it's on. For the usual fixed partitions, that's not often possible (you'd need to have available space after the partition itself), but with something like LVM it's trivial, since you can just resize the logical volume at will.



                          After resizing the partition/volume, the filesystem only makes use of the originally available space, and at that point resize2fs is necessary. Again, you'll usually want to resize the partition to the fill all the now available space, so the default action is what you want.






                          share|improve this answer


























                            1












                            1








                            1








                            The size of a filesystem is by default the size of its underlying partition.




                            Usually, yes. There's little point in creating a filesystem smaller than the available space on the partition.



                            But if you're trying to enlarge the filesystem, you'll first have to enlarge the device it's on. For the usual fixed partitions, that's not often possible (you'd need to have available space after the partition itself), but with something like LVM it's trivial, since you can just resize the logical volume at will.



                            After resizing the partition/volume, the filesystem only makes use of the originally available space, and at that point resize2fs is necessary. Again, you'll usually want to resize the partition to the fill all the now available space, so the default action is what you want.






                            share|improve this answer














                            The size of a filesystem is by default the size of its underlying partition.




                            Usually, yes. There's little point in creating a filesystem smaller than the available space on the partition.



                            But if you're trying to enlarge the filesystem, you'll first have to enlarge the device it's on. For the usual fixed partitions, that's not often possible (you'd need to have available space after the partition itself), but with something like LVM it's trivial, since you can just resize the logical volume at will.



                            After resizing the partition/volume, the filesystem only makes use of the originally available space, and at that point resize2fs is necessary. Again, you'll usually want to resize the partition to the fill all the now available space, so the default action is what you want.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Feb 21 at 18:07









                            ilkkachuilkkachu

                            60.9k1098174




                            60.9k1098174























                                1














                                I also often (ab)use resize2fs in some smallish/skeletal VMs for not to have to setup LVM.



                                For extending a drive/partition, I can provisioning/extend a virtual physical hard disk, and then delete and create a new bigger partition. Once I do that, I can extend the partition to the new "physical" space. (for instance, in vmware, I just edit an existing virtual disk, and edit it to be 10GB instead of 5GB...)



                                Or even in a physical disk, you can delete a second partition, delete the 1st one and recreate it using the former space of the two partitions, and then use resizefs for having a single partition where once you had two partitions.



                                So, resize2fs does something even without using LVM.






                                share|improve this answer






























                                  1














                                  I also often (ab)use resize2fs in some smallish/skeletal VMs for not to have to setup LVM.



                                  For extending a drive/partition, I can provisioning/extend a virtual physical hard disk, and then delete and create a new bigger partition. Once I do that, I can extend the partition to the new "physical" space. (for instance, in vmware, I just edit an existing virtual disk, and edit it to be 10GB instead of 5GB...)



                                  Or even in a physical disk, you can delete a second partition, delete the 1st one and recreate it using the former space of the two partitions, and then use resizefs for having a single partition where once you had two partitions.



                                  So, resize2fs does something even without using LVM.






                                  share|improve this answer




























                                    1












                                    1








                                    1







                                    I also often (ab)use resize2fs in some smallish/skeletal VMs for not to have to setup LVM.



                                    For extending a drive/partition, I can provisioning/extend a virtual physical hard disk, and then delete and create a new bigger partition. Once I do that, I can extend the partition to the new "physical" space. (for instance, in vmware, I just edit an existing virtual disk, and edit it to be 10GB instead of 5GB...)



                                    Or even in a physical disk, you can delete a second partition, delete the 1st one and recreate it using the former space of the two partitions, and then use resizefs for having a single partition where once you had two partitions.



                                    So, resize2fs does something even without using LVM.






                                    share|improve this answer















                                    I also often (ab)use resize2fs in some smallish/skeletal VMs for not to have to setup LVM.



                                    For extending a drive/partition, I can provisioning/extend a virtual physical hard disk, and then delete and create a new bigger partition. Once I do that, I can extend the partition to the new "physical" space. (for instance, in vmware, I just edit an existing virtual disk, and edit it to be 10GB instead of 5GB...)



                                    Or even in a physical disk, you can delete a second partition, delete the 1st one and recreate it using the former space of the two partitions, and then use resizefs for having a single partition where once you had two partitions.



                                    So, resize2fs does something even without using LVM.







                                    share|improve this answer














                                    share|improve this answer



                                    share|improve this answer








                                    edited Feb 21 at 20:38

























                                    answered Feb 21 at 19:58









                                    Rui F RibeiroRui F Ribeiro

                                    41.4k1481140




                                    41.4k1481140






























                                        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%2f502136%2fdoes-resize2fs-by-default-do-nothing%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 make a Squid Proxy server?

                                        Is this a new Fibonacci Identity?

                                        Touch on Surface Book