Resize an existing LVM partition and add the space to another LVM partition

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











up vote
1
down vote

favorite
1












I'd like to resize an existing LVM partition and add the space to another LVM partition.



[root@dckapstaging ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_dckapstaging-lv_root 50G 50G 0 100% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
/dev/sda1 485M 91M 369M 20% /boot
/dev/mapper/vg_dckapstaging-lv_home 215G 93G 111G 46% /home


I want /dev/mapper/vg_dckapstaging-lv_root to be extended to another 15 GB from /dev/mapper/vg_dckapstaging-lv_home; how can I do it?







share|improve this question

























    up vote
    1
    down vote

    favorite
    1












    I'd like to resize an existing LVM partition and add the space to another LVM partition.



    [root@dckapstaging ~]# df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/vg_dckapstaging-lv_root 50G 50G 0 100% /
    tmpfs 3.9G 0 3.9G 0% /dev/shm
    /dev/sda1 485M 91M 369M 20% /boot
    /dev/mapper/vg_dckapstaging-lv_home 215G 93G 111G 46% /home


    I want /dev/mapper/vg_dckapstaging-lv_root to be extended to another 15 GB from /dev/mapper/vg_dckapstaging-lv_home; how can I do it?







    share|improve this question























      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      I'd like to resize an existing LVM partition and add the space to another LVM partition.



      [root@dckapstaging ~]# df -h
      Filesystem Size Used Avail Use% Mounted on
      /dev/mapper/vg_dckapstaging-lv_root 50G 50G 0 100% /
      tmpfs 3.9G 0 3.9G 0% /dev/shm
      /dev/sda1 485M 91M 369M 20% /boot
      /dev/mapper/vg_dckapstaging-lv_home 215G 93G 111G 46% /home


      I want /dev/mapper/vg_dckapstaging-lv_root to be extended to another 15 GB from /dev/mapper/vg_dckapstaging-lv_home; how can I do it?







      share|improve this question













      I'd like to resize an existing LVM partition and add the space to another LVM partition.



      [root@dckapstaging ~]# df -h
      Filesystem Size Used Avail Use% Mounted on
      /dev/mapper/vg_dckapstaging-lv_root 50G 50G 0 100% /
      tmpfs 3.9G 0 3.9G 0% /dev/shm
      /dev/sda1 485M 91M 369M 20% /boot
      /dev/mapper/vg_dckapstaging-lv_home 215G 93G 111G 46% /home


      I want /dev/mapper/vg_dckapstaging-lv_root to be extended to another 15 GB from /dev/mapper/vg_dckapstaging-lv_home; how can I do it?









      share|improve this question












      share|improve this question




      share|improve this question








      edited Jul 13 '15 at 9:12









      dr01

      15.1k114666




      15.1k114666









      asked Jul 13 '15 at 8:42









      Danny

      1411315




      1411315




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          4
          down vote













          Assuming your volume group is already full, and you cannot extend it further, you will need to:



          1. Shrink the filesystem in lv_home using the specific tools for your filesystem, e.g. resize2fs if you use ext3/4.

          2. Resize lv_home accordingly with lvreduce.

          3. Increase lv_root with lvresize.

          4. Increase the filesystem in lv_root so that it uses all the additional space in the LV.

          As always, back up your data first, resizing filesystems is always a risky business.



          If you happen to use XFS in lv_home you'll need to use a different approach, because XFS does not support shrinking. In this case:



          1. backup the data in lv_home

          2. reduce lv_home with lvreduce (FS is destroyed at this point!)

          3. recreate the filesystem in lv_home with smaller size

          4. restore the data

          5. increase lv_root as per steps 3 & 4 above.





          share|improve this answer



















          • 2




            For ext2/ext3/ext4, lv_home needs to be unmounted before shrinking. Enlarging the volume can be done while it's mounted.
            – Gilles
            Jul 13 '15 at 23:00

















          up vote
          2
          down vote













          First off, you want to unmount the partitions in question. Boot an usb stick or similar. Backing up important data is always recommended before fiddling with filesystems.



          Reduce the filesystem first in /dev/mapper/vg_dckapstaging-lv_home. Otherwise, resizing the lv will drop the data. The way to do it depends naturally from filesystem. resize2fs works for ext2/3/4 filesystems. resize2fs /dev/mapper/vg_dckapstaging-lv_home 200G



          After you've shrunken the filesystem, run lvresize -L -15G /dev/mapper/vg_dckapstaging-lv_home to free up the 15GBs and lvresize -L +15G /dev/mapper/vg_dckapstaging-lv_root to enlargen the lv_root



          Finalize with your fs resize tool. For ext that'd be resize2fs /dev/mapper/vg_dckapstaging-lv_root to enlarge it to maximum available space.



          EDIT:corrected a typo: partition -> filesystem






          share|improve this answer























          • resize2fs before lvresize ? (just a question, I never did it). BTW there is a typo 200G instead of 20G.
            – Archemar
            Jul 13 '15 at 9:41










          • @Archemar resize2fs first because lvresize doesn't check whether reduced part contains data i.e. it's filesystem agnostic. resize2fs (or filesystem equivalent) does. 200G isn't a typo, resize2fs takes new size instead of relative size. Or my version does, at any rate. 215G - 15G = 200G
            – WhimsicalWombat
            Jul 13 '15 at 9:46











          • @WhimsicalWombat resize2fs /dev/mapper/vg_dckapstaging-lv_home 200G doesnt work after unmount gives resize2fs invalid new size
            – Danny
            Jul 13 '15 at 13:36










          • @Danny That's weird. You're using ext2/3/4 filesystem, right? Check your resize2fs manpage to be certain that your version accepts the G-suffix. If that's not it then... I don't know. Sounds like a syntax error but the command you wrote seems to be ok. Double check for typos I guess.
            – WhimsicalWombat
            Jul 13 '15 at 14:46










          • When shrinking, you need to shrink the filesystem before the volume. But when enlarging, you need to enlarge the volume before the filesystem.
            – Gilles
            Jul 13 '15 at 23:01

















          up vote
          0
          down vote













          This is a risky operation



          1. you should try to clean / (have a look at /var/log /var/spool and delete old and big file)



          2. theorical way to proceed include



            fsck -F /dev/mapper/vg_dckapstaging-lv_home
            lvresize --size -15G /dev/mapper/vg_dckapstaging-lv_home
            resize2fs /home
            lvresize --size +15G /dev/mapper/vg_dckapstaging-lv_root
            resize2fs /



          3. Disclaimer



            3.1. be sure to have a valid backup !!



            3.2. If this is a production system, please do try to test it before.







          share|improve this answer





















          • There's a big problem with your commands: with lv_home, you're shrinking the container before shrinking the content! That will break the content. Also the argument to resize2fs must be the volume names, not directories (and you need to unmount before shrinking).
            – Gilles
            Jul 13 '15 at 22:59










          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%2f215629%2fresize-an-existing-lvm-partition-and-add-the-space-to-another-lvm-partition%23new-answer', 'question_page');

          );

          Post as a guest






























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          4
          down vote













          Assuming your volume group is already full, and you cannot extend it further, you will need to:



          1. Shrink the filesystem in lv_home using the specific tools for your filesystem, e.g. resize2fs if you use ext3/4.

          2. Resize lv_home accordingly with lvreduce.

          3. Increase lv_root with lvresize.

          4. Increase the filesystem in lv_root so that it uses all the additional space in the LV.

          As always, back up your data first, resizing filesystems is always a risky business.



          If you happen to use XFS in lv_home you'll need to use a different approach, because XFS does not support shrinking. In this case:



          1. backup the data in lv_home

          2. reduce lv_home with lvreduce (FS is destroyed at this point!)

          3. recreate the filesystem in lv_home with smaller size

          4. restore the data

          5. increase lv_root as per steps 3 & 4 above.





          share|improve this answer



















          • 2




            For ext2/ext3/ext4, lv_home needs to be unmounted before shrinking. Enlarging the volume can be done while it's mounted.
            – Gilles
            Jul 13 '15 at 23:00














          up vote
          4
          down vote













          Assuming your volume group is already full, and you cannot extend it further, you will need to:



          1. Shrink the filesystem in lv_home using the specific tools for your filesystem, e.g. resize2fs if you use ext3/4.

          2. Resize lv_home accordingly with lvreduce.

          3. Increase lv_root with lvresize.

          4. Increase the filesystem in lv_root so that it uses all the additional space in the LV.

          As always, back up your data first, resizing filesystems is always a risky business.



          If you happen to use XFS in lv_home you'll need to use a different approach, because XFS does not support shrinking. In this case:



          1. backup the data in lv_home

          2. reduce lv_home with lvreduce (FS is destroyed at this point!)

          3. recreate the filesystem in lv_home with smaller size

          4. restore the data

          5. increase lv_root as per steps 3 & 4 above.





          share|improve this answer



















          • 2




            For ext2/ext3/ext4, lv_home needs to be unmounted before shrinking. Enlarging the volume can be done while it's mounted.
            – Gilles
            Jul 13 '15 at 23:00












          up vote
          4
          down vote










          up vote
          4
          down vote









          Assuming your volume group is already full, and you cannot extend it further, you will need to:



          1. Shrink the filesystem in lv_home using the specific tools for your filesystem, e.g. resize2fs if you use ext3/4.

          2. Resize lv_home accordingly with lvreduce.

          3. Increase lv_root with lvresize.

          4. Increase the filesystem in lv_root so that it uses all the additional space in the LV.

          As always, back up your data first, resizing filesystems is always a risky business.



          If you happen to use XFS in lv_home you'll need to use a different approach, because XFS does not support shrinking. In this case:



          1. backup the data in lv_home

          2. reduce lv_home with lvreduce (FS is destroyed at this point!)

          3. recreate the filesystem in lv_home with smaller size

          4. restore the data

          5. increase lv_root as per steps 3 & 4 above.





          share|improve this answer















          Assuming your volume group is already full, and you cannot extend it further, you will need to:



          1. Shrink the filesystem in lv_home using the specific tools for your filesystem, e.g. resize2fs if you use ext3/4.

          2. Resize lv_home accordingly with lvreduce.

          3. Increase lv_root with lvresize.

          4. Increase the filesystem in lv_root so that it uses all the additional space in the LV.

          As always, back up your data first, resizing filesystems is always a risky business.



          If you happen to use XFS in lv_home you'll need to use a different approach, because XFS does not support shrinking. In this case:



          1. backup the data in lv_home

          2. reduce lv_home with lvreduce (FS is destroyed at this point!)

          3. recreate the filesystem in lv_home with smaller size

          4. restore the data

          5. increase lv_root as per steps 3 & 4 above.






          share|improve this answer















          share|improve this answer



          share|improve this answer








          edited Jul 14 '15 at 7:15


























          answered Jul 13 '15 at 9:31









          katti

          52939




          52939







          • 2




            For ext2/ext3/ext4, lv_home needs to be unmounted before shrinking. Enlarging the volume can be done while it's mounted.
            – Gilles
            Jul 13 '15 at 23:00












          • 2




            For ext2/ext3/ext4, lv_home needs to be unmounted before shrinking. Enlarging the volume can be done while it's mounted.
            – Gilles
            Jul 13 '15 at 23:00







          2




          2




          For ext2/ext3/ext4, lv_home needs to be unmounted before shrinking. Enlarging the volume can be done while it's mounted.
          – Gilles
          Jul 13 '15 at 23:00




          For ext2/ext3/ext4, lv_home needs to be unmounted before shrinking. Enlarging the volume can be done while it's mounted.
          – Gilles
          Jul 13 '15 at 23:00












          up vote
          2
          down vote













          First off, you want to unmount the partitions in question. Boot an usb stick or similar. Backing up important data is always recommended before fiddling with filesystems.



          Reduce the filesystem first in /dev/mapper/vg_dckapstaging-lv_home. Otherwise, resizing the lv will drop the data. The way to do it depends naturally from filesystem. resize2fs works for ext2/3/4 filesystems. resize2fs /dev/mapper/vg_dckapstaging-lv_home 200G



          After you've shrunken the filesystem, run lvresize -L -15G /dev/mapper/vg_dckapstaging-lv_home to free up the 15GBs and lvresize -L +15G /dev/mapper/vg_dckapstaging-lv_root to enlargen the lv_root



          Finalize with your fs resize tool. For ext that'd be resize2fs /dev/mapper/vg_dckapstaging-lv_root to enlarge it to maximum available space.



          EDIT:corrected a typo: partition -> filesystem






          share|improve this answer























          • resize2fs before lvresize ? (just a question, I never did it). BTW there is a typo 200G instead of 20G.
            – Archemar
            Jul 13 '15 at 9:41










          • @Archemar resize2fs first because lvresize doesn't check whether reduced part contains data i.e. it's filesystem agnostic. resize2fs (or filesystem equivalent) does. 200G isn't a typo, resize2fs takes new size instead of relative size. Or my version does, at any rate. 215G - 15G = 200G
            – WhimsicalWombat
            Jul 13 '15 at 9:46











          • @WhimsicalWombat resize2fs /dev/mapper/vg_dckapstaging-lv_home 200G doesnt work after unmount gives resize2fs invalid new size
            – Danny
            Jul 13 '15 at 13:36










          • @Danny That's weird. You're using ext2/3/4 filesystem, right? Check your resize2fs manpage to be certain that your version accepts the G-suffix. If that's not it then... I don't know. Sounds like a syntax error but the command you wrote seems to be ok. Double check for typos I guess.
            – WhimsicalWombat
            Jul 13 '15 at 14:46










          • When shrinking, you need to shrink the filesystem before the volume. But when enlarging, you need to enlarge the volume before the filesystem.
            – Gilles
            Jul 13 '15 at 23:01














          up vote
          2
          down vote













          First off, you want to unmount the partitions in question. Boot an usb stick or similar. Backing up important data is always recommended before fiddling with filesystems.



          Reduce the filesystem first in /dev/mapper/vg_dckapstaging-lv_home. Otherwise, resizing the lv will drop the data. The way to do it depends naturally from filesystem. resize2fs works for ext2/3/4 filesystems. resize2fs /dev/mapper/vg_dckapstaging-lv_home 200G



          After you've shrunken the filesystem, run lvresize -L -15G /dev/mapper/vg_dckapstaging-lv_home to free up the 15GBs and lvresize -L +15G /dev/mapper/vg_dckapstaging-lv_root to enlargen the lv_root



          Finalize with your fs resize tool. For ext that'd be resize2fs /dev/mapper/vg_dckapstaging-lv_root to enlarge it to maximum available space.



          EDIT:corrected a typo: partition -> filesystem






          share|improve this answer























          • resize2fs before lvresize ? (just a question, I never did it). BTW there is a typo 200G instead of 20G.
            – Archemar
            Jul 13 '15 at 9:41










          • @Archemar resize2fs first because lvresize doesn't check whether reduced part contains data i.e. it's filesystem agnostic. resize2fs (or filesystem equivalent) does. 200G isn't a typo, resize2fs takes new size instead of relative size. Or my version does, at any rate. 215G - 15G = 200G
            – WhimsicalWombat
            Jul 13 '15 at 9:46











          • @WhimsicalWombat resize2fs /dev/mapper/vg_dckapstaging-lv_home 200G doesnt work after unmount gives resize2fs invalid new size
            – Danny
            Jul 13 '15 at 13:36










          • @Danny That's weird. You're using ext2/3/4 filesystem, right? Check your resize2fs manpage to be certain that your version accepts the G-suffix. If that's not it then... I don't know. Sounds like a syntax error but the command you wrote seems to be ok. Double check for typos I guess.
            – WhimsicalWombat
            Jul 13 '15 at 14:46










          • When shrinking, you need to shrink the filesystem before the volume. But when enlarging, you need to enlarge the volume before the filesystem.
            – Gilles
            Jul 13 '15 at 23:01












          up vote
          2
          down vote










          up vote
          2
          down vote









          First off, you want to unmount the partitions in question. Boot an usb stick or similar. Backing up important data is always recommended before fiddling with filesystems.



          Reduce the filesystem first in /dev/mapper/vg_dckapstaging-lv_home. Otherwise, resizing the lv will drop the data. The way to do it depends naturally from filesystem. resize2fs works for ext2/3/4 filesystems. resize2fs /dev/mapper/vg_dckapstaging-lv_home 200G



          After you've shrunken the filesystem, run lvresize -L -15G /dev/mapper/vg_dckapstaging-lv_home to free up the 15GBs and lvresize -L +15G /dev/mapper/vg_dckapstaging-lv_root to enlargen the lv_root



          Finalize with your fs resize tool. For ext that'd be resize2fs /dev/mapper/vg_dckapstaging-lv_root to enlarge it to maximum available space.



          EDIT:corrected a typo: partition -> filesystem






          share|improve this answer















          First off, you want to unmount the partitions in question. Boot an usb stick or similar. Backing up important data is always recommended before fiddling with filesystems.



          Reduce the filesystem first in /dev/mapper/vg_dckapstaging-lv_home. Otherwise, resizing the lv will drop the data. The way to do it depends naturally from filesystem. resize2fs works for ext2/3/4 filesystems. resize2fs /dev/mapper/vg_dckapstaging-lv_home 200G



          After you've shrunken the filesystem, run lvresize -L -15G /dev/mapper/vg_dckapstaging-lv_home to free up the 15GBs and lvresize -L +15G /dev/mapper/vg_dckapstaging-lv_root to enlargen the lv_root



          Finalize with your fs resize tool. For ext that'd be resize2fs /dev/mapper/vg_dckapstaging-lv_root to enlarge it to maximum available space.



          EDIT:corrected a typo: partition -> filesystem







          share|improve this answer















          share|improve this answer



          share|improve this answer








          edited Jul 13 '15 at 9:36


























          answered Jul 13 '15 at 9:30









          WhimsicalWombat

          57328




          57328











          • resize2fs before lvresize ? (just a question, I never did it). BTW there is a typo 200G instead of 20G.
            – Archemar
            Jul 13 '15 at 9:41










          • @Archemar resize2fs first because lvresize doesn't check whether reduced part contains data i.e. it's filesystem agnostic. resize2fs (or filesystem equivalent) does. 200G isn't a typo, resize2fs takes new size instead of relative size. Or my version does, at any rate. 215G - 15G = 200G
            – WhimsicalWombat
            Jul 13 '15 at 9:46











          • @WhimsicalWombat resize2fs /dev/mapper/vg_dckapstaging-lv_home 200G doesnt work after unmount gives resize2fs invalid new size
            – Danny
            Jul 13 '15 at 13:36










          • @Danny That's weird. You're using ext2/3/4 filesystem, right? Check your resize2fs manpage to be certain that your version accepts the G-suffix. If that's not it then... I don't know. Sounds like a syntax error but the command you wrote seems to be ok. Double check for typos I guess.
            – WhimsicalWombat
            Jul 13 '15 at 14:46










          • When shrinking, you need to shrink the filesystem before the volume. But when enlarging, you need to enlarge the volume before the filesystem.
            – Gilles
            Jul 13 '15 at 23:01
















          • resize2fs before lvresize ? (just a question, I never did it). BTW there is a typo 200G instead of 20G.
            – Archemar
            Jul 13 '15 at 9:41










          • @Archemar resize2fs first because lvresize doesn't check whether reduced part contains data i.e. it's filesystem agnostic. resize2fs (or filesystem equivalent) does. 200G isn't a typo, resize2fs takes new size instead of relative size. Or my version does, at any rate. 215G - 15G = 200G
            – WhimsicalWombat
            Jul 13 '15 at 9:46











          • @WhimsicalWombat resize2fs /dev/mapper/vg_dckapstaging-lv_home 200G doesnt work after unmount gives resize2fs invalid new size
            – Danny
            Jul 13 '15 at 13:36










          • @Danny That's weird. You're using ext2/3/4 filesystem, right? Check your resize2fs manpage to be certain that your version accepts the G-suffix. If that's not it then... I don't know. Sounds like a syntax error but the command you wrote seems to be ok. Double check for typos I guess.
            – WhimsicalWombat
            Jul 13 '15 at 14:46










          • When shrinking, you need to shrink the filesystem before the volume. But when enlarging, you need to enlarge the volume before the filesystem.
            – Gilles
            Jul 13 '15 at 23:01















          resize2fs before lvresize ? (just a question, I never did it). BTW there is a typo 200G instead of 20G.
          – Archemar
          Jul 13 '15 at 9:41




          resize2fs before lvresize ? (just a question, I never did it). BTW there is a typo 200G instead of 20G.
          – Archemar
          Jul 13 '15 at 9:41












          @Archemar resize2fs first because lvresize doesn't check whether reduced part contains data i.e. it's filesystem agnostic. resize2fs (or filesystem equivalent) does. 200G isn't a typo, resize2fs takes new size instead of relative size. Or my version does, at any rate. 215G - 15G = 200G
          – WhimsicalWombat
          Jul 13 '15 at 9:46





          @Archemar resize2fs first because lvresize doesn't check whether reduced part contains data i.e. it's filesystem agnostic. resize2fs (or filesystem equivalent) does. 200G isn't a typo, resize2fs takes new size instead of relative size. Or my version does, at any rate. 215G - 15G = 200G
          – WhimsicalWombat
          Jul 13 '15 at 9:46













          @WhimsicalWombat resize2fs /dev/mapper/vg_dckapstaging-lv_home 200G doesnt work after unmount gives resize2fs invalid new size
          – Danny
          Jul 13 '15 at 13:36




          @WhimsicalWombat resize2fs /dev/mapper/vg_dckapstaging-lv_home 200G doesnt work after unmount gives resize2fs invalid new size
          – Danny
          Jul 13 '15 at 13:36












          @Danny That's weird. You're using ext2/3/4 filesystem, right? Check your resize2fs manpage to be certain that your version accepts the G-suffix. If that's not it then... I don't know. Sounds like a syntax error but the command you wrote seems to be ok. Double check for typos I guess.
          – WhimsicalWombat
          Jul 13 '15 at 14:46




          @Danny That's weird. You're using ext2/3/4 filesystem, right? Check your resize2fs manpage to be certain that your version accepts the G-suffix. If that's not it then... I don't know. Sounds like a syntax error but the command you wrote seems to be ok. Double check for typos I guess.
          – WhimsicalWombat
          Jul 13 '15 at 14:46












          When shrinking, you need to shrink the filesystem before the volume. But when enlarging, you need to enlarge the volume before the filesystem.
          – Gilles
          Jul 13 '15 at 23:01




          When shrinking, you need to shrink the filesystem before the volume. But when enlarging, you need to enlarge the volume before the filesystem.
          – Gilles
          Jul 13 '15 at 23:01










          up vote
          0
          down vote













          This is a risky operation



          1. you should try to clean / (have a look at /var/log /var/spool and delete old and big file)



          2. theorical way to proceed include



            fsck -F /dev/mapper/vg_dckapstaging-lv_home
            lvresize --size -15G /dev/mapper/vg_dckapstaging-lv_home
            resize2fs /home
            lvresize --size +15G /dev/mapper/vg_dckapstaging-lv_root
            resize2fs /



          3. Disclaimer



            3.1. be sure to have a valid backup !!



            3.2. If this is a production system, please do try to test it before.







          share|improve this answer





















          • There's a big problem with your commands: with lv_home, you're shrinking the container before shrinking the content! That will break the content. Also the argument to resize2fs must be the volume names, not directories (and you need to unmount before shrinking).
            – Gilles
            Jul 13 '15 at 22:59














          up vote
          0
          down vote













          This is a risky operation



          1. you should try to clean / (have a look at /var/log /var/spool and delete old and big file)



          2. theorical way to proceed include



            fsck -F /dev/mapper/vg_dckapstaging-lv_home
            lvresize --size -15G /dev/mapper/vg_dckapstaging-lv_home
            resize2fs /home
            lvresize --size +15G /dev/mapper/vg_dckapstaging-lv_root
            resize2fs /



          3. Disclaimer



            3.1. be sure to have a valid backup !!



            3.2. If this is a production system, please do try to test it before.







          share|improve this answer





















          • There's a big problem with your commands: with lv_home, you're shrinking the container before shrinking the content! That will break the content. Also the argument to resize2fs must be the volume names, not directories (and you need to unmount before shrinking).
            – Gilles
            Jul 13 '15 at 22:59












          up vote
          0
          down vote










          up vote
          0
          down vote









          This is a risky operation



          1. you should try to clean / (have a look at /var/log /var/spool and delete old and big file)



          2. theorical way to proceed include



            fsck -F /dev/mapper/vg_dckapstaging-lv_home
            lvresize --size -15G /dev/mapper/vg_dckapstaging-lv_home
            resize2fs /home
            lvresize --size +15G /dev/mapper/vg_dckapstaging-lv_root
            resize2fs /



          3. Disclaimer



            3.1. be sure to have a valid backup !!



            3.2. If this is a production system, please do try to test it before.







          share|improve this answer













          This is a risky operation



          1. you should try to clean / (have a look at /var/log /var/spool and delete old and big file)



          2. theorical way to proceed include



            fsck -F /dev/mapper/vg_dckapstaging-lv_home
            lvresize --size -15G /dev/mapper/vg_dckapstaging-lv_home
            resize2fs /home
            lvresize --size +15G /dev/mapper/vg_dckapstaging-lv_root
            resize2fs /



          3. Disclaimer



            3.1. be sure to have a valid backup !!



            3.2. If this is a production system, please do try to test it before.








          share|improve this answer













          share|improve this answer



          share|improve this answer











          answered Jul 13 '15 at 9:28









          Archemar

          18.9k93365




          18.9k93365











          • There's a big problem with your commands: with lv_home, you're shrinking the container before shrinking the content! That will break the content. Also the argument to resize2fs must be the volume names, not directories (and you need to unmount before shrinking).
            – Gilles
            Jul 13 '15 at 22:59
















          • There's a big problem with your commands: with lv_home, you're shrinking the container before shrinking the content! That will break the content. Also the argument to resize2fs must be the volume names, not directories (and you need to unmount before shrinking).
            – Gilles
            Jul 13 '15 at 22:59















          There's a big problem with your commands: with lv_home, you're shrinking the container before shrinking the content! That will break the content. Also the argument to resize2fs must be the volume names, not directories (and you need to unmount before shrinking).
          – Gilles
          Jul 13 '15 at 22:59




          There's a big problem with your commands: with lv_home, you're shrinking the container before shrinking the content! That will break the content. Also the argument to resize2fs must be the volume names, not directories (and you need to unmount before shrinking).
          – Gilles
          Jul 13 '15 at 22:59












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f215629%2fresize-an-existing-lvm-partition-and-add-the-space-to-another-lvm-partition%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?