Gotta love LVM

Posted: 17th November 2010 by Gert in Linux, Open Future, Planet

# lvresize -L +1G /dev/vg/gert_var
Extending logical volume gert_var to 3.00 GB
Logical volume gert_var successfully resized

# e2fsck -f /dev/vg/gert_var
e2fsck 1.41.3 (12-Oct-2008)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/vg/gert_var: 22902/131072 files (6.4% non-contiguous), 472351/524288 blocks

# resize2fs  /dev/vg/gert_var
resize2fs 1.41.3 (12-Oct-2008)
Resizing the filesystem on /dev/vg/gert_var to 786432 (4k) blocks.
The filesystem on /dev/vg/gert_var is now 786432 blocks long.

A breeze! Gotta love it :)

Share
  1. Philip Paeps says:

    And this also feels very baroque once you’ve used ZFS for a while. ;-)

  2. Also note that the ext2, 3, and 4 filesystems all support online live resizing, which has two advantages:
    * You can skip the forced fsck
    * You don’t need to kill processes using the filesystem, they can continue writing to the filesystem.

    It takes a bit longer to do the actual resize, but if your filesystem is huge (say, a terabyte or so) the lack of forced fsck is a real time saver.

  3. Dag Wieers says:

    Next time, try:

    lvextend -r -L +1G /dev/rootvg/varlv

    Gotta love it even more ;-)

  4. Gert says:

    I guess about everyone loves LVM ;) Tnx for filling the gaps!
    Asfor zfs – Im still sad the licences are incompatible.