Safe way of extending xfs partition

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











up vote
1
down vote

favorite












I created an xfs partition using fdisk and mkfs.xfs on my 6T hhd. I ended up with only 2T. What is the safest way of expanding the partition to take up all the remaining space without disturbing the files already in the drive? Will xfs_growfs do the job? What other things should I take into consideration?










share|improve this question

















  • 1




    Was your disk was partitioned with GPT? MBR has an inherent limitation of about 2 TB.
    – Haxiel
    Dec 5 at 13:33











  • I used fdisk to create the partition.
    – Ivan Jacob Pesigan
    Dec 5 at 13:37










  • To verify this, can you run fdisk -l [disk] and update the question with its output?
    – Haxiel
    Dec 5 at 13:40










  • Don't have access to the machine right now but I distinctly remember getting a size of 2T on /dev/sdg1 but fdisk correctly detects that the whole device (/dev/sdg) is around 6T.
    – Ivan Jacob Pesigan
    Dec 5 at 14:04










  • Using fdisk was the problem. Next time, use parted or gdisk for disks > 2TB. GPT, not MBR.
    – Christopher
    Dec 5 at 14:29















up vote
1
down vote

favorite












I created an xfs partition using fdisk and mkfs.xfs on my 6T hhd. I ended up with only 2T. What is the safest way of expanding the partition to take up all the remaining space without disturbing the files already in the drive? Will xfs_growfs do the job? What other things should I take into consideration?










share|improve this question

















  • 1




    Was your disk was partitioned with GPT? MBR has an inherent limitation of about 2 TB.
    – Haxiel
    Dec 5 at 13:33











  • I used fdisk to create the partition.
    – Ivan Jacob Pesigan
    Dec 5 at 13:37










  • To verify this, can you run fdisk -l [disk] and update the question with its output?
    – Haxiel
    Dec 5 at 13:40










  • Don't have access to the machine right now but I distinctly remember getting a size of 2T on /dev/sdg1 but fdisk correctly detects that the whole device (/dev/sdg) is around 6T.
    – Ivan Jacob Pesigan
    Dec 5 at 14:04










  • Using fdisk was the problem. Next time, use parted or gdisk for disks > 2TB. GPT, not MBR.
    – Christopher
    Dec 5 at 14:29













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I created an xfs partition using fdisk and mkfs.xfs on my 6T hhd. I ended up with only 2T. What is the safest way of expanding the partition to take up all the remaining space without disturbing the files already in the drive? Will xfs_growfs do the job? What other things should I take into consideration?










share|improve this question













I created an xfs partition using fdisk and mkfs.xfs on my 6T hhd. I ended up with only 2T. What is the safest way of expanding the partition to take up all the remaining space without disturbing the files already in the drive? Will xfs_growfs do the job? What other things should I take into consideration?







partition xfs






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 5 at 13:21









Ivan Jacob Pesigan

61




61







  • 1




    Was your disk was partitioned with GPT? MBR has an inherent limitation of about 2 TB.
    – Haxiel
    Dec 5 at 13:33











  • I used fdisk to create the partition.
    – Ivan Jacob Pesigan
    Dec 5 at 13:37










  • To verify this, can you run fdisk -l [disk] and update the question with its output?
    – Haxiel
    Dec 5 at 13:40










  • Don't have access to the machine right now but I distinctly remember getting a size of 2T on /dev/sdg1 but fdisk correctly detects that the whole device (/dev/sdg) is around 6T.
    – Ivan Jacob Pesigan
    Dec 5 at 14:04










  • Using fdisk was the problem. Next time, use parted or gdisk for disks > 2TB. GPT, not MBR.
    – Christopher
    Dec 5 at 14:29













  • 1




    Was your disk was partitioned with GPT? MBR has an inherent limitation of about 2 TB.
    – Haxiel
    Dec 5 at 13:33











  • I used fdisk to create the partition.
    – Ivan Jacob Pesigan
    Dec 5 at 13:37










  • To verify this, can you run fdisk -l [disk] and update the question with its output?
    – Haxiel
    Dec 5 at 13:40










  • Don't have access to the machine right now but I distinctly remember getting a size of 2T on /dev/sdg1 but fdisk correctly detects that the whole device (/dev/sdg) is around 6T.
    – Ivan Jacob Pesigan
    Dec 5 at 14:04










  • Using fdisk was the problem. Next time, use parted or gdisk for disks > 2TB. GPT, not MBR.
    – Christopher
    Dec 5 at 14:29








1




1




Was your disk was partitioned with GPT? MBR has an inherent limitation of about 2 TB.
– Haxiel
Dec 5 at 13:33





Was your disk was partitioned with GPT? MBR has an inherent limitation of about 2 TB.
– Haxiel
Dec 5 at 13:33













I used fdisk to create the partition.
– Ivan Jacob Pesigan
Dec 5 at 13:37




I used fdisk to create the partition.
– Ivan Jacob Pesigan
Dec 5 at 13:37












To verify this, can you run fdisk -l [disk] and update the question with its output?
– Haxiel
Dec 5 at 13:40




To verify this, can you run fdisk -l [disk] and update the question with its output?
– Haxiel
Dec 5 at 13:40












Don't have access to the machine right now but I distinctly remember getting a size of 2T on /dev/sdg1 but fdisk correctly detects that the whole device (/dev/sdg) is around 6T.
– Ivan Jacob Pesigan
Dec 5 at 14:04




Don't have access to the machine right now but I distinctly remember getting a size of 2T on /dev/sdg1 but fdisk correctly detects that the whole device (/dev/sdg) is around 6T.
– Ivan Jacob Pesigan
Dec 5 at 14:04












Using fdisk was the problem. Next time, use parted or gdisk for disks > 2TB. GPT, not MBR.
– Christopher
Dec 5 at 14:29





Using fdisk was the problem. Next time, use parted or gdisk for disks > 2TB. GPT, not MBR.
– Christopher
Dec 5 at 14:29











1 Answer
1






active

oldest

votes

















up vote
0
down vote













I see two possible ways to resolve your case:
If you can backup files to external storage:



  1. destroy the filesystem

  2. create dedicated volume group

  3. create entire disk /dev/sdg as PV: pvcreate /dev/sdg

  4. add PV to the VG

  5. create LV

  6. create filesystem on LV


  7. restore the files



    If you do not have place to backup the files (here start with step 1, not 8, numeration in SE do not work well)



  8. create two partitions /dev/sdg2 and /dev/sdg3 to the end of the disk


  9. create VG


  10. create PVs on the partitions


  11. add PVs to the VG


  12. create LV


  13. create filesystem on this LV


  14. mount this LV


  15. copy files to the new filesystem


  16. unmount /dev/sdg1


  17. create on /dev/sdg1 PV


  18. add PV to VG


  19. extend LV to the full size of VG






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: 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%2f486147%2fsafe-way-of-extending-xfs-partition%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








    up vote
    0
    down vote













    I see two possible ways to resolve your case:
    If you can backup files to external storage:



    1. destroy the filesystem

    2. create dedicated volume group

    3. create entire disk /dev/sdg as PV: pvcreate /dev/sdg

    4. add PV to the VG

    5. create LV

    6. create filesystem on LV


    7. restore the files



      If you do not have place to backup the files (here start with step 1, not 8, numeration in SE do not work well)



    8. create two partitions /dev/sdg2 and /dev/sdg3 to the end of the disk


    9. create VG


    10. create PVs on the partitions


    11. add PVs to the VG


    12. create LV


    13. create filesystem on this LV


    14. mount this LV


    15. copy files to the new filesystem


    16. unmount /dev/sdg1


    17. create on /dev/sdg1 PV


    18. add PV to VG


    19. extend LV to the full size of VG






    share|improve this answer
























      up vote
      0
      down vote













      I see two possible ways to resolve your case:
      If you can backup files to external storage:



      1. destroy the filesystem

      2. create dedicated volume group

      3. create entire disk /dev/sdg as PV: pvcreate /dev/sdg

      4. add PV to the VG

      5. create LV

      6. create filesystem on LV


      7. restore the files



        If you do not have place to backup the files (here start with step 1, not 8, numeration in SE do not work well)



      8. create two partitions /dev/sdg2 and /dev/sdg3 to the end of the disk


      9. create VG


      10. create PVs on the partitions


      11. add PVs to the VG


      12. create LV


      13. create filesystem on this LV


      14. mount this LV


      15. copy files to the new filesystem


      16. unmount /dev/sdg1


      17. create on /dev/sdg1 PV


      18. add PV to VG


      19. extend LV to the full size of VG






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        I see two possible ways to resolve your case:
        If you can backup files to external storage:



        1. destroy the filesystem

        2. create dedicated volume group

        3. create entire disk /dev/sdg as PV: pvcreate /dev/sdg

        4. add PV to the VG

        5. create LV

        6. create filesystem on LV


        7. restore the files



          If you do not have place to backup the files (here start with step 1, not 8, numeration in SE do not work well)



        8. create two partitions /dev/sdg2 and /dev/sdg3 to the end of the disk


        9. create VG


        10. create PVs on the partitions


        11. add PVs to the VG


        12. create LV


        13. create filesystem on this LV


        14. mount this LV


        15. copy files to the new filesystem


        16. unmount /dev/sdg1


        17. create on /dev/sdg1 PV


        18. add PV to VG


        19. extend LV to the full size of VG






        share|improve this answer












        I see two possible ways to resolve your case:
        If you can backup files to external storage:



        1. destroy the filesystem

        2. create dedicated volume group

        3. create entire disk /dev/sdg as PV: pvcreate /dev/sdg

        4. add PV to the VG

        5. create LV

        6. create filesystem on LV


        7. restore the files



          If you do not have place to backup the files (here start with step 1, not 8, numeration in SE do not work well)



        8. create two partitions /dev/sdg2 and /dev/sdg3 to the end of the disk


        9. create VG


        10. create PVs on the partitions


        11. add PVs to the VG


        12. create LV


        13. create filesystem on this LV


        14. mount this LV


        15. copy files to the new filesystem


        16. unmount /dev/sdg1


        17. create on /dev/sdg1 PV


        18. add PV to VG


        19. extend LV to the full size of VG







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 5 at 14:19









        Romeo Ninov

        5,06231727




        5,06231727



























            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2f486147%2fsafe-way-of-extending-xfs-partition%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

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)