using parted to resize partitions using free space in the end of the disk

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I have RH6 wtith GPT disk, which is partitioned as following:



parted /dev/sdb print free
Model: IBM ServeRAID M5110e (scsi)
Disk /dev/sdb: 4599GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number Start End Size File system Name Flags
17.4kB 1049kB 1031kB Free Space
1 1049kB 2199GB 2199GB ext4
2 2199GB 2843GB 644GB ext4
3 2843GB 3165GB 322GB ext4
4 3165GB 3488GB 322GB ext4
3488GB 4599GB 1111GB Free Space


I want to resize 2 and 3 partitions using 'Free Space' at the end of the block device. These partitions currently unmounted .
What is the most proper way to complete the task ?
It is not completely clear in manual of parted, as in 'resize' section it gives examples to resize partition with no other partitions present.
This is production critical server and no place for mistake here.







share|improve this question




















  • You cannot. You can only resize partition 4.
    – NickD
    Oct 30 '17 at 13:21










  • A.B. This is what I`ve done exactly and now it is looks good. Also i have increased the size of partitions ( all, but / ) by tune2fs -m 1 /dev/sdX
    – nix-power
    Oct 30 '17 at 15:20










  • parted can resize partition only in case free space is located directly at the end after the partition in current case the only possible and correct way, is to create brand new partition in free space at the end of the disk, then move all data from partition 3 to to the newly created one, then remove partition 3, and only then resize partition 2 (partition + resize2fs) to whole space created from partition 2 deletion. There is also the way to move 3 partition to the end of disk ( and then resizing it) but it will take more time and more dangerous operation, generally
    – nix-power
    Nov 2 '17 at 9:35














up vote
1
down vote

favorite












I have RH6 wtith GPT disk, which is partitioned as following:



parted /dev/sdb print free
Model: IBM ServeRAID M5110e (scsi)
Disk /dev/sdb: 4599GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number Start End Size File system Name Flags
17.4kB 1049kB 1031kB Free Space
1 1049kB 2199GB 2199GB ext4
2 2199GB 2843GB 644GB ext4
3 2843GB 3165GB 322GB ext4
4 3165GB 3488GB 322GB ext4
3488GB 4599GB 1111GB Free Space


I want to resize 2 and 3 partitions using 'Free Space' at the end of the block device. These partitions currently unmounted .
What is the most proper way to complete the task ?
It is not completely clear in manual of parted, as in 'resize' section it gives examples to resize partition with no other partitions present.
This is production critical server and no place for mistake here.







share|improve this question




















  • You cannot. You can only resize partition 4.
    – NickD
    Oct 30 '17 at 13:21










  • A.B. This is what I`ve done exactly and now it is looks good. Also i have increased the size of partitions ( all, but / ) by tune2fs -m 1 /dev/sdX
    – nix-power
    Oct 30 '17 at 15:20










  • parted can resize partition only in case free space is located directly at the end after the partition in current case the only possible and correct way, is to create brand new partition in free space at the end of the disk, then move all data from partition 3 to to the newly created one, then remove partition 3, and only then resize partition 2 (partition + resize2fs) to whole space created from partition 2 deletion. There is also the way to move 3 partition to the end of disk ( and then resizing it) but it will take more time and more dangerous operation, generally
    – nix-power
    Nov 2 '17 at 9:35












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have RH6 wtith GPT disk, which is partitioned as following:



parted /dev/sdb print free
Model: IBM ServeRAID M5110e (scsi)
Disk /dev/sdb: 4599GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number Start End Size File system Name Flags
17.4kB 1049kB 1031kB Free Space
1 1049kB 2199GB 2199GB ext4
2 2199GB 2843GB 644GB ext4
3 2843GB 3165GB 322GB ext4
4 3165GB 3488GB 322GB ext4
3488GB 4599GB 1111GB Free Space


I want to resize 2 and 3 partitions using 'Free Space' at the end of the block device. These partitions currently unmounted .
What is the most proper way to complete the task ?
It is not completely clear in manual of parted, as in 'resize' section it gives examples to resize partition with no other partitions present.
This is production critical server and no place for mistake here.







share|improve this question












I have RH6 wtith GPT disk, which is partitioned as following:



parted /dev/sdb print free
Model: IBM ServeRAID M5110e (scsi)
Disk /dev/sdb: 4599GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number Start End Size File system Name Flags
17.4kB 1049kB 1031kB Free Space
1 1049kB 2199GB 2199GB ext4
2 2199GB 2843GB 644GB ext4
3 2843GB 3165GB 322GB ext4
4 3165GB 3488GB 322GB ext4
3488GB 4599GB 1111GB Free Space


I want to resize 2 and 3 partitions using 'Free Space' at the end of the block device. These partitions currently unmounted .
What is the most proper way to complete the task ?
It is not completely clear in manual of parted, as in 'resize' section it gives examples to resize partition with no other partitions present.
This is production critical server and no place for mistake here.









share|improve this question











share|improve this question




share|improve this question










asked Oct 30 '17 at 12:45









nix-power

365




365











  • You cannot. You can only resize partition 4.
    – NickD
    Oct 30 '17 at 13:21










  • A.B. This is what I`ve done exactly and now it is looks good. Also i have increased the size of partitions ( all, but / ) by tune2fs -m 1 /dev/sdX
    – nix-power
    Oct 30 '17 at 15:20










  • parted can resize partition only in case free space is located directly at the end after the partition in current case the only possible and correct way, is to create brand new partition in free space at the end of the disk, then move all data from partition 3 to to the newly created one, then remove partition 3, and only then resize partition 2 (partition + resize2fs) to whole space created from partition 2 deletion. There is also the way to move 3 partition to the end of disk ( and then resizing it) but it will take more time and more dangerous operation, generally
    – nix-power
    Nov 2 '17 at 9:35
















  • You cannot. You can only resize partition 4.
    – NickD
    Oct 30 '17 at 13:21










  • A.B. This is what I`ve done exactly and now it is looks good. Also i have increased the size of partitions ( all, but / ) by tune2fs -m 1 /dev/sdX
    – nix-power
    Oct 30 '17 at 15:20










  • parted can resize partition only in case free space is located directly at the end after the partition in current case the only possible and correct way, is to create brand new partition in free space at the end of the disk, then move all data from partition 3 to to the newly created one, then remove partition 3, and only then resize partition 2 (partition + resize2fs) to whole space created from partition 2 deletion. There is also the way to move 3 partition to the end of disk ( and then resizing it) but it will take more time and more dangerous operation, generally
    – nix-power
    Nov 2 '17 at 9:35















You cannot. You can only resize partition 4.
– NickD
Oct 30 '17 at 13:21




You cannot. You can only resize partition 4.
– NickD
Oct 30 '17 at 13:21












A.B. This is what I`ve done exactly and now it is looks good. Also i have increased the size of partitions ( all, but / ) by tune2fs -m 1 /dev/sdX
– nix-power
Oct 30 '17 at 15:20




A.B. This is what I`ve done exactly and now it is looks good. Also i have increased the size of partitions ( all, but / ) by tune2fs -m 1 /dev/sdX
– nix-power
Oct 30 '17 at 15:20












parted can resize partition only in case free space is located directly at the end after the partition in current case the only possible and correct way, is to create brand new partition in free space at the end of the disk, then move all data from partition 3 to to the newly created one, then remove partition 3, and only then resize partition 2 (partition + resize2fs) to whole space created from partition 2 deletion. There is also the way to move 3 partition to the end of disk ( and then resizing it) but it will take more time and more dangerous operation, generally
– nix-power
Nov 2 '17 at 9:35




parted can resize partition only in case free space is located directly at the end after the partition in current case the only possible and correct way, is to create brand new partition in free space at the end of the disk, then move all data from partition 3 to to the newly created one, then remove partition 3, and only then resize partition 2 (partition + resize2fs) to whole space created from partition 2 deletion. There is also the way to move 3 partition to the end of disk ( and then resizing it) but it will take more time and more dangerous operation, generally
– nix-power
Nov 2 '17 at 9:35










1 Answer
1






active

oldest

votes

















up vote
1
down vote













You can't create a partition that is not contiguous directly on GPT, MBR or pretty much any partition table.



To use the disk with more freedom the most common solution is using an LVM as a single partition over the table and then creating your actual partitions over the lvm, but still you won't be able to just do that with parted. You pretty much would need to recreate all partitions.






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',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    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%2f401403%2fusing-parted-to-resize-partitions-using-free-space-in-the-end-of-the-disk%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    You can't create a partition that is not contiguous directly on GPT, MBR or pretty much any partition table.



    To use the disk with more freedom the most common solution is using an LVM as a single partition over the table and then creating your actual partitions over the lvm, but still you won't be able to just do that with parted. You pretty much would need to recreate all partitions.






    share|improve this answer
























      up vote
      1
      down vote













      You can't create a partition that is not contiguous directly on GPT, MBR or pretty much any partition table.



      To use the disk with more freedom the most common solution is using an LVM as a single partition over the table and then creating your actual partitions over the lvm, but still you won't be able to just do that with parted. You pretty much would need to recreate all partitions.






      share|improve this answer






















        up vote
        1
        down vote










        up vote
        1
        down vote









        You can't create a partition that is not contiguous directly on GPT, MBR or pretty much any partition table.



        To use the disk with more freedom the most common solution is using an LVM as a single partition over the table and then creating your actual partitions over the lvm, but still you won't be able to just do that with parted. You pretty much would need to recreate all partitions.






        share|improve this answer












        You can't create a partition that is not contiguous directly on GPT, MBR or pretty much any partition table.



        To use the disk with more freedom the most common solution is using an LVM as a single partition over the table and then creating your actual partitions over the lvm, but still you won't be able to just do that with parted. You pretty much would need to recreate all partitions.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 1 '17 at 1:37









        Zip

        51118




        51118



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f401403%2fusing-parted-to-resize-partitions-using-free-space-in-the-end-of-the-disk%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Peggy Mitchell

            The Forum (Inglewood, California)

            Palaiologos