Can I resize mature LVMs?

Discussion in 'Server Operation' started by Heeter, Oct 3, 2021.

  1. Heeter

    Heeter Member

    Hi all,

    Can I resize and remove delete LVMs

    The server is Ubuntu 20LTS and after three years of use, I would like to fine tune my LVM setup. Some LVMs can be reduced in size, others can be outright deleted.
    I have never done this before, so better ask first

    Regards
     
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Yes, you can change them as needed. If you are reducing the size, be sure to reduce the size of the filesystem on the lv before reducing the lv itself
     
  3. Heeter

    Heeter Member

    Great Thank you! will start hacking away immediately
     
  4. Heeter

    Heeter Member

    Hi

    Would you be able to tell me the command line to reduce an LVM?

    I am trying
    but it complains that the file system is smaller

    Code:
    root@serv:/home/adminpc# lvreduce -r -L80G /dev/LVG/vmstorage
    fsck from util-linux 2.34
    /dev/mapper/LVG-vmstorage: Inode 13 extent tree (at level 2) could be narrower.  IGNORED.
    /dev/mapper/LVG-vmstorage: 13/103661568 files (0.0% non-contiguous), 79608165/414621696 blocks
    find: ‘/proc/37913’: No such file or directory
    resize2fs 1.45.5 (07-Jan-2020)
    resize2fs: New size smaller than minimum (75252515)
    
    fsadm: Resize ext4 failed.
      /sbin/fsadm failed: 1
      Filesystem resize failed.
    root@serv:/home/adminpc#
    
     
    Last edited: Oct 8, 2021
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Using Internet Search Engines with
    Code:
    md lvreduce
    finds instructions.
    Some file systems can not be made smaller. What file system is on that disk partition? If the file system can be shrunk, do that separately before shrinking the disk.
     
  6. Heeter

    Heeter Member

    Thank you for that, that search pulled up something I could use, The searches I found were perfect world type stuff
     

Share This Page